/* Site chrome: the one header and the one footer every Bahjah page wears.

   The landing page's header and footer are the reference; this file is
   that design, lifted out so every marketing, account and game page
   renders the same bar at the same height, the same logo at the same size,
   the same links in the same places and the same four social icons -- not
   a per-page copy that drifts. Markup lives in each page (copy it from
   bahjah-landing.html); pages keep no header/footer CSS of their own.

   Every rule is scoped under .site-header / .site-footer so it outranks
   whatever a page or game theme still says about bare `header`, `.nav`,
   `.switch`, etc.

   Colour is the one thing that follows the page: it reads the shared
   design-system tokens (--text-primary, --border-subtle, --logo-filter...),
   which each game theme already pins to its own palette, so the bar sits
   correctly on Trivia's green, Mafia's noir or Fabrication's paper.
   A page that doesn't load tokens.css sets those tokens itself. */
@import url("https://fonts.googleapis.com/css2?family=Tektur:wght@400;500;600;700;800;900&family=Readex+Pro:wght@300;400;500;600;700&family=Silkscreen:wght@400;700&display=swap");

.site-header,
.site-footer{
  --sc-text:var(--text-primary, #F5F5FA);
  --sc-muted:var(--text-muted, rgba(245,245,250,.56));
  --sc-line:var(--border-subtle, rgba(255,255,255,.12));
  --sc-line-strong:var(--border-strong, rgba(255,255,255,.24));
  --sc-active:var(--cyber-cyan, #22D3EE);
  --sc-hover:var(--electric-purple, #8B5CF6);
  --sc-danger:var(--neon-pink, #FF2E88);
  --sc-card:var(--surface-card, #14141F);
  --sc-raised:var(--surface-raised, #1C1C2A);
  --sc-shadow:var(--shadow-pop, 0 12px 40px rgba(0,0,0,.4));
  --sc-font:"Tektur", system-ui, sans-serif;
  --sc-font-pixel:"Silkscreen", "Readex Pro", monospace;
  font-family:var(--sc-font);
  line-height:1.6;
  color:var(--sc-text);
}
html[dir="rtl"] .site-header,
html[dir="rtl"] .site-footer{
  --sc-font:"Readex Pro", sans-serif;
  --sc-font-pixel:"Readex Pro", sans-serif;
}
.site-header *, .site-footer *{ box-sizing:border-box; }

.site-header > .wrap,
.site-footer > .wrap{
  max-width:1120px; margin:0 auto; padding-inline:24px; position:relative; z-index:1;
  /* A page's own .wrap (a full-height column, say) must not reach in. */
  width:auto; min-height:0; height:auto; flex:none;
}

/* ---------- Header ---------- */
.site-header{
  position:relative; top:auto; z-index:5;
  background:none; border:0; border-bottom:1px solid var(--sc-line);
  margin:0; padding:0;
}
.site-header .nav{
  display:flex; flex-direction:row; flex-wrap:nowrap; align-items:center; justify-content:space-between;
  gap:16px; padding-block:22px;
}
.site-header .nav-brand{ display:flex; align-items:center; flex-shrink:0; min-width:220px; text-decoration:none; }
.site-header .brand-logo{
  display:block; height:28px; width:auto; max-width:none;
  filter:var(--logo-filter, brightness(0) invert(1));
}

.site-header .nav-links{
  display:flex; flex-wrap:nowrap; gap:28px; list-style:none; padding:0; margin:0; flex-shrink:0;
  font-size:13px; font-weight:600;
}
.site-header .nav-links a,
.site-header .nav-links button{
  text-decoration:none; font-size:13px; font-family:var(--sc-font-pixel); letter-spacing:.08em;
  text-transform:uppercase; color:var(--sc-muted); font-weight:600; line-height:1.6;
  background:none; border:0; border-bottom:1px solid transparent; border-radius:0;
  padding:0 0 2px; transition:color .15s, border-color .15s;
}
.site-header .nav-links a:hover,
.site-header .nav-links button:hover{ color:var(--sc-text); border-color:var(--sc-line-strong); }

.site-header .nav-right{
  display:flex; align-items:center; justify-content:flex-end; gap:16px;
  flex-shrink:0; min-width:220px; margin:0; font-size:14px;
}
@media (max-width:820px){
  .site-header .nav-links{ display:none; }
  .site-header .nav-brand{ min-width:0; }
  /* min-height matches the hamburger, so a header without one (a room's)
     stands exactly as tall. */
  .site-header .nav-right{ min-width:0; min-height:34px; gap:10px; }
}

.site-header .back-link{
  font-family:var(--sc-font); font-size:14px; font-weight:700; color:var(--sc-muted);
  text-decoration:none; border-bottom:1px solid transparent;
}
.site-header .back-link:hover{ color:var(--sc-text); border-color:var(--sc-line-strong); }

/* The round header buttons: theme (injected by theme-toggle.js) and, in a
   room, sound. */
.site-header .theme-btn{
  background:none; border:1px solid var(--sc-line); border-radius:50%;
  width:32px; height:32px; padding:0; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  font-size:14px; line-height:1; color:var(--sc-text); cursor:pointer;
}

.site-header .switch{ display:flex; align-items:center; gap:6px; font-family:var(--sc-font-pixel); font-size:11px; font-weight:400; }
.site-header .switch button{
  background:none; border:none; color:var(--sc-muted); padding:2px 3px; margin:0;
  font-family:var(--sc-font-pixel); font-size:11px; font-weight:400; opacity:1; cursor:pointer;
}
.site-header .switch button.active{ color:var(--sc-active); text-decoration:underline; text-underline-offset:4px; }
.site-header .switch .sep{ color:var(--sc-line-strong); opacity:1; }

.site-header .user-menu{ position:relative; display:inline-flex; }
.site-header .user-avatar-btn{
  width:32px; height:32px; border-radius:50%; padding:0; border:1px solid var(--sc-line-strong);
  background:var(--sc-raised); cursor:pointer; overflow:hidden;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.site-header .user-avatar-inner{ width:100%; height:100%; display:block; }
.site-header .user-dropdown{
  position:absolute; top:calc(100% + 10px); inset-inline-end:0; min-width:190px;
  background:var(--sc-card); border:1px solid var(--sc-line-strong); border-radius:12px;
  box-shadow:var(--sc-shadow); padding:8px; display:none; flex-direction:column; gap:2px; z-index:50;
}
.site-header .session-user-menu.open .user-dropdown{ display:flex; }
.site-header .user-dropdown-name{
  padding:8px 10px 6px; font-size:13px; font-weight:800; color:var(--sc-text);
  border-bottom:1px solid var(--sc-line); margin-bottom:4px;
}
.site-header .user-dropdown-item{
  display:block; width:100%; text-align:start; background:none; border:none; padding:9px 10px;
  border-radius:6px; font-size:14px; font-weight:600; color:var(--sc-text); cursor:pointer;
  font-family:var(--sc-font);
}
.site-header .user-dropdown-item:hover{ background:var(--sc-raised); }
.site-header .user-dropdown-danger{ color:var(--sc-danger); }

/* The small-screen menu button and drawer from assets/mobile-nav.js. */
.site-header .nav-hamburger{
  display:none; background:none; border:1px solid var(--sc-line); border-radius:8px;
  width:34px; height:34px; align-items:center; justify-content:center;
  color:var(--sc-text); font-size:16px; line-height:1; flex-shrink:0; padding:0; cursor:pointer;
}
@media (max-width:820px){
  .site-header .nav-hamburger{ display:flex; }
  .site-header .nav{ position:relative; }
  .site-header .nav.mobile-open .nav-links{
    display:flex; flex-direction:column; position:absolute; top:100%; left:0; right:0;
    background:var(--sc-card); border:1px solid var(--sc-line); border-radius:12px;
    padding:10px 14px; margin-top:10px; gap:2px; box-shadow:var(--sc-shadow); z-index:30;
  }
  .site-header .nav.mobile-open .nav-links a,
  .site-header .nav.mobile-open .nav-links button{
    display:block; width:100%; text-align:start; padding:12px 6px; border-bottom:1px solid var(--sc-line);
  }
  .site-header .nav.mobile-open .nav-links li:last-child a{ border-bottom:none; }
}

/* ---------- Footer ---------- */
.site-footer{
  position:relative; z-index:1; margin:0;
  background:none; border:0; border-top:1px solid var(--sc-line);
  padding-block:32px;
}
.site-footer .foot-row{
  display:flex; flex-direction:row; align-items:center; justify-content:space-between; flex-wrap:wrap;
  gap:16px; padding-block:0; font-size:13px; font-weight:400;
}
.site-footer .copy{
  display:block; margin:0; color:var(--sc-muted); font-size:13px; font-weight:400; opacity:1;
}
.site-footer .copy::before,
.site-footer .copy::after{ content:none; display:none; }
.site-footer .social-icons{ display:flex; align-items:center; gap:16px; margin:0; }
.site-footer .social-icon{
  color:var(--sc-muted); display:inline-flex; width:20px; height:20px;
  text-decoration:none; transition:color .15s ease;
}
.site-footer .social-icon svg{ width:100%; height:100%; }
.site-footer .social-icon:hover{ color:var(--sc-hover); }
/* Optical size correction: each brand mark fills a different proportion of
   its own 24x24 viewBox (Snapchat's ghost nearly bleeds to the edges,
   TikTok's note sits in a narrow column), so equal container size alone
   left them reading as different sizes. Scaling the svg itself keeps every
   anchor's box -- and therefore the gap between icons -- perfectly uniform. */
.site-footer .social-icon svg.icon-x{ transform:scale(1.05); }
.site-footer .social-icon svg.icon-tiktok{ transform:scale(1.13); }
.site-footer .social-icon svg.icon-instagram{ transform:scale(1.08); }
.site-footer .social-icon svg.icon-snapchat{ transform:scale(0.92); }
