/* ref → /opt/raptor/app.css on CT 107. The game has its own volcanic look — not ruperti-style, it is his game. */
:root {
  --bg: #1a0806;
  --panel: rgba(28, 12, 9, 0.88);
  --ink: #fff4e6;
  --muted: #d9b8a0;
  --lava: #ff6a1a;
  --lava2: #ffb020;
  --gold: #ffd23f;
  --green: #6fbf4a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden;
  touch-action: none; -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
canvas#world { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }

.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 16px; padding-top: max(16px, env(safe-area-inset-top)); }
.loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--lava2); text-shadow: 0 0 12px rgba(255,120,30,.7); }
.screen[hidden], .loading[hidden], #hud[hidden], .hint[hidden], .fps[hidden], form[hidden] { display: none !important; }
.panel { background: var(--panel); border: 2px solid rgba(255, 106, 26, 0.45); border-radius: 22px;
  padding: 24px 22px; width: min(440px, 100%); max-height: 100%; overflow-y: auto; text-align: center;
  box-shadow: 0 0 40px rgba(255, 90, 20, 0.25); touch-action: pan-y; }
h1 { font-size: 40px; margin: 0 0 4px; color: var(--lava2); letter-spacing: 0.5px;
  text-shadow: 0 2px 0 #7a1f00, 0 0 18px rgba(255, 120, 30, 0.6); }
h2 { font-size: 28px; margin: 0 0 12px; color: var(--lava2); }
h3 { font-size: 18px; margin: 18px 0 8px; color: var(--muted); }
.sub { color: var(--muted); font-size: 18px; margin: 4px 0 16px; }
.note { color: var(--muted); font-size: 14px; margin: 6px 0; }
.note a { color: var(--lava2); }
.err { color: #ff8a7a; min-height: 1.2em; margin: 6px 0 0; }

.btn { display: block; width: 100%; margin: 10px 0; padding: 16px; font-size: 22px; font-weight: 700;
  color: #2a0a00; background: linear-gradient(180deg, var(--lava2), var(--lava)); border: 0;
  border-radius: 16px; box-shadow: 0 4px 0 #8a2a00; cursor: pointer; font-family: inherit; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #8a2a00; }
.btn.big { font-size: 30px; padding: 20px; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: none; border: 2px solid rgba(255, 244, 230, 0.3); font-weight: 600; }
.btn:disabled { opacity: 0.45; }
.corner { position: fixed; right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); background: transparent;
  color: rgba(255, 244, 230, 0.45); border: 1px solid rgba(255, 244, 230, 0.25); border-radius: 10px;
  padding: 8px 12px; font-size: 14px; font-family: inherit; }

.player-list { display: grid; gap: 10px; margin-bottom: 12px; }
.player-list .btn { margin: 0; display: flex; justify-content: space-between; align-items: center; }
.player-list .btn small { font-weight: 600; font-size: 16px; opacity: 0.8; }
.new-player { display: flex; gap: 10px; }
.new-player input, .pin-form input, .settings input {
  flex: 1; min-width: 0; font-size: 22px; padding: 14px; border-radius: 14px; border: 2px solid rgba(255, 244, 230, 0.3);
  background: rgba(0, 0, 0, 0.35); color: var(--ink); font-family: inherit; -webkit-user-select: text; user-select: text; }
.new-player .btn { width: 64px; margin: 0; }
.pin-form input { width: 100%; text-align: center; letter-spacing: 8px; }
.settings label { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; margin: 10px 0; font-size: 17px; }
.settings input { flex: 0 0 110px; font-size: 20px; padding: 10px; text-align: center; }
.parent-players .row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0;
  border-bottom: 1px solid rgba(255, 244, 230, 0.12); font-size: 17px; }
.parent-players button { background: transparent; color: #ff8a7a; border: 1px solid #ff8a7a; border-radius: 10px; padding: 6px 10px; font-family: inherit; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 8px; }
.stats div { background: rgba(0, 0, 0, 0.3); border-radius: 14px; padding: 10px 4px; }
.stats b { font-size: 26px; display: inline-block; }
.stats small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.coin-dot { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 50%; margin-right: 6px; vertical-align: -0.05em;
  background: radial-gradient(circle at 35% 35%, #fff3a0, var(--gold) 55%, #b8860b); box-shadow: 0 0 6px rgba(255, 210, 63, 0.7); }

.how { width: 100%; border-collapse: collapse; text-align: left; font-size: 18px; margin-bottom: 8px; }
.how td { padding: 10px 6px; border-bottom: 1px solid rgba(255, 244, 230, 0.12); }
.how td:first-child { white-space: nowrap; font-weight: 700; }

.shop-list { display: grid; gap: 10px; margin-bottom: 8px; text-align: left; }
.item { display: flex; align-items: center; gap: 12px; background: rgba(0, 0, 0, 0.3); border-radius: 14px; padding: 12px; }
.item div { flex: 1; }
.item b { font-size: 20px; }
.item small { display: block; color: var(--muted); font-size: 14px; }
.item .btn { width: auto; margin: 0; padding: 10px 14px; font-size: 18px; white-space: nowrap; }
.item .owned { color: var(--green); font-weight: 700; font-size: 18px; }
.item .goal { height: 6px; background: rgba(255, 255, 255, 0.12); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.item .goal i { display: block; height: 100%; background: var(--gold); }

.moon { font-size: 64px; color: #ffe9a8; text-shadow: 0 0 24px rgba(255, 230, 160, 0.6); }

#hud { position: fixed; inset: 0; pointer-events: none; font-weight: 800; }
.hud-score, .hud-coins { position: absolute; top: max(14px, env(safe-area-inset-top)); font-size: 30px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8); }
.hud-score { left: 18px; }
.hud-coins { right: 136px; transition: transform .12s; }
.hud-coins.pop { animation: pop .22s; }
@keyframes pop { 40% { transform: scale(1.35); } }
.hud-sound { pointer-events: auto; position: absolute; right: 72px; top: max(10px, env(safe-area-inset-top)); width: 48px; height: 48px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.6); background: rgba(20,8,6,.55); font-size: 20px; padding: 0; }
.hud-pause { pointer-events: auto; position: absolute; right: 14px; top: max(10px, env(safe-area-inset-top));
  width: 52px; height: 52px; border-radius: 50%; border: 2px solid rgba(255, 244, 230, 0.5); background: rgba(0, 0, 0, 0.35);
  color: var(--ink); font-size: 18px; }
.hint { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.55); padding: 10px 16px; border-radius: 12px; font-size: 18px; pointer-events: none;
  white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
.fps { position: fixed; left: 8px; bottom: 8px; font: 12px monospace; background: rgba(0, 0, 0, 0.6); padding: 2px 6px; border-radius: 4px; }
/* menu + shop leave the stage to the raptor: panel on the left in landscape, at the bottom in portrait */
.screen.stage { justify-content: flex-start; padding-left: max(24px, 5vw); }
@media (orientation: portrait) {
  .screen.stage { justify-content: center; align-items: flex-end; padding-left: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .screen.stage .panel { max-height: 56vh; }
}
@media (max-width: 420px) { h1 { font-size: 32px; } .btn.big { font-size: 26px; } .hint { font-size: 14px; } }

/* active pickups: one chip each, the bar runs down */
.fx { position: fixed; left: 12px; top: calc(max(12px, env(safe-area-inset-top)) + 54px); display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.fx .chip { position: relative; display: flex; align-items: center; gap: 8px; min-width: 150px; padding: 6px 12px 9px 8px; border-radius: 14px;
  background: rgba(20, 8, 6, 0.72); border: 2px solid rgba(255, 210, 63, 0.7); overflow: hidden; font-size: 15px; }
.fx .chip.bad { border-color: rgba(160, 140, 130, 0.8); }
.fx .chip span { font-size: 22px; width: 28px; text-align: center; font-weight: 800; color: var(--gold); }
.fx .chip i { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--gold); transition: width .1s linear; }
.fx .chip.bad i { background: #a89a90; }

/* speed lines: only at the edges, only when it really goes fast (downhill) */
.speed { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: repeating-conic-gradient(from 0deg at 50% 46%, rgba(255,255,255,0) 0deg 5deg, rgba(255,240,220,.55) 5.4deg 5.9deg, rgba(255,255,255,0) 6.3deg 11deg);
  -webkit-mask-image: radial-gradient(ellipse at 50% 46%, transparent 42%, #000 95%); mask-image: radial-gradient(ellipse at 50% 46%, transparent 42%, #000 95%); }
#flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; }

/* wardrobe: tabs, tiles to try on, one buy bar */
.panel.wide { width: min(520px, 100%); padding: 18px 18px 14px; }
.ward-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ward-head h2 { margin: 0; }
.purse { font-size: 24px; font-weight: 800; background: rgba(0,0,0,.35); padding: 6px 14px; border-radius: 14px; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tab { flex: 1; padding: 10px 2px; font-size: 16px; font-weight: 700; font-family: inherit; color: var(--muted); background: rgba(0,0,0,.3); border: 2px solid transparent; border-radius: 12px; }
.tab.on { color: #2a0a00; background: linear-gradient(180deg, var(--lava2), var(--lava)); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px 8px; color: var(--ink); font-family: inherit;
  background: rgba(0,0,0,.32); border: 2px solid rgba(255,244,230,.14); border-radius: 14px; }
.tile b { font-size: 15px; } .tile small { font-size: 13px; color: var(--muted); }
.tile.locked { background: rgba(0,0,0,.5); } .tile.locked b { color: var(--muted); }
.tile.worn { border-color: var(--green); } .tile.worn small { color: var(--green); font-weight: 700; }
.tile.pick { border-color: var(--gold); box-shadow: 0 0 14px rgba(255,210,63,.45); }
.tile em { position: absolute; top: 4px; right: 8px; color: var(--gold); font-style: normal; }
.ico { font-style: normal; font-size: 30px; line-height: 38px; height: 38px; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); }
.action { min-height: 86px; margin-top: 10px; }
.buy { display: flex; gap: 12px; align-items: center; text-align: left; background: rgba(0,0,0,.3); border-radius: 14px; padding: 10px 12px; }
.buy > div { flex: 1; } .buy b { font-size: 19px; } .buy small { color: var(--muted); font-size: 14px; }
.buy .btn { width: auto; margin: 0; padding: 12px 14px; font-size: 18px; white-space: nowrap; }
.goal { height: 8px; background: rgba(255,255,255,.12); border-radius: 4px; margin: 6px 0 4px; overflow: hidden; }
.goal i { display: block; height: 100%; background: var(--gold); }
.grid.powers { grid-template-columns: 1fr; }
.power { display: flex; align-items: center; gap: 12px; text-align: left; background: rgba(0,0,0,.3); border-radius: 14px; padding: 8px 12px; }
.power > div { flex: 1; } .power b { font-size: 18px; display: block; } .power small { color: var(--muted); font-size: 14px; }
.power .btn { width: auto; margin: 0; padding: 10px 12px; font-size: 17px; white-space: nowrap; }
.pips { display: flex; gap: 5px; margin-top: 4px; } .pips u { width: 26px; height: 7px; border-radius: 4px; background: rgba(255,255,255,.15); }
.pips u.on { background: var(--gold); }
.goalbox { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; text-align: left; font-size: 16px; background: rgba(0,0,0,.3); border-radius: 14px; padding: 10px 12px 6px; margin: 8px 0 2px; }
.goalbox .goal { flex-basis: 100%; } .goalbox.done { box-shadow: 0 0 14px rgba(255,210,63,.5); }
.place { margin: 8px 0 4px; color: var(--lava2); font-weight: 700; }
.hud-place { position: absolute; left: 18px; top: calc(max(14px, env(safe-area-inset-top)) + 38px); font-size: 18px; text-shadow: 0 2px 4px rgba(0,0,0,.8); color: var(--lava2); }
.fx { top: calc(max(12px, env(safe-area-inset-top)) + 84px) !important; }
.toast { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); padding: 12px 22px; border-radius: 16px; font-size: 24px; font-weight: 800; white-space: nowrap;
  color: #2a0a00; background: linear-gradient(180deg, var(--lava2), var(--lava)); box-shadow: 0 0 30px rgba(255,150,40,.6); pointer-events: none; }
.toast[hidden] { display: none; }
@media (orientation: portrait) { .screen.stage .panel.wide { max-height: 60vh; } }
.hud-swing { position: absolute; left: 18px; top: calc(max(14px, env(safe-area-inset-top)) + 64px); width: 92px; height: 8px; border-radius: 4px; background: rgba(0,0,0,.45); overflow: hidden; }
.hud-swing i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--lava), var(--lava2)); }
.minimap { position: absolute; right: 14px; top: calc(max(14px, env(safe-area-inset-top)) + 64px); width: 34px; height: min(38vh, 300px); border-radius: 17px;
  background: linear-gradient(180deg, rgba(0,0,0,.5), rgba(0,0,0,.3)); box-shadow: inset 0 0 0 2px rgba(255,255,255,.18); }
.minimap .mm-goal { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font-size: 15px; }
.minimap b { position: absolute; width: 15px; height: 15px; margin: 0 0 -7px -7px; border-radius: 50%; font: 800 10px/15px -apple-system, "Segoe UI", sans-serif; text-align: center; color: #1a0a06; box-shadow: 0 0 0 1.5px rgba(0,0,0,.7); }
.minimap .mm-me { background: #58e06a; width: 19px; height: 19px; margin: 0 0 -9px -9px; z-index: 2; box-shadow: 0 0 0 2px #fff; }
.minimap .r0 { background: #ecd596; } .minimap .r1 { background: #ff7a3a; } .minimap .r2 { background: #bfeeff; }
.minimap b[hidden] { display: none; }
.stats .lvl { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px; }
.stats .lvl span { display: flex; flex-direction: column; align-items: center; }
.lvl-btn { width: 44px; height: 44px; border: 0; border-radius: 12px; font-size: 26px; font-weight: 800; color: #2a0a00; background: linear-gradient(180deg, var(--lava2), var(--lava)); }
.lvl-btn:disabled { opacity: .25; }
.lvl-info { margin: 2px 0 6px; font-size: 14px; }
@media (max-width: 420px) { .lvl-btn { width: 36px; } }
