/* =========================================================================
   HIDE & SEEK — UI
   Visual language pulled from the project's own design notes:
   condensed uppercase type on a -4deg skew, heavy black outlines, a gold
   #FFD700 -> #C5A059 primary action, and dark glass panels over the live 3D
   menu backdrop.
   ========================================================================= */

:root {
  --bg:            #07080b;
  --bg-2:          #0d1016;
  --glass:         rgba(14, 17, 24, 0.72);
  --glass-hi:      rgba(30, 36, 48, 0.72);
  --line:          rgba(255, 255, 255, 0.10);
  --line-hi:       rgba(255, 255, 255, 0.22);

  --ink:           #f2f5fa;
  --ink-dim:       #99a2b3;
  --ink-faint:     #5d6675;

  --gold-1:        #ffd700;
  --gold-2:        #c5a059;
  --cyan:          #46e0ff;
  --magenta:       #ff3fa4;
  --amber:         #ffab2e;
  --green:         #45e08a;
  --red:           #ff4d4d;

  --accent:        var(--cyan);

  --radius:        18px;
  --radius-sm:     11px;
  --shadow:        0 18px 48px rgba(0, 0, 0, .58), 0 2px 0 rgba(255,255,255,.05) inset;
  --skew:          -4deg;

  --font-display: "Bahnschrift", "Oswald", "Arial Narrow", "Haettenschweiler",
                  "Impact", system-ui, sans-serif;
  --font-ui:      ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.screen {
  position: fixed; inset: 0;
  display: none;
  z-index: 10;
}
.screen.active { display: block; }
.screen.modal.active { display: grid; place-items: center; }

kbd {
  font-family: var(--font-mono);
  font-size: .72rem;
  background: rgba(255,255,255,.09);
  border: 1px solid var(--line-hi);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--ink);
}

/* ---------------------------------------------------------------- type -- */
h1, h2, h3, .display {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .02em;
  font-weight: 700;
}
.display-skew { transform: skewX(var(--skew)); }

/* ================================================================= BOOT == */
#boot {
  background: radial-gradient(120% 90% at 50% 30%, #12161f 0%, #07080b 65%);
  display: none;
  place-items: center;
}
#boot.active { display: grid; }
.boot-inner { text-align: center; width: min(520px, 84vw); }
.boot-mark { width: 132px; margin: 0 auto 26px; }
.boot-eye { width: 100%; height: auto; overflow: visible; }
.boot-eye .ring {
  fill: none; stroke: var(--cyan); stroke-width: 1.6;
  opacity: .55; transform-origin: 60px 60px;
}
.boot-eye .r1 { animation: spin 7s linear infinite; stroke-dasharray: 60 24; }
.boot-eye .r2 { animation: spin 5s linear infinite reverse; stroke-dasharray: 30 14; opacity:.8; }
.boot-eye .r3 { animation: spin 3.4s linear infinite; stroke-dasharray: 14 10; }
.boot-eye .pupil { fill: var(--cyan); animation: pulse 1.9s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity:.35; r:7 } 50% { opacity:1; r:10 } }

.boot-title {
  font-family: var(--font-display); font-size: clamp(2.6rem, 7vw, 4.2rem);
  letter-spacing: .06em; transform: skewX(var(--skew));
  text-shadow: 0 0 40px rgba(70,224,255,.25);
}
.boot-sub {
  font-family: var(--font-display); font-size: .95rem; letter-spacing: .55em;
  color: var(--ink-faint); margin: 4px 0 30px; transform: skewX(var(--skew));
}
.boot-bar, .load-bar {
  height: 4px; background: rgba(255,255,255,.08);
  border-radius: 99px; overflow: hidden; margin: 0 auto; width: 100%;
}
.boot-bar > i, .load-bar > i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--cyan), #b6f2ff);
  box-shadow: 0 0 18px var(--cyan);
  transition: width .28s cubic-bezier(.2,.8,.2,1);
}
.boot-status {
  margin-top: 14px; font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .28em; color: var(--ink-faint); text-transform: uppercase;
}

/* ================================================================= MENU == */
#menu {
  display: none;
  grid-template-rows: auto auto 1fr auto;
  padding: clamp(14px, 2.4vh, 26px) clamp(16px, 3vw, 46px);
  gap: 14px;
}
#menu.active { display: grid; }
.menu-bg-fade {
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    linear-gradient(180deg, rgba(7,8,11,.86) 0%, rgba(7,8,11,.30) 34%, rgba(7,8,11,.55) 72%, rgba(7,8,11,.94) 100%),
    radial-gradient(70% 55% at 78% 42%, rgba(70,224,255,.10), transparent 70%);
}

/* topbar */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.profile { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 46px; height: 46px; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 1.05rem; letter-spacing: .02em;
  background: linear-gradient(150deg, var(--gold-1), var(--gold-2));
  color: #17130a; border-radius: 13px;
  box-shadow: 0 6px 18px rgba(255,215,0,.22), 0 0 0 2px #000 inset;
  transform: skewX(var(--skew));
}
.pname {
  font-family: var(--font-display); font-size: 1.02rem; letter-spacing: .06em;
  transform: skewX(var(--skew));
}
.plevel { display: flex; align-items: center; gap: 9px; font-size: .68rem; color: var(--ink-dim); letter-spacing: .16em; }
.xpbar { width: 104px; height: 4px; background: rgba(255,255,255,.1); border-radius: 99px; overflow: hidden; }
.xpbar > i { display: block; height: 100%; width: 20%; background: linear-gradient(90deg, var(--gold-2), var(--gold-1)); }

.currency { display: flex; gap: 9px; }
.coinchip {
  display: flex; align-items: center; gap: 7px;
  background: var(--glass); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 12px;
  font-family: var(--font-display); letter-spacing: .06em; font-size: .95rem;
  backdrop-filter: blur(14px);
}
.coinchip .of { color: var(--ink-faint); font-size: .8em; }
.coinchip.alt { border-color: rgba(255, 63, 164, .28); }
.profile-txt { display: grid; gap: 3px; }
.coin-ico, .found-ico, .pup-ico {
  width: 15px; height: 15px; border-radius: 50%; display: inline-block; flex: 0 0 auto;
}
.coin-ico { background: radial-gradient(circle at 34% 30%, #fff6c2, var(--gold-1) 46%, #9a7a1c); box-shadow: 0 0 10px rgba(255,215,0,.45); }
.found-ico { background: radial-gradient(circle at 34% 30%, #d9fff0, var(--green) 48%, #1d6c43); box-shadow: 0 0 10px rgba(69,224,138,.4); border-radius: 4px; }
.pup-ico { background: radial-gradient(circle at 34% 30%, #ffd9ec, var(--magenta) 48%, #7d1148); box-shadow: 0 0 10px rgba(255,63,164,.45); }

/* tabs */
.tabs { display: flex; gap: 4px; }
.tab {
  font-family: var(--font-display); font-size: .92rem; letter-spacing: .16em;
  background: transparent; color: var(--ink-faint); border: 0;
  padding: 10px 20px 12px; cursor: pointer; position: relative;
  transform: skewX(var(--skew)); transition: color .15s;
}
.tab:hover { color: var(--ink-dim); }
.tab.active { color: var(--ink); }
.tab.active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 3px;
  background: linear-gradient(90deg, var(--gold-1), var(--gold-2)); border-radius: 2px;
  box-shadow: 0 0 14px rgba(255,215,0,.5);
}

/* panel */
.panel { overflow: hidden; position: relative; min-height: 0; }
.tabpage { display: none; height: 100%; overflow-y: auto; padding-right: 8px; }
.tabpage.active { display: block; animation: fadeUp .28s cubic-bezier(.2,.8,.2,1); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.tabpage::-webkit-scrollbar { width: 8px; }
.tabpage::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 99px; }

.page-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h2 { font-size: 1.35rem; letter-spacing: .12em; transform: skewX(var(--skew)); }
.page-head .hint { color: var(--ink-faint); font-size: .78rem; }
.colhead { font-size: .82rem; letter-spacing: .2em; color: var(--ink-dim); margin-bottom: 10px; }

.mutators { display: flex; gap: 6px; flex-wrap: wrap; }
.mutator {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .12em;
  padding: 5px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); color: var(--ink-faint); background: rgba(255,255,255,.02);
  text-transform: uppercase; transition: .15s;
}
.mutator:hover { border-color: var(--line-hi); color: var(--ink-dim); }
.mutator.on { border-color: var(--magenta); color: var(--magenta); background: rgba(255,63,164,.10); box-shadow: 0 0 14px rgba(255,63,164,.18); }

/* arena cards */
.arena-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  padding-bottom: 24px;
}
.arena-card {
  position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius);
  overflow: hidden; cursor: pointer; border: 1px solid var(--line);
  background: var(--bg-2); isolation: isolate;
  transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s, border-color .22s;
}
.arena-card:hover { transform: translateY(-6px) scale(1.015); border-color: var(--line-hi); box-shadow: var(--shadow); }
.arena-card.selected { border-color: var(--gold-1); box-shadow: 0 0 0 2px rgba(255,215,0,.35), var(--shadow); }
.arena-card .art { position: absolute; inset: 0; z-index: -2; }
.arena-card .art canvas { width: 100%; height: 100%; display: block; }
.arena-card .scrim {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,.28) 46%, rgba(4,5,8,.93) 100%);
}
.arena-card .body { position: absolute; inset: auto 0 0 0; padding: 16px 15px 15px; }
.arena-card .idx {
  position: absolute; top: 12px; left: 14px;
  font-family: var(--font-display); font-size: 2.4rem; line-height: 1;
  color: rgba(255,255,255,.14); transform: skewX(var(--skew));
  -webkit-text-stroke: 1px rgba(255,255,255,.14); paint-order: stroke;
}
.arena-card h3 {
  font-size: 1.12rem; letter-spacing: .04em; transform: skewX(var(--skew));
  text-shadow: 0 2px 0 #000, 0 0 22px rgba(0,0,0,.9); line-height: 1.05;
}
.arena-card .tagline { font-size: .7rem; color: var(--ink-dim); margin-top: 5px; line-height: 1.35; }
.arena-card .meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.diff { display: flex; gap: 3px; }
.diff i { width: 12px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.18); }
.diff i.on { background: var(--amber); box-shadow: 0 0 8px rgba(255,171,46,.6); }
.arena-card .prog {
  margin-left: auto; font-family: var(--font-mono); font-size: .62rem;
  color: var(--ink-faint); letter-spacing: .1em;
}
.arena-card .badge {
  position: absolute; top: 12px; right: 12px; font-family: var(--font-mono);
  font-size: .56rem; letter-spacing: .14em; padding: 4px 8px; border-radius: 6px;
  background: rgba(69,224,138,.14); color: var(--green); border: 1px solid rgba(69,224,138,.35);
}
.arena-card .badge.pup { background: rgba(255,63,164,.14); color: var(--magenta); border-color: rgba(255,63,164,.35); }

/* skins / store */
.skin-grid, .store-grid {
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  padding-bottom: 22px;
}
.store-cols { display: grid; gap: 26px; grid-template-columns: 1.4fr 1fr; align-items: start; }
@media (max-width: 900px) { .store-cols { grid-template-columns: 1fr; } }

.skin-card {
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
  background: var(--glass); cursor: pointer; transition: .2s; position: relative;
  backdrop-filter: blur(10px);
}
.skin-card:hover { transform: translateY(-4px); border-color: var(--line-hi); }
.skin-card.equipped { border-color: var(--cyan); box-shadow: 0 0 0 1px rgba(70,224,255,.4), 0 0 26px rgba(70,224,255,.18); }
.skin-card.locked { opacity: .62; }
.skin-swatch { height: 96px; position: relative; overflow: hidden; }
.skin-swatch::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(60% 70% at 50% 40%, rgba(255,255,255,.22), transparent 70%);
  mix-blend-mode: overlay;
}
.skin-body { padding: 10px 11px 12px; }
.skin-body b { font-family: var(--font-display); font-size: .84rem; letter-spacing: .07em; display: block; }
.skin-body .rar { font-family: var(--font-mono); font-size: .56rem; letter-spacing: .16em; margin-top: 3px; display: block; }
.skin-body .desc { font-size: .66rem; color: var(--ink-faint); margin-top: 6px; line-height: 1.4; }
.skin-price {
  margin-top: 9px; display: flex; align-items: center; gap: 6px;
  font-family: var(--font-display); font-size: .82rem; letter-spacing: .05em;
}
.skin-card .tickmark {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--cyan); color: #05242c; display: grid; place-items: center;
  font-size: .72rem; font-weight: 800;
}
.rar-common   { color: #9aa6b8; }
.rar-rare     { color: #4da3ff; }
.rar-epic     { color: #b46cff; }
.rar-legendary{ color: var(--gold-1); }
.rar-secret   { color: var(--magenta); }

/* extras */
.extras-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); padding-bottom: 24px; }
.card {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; backdrop-filter: blur(14px);
}
.card.wide { grid-column: span 2; }
@media (max-width: 780px) { .card.wide { grid-column: span 1; } }
.card h3 { font-size: .92rem; letter-spacing: .16em; margin-bottom: 14px; color: var(--ink); }
.card .hint { font-size: .74rem; color: var(--ink-faint); line-height: 1.5; }
.row { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: .74rem; letter-spacing: .1em; color: var(--ink-dim); }
.row > span { flex: 0 0 150px; }
.row > b { font-family: var(--font-mono); font-size: .7rem; color: var(--ink); min-width: 40px; text-align: right; }
.row input[type=range] { flex: 1; accent-color: var(--cyan); }
.row select {
  flex: 1; background: rgba(255,255,255,.05); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; font-family: var(--font-display); letter-spacing: .1em;
}
.keys { list-style: none; display: grid; gap: 8px; font-size: .74rem; color: var(--ink-dim); }
.keys li { display: flex; gap: 10px; align-items: center; }
.pupboard { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 12px; }
.pupdot {
  aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--line);
  display: grid; place-items: center; font-size: .9rem; opacity: .3;
}
.pupdot.found { opacity: 1; border-color: var(--magenta); background: rgba(255,63,164,.12); }

/* buttons */
.btn {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .14em;
  border: 0; cursor: pointer; border-radius: 12px; padding: 14px 34px; font-size: 1rem;
  transform: skewX(var(--skew)); transition: transform .16s cubic-bezier(.2,.8,.2,1), filter .16s, box-shadow .16s;
  color: #17130a;
}
.btn > * { display: inline-block; transform: skewX(calc(-1 * var(--skew))); }
.btn.play {
  background: linear-gradient(150deg, var(--gold-1) 0%, var(--gold-2) 100%);
  box-shadow: 0 8px 0 #6d5620, 0 14px 30px rgba(255,215,0,.22);
  -webkit-text-stroke: 2px #000; paint-order: stroke fill;
  padding: 16px 56px; font-size: 1.28rem;
}
.btn.play:hover { transform: skewX(var(--skew)) translateY(-2px); filter: brightness(1.08); }
.btn.play:active { transform: skewX(var(--skew)) translateY(4px); box-shadow: 0 4px 0 #6d5620; }
.btn.ghost {
  background: rgba(255,255,255,.06); color: var(--ink); border: 1px solid var(--line-hi);
  font-size: .84rem; padding: 11px 22px;
}
.btn.ghost:hover { background: rgba(255,255,255,.12); }
.btn.ghost.danger { color: var(--red); border-color: rgba(255,77,77,.35); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.menu-foot { display: flex; align-items: center; justify-content: space-between; }
.build { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .22em; color: var(--ink-faint); }

/* ============================================================== LOADING == */
#loading { display: none; place-items: center; background: rgba(4,5,8,.9); backdrop-filter: blur(6px); }
#loading.active { display: grid; }
.load-inner { width: min(660px, 86vw); text-align: left; }
.load-tag { font-family: var(--font-mono); font-size: .64rem; letter-spacing: .32em; color: var(--accent); margin-bottom: 8px; }
.load-title { font-size: clamp(2.2rem, 6vw, 3.6rem); letter-spacing: .04em; transform: skewX(var(--skew)); }
.load-sub { color: var(--ink-dim); font-size: .84rem; margin: 8px 0 24px; line-height: 1.5; max-width: 46ch; }
.load-tip { margin-top: 14px; font-size: .72rem; color: var(--ink-faint); font-style: italic; }

/* ================================================================== HUD == */
.hud { pointer-events: none; z-index: 12; }
.hud.active { display: block; }
.hud-tl { position: absolute; top: 22px; left: 26px; }
.hud-tr { position: absolute; top: 22px; right: 26px; text-align: right; display: grid; gap: 6px; justify-items: end; }
.hud-bl { position: absolute; bottom: 24px; left: 26px; display: grid; gap: 9px; }
.hud-br { position: absolute; bottom: 24px; right: 26px; }
.hud-bc { position: absolute; bottom: 96px; left: 0; right: 0; text-align: center; }

.hud-arena { font-family: var(--font-display); font-size: .84rem; letter-spacing: .22em; color: var(--ink-dim); transform: skewX(var(--skew)); }
.hud-timer { font-family: var(--font-mono); font-size: 1.55rem; letter-spacing: .05em; text-shadow: 0 2px 12px #000; }
.hud-stat {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-display); font-size: 1.05rem; letter-spacing: .06em;
  text-shadow: 0 2px 10px #000;
}
.hud-stat .sub { color: var(--ink-faint); font-size: .74em; }

.meter { width: 174px; }
.meter label { font-family: var(--font-mono); font-size: .54rem; letter-spacing: .24em; color: var(--ink-faint); }
.mbar { height: 5px; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.13); border-radius: 99px; overflow: hidden; margin-top: 3px; }
.mbar > i { display: block; height: 100%; width: 100%; transition: width .12s linear; }
.stamina .mbar > i { background: linear-gradient(90deg, #2ea6ff, #8fe0ff); }
.battery .mbar > i { background: linear-gradient(90deg, var(--gold-2), var(--gold-1)); }
.fear    .mbar > i { background: linear-gradient(90deg, #7a1030, var(--red)); width: 0%; }
.meter.low .mbar > i { animation: warn .7s steps(2) infinite; }
@keyframes warn { 50% { opacity: .35; } }

.powerslot {
  display: flex; align-items: center; gap: 11px;
  background: var(--glass); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 14px; backdrop-filter: blur(12px); min-width: 236px;
}
.powerslot.empty { opacity: .48; }
.powerslot.ready { border-color: var(--cyan); box-shadow: 0 0 22px rgba(70,224,255,.22); }
.powerslot.active { border-color: var(--magenta); box-shadow: 0 0 26px rgba(255,63,164,.3); }
.pico { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.08); display: grid; place-items: center; font-size: 1.1rem; }
.ptxt b { font-family: var(--font-display); font-size: .82rem; letter-spacing: .1em; display: block; }
.ptxt span { font-size: .62rem; color: var(--ink-faint); }
.powerslot kbd { margin-left: auto; }

.crosshair { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%,-50%); }
.crosshair i { position: absolute; background: rgba(255,255,255,.85); box-shadow: 0 0 4px rgba(0,0,0,.9); }
.crosshair i:nth-child(1) { left: 50%; top: 0;  width: 1.5px; height: 6px; transform: translateX(-50%); }
.crosshair i:nth-child(2) { left: 50%; bottom: 0; width: 1.5px; height: 6px; transform: translateX(-50%); }
.crosshair i:nth-child(3) { top: 50%; left: 0;  height: 1.5px; width: 6px; transform: translateY(-50%); }
.crosshair i:nth-child(4) { top: 50%; right: 0; height: 1.5px; width: 6px; transform: translateY(-50%); }
.crosshair.interact i { background: var(--gold-1); }

.conceal {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: .78rem; letter-spacing: .26em;
  color: var(--green); background: rgba(6, 28, 18, .55);
  border: 1px solid rgba(69, 224, 138, .38); border-radius: 9px;
  padding: 6px 15px; margin-bottom: 8px;
  opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s;
  backdrop-filter: blur(8px);
}
.conceal.show { opacity: 1; transform: none; }
.conceal > i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 10px var(--green); animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: .35; } }

.hint-line {
  display: inline-block; font-family: var(--font-display); font-size: .82rem; letter-spacing: .14em;
  color: var(--ink); background: rgba(0,0,0,.5); padding: 7px 16px; border-radius: 9px;
  border: 1px solid var(--line); opacity: 0; transition: opacity .2s; backdrop-filter: blur(8px);
}
.hint-line.show { opacity: 1; }

.toasts { position: absolute; top: 88px; right: 26px; display: grid; gap: 7px; justify-items: end; }
.toast {
  font-family: var(--font-display); font-size: .8rem; letter-spacing: .1em;
  background: var(--glass); border: 1px solid var(--line-hi); border-left: 3px solid var(--accent);
  padding: 9px 15px; border-radius: 10px; backdrop-filter: blur(12px);
  animation: toastIn .3s cubic-bezier(.2,.8,.2,1);
  text-shadow: 0 1px 0 #000;
}
.toast.gold { border-left-color: var(--gold-1); }
.toast.pink { border-left-color: var(--magenta); }
.toast.red  { border-left-color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateX(26px); } }
.toast.out { animation: toastOut .3s forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(26px); } }

.scanwave {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 50%, transparent 38%, rgba(70,224,255,.16) 45%, transparent 52%);
}
.scanwave.go { animation: scanpulse 1.1s ease-out; }
@keyframes scanpulse { 0% { opacity: 0; transform: scale(.2); } 20% { opacity: 1; } 100% { opacity: 0; transform: scale(1.9); } }

.spotted {
  position: absolute; inset: 0; display: grid; place-items: center; opacity: 0;
  background: radial-gradient(60% 55% at 50% 50%, transparent 40%, rgba(180,10,10,.4) 100%);
}
.spotted span {
  font-family: var(--font-display); font-size: 3.2rem; letter-spacing: .3em;
  color: #ff5a5a; transform: skewX(var(--skew)); text-shadow: 0 0 40px rgba(255,0,0,.7), 0 3px 0 #000;
}
.spotted.go { animation: spotFlash 1.5s ease-out; }
@keyframes spotFlash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }

.vignette-fear {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(58% 52% at 50% 50%, transparent 42%, rgba(120,0,0,.72) 100%);
  transition: opacity .3s;
}

.minimap {
  position: absolute; top: 84px; left: 26px; width: 190px; height: 190px;
  border-radius: 14px; border: 1px solid var(--line); background: rgba(4,6,10,.62);
  backdrop-filter: blur(8px); display: none;
}
.minimap.on { display: block; }

/* =============================================================== MODALS == */
.modal { background: rgba(4,5,8,.78); backdrop-filter: blur(14px); z-index: 20; }
.modal-box {
  width: min(460px, 88vw); background: var(--glass-hi); border: 1px solid var(--line-hi);
  border-radius: var(--radius); padding: 34px; text-align: center; box-shadow: var(--shadow);
  display: grid; gap: 12px; animation: fadeUp .26s cubic-bezier(.2,.8,.2,1);
}
.modal-box.wide { width: min(600px, 92vw); }
.modal-box h2 { font-size: 1.9rem; letter-spacing: .16em; transform: skewX(var(--skew)); margin-bottom: 8px; }
.pausestats, .res-rows {
  display: grid; gap: 7px; text-align: left; margin: 6px 0 14px;
  font-family: var(--font-mono); font-size: .74rem; color: var(--ink-dim);
}
.res-rows .rrow { display: flex; justify-content: space-between; padding: 8px 12px; background: rgba(255,255,255,.04); border-radius: 8px; }
.res-rows .rrow b { color: var(--ink); font-family: var(--font-display); letter-spacing: .08em; }
.res-rows .rrow.hero { background: linear-gradient(90deg, rgba(255,215,0,.16), rgba(255,215,0,.03)); }
.res-tag { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .32em; color: var(--gold-1); }
.res-actions { display: flex; gap: 10px; justify-content: center; margin-top: 6px; }

/* ============================================================== CREDITS == */
#credits { background: #04050880; }
#credits.active { display: block; }
.credit-scroll {
  position: absolute; left: 0; right: 0; top: 100%;
  text-align: center; padding: 0 20px 40vh;
  animation: roll 78s linear forwards;
}
@keyframes roll { to { transform: translateY(-100%); } }
.credit-scroll h1 { font-size: clamp(2.4rem, 8vw, 4.4rem); letter-spacing: .08em; transform: skewX(var(--skew)); margin-bottom: 4px; }
.credit-scroll h2 { font-size: 1rem; letter-spacing: .34em; color: var(--accent); margin: 60px 0 14px; }
.credit-scroll p { font-size: .86rem; color: var(--ink-dim); line-height: 2; }
.credit-scroll .big { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: .1em; color: var(--ink); }
.credit-scroll .tiny { font-size: .68rem; color: var(--ink-faint); line-height: 1.9; max-width: 56ch; margin: 0 auto; }
.credit-skip { position: absolute; bottom: 30px; right: 30px; }

/* ============================================================ RESPONSIVE = */
#rotate-warn { display: none; }
@media (max-width: 620px) {
  .arena-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .hud-bl .meter { width: 118px; }
  .row > span { flex: 0 0 108px; }
  .minimap { width: 130px; height: 130px; }
}
.noscript { display: grid; place-items: center; height: 100vh; font-family: var(--font-display); letter-spacing: .2em; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* ===================================================== LAUNCH PANEL ====== */
/* The PLAY tab is one decision: start. Choosing a map was a choice nobody
   wanted to make eleven times an evening, so the arena is picked for you and
   this panel just sets the mood and gets out of the way. */
.launch {
  position: relative; height: 100%; min-height: 320px;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); isolation: isolate;
}
.launch-art { position: absolute; inset: 0; z-index: -2; }
.launch-art canvas {
  width: 100%; height: 100%; object-fit: cover; display: block;
  animation: launchDrift 26s ease-in-out infinite alternate;
}
@keyframes launchDrift { from { transform: scale(1.04) translateX(-1%); } to { transform: scale(1.12) translateX(1%); } }
.launch-scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(5,6,9,.94) 0%, rgba(5,6,9,.72) 42%, rgba(5,6,9,.25) 100%),
    linear-gradient(0deg, rgba(5,6,9,.9), transparent 55%);
}
.launch-body {
  position: absolute; inset: auto auto 0 0; padding: clamp(20px, 4vw, 46px);
  max-width: min(620px, 90%); display: grid; gap: 12px; justify-items: start;
}
.launch-tag {
  font-family: var(--font-mono); font-size: .64rem; letter-spacing: .38em;
  color: var(--gold-1);
}
.launch-title {
  font-family: var(--font-display); font-size: clamp(2rem, 5.5vw, 3.4rem);
  letter-spacing: .07em; transform: skewX(var(--skew)); line-height: 1;
  text-shadow: 0 3px 0 #000, 0 0 60px rgba(0,0,0,.8);
}
.launch-sub { color: var(--ink-dim); font-size: .92rem; max-width: 44ch; line-height: 1.5; }
.launch .mutators { margin-top: 6px; }

/* the arena list, demoted to a record of where you have been */
.arena-grid.small { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; margin-top: 12px; }
.arena-grid.small .arena-card { aspect-ratio: 3 / 4; cursor: default; }
.arena-grid.small .arena-card:hover { transform: none; }
.arena-grid.small .arena-card .tagline,
.arena-grid.small .arena-card .meta { display: none; }
.arena-grid.small .arena-card h3 { font-size: .68rem; letter-spacing: .02em; }
.arena-grid.small .arena-card .idx { font-size: 1.5rem; }
.arena-grid.small .arena-card .body { padding: 8px; }


/* ================================================== LOADING SCREEN ======= */
/* The build blocks the main thread in bursts, so a CSS-driven spinner would
   stutter. These animations are cheap and the build yields between phases, so
   the screen stays alive instead of freezing on a static bar. */
.load-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .5; }
.load-inner { position: relative; }
.load-rings { position: absolute; right: -10px; top: 50%; width: 190px; margin-top: -95px; opacity: .5; }
@media (max-width: 900px) { .load-rings { display: none; } }
.load-rings svg { width: 100%; overflow: visible; }
.load-rings .lr { fill: none; stroke: var(--accent); stroke-width: 1.4; opacity: .6; transform-origin: 60px 60px; }
.load-rings .lr1 { animation: spin 6s linear infinite; stroke-dasharray: 64 26; }
.load-rings .lr2 { animation: spin 4s linear infinite reverse; stroke-dasharray: 30 16; }
.load-rings .lr3 { animation: spin 2.6s linear infinite; stroke-dasharray: 12 9; }
.load-rings .lrp { fill: var(--accent); animation: pulse 1.6s ease-in-out infinite; }

.load-title {
  font-size: clamp(2.2rem, 6vw, 3.6rem); letter-spacing: .04em;
  transform: skewX(var(--skew));
  animation: loadIn .5s cubic-bezier(.2,.8,.2,1) both;
}
.load-tag { animation: loadIn .4s cubic-bezier(.2,.8,.2,1) both; }
.load-sub { animation: loadIn .6s .08s cubic-bezier(.2,.8,.2,1) both; }
@keyframes loadIn { from { opacity: 0; transform: translateY(14px) skewX(var(--skew)); } }

.load-bar { position: relative; }
/* A sheen that travels the bar, so the screen reads as busy even while a
   synchronous chunk of work has the thread. */
.load-bar::after {
  content: ''; position: absolute; inset: 0; border-radius: 99px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  background-size: 40% 100%; background-repeat: no-repeat;
  animation: sheen 1.25s linear infinite;
}
@keyframes sheen { from { background-position: -45% 0; } to { background-position: 145% 0; } }

.load-step {
  margin-top: 10px; font-family: var(--font-mono); font-size: .62rem;
  letter-spacing: .3em; color: var(--accent); text-transform: uppercase;
  min-height: 1em;
}
@media (prefers-reduced-motion: reduce) {
  .load-bar::after, .load-rings .lr, .load-rings .lrp { animation: none; }
}


/* The sprint bar is a resource you spend and rebuild, so it needs to read at a
   glance: filling, empty, or ready. */
.meter.stamina.charging .mbar > i {
  background: linear-gradient(90deg, #1d6ea8, #46e0ff);
  transition: width .1s linear;
}
.meter.stamina.charging label::after { content: ' · CHARGING'; color: var(--cyan); }
.meter.stamina.empty .mbar > i { background: linear-gradient(90deg, #6b2030, #b03040); }
.meter.stamina.empty label::after { content: ' · SPENT'; color: var(--red); }
.meter.stamina.empty .mbar { border-color: rgba(255,77,77,.4); }


/* F3 readout. Deliberately plain and unmissable — a diagnostic, not UI. */
.hud-diag {
  position: fixed; left: 26px; bottom: 120px; z-index: 40; display: none;
  margin: 0; padding: 10px 14px; border-radius: 8px;
  font: 11px/1.5 ui-monospace, monospace; white-space: pre;
  color: #9effc0; background: rgba(0,0,0,.78);
  border: 1px solid rgba(158,255,192,.3); pointer-events: none;
}
