/* The site outside the game (home, wiki, packs, profile, log in): "Night & gold".
   Same colors and fonts as the table (static/table/table.css), so the two worlds match.
   Spec: docs/superpowers/specs/2026-10-18-site-refresh-design.md */
:root {
  --gold: #c9a84c; --gold-2: #e6cc7a; --gold-dk: #7a6024;
  --ink: #e9dfc4; --ink-dim: #a99d7d;
  --night: #0b0f09; --night-2: #1a2216; --panel: rgba(26, 34, 22, .72);
  --hair: rgba(201, 168, 76, .18); --hair-2: rgba(201, 168, 76, .45);
  --font-display: 'Cinzel', Georgia, serif; --font-body: 'IM Fell English', Georgia, serif;
  --wax-ink: #f3d2c4; --wax-dk: #8b1d1d; --red-ink: #e0796e;
}
* { box-sizing: border-box; }
html { background: var(--night); }
body.site {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: 1.55;
}
/* html carries the flat night color; this layer sits above it and behind the content. */
body.site::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(201, 168, 76, .18), transparent 70%),
    radial-gradient(ellipse at 50% 40%, var(--night-2), var(--night) 75%); }
a { color: var(--gold-2); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; color: var(--gold-2); letter-spacing: .08em; line-height: 1.2; }
h1 { font-size: 32px; margin: 0 0 6px; }
h2 { font-size: 20px; margin: 28px 0 8px; }
h3 { font-size: 16px; margin: 20px 0 6px; }

/* ── top bar ─────────────────────────────────────────────────────────── */
.site-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 22px; min-height: 54px; padding: 0 28px;
  background: rgba(11, 15, 9, .86); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-bottom: 1px solid var(--hair); }
.site-brand { position: relative; font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-2); text-decoration: none; white-space: nowrap; }
.site-links { flex: 1; display: flex; align-items: center; gap: 22px; }
.site-links a { position: relative; font-family: var(--font-display); font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); text-decoration: none; padding: 4px 0; border-bottom: 1px solid transparent; white-space: nowrap; }
.site-links a:hover { color: var(--gold-2); }
/* Tap targets (2026-11-06): small links and buttons keep their look, with an invisible margin that
   takes the tap, so each is about 44 px tall. */
.site-links a::after, .site-link::after, .site-foot a::after, .site-brand::after, .auth-alt a::after { content: ''; position: absolute; inset: -12px -6px; }
.site-links a.on { color: var(--gold-2); border-bottom-color: var(--gold); }
.site-links .site-user { color: var(--gold-2); }
.site-spacer { flex: 1; }
.site-menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--hair-2); border-radius: 3px; color: var(--gold-2); font-size: 18px; padding: 2px 10px; min-width: 44px; min-height: 44px; cursor: pointer; }

/* sound: a speaker in the bar, opening Sound on/off and Volume (static/site/sound.js) */
.site-sound { position: relative; }
.site-sound-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; background: none; border: 1px solid transparent; border-radius: 3px; color: var(--gold-2); cursor: pointer; }
.site-sound-btn:hover, .site-sound-btn[aria-expanded="true"] { border-color: var(--hair-2); }
.site-sound-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.site-sound-btn .spk { fill: currentColor; }
.site-sound-btn .x, .site-sound-btn.muted .wave { display: none; }
.site-sound-btn.muted .x { display: inline; }
.site-sound .site-sound-panel { position: absolute; right: 0; top: calc(100% + 10px); width: 220px; padding: 14px 16px 16px; text-align: left; z-index: 30;
  background: var(--night-2); box-shadow: 0 12px 28px rgba(0, 0, 0, .6); }   /* opaque: .site-panel alone is see-through */
.site-sound-panel[hidden] { display: none; }
.site-sound-panel .k { display: flex; justify-content: space-between; font-family: var(--font-display); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-dim); margin: 0 0 8px; }
.site-sound-panel .k + .site-toggle { margin-bottom: 16px; }
.site-sound-panel output { letter-spacing: .06em; color: var(--ink); }
.site-toggle { display: inline-flex; border: 1px solid var(--gold-dk); border-radius: 3px; overflow: hidden; }
.site-toggle button { padding: 6px 18px; background: none; border: 0; font-family: var(--font-display); font-size: 12px; letter-spacing: .12em; color: var(--ink); cursor: pointer; }
.site-toggle button.on { background: var(--gold-dk); color: #fff3cf; }
.site-sound-panel input[type="range"] { width: 100%; accent-color: var(--gold); }
.site-sound-panel input[type="range"]:disabled { opacity: .4; }

/* ── page frame and footer ───────────────────────────────────────────── */
.site-main { flex: 1; width: 100%; }
.site-page { max-width: 1100px; margin: 0 auto; padding: 36px 28px 48px; }
.site-foot { text-align: center; padding: 22px 16px 28px; font-style: italic; font-size: 15px; color: var(--ink-dim); border-top: 1px solid var(--hair); }
.site-foot p { margin: 10px 0; }
.site-foot a { position: relative; color: var(--ink); }
.site-copy { font-size: 14px; opacity: .75; }

/* ── Privacy Policy, Terms of Use: text on the night at reading width ─── */
.legal { max-width: 74ch; }
.legal h1 { font-size: 32px; margin: 0 0 4px; }
.legal h2 { font-size: 19px; margin: 34px 0 8px; }
.legal-date { color: var(--ink-dim); font-style: italic; margin: 0 0 24px; }
.legal ul { padding-left: 22px; } .legal li { margin-bottom: 8px; }
.legal b { color: var(--gold-2); font-weight: 400; }

/* ── shared pieces ───────────────────────────────────────────────────── */
.site-wax { display: inline-block; padding: 13px 40px; border: 0; border-radius: 40px; cursor: pointer; text-decoration: none; text-align: center;
  font-family: var(--font-display); font-weight: 900; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--wax-ink);
  background: radial-gradient(circle at 38% 32%, #c9443a, var(--wax-dk) 55%, #3d0909);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .5), inset 0 -4px 8px rgba(0, 0, 0, .35); }
.site-wax:hover { filter: brightness(1.12); }
.site-link { position: relative; font-family: var(--font-display); font-size: 14px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-2); text-decoration: none;
  border-bottom: 1px solid var(--hair-2); padding-bottom: 3px; }
.site-link:hover { border-bottom-color: var(--gold-2); }
.site-tabs { display: flex; flex-wrap: wrap; gap: 4px 26px; border-bottom: 1px solid var(--hair); margin: 0 0 22px; }
.site-tabs a, .site-tabs button { font-family: var(--font-display); font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-dim); text-decoration: none;
  background: none; border: 0; border-bottom: 2px solid transparent; padding: 13px 0; margin-bottom: -1px; cursor: pointer; }
.site-tabs a:hover, .site-tabs button:hover { color: var(--ink); }
.site-tabs .on { color: var(--gold-2); border-bottom-color: var(--gold); }
.site-panel { background: var(--panel); border: 1px solid var(--hair); border-radius: 6px; }
.site-lede { font-style: italic; color: var(--ink-dim); margin: 0 0 18px; }
.site-table { border-collapse: collapse; width: 100%; }
.site-table th, .site-table td { text-align: left; padding: 8px 14px 8px 0; border-bottom: 1px solid var(--hair); vertical-align: top; }
.site-table th { font-family: var(--font-display); font-weight: 500; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-dim); white-space: nowrap; }

/* the scrolling class emblems (4 copies of the 8, so the track overflows screens up to ~2300px wide) */
.site-emblems { overflow: hidden; padding: 18px 0;
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent); }
.site-emblems-track { display: flex; width: max-content; animation: site-emblems 26s linear infinite; }
.site-emblems-track img { width: 56px; height: 56px; object-fit: contain; flex: none; margin-right: 44px; }
@keyframes site-emblems { to { transform: translateX(-25%); } }
@media (prefers-reduced-motion: reduce) { .site-emblems-track { animation: none; } }

/* ── home ────────────────────────────────────────────────────────────── */
.site-home .site-main { display: flex; flex-direction: column; justify-content: center; }
.home-hero { padding: 40px 16px 0; text-align: center; }
.home-logo { width: min(520px, 86vw); height: auto; filter: drop-shadow(0 0 30px rgba(201, 168, 76, .25)); }
.home-actions { display: flex; flex-direction: column; align-items: center; gap: 26px; padding: 18px 16px 48px; }
.home-doors { display: flex; flex-wrap: wrap; justify-content: center; gap: 40px; }
/* Free Play or Adventure Mode: two doors, each a wax pill */
.home-modes { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px 44px; }
.home-mode { display: flex; width: 230px; text-decoration: none; }
.home-mode .site-wax { box-sizing: border-box; width: 100%; padding-inline: 20px; }
.home-mode:hover .site-wax, .home-mode:focus-visible .site-wax { filter: brightness(1.12); }

/* ── log in / sign up ────────────────────────────────────────────────── */
.auth-panel { width: min(400px, calc(100% - 32px)); margin: 48px auto; padding: 30px 32px 26px; text-align: center; }
.auth-logo { width: 150px; height: auto; }
.auth-panel h1 { font-size: 24px; margin: 8px 0 18px; }
.auth-panel form { text-align: left; }
.auth-field { margin-bottom: 14px; }
.auth-field label { display: block; font-family: var(--font-display); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 5px; }
.auth-field input { width: 100%; padding: 10px 12px; font: inherit; font-size: 16px; color: var(--ink); background: rgba(0, 0, 0, .35);
  border: 1px solid var(--hair-2); border-radius: 4px; outline: none; }
.auth-field input:focus { border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(230, 204, 122, .18); }
.auth-submit { width: 100%; margin-top: 8px; }
.auth-error { color: var(--wax-ink); background: rgba(142, 31, 31, .55); border: 1px solid var(--wax-dk); border-radius: 4px; padding: 8px 10px; font-size: 15px; }
.auth-alt { margin: 18px 0 0; font-size: 15px; color: var(--ink-dim); }
.auth-alt a { position: relative; }
.auth-note { text-align: left; color: var(--ink-dim); font-size: 16px; margin: 0 0 18px; }
.auth-note b { color: var(--ink); font-weight: 400; }
/* sign-up: 13 or older, terms and privacy */
.auth-check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; font-size: 15px; line-height: 1.4; color: var(--ink-dim); cursor: pointer; }
.auth-check input { margin-top: 1px; width: 20px; height: 20px; accent-color: var(--gold); flex: none; }

/* ── profile ─────────────────────────────────────────────────────────── */
.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.profile-seal { flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 900; font-size: 26px; color: #3a2706;
  background: radial-gradient(circle at 35% 30%, #f3e2a6, #b48a32 60%, #5e4314); box-shadow: 0 4px 10px rgba(0, 0, 0, .6), inset 0 0 0 2px rgba(80, 55, 10, .5); }
.profile-head h1 { margin: 0; }
.profile-meta { color: var(--ink-dim); font-style: italic; }
/* A form button that reads as a link (Log out is a POST). */
.inline-form { display: inline; margin: 0; }
.link-button { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--gold-2); text-decoration: underline; cursor: pointer; }
.link-button:focus-visible { outline: 1px solid var(--gold-2); outline-offset: 3px; }
.profile-panel[hidden] { display: none; }
.profile-list { display: flex; flex-direction: column; gap: 10px; }
.profile-row { display: flex; align-items: center; gap: 16px; padding: 12px 16px; color: var(--ink); text-decoration: none; }
.profile-row:hover { border-color: var(--hair-2); }
.profile-row .grow { flex: 1; min-width: 0; }
.profile-row small { display: block; color: var(--ink-dim); font-size: 14px; }
.profile-row .arrow { color: var(--gold); font-size: 22px; }
.result-tag { flex: none; width: 58px; padding: 4px 0; border-radius: 3px; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: .14em; }
.result-tag.win { color: #3a2706; background: var(--gold-2); }
.result-tag.loss { color: var(--wax-ink); background: var(--wax-dk); }
.result-tag.left { color: var(--ink-dim); border: 1px solid var(--hair-2); }
.profile-classes img { width: 22px; height: 22px; margin-left: 4px; filter: invert(.85) sepia(1); }
.profile-build { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.profile-empty { text-align: center; color: var(--ink-dim); font-style: italic; padding: 30px 0; }
.profile-account { margin: 44px 0 0; text-align: right; font-size: 14px; color: var(--ink-dim); }
.profile-delete a { color: var(--red-ink); }

/* ── battle log ──────────────────────────────────────────────────────── */
.battle-back { display: inline-block; margin-bottom: 18px; }
.battle-result.win { color: var(--gold-2); }
.battle-result.loss { color: var(--red-ink); }
.battle-result.left { color: var(--ink-dim); }
.battle-meta { color: var(--ink-dim); margin: 0 0 22px; }
.battle-log { padding: 14px 20px; max-height: 70vh; overflow-y: auto; }
.log-entry { padding: 3px 0; border-bottom: 1px solid rgba(201, 168, 76, .07); font-size: 15px; }
.log-turn { padding-top: 12px; font-family: var(--font-display); font-size: 12px; letter-spacing: .16em; color: var(--gold-2); border-bottom-color: var(--hair); }
.log-gameover { color: var(--gold-2); font-weight: bold; }
.log-loot { color: var(--gold-2); }
.log-destroy { color: var(--red-ink); }
.log-attack { color: #f0b8a0; }
.log-ability { color: #c9d9a8; }
.log-error { color: var(--ink-dim); font-style: italic; }

/* ── phone ───────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .site-bar { flex-wrap: wrap; padding: 0 16px; min-height: 50px; }
  .site-menu-btn { display: block; order: 2; margin-left: 8px; }
  .site-sound { order: 1; margin-left: auto; }   /* the speaker, left of the ☰ */
  .site-links { order: 3; display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 4px 0 12px; }
  .site-menu-open .site-links { display: flex; }
  .site-links a { padding: 12px 0; border-bottom: 1px solid var(--hair); }
  .site-links a.on { border-bottom-color: var(--hair); }
  .site-spacer { display: none; }
  .site-page { padding: 24px 16px 36px; }
  h1 { font-size: 26px; }
  .home-doors { gap: 24px; }
}
