/* WhisperBytes — site stylesheet. Arcade palette taken from the game: deep navy, amber, cyan.
   No external fonts or files (the CSP only allows our own origin). */

:root {
  --bg: #0b0e1c;
  --bg-2: #10152a;
  --panel: #151b33;
  --panel-2: #1c2547;
  --line: #2c3764;
  --text: #e8ebf8;
  --dim: #9aa5cf;
  --faint: #6b76a3;
  --amber: #ffcc3d;
  --orange: #ff8a1f;
  --cyan: #5fd0ff;
  --green: #59e08a;
  --red: #ff6b6b;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", "Courier New", monospace;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 4px 4px 0 rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% -6%, rgba(255, 138, 31, 0.13), transparent 62%),
    radial-gradient(800px 560px at 96% 8%, rgba(95, 208, 255, 0.10), transparent 60%);
}
img { max-width: 100%; height: auto; }
.pixel { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--cyan); }
a:hover { color: #fff; }
::selection { background: var(--amber); color: #111; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.center { text-align: center; }
.muted { color: var(--dim); }
.mono { font-family: var(--mono); }

h1, h2, h3 { font-family: var(--mono); line-height: 1.15; letter-spacing: 0.5px; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0 0 14px; color: var(--amber); text-transform: uppercase; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin: 0 0 12px; color: var(--amber); text-transform: uppercase; }
h3 { font-size: 1.1rem; margin: 0 0 8px; color: #fff; }
.eyebrow { font: 600 0.78rem var(--mono); letter-spacing: 3px; text-transform: uppercase; color: var(--cyan); margin: 0 0 10px; }

/* ---------------------------------------------------------------- navigation */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(11, 14, 28, 0.88); backdrop-filter: blur(8px); border-bottom: 2px solid var(--line); }
.nav-in { display: flex; align-items: center; gap: 18px; max-width: 1120px; margin: 0 auto; padding: 10px 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 30px; image-rendering: pixelated; }
.brand span { font: 700 1.05rem var(--mono); color: var(--amber); letter-spacing: 1px; }
.links { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.links a, .links button.linklike {
  color: var(--text); text-decoration: none; padding: 6px 12px; border-radius: 6px;
  font: 600 0.9rem var(--mono); background: none; border: 0; cursor: pointer;
}
.links a:hover, .links a.active { background: var(--panel-2); color: var(--amber); }
.links .account { border: 2px solid var(--line); }
.lang { display: inline-flex; border: 2px solid var(--line); border-radius: 6px; overflow: hidden; margin-left: 6px; }
.lang button { background: none; color: var(--dim); border: 0; padding: 4px 9px; font: 700 0.8rem var(--mono); cursor: pointer; }
.lang button.on { background: var(--amber); color: #111; }
.burger { display: none; margin-left: auto; background: none; border: 2px solid var(--line); color: var(--text); border-radius: 6px; padding: 4px 10px; font-size: 1.2rem; cursor: pointer; }

/* ------------------------------------------------------------------- buttons */
.btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  font: 700 0.95rem var(--mono); letter-spacing: 1px; text-transform: uppercase;
  padding: 12px 22px; border-radius: 6px; border: 2px solid transparent;
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn-primary { background: var(--amber); color: #111; border-color: #111; box-shadow: var(--shadow); }
.btn-primary:hover { color: #111; transform: translate(-1px, -1px); box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.55); }
.btn-primary:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.55); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-small { padding: 6px 12px; font-size: 0.78rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

/* ---------------------------------------------------------------------- hero */
.hero { padding: 56px 0 30px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 36px; align-items: center; }
.hero p.lead { font-size: 1.15rem; color: var(--dim); max-width: 52ch; }
.hero .logo { width: min(520px, 100%); display: block; margin-bottom: 18px; image-rendering: pixelated; }
.frame { border: 3px solid var(--line); border-radius: 8px; overflow: hidden; background: #000; box-shadow: var(--shadow); }
.frame img { display: block; width: 100%; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pill { font: 600 0.75rem var(--mono); text-transform: uppercase; letter-spacing: 1px; padding: 4px 10px; border: 2px solid var(--line); border-radius: 999px; color: var(--dim); }
.pill.hot { border-color: var(--amber); color: var(--amber); }

/* ------------------------------------------------------------------ sections */
section.block { padding: 54px 0; }
section.block.alt { background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.025), transparent); }
.head { max-width: 760px; margin-bottom: 28px; }
.head p { color: var(--dim); }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--panel); border: 2px solid var(--line); border-radius: 8px; padding: 18px; box-shadow: var(--shadow); }
.card p { margin: 0; color: var(--dim); font-size: 0.95rem; }
.card .art { height: 96px; display: flex; align-items: center; justify-content: center; background: #0b1020; border-radius: 6px; margin-bottom: 12px; }
.card .art img { max-height: 84px; image-rendering: pixelated; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { text-align: center; padding: 14px; border: 2px dashed var(--line); border-radius: 8px; }
.stat b { display: block; font: 700 2rem var(--mono); color: var(--amber); }
.stat span { color: var(--dim); font-size: 0.85rem; }

.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.shot { display: block; position: relative; border: 3px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); background: #000; cursor: zoom-in; }
.shot img { display: block; width: 100%; transition: transform 0.2s; }
.shot:hover img { transform: scale(1.03); }
.shot figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 8px; font: 600 0.8rem var(--mono); background: linear-gradient(transparent, rgba(0, 0, 0, 0.85)); }
figure.shot { margin: 0; }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.9); display: none; align-items: center; justify-content: center; padding: 20px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border: 3px solid var(--line); }

.list { padding-left: 1.1rem; color: var(--dim); }
.list li { margin: 6px 0; }
.list b { color: var(--text); }

table.spec { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.spec th, table.spec td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.spec th { font: 600 0.78rem var(--mono); letter-spacing: 1px; text-transform: uppercase; color: var(--cyan); background: var(--panel-2); }
kbd { font: 600 0.85em var(--mono); background: var(--panel-2); border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 5px; padding: 1px 7px; }

.callout { border-left: 4px solid var(--cyan); background: var(--panel); padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 16px 0; color: var(--dim); }
.callout.warn { border-left-color: var(--amber); }
.callout.ok { border-left-color: var(--green); }

.price { font: 700 2.6rem var(--mono); color: var(--amber); }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 8px 0 8px 48px; color: var(--dim); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 6px; width: 32px; height: 32px; background: var(--amber); color: #111; font: 700 1rem/32px var(--mono); text-align: center; border-radius: 4px; }
.steps li b { color: var(--text); }

details.faq { background: var(--panel); border: 2px solid var(--line); border-radius: 8px; margin: 10px 0; }
details.faq summary { cursor: pointer; padding: 14px 18px; font-weight: 700; }
details.faq div { padding: 0 18px 14px; color: var(--dim); }

/* --------------------------------------------------------------------- forms */
.panel { background: var(--panel); border: 2px solid var(--line); border-radius: 8px; padding: 24px; box-shadow: var(--shadow); }
.auth { max-width: 460px; margin: 40px auto; }
.tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.tab { background: none; border: 2px solid var(--line); color: var(--dim); padding: 7px 14px; border-radius: 6px; font: 700 0.8rem var(--mono); text-transform: uppercase; cursor: pointer; }
.tab.on { background: var(--amber); color: #111; border-color: #111; }
label.field { display: block; margin: 14px 0; font: 600 0.8rem var(--mono); text-transform: uppercase; letter-spacing: 1px; color: var(--dim); }
label.field input, label.field select { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; background: #0a0d1a; border: 2px solid var(--line); border-radius: 6px; color: var(--text); font: 1rem var(--sans); }
label.field input:focus { outline: 0; border-color: var(--cyan); }
.msg { padding: 10px 14px; border-radius: 6px; margin: 14px 0; font-size: 0.92rem; }
.msg.err { background: rgba(255, 107, 107, 0.12); border: 1px solid var(--red); color: #ffc2c2; }
.msg.ok { background: rgba(89, 224, 138, 0.12); border: 1px solid var(--green); color: #c4f5d6; }
.msg.info { background: rgba(95, 208, 255, 0.1); border: 1px solid var(--cyan); color: #cdeeff; }

.badge { display: inline-block; font: 700 0.75rem var(--mono); text-transform: uppercase; letter-spacing: 1px; padding: 3px 10px; border-radius: 999px; }
.badge.active { background: rgba(89, 224, 138, 0.15); color: var(--green); border: 1px solid var(--green); }
.badge.expired, .badge.none, .badge.off { background: rgba(255, 107, 107, 0.12); color: var(--red); border: 1px solid var(--red); }
.badge.on { background: rgba(89, 224, 138, 0.15); color: var(--green); border: 1px solid var(--green); }
.badge.warn { background: rgba(255, 190, 70, 0.14); color: var(--yellow, #ffbe46); border: 1px solid var(--yellow, #ffbe46); }

/* --------------------------------------------------------------------- admin */
.admin-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.tablewrap { overflow-x: auto; border: 2px solid var(--line); border-radius: 8px; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.data th { background: var(--panel-2); font: 600 0.75rem var(--mono); text-transform: uppercase; letter-spacing: 1px; color: var(--cyan); position: sticky; top: 0; }
table.data td.wrapcell { white-space: normal; max-width: 420px; }
.cards4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.mini { background: var(--panel); border: 2px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.mini b { display: block; font: 700 1.5rem var(--mono); color: var(--amber); }
.mini span { color: var(--dim); font-size: 0.82rem; }
.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.inline label.field { margin: 0; flex: 1 1 180px; }
.logline.WARN td:nth-child(2) { color: var(--amber); }
.logline.ERROR td:nth-child(2) { color: var(--red); }

/* ------------------------------------------------------------------- footer */
.footer { border-top: 2px solid var(--line); margin-top: 40px; padding: 30px 0 18px; background: var(--bg-2); }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.foot-grid h4 { margin: 0 0 8px; font: 700 0.85rem var(--mono); color: var(--amber); text-transform: uppercase; letter-spacing: 1px; }
.foot-grid a { display: block; color: var(--dim); text-decoration: none; padding: 2px 0; }
.foot-grid a:hover { color: var(--amber); }
.foot-grid p { color: var(--dim); font-size: 0.9rem; margin: 0; }
.foot-bottom { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--faint); font-size: 0.82rem; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s, transform 0.5s; }
.reveal.seen { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .hero-grid, .g2 { grid-template-columns: 1fr; }
  .g3, .shots { grid-template-columns: repeat(2, 1fr); }
  .g4, .stats { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr; }
  .burger { display: block; }
  .links { display: none; width: 100%; flex-direction: column; align-items: stretch; margin-left: 0; }
  .links.open { display: flex; }
  .nav-in { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .g3, .shots, .g4, .stats { grid-template-columns: 1fr; }
  .hero { padding-top: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .shot img { transition: none; }
}

/* a game and its licence, with the action to the right */
.gamerow { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.gamerow:last-of-type { border-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; }

/* A button whose target is not open yet */
.btn.is-closed, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; pointer-events: none; }

/* WhisperBytes logo */
.brand img.brand-logo { height: 40px; image-rendering: auto; }
.foot-logo { height: 34px; vertical-align: middle; margin-right: 8px; }

/* Account edit window (admin) */
dialog.dlg { background: var(--panel); color: var(--text, inherit); border: 2px solid var(--line); border-radius: 10px; padding: 22px; width: min(1100px, 96vw); max-height: 92vh; overflow: auto; box-shadow: var(--shadow); }
dialog.dlg::backdrop { background: rgba(0, 0, 0, 0.7); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.dlg-head h3 { margin: 0; overflow-wrap: anywhere; }
.dlg h4 { margin: 22px 0 8px; font: 700 0.85rem var(--mono); text-transform: uppercase; letter-spacing: 1px; color: var(--cyan); }
.dlg h4.ud-danger { color: #ff7a7a; }
.ud-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 16px; align-items: end; }
.ud-actions { grid-column: 1 / -1; }
.ud-num { width: 8.5em; }
.ud-date { min-width: 10em; }

/* ============================================================ studio and games */
/* Each game carries its own accent colour (`--accent`), set on its card, its menu entry or its page. */
:root { --accent: var(--amber); }

/* Games menu in the navigation */
.dd { position: relative; }
.dd-btn { color: var(--text); background: none; border: 0; cursor: pointer; padding: 6px 12px; border-radius: 6px; font: 600 0.9rem var(--mono); }
.dd-btn::after { content: " ▾"; color: var(--dim); }
.dd:hover .dd-btn, .dd.open .dd-btn, .dd.active .dd-btn { background: var(--panel-2); color: var(--amber); }
.dd-menu { display: none; position: absolute; left: 0; top: 100%; min-width: 220px; padding: 6px; background: var(--panel); border: 2px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); z-index: 60; }
.dd:hover .dd-menu, .dd.open .dd-menu, .dd:focus-within .dd-menu { display: block; }
.dd-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 12px !important; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }

/* Studio hero (home) */
.studio { padding: 64px 0 24px; text-align: center; }
.studio .brand-big { width: min(420px, 80%); margin: 0 auto 20px; display: block; }
.studio h1 { margin-bottom: 12px; }
.studio .lead { font-size: 1.15rem; color: var(--dim); max-width: 60ch; margin: 0 auto; }
.studio .actions { justify-content: center; }

/* A game card */
.gcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.gcard { display: flex; flex-direction: column; text-decoration: none; color: var(--text); background: var(--panel); border: 2px solid var(--line); border-top: 4px solid var(--accent); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; transition: transform 0.1s, border-color 0.1s; }
.gcard:hover { transform: translate(-2px, -2px); border-color: var(--accent); color: var(--text); }
.gcard.featured { grid-column: 1 / -1; flex-direction: row; }
.gcard .gart { position: relative; flex: 0 0 auto; aspect-ratio: 16 / 9; background: #000; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gcard.featured .gart { width: 52%; aspect-ratio: auto; min-height: 260px; }
.gcard .gart img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gcard .gart.blank { background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 38%, transparent), transparent 60%), linear-gradient(135deg, #0d1226, #070914); }
.gcard .gart.blank b { font: 700 clamp(1.1rem, 2.4vw, 1.6rem) var(--mono); letter-spacing: 2px; color: var(--accent); text-shadow: 0 0 18px var(--accent); text-align: center; padding: 0 10px; }
.gcard .gbody { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.gcard h3 { margin: 0; color: var(--accent); font-size: 1.3rem; }
.gcard .tag { color: var(--dim); font-size: 0.95rem; margin: 0; }
.gcard .gfoot { margin-top: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge.soon { background: rgba(155, 165, 207, 0.12); color: var(--dim); border: 1px solid var(--line); }
.badge.live { background: rgba(89, 224, 138, 0.15); color: var(--green); border: 1px solid var(--green); }

/* Challenge strip (home) */
.strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border: 2px solid var(--accent); border-radius: 8px; background: color-mix(in srgb, var(--accent) 9%, var(--panel)); margin: 8px 0 24px; }
.strip b { font-family: var(--mono); color: var(--accent); }

/* A game's own page */
.ghero { padding: 46px 0 24px; border-bottom: 2px solid var(--line); background: radial-gradient(800px 360px at 80% -20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); }
.ghero .eyebrow { color: var(--accent); }
.ghero h1 { color: var(--accent); }
.ghero .lead { font-size: 1.1rem; color: var(--dim); max-width: 60ch; }
.subnav { position: sticky; top: 52px; z-index: 40; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0; background: rgba(11, 14, 28, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.subnav button { background: none; border: 2px solid var(--line); color: var(--dim); padding: 7px 14px; border-radius: 6px; font: 700 0.8rem var(--mono); text-transform: uppercase; cursor: pointer; }
.subnav button.on { background: var(--accent); color: #111; border-color: #111; }
.gsoon { text-align: center; padding: 56px 0; }
.gsoon .lead, .gsoon .muted { margin-left: auto; margin-right: auto; max-width: 60ch; }
.gsoon .gart { width: min(560px, 100%); margin: 0 auto 24px; border: 3px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.shopgame { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; margin-bottom: 14px; border-left: 6px solid var(--accent); }

@media (max-width: 900px) {
  .gcard.featured { flex-direction: column; }
  .gcard.featured .gart { width: 100%; aspect-ratio: 16 / 9; min-height: 0; }
  .dd { width: 100%; }
  .dd-menu { position: static; box-shadow: none; }
  .dd:hover .dd-menu { display: none; }
  .dd.open .dd-menu { display: block; }
  .subnav { top: 0; position: static; }
  .shopgame { grid-template-columns: 1fr; }
}
