/* APN PLAY: tokens, fonts and the shell (top bar, left rail, footer).
   The layout follows the CrazyGames structure (60 px top bar, 68 px icon rail that opens to 240 px);
   colours, type and marks are APN's own (allpatchnotes.com tokens). */
@font-face { font-family: "APN Sans"; src: url("fonts/apn-sans.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "APN Display"; src: url("fonts/apn-display.woff2") format("woff2"); font-weight: 600 900; font-display: swap; }

:root {
  color-scheme: dark;
  --canvas: #0d1217;
  --chrome: #0a0e13;
  --bar: #11171d;
  --surface: #131920;
  --raised: #1a2129;
  --raised-2: #222a34;
  /* What a cover box shows until its picture arrives: a soft diagonal sheen, so the box reads as a picture on its way and not as a hole. The box keeps its aspect ratio, so nothing moves when the picture lands. */
  --cover-wait: linear-gradient(135deg, #252e39 0%, #1a2129 52%, #151c24 100%);
  --hover: rgba(255, 255, 255, 0.05);
  --press: rgba(255, 255, 255, 0.09);
  --line: rgba(150, 156, 171, 0.16);
  --line-strong: rgba(150, 156, 171, 0.3);
  --text: #f5f6f8;
  --muted: #a7afbc;
  --subtle: #7b8697;
  --crimson: #fc1243;
  /* Crimson behind white text: #fc1243 gives 3.96:1, this gives 4.88:1 (WCAG AA). */
  --crimson-fill: #e00f3b;
  --crimson-deep: #a3072f;
  --crimson-wash: rgba(252, 18, 67, 0.12);
  --crimson-text: #ff5f7e;
  --official: #58a6ff;
  --live: #3fcf8e;
  --gold: #f5b83d;
  --f-ui: "APN Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --f-display: "APN Display", "APN Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --top-h: 60px;
  --rail-w: 68px;
  --rail-open: 240px;
  --gap: 8px;
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: .15s;
  --t: .2s;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--raised-2) transparent; }
body { margin: 0; background: var(--canvas); color: var(--text); font: 400 14px/1.45 var(--f-ui); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--crimson-text); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.fill { fill: currentColor; stroke: none; }

/* Top bar */
.top { position: fixed; inset: 0 0 auto 0; height: var(--top-h); z-index: 50; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 0 16px 0 12px; background: var(--bar); border-bottom: 1px solid var(--line); }
.top-left { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--text); transition: background var(--t-fast); position: relative; }
@media (hover: hover) { .icon-btn:hover { background: var(--hover); } }
.icon-btn:active { background: var(--press); }
.icon-btn.round { background: var(--raised); }
.brand { display: flex; align-items: center; gap: 8px; height: 40px; }
.brand img { width: 32px; height: 32px; transform-origin: 50% 100%; }
/* The mascot head squashes and stretches like jelly for as long as the pointer stays on it (owner, 2026-11-02); the home page's Originals band uses it too (app.css .ob-head). */
@keyframes apn-jelly { 0%, 100% { transform: scale(1, 1); } 15% { transform: scale(1.22, .78); } 30% { transform: scale(.84, 1.18); } 45% { transform: scale(1.1, .9); } 60% { transform: scale(.95, 1.05); } 75% { transform: scale(1.02, .98); } }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .brand:hover img { animation: apn-jelly 1.1s ease-out infinite; } }
.brand b { font: 800 19px/1 var(--f-display); letter-spacing: .02em; white-space: nowrap; }
.brand b span { color: var(--crimson); }
.search { justify-self: center; width: min(610px, 100%); position: relative; }
.search input { width: 100%; height: 40px; border-radius: 999px; border: 1px solid transparent; background: var(--raised-2); padding: 0 44px 0 20px; font-weight: 600; font-size: 15px; outline: none; transition: border-color var(--t-fast), background var(--t-fast); }
.search input::placeholder { color: var(--muted); font-weight: 500; }
.search input:focus { border-color: var(--line-strong); background: var(--raised); }
.search .ico { position: absolute; right: 14px; top: 10px; color: var(--muted); pointer-events: none; }
.top-right { display: flex; align-items: center; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 700; font-size: 14px; white-space: nowrap; transition: filter var(--t-fast), background var(--t-fast); }
.btn-primary { background: var(--crimson-fill); color: #fff; }
.btn-ghost { background: var(--raised); color: var(--text); }
.btn-outline { border: 1px solid var(--line-strong); }
@media (hover: hover) { .btn-primary:hover { filter: brightness(1.04); } .btn-ghost:hover { background: var(--raised-2); } }
.btn:active { filter: brightness(.92); }
.btn.sm { height: 32px; padding: 0 14px; font-size: 13px; }

/* Left rail: 68 px icons, opens to 240 px with labels over the page (as CrazyGames) */
.rail { position: fixed; top: var(--top-h); bottom: 0; left: 0; width: var(--rail-w); z-index: 40; background: var(--chrome); overflow-y: auto; overflow-x: hidden; scrollbar-width: none; transition: width var(--t) var(--ease), box-shadow var(--t); padding: 8px 0 24px; }
.rail::-webkit-scrollbar { display: none; }
body.rail-open .rail { width: var(--rail-open); box-shadow: 8px 0 32px rgba(0, 0, 0, .45); }
.rail a { display: flex; align-items: center; gap: 16px; height: 44px; margin: 0 8px; padding: 0 14px; border-radius: 10px; color: var(--muted); white-space: nowrap; font-weight: 600; font-size: 15px; transition: background var(--t-fast), color var(--t-fast); }
.rail a .ico { width: 22px; height: 22px; color: var(--muted); }
.rail a span { opacity: 0; transition: opacity var(--t-fast); }
body.rail-open .rail a span { opacity: 1; }
/* the developer program is not open (src/data/launch.mjs DEVELOPERS): the rail shows it as a label, not a link */
.rail .rail-soon { display: flex; align-items: center; gap: 16px; height: 44px; margin: 0 8px; padding: 0 14px; color: var(--muted); white-space: nowrap; font-weight: 600; font-size: 15px; cursor: default; }
.rail .rail-soon .ico { width: 22px; height: 22px; color: var(--muted); }
.rail .rail-soon > span { opacity: 0; transition: opacity var(--t-fast); }
body.rail-open .rail .rail-soon > span { opacity: 1; }
.rail .rail-soon small { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-left: 6px; color: var(--muted); }
@media (hover: hover) { .rail a:hover { background: var(--hover); color: var(--text); } .rail a:hover .ico { color: var(--text); } }
.rail a[aria-current="page"] { color: var(--text); font-weight: 800; }
.rail a[aria-current="page"] .ico { color: var(--crimson); }
.rail a.orig .ico { color: var(--crimson); }
.rail hr { border: 0; border-top: 1px solid var(--line); margin: 8px 16px; }
.rail-foot { padding: 8px 22px; font-size: 12px; color: var(--subtle); white-space: nowrap; opacity: 0; transition: opacity var(--t-fast); }
body.rail-open .rail-foot { opacity: 1; }
.scrim { position: fixed; inset: var(--top-h) 0 0 0; z-index: 39; background: rgba(0, 0, 0, .4); opacity: 0; pointer-events: none; transition: opacity var(--t); }
body.rail-open .scrim { opacity: 1; pointer-events: auto; }

/* Page frame */
.main { padding: calc(var(--top-h) + 20px) 24px 48px calc(var(--rail-w) + 24px); min-height: 100vh; }
.wrap { max-width: 1840px; margin: 0 auto; }

/* Footer */
.foot { margin: 56px 0 0; padding: 32px 0 8px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; color: var(--muted); }
.foot h4 { margin: 0 0 12px; color: var(--text); font: 700 14px/1.3 var(--f-ui); }
.foot h4 ~ a { display: block; padding: 4px 0; font-size: 14px; }
.foot .foot-soon { display: block; padding: 4px 0; font-size: 14px; color: var(--subtle); }
.foot p a, .foot-legal a { text-decoration: underline; text-underline-offset: 2px; }
.foot-brand .brand { display: inline-flex; }
@media (hover: hover) { .foot a:hover { color: var(--text); } }
.foot p { margin: 12px 0 0; font-size: 13px; line-height: 1.55; max-width: 320px; }
.foot-legal { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--subtle); }

@media (max-width: 1100px) { .foot { grid-template-columns: 1fr 1fr; } }
@media (max-width: 767px) {
  :root { --top-h: 56px; }
  .top { grid-template-columns: auto 1fr auto; gap: 8px; padding: 0 8px; }
  .search { display: none; }
  .search.open { display: block; position: fixed; inset: 8px 8px auto 8px; width: auto; z-index: 60; }
  .rail { width: 0; padding: 0; }
  body.rail-open .rail { width: min(300px, 86vw); padding: 8px 0 24px; }
  .main { padding: calc(var(--top-h) + 12px) 12px 32px 12px; }
  .hide-sm { display: none !important; }
  .foot { grid-template-columns: 1fr; gap: 20px; }
}
@media (min-width: 768px) { .show-sm { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; } }
