/* ─────────────────────────────────────
   9389 STUDIOS — SHARED STYLESHEET
   style.css
───────────────────────────────────── */

/* RESET & VARIABLES */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

:root {
  --gold:        #C9912A;
  --gold-light:  #F0C96A;
  --gold-pale:   #F5E6B8;
  --red:         #8B1A1A;
  --red-bright:  #C0392B;
  --black:       #050403;
  --ink:         #0A0806;
  --charcoal:    #141008;
  --stone:       #1C1610;
  --cream:       #E8DCC8;
  --jade:        #1A6B4A;
  --jade-light:  #2EAF7D;
  --blue:        #1A3A6B;
  --blue-light:  #2E6FAF;
  --green:       #1A6B2A;
  --green-light: #2EAF4A;
  --white:       #FFFFFF;
}

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--cream);
  font-family: 'IM Fell English', Georgia, serif;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 999; opacity: 0.35;
}

/* ─── NAVIGATION ─── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 4rem;
  background: rgba(5,4,3,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201,145,42,0.1); transition: background 0.3s;
}

.nav-logo {
  font-family: 'Cinzel Decorative', serif; font-size: 1rem; font-weight: 700;
  color: var(--gold-light); letter-spacing: 0.12em; text-decoration: none;
  display: flex; align-items: center; gap: 0.6rem;
}
.nav-logo-sub {
  font-family: 'Cinzel', serif; font-size: 0.55rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--cream); opacity: 0.4;
  display: block; font-weight: 400;
}
.nav-links { display: flex; gap: 2.5rem; list-style: none; align-items: center; }
.nav-links a {
  font-family: 'Cinzel', serif; font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--cream);
  text-decoration: none; opacity: 0.65; transition: opacity 0.3s, color 0.3s;
  position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 1px; background: var(--gold); transition: width 0.3s;
}
.nav-links a:hover, .nav-links a.active { opacity: 1; color: var(--gold-light); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-cta {
  font-family: 'Cinzel', serif; font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--black) !important;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  padding: 0.6rem 1.4rem; text-decoration: none; opacity: 1 !important;
  clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
  transition: box-shadow 0.2s, transform 0.2s !important;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(201,145,42,0.4); }
.nav-cta::after { display: none !important; }

/* ─── SECTION BASE ─── */
section { position: relative; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 2rem; }

.section-label {
  font-family: 'Cinzel', serif; font-size: 0.62rem; letter-spacing: 0.5em;
  text-transform: uppercase; color: var(--gold); opacity: 0.75; margin-bottom: 0.75rem;
}
.section-title {
  font-family: 'Cinzel Decorative', serif; font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700; color: var(--gold-pale); line-height: 1.15; margin-bottom: 1.2rem;
}
.section-title em { font-style: normal; color: var(--gold-light); }
.gold-rule { width: 100%; height: 1px; background: linear-gradient(to right, transparent, var(--gold), transparent); }
.gold-divider { width: 60px; height: 2px; background: linear-gradient(to right, var(--gold), transparent); margin-bottom: 2rem; }

/* ─── BUTTONS ─── */
.btn-primary {
  font-family: 'Cinzel', serif; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.25em; text-transform: uppercase; text-decoration: none;
  color: var(--black); background: linear-gradient(135deg, var(--gold-light), var(--gold));
  padding: 0.9rem 2.2rem; display: inline-block;
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 24px rgba(201,145,42,0.25); cursor: pointer; border: none;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 36px rgba(201,145,42,0.45); }
.btn-secondary {
  font-family: 'Cinzel', serif; font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.25em; text-transform: uppercase; text-decoration: none;
  color: var(--gold-light); background: transparent; padding: 0.9rem 2.2rem;
  display: inline-block; border: 1px solid rgba(201,145,42,0.35);
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
  transition: all 0.2s; cursor: pointer;
}
.btn-secondary:hover { background: rgba(201,145,42,0.08); border-color: var(--gold); }

/* ─── GAME CARDS ─── */
.game-card {
  background: var(--stone); border: 1px solid rgba(201,145,42,0.15);
  overflow: hidden; transition: transform 0.3s, border-color 0.3s;
  text-decoration: none; display: block;
}
.game-card:hover { transform: translateY(-6px); border-color: rgba(201,145,42,0.45); }
.game-card-art { width: 100%; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.game-card-body { padding: 1.8rem; }
.game-card-status {
  font-family: 'Cinzel', serif; font-size: 0.58rem; letter-spacing: 0.25em;
  text-transform: uppercase; padding: 0.3rem 0.8rem; display: inline-block; margin-bottom: 0.75rem;
}
.status-live { background: rgba(46,175,125,0.15); border: 1px solid rgba(46,175,125,0.4); color: var(--jade-light); }
.status-soon { background: rgba(201,145,42,0.1); border: 1px solid rgba(201,145,42,0.3); color: var(--gold); }
.game-card-title { font-family: 'Cinzel Decorative', serif; font-size: 1.3rem; font-weight: 700; color: var(--gold-pale); margin-bottom: 0.5rem; line-height: 1.2; }
.game-card-genre { font-family: 'Cinzel', serif; font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); opacity: 0.6; margin-bottom: 1rem; }
.game-card-desc { font-size: 0.88rem; line-height: 1.75; color: var(--cream); opacity: 0.68; }
.game-card-platforms { display: flex; gap: 0.5rem; margin-top: 1.2rem; }
.platform-tag { font-family: 'Cinzel', serif; font-size: 0.55rem; letter-spacing: 0.15em; text-transform: uppercase; padding: 0.3rem 0.8rem; border: 1px solid rgba(201,145,42,0.2); color: var(--cream); opacity: 0.5; }

/* ─── BADGES ─── */
.ghc-coming { display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 1.2rem; }
.ghc-coming-dot { width: 8px; height: 8px; border-radius: 50%; background: #FFB800; animation: blink 2s ease-in-out infinite; }
.ghc-coming-text { font-family: 'Cinzel', serif; font-size: 0.62rem; letter-spacing: 0.3em; text-transform: uppercase; color: #FFB800; opacity: 0.85; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ─── FOOTER ─── */
footer { background: var(--ink); padding: 3rem 0 2rem; border-top: 1px solid rgba(201,145,42,0.12); }
.footer-inner { max-width: 1140px; margin: 0 auto; padding: 0 2rem; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; }
.footer-brand-name { font-family: 'Cinzel Decorative', serif; font-size: 1rem; color: var(--gold-light); margin-bottom: 0.75rem; }
.footer-brand-desc { font-size: 0.82rem; line-height: 1.75; opacity: 0.5; max-width: 280px; }
.footer-col-title { font-family: 'Cinzel', serif; font-size: 0.62rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); opacity: 0.7; margin-bottom: 1.2rem; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }
.footer-col a { font-family: 'Cinzel', serif; font-size: 0.68rem; letter-spacing: 0.1em; color: var(--cream); text-decoration: none; opacity: 0.45; transition: opacity 0.2s, color 0.2s; }
.footer-col a:hover { opacity: 0.9; color: var(--gold-light); }
.footer-bottom { max-width: 1140px; margin: 2.5rem auto 0; padding: 1.5rem 2rem 0; border-top: 1px solid rgba(201,145,42,0.08); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-copy { font-family: 'Cinzel', serif; font-size: 0.58rem; letter-spacing: 0.15em; text-transform: uppercase; opacity: 0.28; }
.footer-legal { display: flex; gap: 2rem; list-style: none; }
.footer-legal a { font-family: 'Cinzel', serif; font-size: 0.58rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cream); text-decoration: none; opacity: 0.28; transition: opacity 0.2s; }
.footer-legal a:hover { opacity: 0.7; }

/* ─── SCROLL REVEAL ─── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ─── HAMBURGER / MOBILE NAV ─── */
.nav-hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 36px; height: 36px; cursor: pointer; background: none; border: none; padding: 4px; z-index: 300; flex-shrink: 0; }
.nav-hamburger span { display: block; width: 100%; height: 2px; background: var(--gold-light); border-radius: 2px; transition: transform 0.3s, opacity 0.3s; transform-origin: center; }
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-menu { position: fixed; top: 0; left: 0; right: 0; background: rgba(5,4,3,0.98); backdrop-filter: blur(16px); z-index: 150; padding: 5rem 2rem 2rem; border-bottom: 1px solid rgba(201,145,42,0.2); visibility: hidden; opacity: 0; pointer-events: none; transform: translateY(-8px); transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease; display: none; }
@media (max-width: 900px) {
  .mobile-menu { display: block; }
  .mobile-menu.open { visibility: visible; opacity: 1; pointer-events: all; transform: translateY(0); }
  nav { padding: 1rem 1.5rem; }
  .nav-links { display: none !important; }
  .nav-hamburger { display: flex; }
}
@media (min-width: 901px) {
  .mobile-menu { display: none !important; visibility: hidden !important; }
  .nav-hamburger { display: none !important; }
}
.mobile-menu ul { list-style: none; display: flex; flex-direction: column; gap: 0; }
.mobile-menu ul li { border-bottom: 1px solid rgba(201,145,42,0.1); }
.mobile-menu ul li:first-child { border-top: 1px solid rgba(201,145,42,0.1); }
.mobile-menu ul a { display: block; padding: 1.1rem 0; font-family: 'Cinzel', serif; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--cream); opacity: 0.75; transition: opacity 0.2s, color 0.2s, padding-left 0.2s; }
.mobile-menu ul a:hover, .mobile-menu ul a.active { opacity: 1; color: var(--gold-light); padding-left: 0.75rem; }
.mobile-menu-contact { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(201,145,42,0.1); }
.mobile-menu-contact a { font-family: 'Cinzel', serif; font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--black); background: linear-gradient(135deg, var(--gold-light), var(--gold)); padding: 0.85rem 2rem; display: inline-block; clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%); font-weight: 700; }

/* ─── MOBILE LAYOUT ─── */
@media (max-width: 600px) {
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-legal { justify-content: center; }
  #hero { background-position: 60% top; min-height: 100svh; }
  #xins-hero { background-position: 40% top; }
  .hero-cta-group, .xins-hero-cta { flex-direction: column; align-items: center; width: 100%; }
  .btn-primary, .btn-secondary { width: 100%; max-width: 280px; text-align: center; }
  .game-card-featured { grid-template-columns: 1fr !important; }
  section { padding: 4rem 0; }
  .container { padding: 0 1.2rem; }
  .nav-logo { font-size: 0.85rem; }
  .nav-logo-sub { font-size: 0.48rem; }
}
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .hero-title { font-size: clamp(2.2rem, 6vw, 4rem); }
  .troop-grid, .armies-grid, .features-grid, .devlog-preview-grid, .devlog-grid { grid-template-columns: 1fr; }
  .posts-grid { grid-template-columns: 1fr; }
  .post-card-featured { grid-column: 1; grid-template-columns: 1fr !important; }
  .post-card-featured .post-card-header { min-height: 180px; }
  .studio-inner, .studio-strip-inner { grid-template-columns: 1fr; gap: 3rem; }
  .pillars, .studio-pillars { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
  .form-row { grid-template-columns: 1fr; }
  .palace-showcase { grid-template-columns: 1fr; gap: 3rem; }
  .games-grid { grid-template-columns: 1fr; }
  .game-card-featured { grid-column: 1; }
  .devlog-preview-head, .devlog-preview-header { flex-direction: column; gap: 1rem; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════════════
   ALLIANCE QUIZ
   Full quiz: xins-siege.html#alliance-quiz
   Teaser:    index.html#alliance-teaser
═══════════════════════════════════════════════════════════ */

/* ── Teaser (index.html) ── */
#alliance-teaser {
  padding: 7rem 0;
  background: linear-gradient(to bottom, var(--charcoal), var(--black));
  border-top: 1px solid rgba(201,145,42,0.1);
  text-align: center;
}

/* ── Full quiz section (xins-siege.html) ── */
#alliance-quiz {
  padding: 7rem 0;
  background: linear-gradient(to bottom, var(--stone), var(--black));
  border-top: 1px solid rgba(201,145,42,0.1);
}

.aq-wrap { max-width: 820px; margin: 0 auto; }
.aq-screen { display: none; }
.aq-screen.aq-on { display: block; }

/* ── Emblem grid — large enough to read the detail ── */
.aq-intro-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin: 2.5rem 0;
}

.aq-mini {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid rgba(201,145,42,0.3);
  transition: border-color 0.25s, transform 0.25s;
  display: block;
}
.aq-mini:hover { border-color: var(--gold); transform: scale(1.06); }

.aq-mini-fb {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(201,145,42,0.25);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel', serif; font-size: 14px;
  color: var(--gold); background: rgba(201,145,42,0.05);
}

/* ── Progress ── */
.aq-progress-track {
  height: 2px;
  background: rgba(201,145,42,0.1);
  margin-bottom: 3rem;
}
.aq-progress-fill {
  height: 2px;
  background: linear-gradient(to right, var(--gold), var(--gold-light));
  transition: width 0.5s ease;
}

/* ── Question ── */
.aq-q-meta {
  font-family: 'Cinzel', serif; font-size: 0.55rem;
  letter-spacing: 0.45em; text-transform: uppercase;
  color: var(--gold); opacity: 0.55; margin-bottom: 0.75rem;
}

.aq-q-text {
  font-family: 'Cinzel', serif;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 600; color: var(--gold-pale);
  line-height: 1.5; margin-bottom: 2rem;
}

/* ── Answer buttons — styled like the site's feat cards ── */
.aq-answer {
  display: block; width: 100%; text-align: left;
  background: rgba(201,145,42,0.02);
  border: 1px solid rgba(201,145,42,0.14);
  padding: 1.1rem 1.4rem;
  margin-bottom: 0.75rem;
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 1rem; line-height: 1.55;
  color: var(--cream); opacity: 0.72;
  cursor: pointer;
  transition: border-color 0.25s, opacity 0.25s, background 0.25s;
  position: relative; overflow: hidden;
}
.aq-answer::before {
  content: ''; position: absolute; left: 0; top: 0;
  width: 3px; height: 100%; background: var(--gold);
  transform: scaleY(0); transform-origin: top; transition: transform 0.25s;
}
.aq-answer:hover { border-color: rgba(201,145,42,0.45); opacity: 1; }
.aq-answer:hover::before { transform: scaleY(1); }
.aq-answer.aq-sel {
  border-color: rgba(201,145,42,0.7);
  background: rgba(201,145,42,0.07); opacity: 1;
}
.aq-answer.aq-sel::before { transform: scaleY(1); }

.aq-letter {
  font-family: 'Cinzel', serif; font-size: 0.58rem;
  letter-spacing: 0.12em; color: var(--gold);
  margin-right: 0.9rem; opacity: 0.65;
}

/* ── Continue button ── */
.aq-next {
  display: block; margin-top: 2rem;
  font-family: 'Cinzel', serif; font-size: 0.65rem;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--gold); border: 1px solid rgba(201,145,42,0.28);
  background: transparent; padding: 1rem 3rem;
  cursor: pointer; opacity: 0.25; pointer-events: none;
  transition: opacity 0.25s, background 0.25s, border-color 0.25s;
  clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
}
.aq-next.aq-ready { opacity: 1; pointer-events: auto; }
.aq-next.aq-ready:hover { background: rgba(201,145,42,0.1); border-color: var(--gold); }

/* ── Result — emblem large enough to see detail ── */
.aq-result-wrap { text-align: center; }

.aq-emblem-frame {
  text-align: center;
  margin: 0 0 2rem;
}

.aq-emblem-img {
  width: 260px; height: 260px;
  object-fit: cover;
  border: 1px solid rgba(201,145,42,0.5);
  filter: drop-shadow(0 0 50px rgba(201,145,42,0.4));
  animation: aq-breathe 4s ease-in-out infinite;
}

.aq-emblem-fb {
  width: 260px; height: 260px;
  border: 1px solid rgba(201,145,42,0.5);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Cinzel Decorative', serif; font-size: 3.5rem;
  color: var(--gold); background: rgba(201,145,42,0.04);
}

@keyframes aq-breathe {
  0%,100% { transform: scale(1); filter: drop-shadow(0 0 50px rgba(201,145,42,0.4)); }
  50%     { transform: scale(1.03); filter: drop-shadow(0 0 70px rgba(201,145,42,0.6)); }
}

.aq-result-name {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 900;
  color: var(--gold-light); text-align: center;
  letter-spacing: 0.05em; margin: 0.5rem 0 0.4rem;
}

.aq-result-motto {
  font-family: 'IM Fell English', Georgia, serif; font-style: italic;
  font-size: 1.1rem; color: var(--cream); opacity: 0.5;
  text-align: center; margin-bottom: 2rem;
}

.aq-result-rule {
  width: min(360px, 70%); height: 1px; margin: 0 auto 2.5rem;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}

.aq-result-desc {
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 1.05rem; line-height: 2.0; opacity: 0.72;
  text-align: center; max-width: 580px; margin: 0 auto 2.5rem;
}

.aq-traits {
  display: flex; gap: 0.7rem; flex-wrap: wrap;
  justify-content: center; margin-bottom: 2.5rem;
}

.aq-trait {
  font-family: 'Cinzel', serif; font-size: 0.55rem;
  letter-spacing: 0.22em; text-transform: uppercase;
  padding: 0.38rem 1rem;
  border: 1px solid rgba(201,145,42,0.32); color: var(--gold); opacity: 0.8;
}

.aq-actions { display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; }

.aq-retry {
  display: block; text-align: center; margin-top: 1.8rem;
  font-family: 'Cinzel', serif; font-size: 0.52rem;
  letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--cream); opacity: 0.28;
  cursor: pointer; background: none; border: none;
  transition: opacity 0.2s;
}
.aq-retry:hover { opacity: 0.65; }

/* ── Teaser emblem grid (index.html) — 6 per row, large ── */
.aq-teaser-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  max-width: 700px;
  margin: 2.5rem auto;
}

/* Mobile */
@media (max-width: 700px) {
  .aq-intro-grid, .aq-teaser-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .aq-emblem-img, .aq-emblem-fb { width: 180px; height: 180px; }
  .aq-actions { flex-direction: column; align-items: center; }
  .aq-actions .btn-primary,
  .aq-actions .btn-secondary { width: 100%; max-width: 280px; text-align: center; }
}

@media (max-width: 420px) {
  .aq-intro-grid, .aq-teaser-grid { grid-template-columns: repeat(3, 1fr); }
}