:root {
  --c0: #3fe0c8; --c0d: #0f5c57; --c1: #ff5a6e; --c1d: #7a1f2c;
  --ink: #f4ecd8; --dim: rgba(244, 236, 216, .62); --panel: rgba(18, 13, 9, .72); --line: rgba(255, 220, 170, .14);
  --gold: #f2b84b; --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace; --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1a120b; color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
.stage { position: fixed; inset: 0; }
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #ff4b3e; box-shadow: 0 0 8px #ff4b3e; margin-right: 5px; animation: pulse 1.4s infinite; vertical-align: 1px; }
@keyframes pulse { 50% { opacity: .35; } }
.panel, .scorebug, .neuro-meter, .braincam, .toolbar, .tiles .tile, .notebook { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

/* scorebug */
.scorebug { position: fixed; top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; z-index: 5; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.sb-brand { padding: 7px 12px; font: 600 9px/1.25 var(--mono); letter-spacing: .12em; color: var(--dim); border-right: 1px solid var(--line); }
.sb-brand b { color: var(--gold); font-size: 11px; }
.sb-team { padding: 6px 12px; min-width: 150px; }
.sb-team.t1 { text-align: right; }
.sb-name { display: flex; align-items: center; gap: 7px; font: 800 15px/1 var(--sans); letter-spacing: .08em; }
.sb-team.t1 .sb-name { justify-content: flex-end; }
.sb-name > i { width: 10px; height: 10px; border-radius: 3px; }
.t0 .sb-name > i { background: var(--c0); box-shadow: 0 0 10px var(--c0); } .t1 .sb-name > i { background: var(--c1); box-shadow: 0 0 10px var(--c1); }
.sb-wins { display: inline-flex; gap: 3px; }
.sb-wins i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--dim); }
.sb-wins i.won { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 8px var(--gold); }
.sb-alive { display: flex; gap: 4px; margin-top: 6px; }
.sb-team.t1 .sb-alive { justify-content: flex-end; }
.sb-alive span { width: 30px; height: 6px; background: rgba(255,255,255,.12); border-radius: 3px; overflow: hidden; }
.sb-alive span b { display: block; height: 100%; }
.t0 .sb-alive b { background: var(--c0); } .t1 .sb-alive b { background: var(--c1); }
.sb-alive span.ko { background: repeating-linear-gradient(45deg, rgba(255,255,255,.1) 0 3px, transparent 3px 6px); }
.sb-clock { padding: 6px 16px; text-align: center; background: rgba(0,0,0,.25); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.sb-clock small { display: block; font: 600 9px var(--mono); letter-spacing: .14em; color: var(--gold); }
.sb-clock b { font: 700 22px/1.1 var(--mono); }

/* neural meter */
.neuro-meter { position: fixed; top: calc(12px + var(--safe-t)); right: 12px; width: 178px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; z-index: 4; }
.neuro-meter > small, .meter-row small { font: 600 9px var(--mono); letter-spacing: .12em; color: var(--dim); }
.neuro-meter > b { display: block; font: 700 24px/1.1 var(--mono); color: var(--gold); margin-top: 3px; }
.neuro-meter > span { font: 10px var(--mono); color: var(--dim); }
.meter-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 5px; }
.meter-row b { font: 600 11px var(--mono); }

/* notebook map */
.notebook { position: fixed; top: calc(150px + var(--safe-t)); right: 12px; margin: 0; padding: 6px 6px 4px; background: #f6f1e3; border-radius: 4px; transform: rotate(1.2deg); box-shadow: 0 12px 28px rgba(0,0,0,.4); z-index: 4; }
.notebook canvas { display: block; width: 236px; height: auto; }
.notebook figcaption { font: 11px "Comic Sans MS", "Bradley Hand", cursive; color: #1f3f8f; text-align: right; padding-top: 2px; }
.notebook::before { content: ""; position: absolute; top: -8px; left: 44%; width: 46px; height: 16px; background: rgba(240,220,150,.75); transform: rotate(-4deg); }

/* toolbar */
.toolbar { position: fixed; bottom: calc(12px + var(--safe-b)); left: 50%; transform: translateX(-50%); display: flex; gap: 4px; padding: 5px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; z-index: 6; }
.toolbar button { background: none; border: 0; padding: 7px 11px; border-radius: 8px; font: 600 12px var(--sans); cursor: pointer; color: var(--dim); }
.toolbar button:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.toolbar button.on, .toolbar button[aria-pressed="true"] { color: #1a120b; background: var(--gold); }
.toolbar .sep { width: 1px; background: var(--line); margin: 4px 3px; }
.menu-btn { display: none; }

/* brain cam */
.braincam { position: fixed; left: 12px; bottom: calc(12px + var(--safe-b)); width: 360px; padding: 10px 12px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; z-index: 5; }
.braincam.t0 { border-top: 3px solid var(--c0); } .braincam.t1 { border-top: 3px solid var(--c1); }
.bc-head { display: flex; align-items: center; gap: 10px; }
.bc-badge { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; font: 800 15px var(--mono); color: #10100c; }
.t0 .bc-badge, .t0 .bp-badge { background: var(--c0); } .t1 .bc-badge, .t1 .bp-badge { background: var(--c1); }
.bc-head small { display: block; font: 600 9px var(--mono); letter-spacing: .1em; color: var(--dim); }
.bc-head b { font: 800 17px var(--sans); }
.bc-pin { margin-left: auto; font: 600 9px var(--mono); color: var(--gold); cursor: pointer; letter-spacing: .06em; }
.bc-close { background: none; border: 0; cursor: pointer; color: var(--dim); font-size: 16px; padding: 2px 4px; }
.bc-grid { display: grid; grid-template-columns: 1fr 96px; gap: 8px; margin-top: 8px; }
.bc-raster canvas { width: 100%; height: 92px; display: block; border-radius: 6px; background: #05090c; image-rendering: pixelated; }
.bc-raster small { font: 9px var(--mono); color: var(--dim); }
.bc-cells { display: flex; flex-direction: column; gap: 3px; }
.cell { display: grid; grid-template-columns: 40px 1fr 1fr; gap: 3px; align-items: center; }
.cell small { font: 600 8.5px var(--mono); color: var(--dim); }
.cell i { height: 6px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; }
.cell b { display: block; height: 100%; width: 0; background: var(--gold); transition: width .15s; }
.bc-sensors { margin-top: 6px; }
.bc-sensors summary { font: 600 9px var(--mono); letter-spacing: .1em; color: var(--dim); cursor: pointer; }
#sensors { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; margin-top: 4px; }
.sen { display: grid; grid-template-columns: 86px 1fr; align-items: center; gap: 4px; }
.sen small { font: 8.5px var(--mono); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sen i { position: relative; height: 5px; background: rgba(255,255,255,.08); border-radius: 3px; }
.sen i::after { content: ""; position: absolute; left: 50%; top: -1px; bottom: -1px; width: 1px; background: rgba(255,255,255,.3); }
.sen b { position: absolute; top: 0; bottom: 0; background: var(--c0); border-radius: 3px; }
.t1 .sen b { background: var(--c1); } .sen b.neg { opacity: .55; }
.bc-motor { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin-top: 8px; height: 56px; }
.mot { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mot i { flex: 1; width: 100%; background: rgba(255,255,255,.06); border-radius: 3px; display: flex; align-items: flex-end; overflow: hidden; }
.mot b { display: block; width: 100%; background: rgba(242,184,75,.55); transition: height .12s; }
.mot.on b { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.mot small { font: 7.5px var(--mono); color: var(--dim); white-space: nowrap; transform: rotate(-30deg); transform-origin: top center; height: 12px; }
.mot.on small { color: var(--gold); }
.bc-thought { margin: 12px 0 0; font: 500 13px/1.35 var(--sans); min-height: 2.7em; }
.brainpill { display: none; position: fixed; left: 12px; bottom: calc(12px + var(--safe-b)); align-items: center; gap: 8px; padding: 6px 10px 6px 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; z-index: 5; cursor: pointer; }
.bp-badge { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; font: 800 13px var(--mono); color: #111; }
.bp-txt small { display: block; font: 600 8px var(--mono); color: var(--dim); } .bp-txt b { font: 800 13px var(--sans); }
.bp-act { font: 700 11px var(--mono); color: var(--gold); min-width: 54px; }
.bp-open { font: 600 9px var(--mono); color: var(--dim); }
body.bc-hidden .braincam { display: none; } body.bc-hidden .brainpill { display: flex; }

/* tiles */
.tiles { position: fixed; right: 12px; bottom: calc(66px + var(--safe-b)); display: grid; grid-template-columns: 1fr 1fr; gap: 5px; z-index: 4; width: 280px; }
.tile { position: relative; display: grid; grid-template-columns: 26px 1fr auto; grid-template-rows: auto auto; align-items: center; gap: 0 6px; padding: 5px 7px 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; text-align: left; overflow: hidden; }
.tile.t0 { border-left: 3px solid var(--c0); } .tile.t1 { border-left: 3px solid var(--c1); }
.tile.on { outline: 1.5px solid var(--gold); }
.tile.ko { opacity: .45; }
.tl-num { font: 800 11px var(--mono); grid-row: span 2; }
.tl-name { font: 700 11px var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-act { font: 600 9px var(--mono); color: var(--gold); }
.tl-hp { grid-column: 2 / 4; height: 3px; background: rgba(255,255,255,.1); border-radius: 2px; overflow: hidden; }
.tl-hp b { display: block; height: 100%; background: var(--ink); }
.tile canvas { position: absolute; right: 4px; bottom: 6px; width: 60px; height: 15px; opacity: .55; pointer-events: none; }

/* ticker & banner */
.ticker { position: fixed; left: 12px; top: calc(88px + var(--safe-t)); display: flex; flex-direction: column; gap: 4px; z-index: 4; max-width: 360px; pointer-events: none; }
.tick { padding: 5px 10px; background: var(--panel); border-radius: 8px; font: 500 12px var(--sans); border-left: 3px solid var(--gold); animation: tickin .35s ease-out; transition: opacity 1s; }
.tick.t0 { border-left-color: var(--c0); } .tick.t1 { border-left-color: var(--c1); } .tick.old { opacity: .45; }
.tick b.c0, .c0 { color: var(--c0); } .tick b.c1, .c1 { color: var(--c1); }
@keyframes tickin { from { transform: translateX(-20px); opacity: 0; } }
.banner { position: fixed; top: 34%; left: 50%; transform: translate(-50%, -50%); text-align: center; z-index: 7; pointer-events: none; }
.banner small { display: block; font: 700 13px var(--mono); letter-spacing: .3em; color: var(--gold); }
.banner b { display: block; font: 900 clamp(38px, 7vw, 84px)/1 var(--sans); letter-spacing: .02em; text-shadow: 0 6px 30px rgba(0,0,0,.6); }
.banner.go { animation: bannerin 2.4s cubic-bezier(.2,.9,.2,1) both; }
@keyframes bannerin { 0% { transform: translate(-50%,-50%) scale(1.6); opacity: 0; } 12% { transform: translate(-50%,-50%) scale(1); opacity: 1; } 82% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%,-56%); } }

/* pregame */
.pregame { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 60%, rgba(26,18,11,.35), rgba(26,18,11,.86)); z-index: 10; padding: 16px; transition: opacity .6s; }
.pregame.gone { opacity: 0; pointer-events: none; }
.pg-card { max-width: 620px; width: 100%; padding: 26px 28px 22px; background: rgba(20,14,9,.86); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.pg-eyebrow { margin: 0; font: 600 10px var(--mono); letter-spacing: .16em; color: var(--dim); }
.pg-card h1 { margin: 8px 0 6px; font: 900 clamp(40px, 8vw, 64px)/.95 var(--sans); letter-spacing: -.02em; }
.pg-card h1 em { font-style: normal; color: var(--gold); }
.pg-copy { font: 15px/1.5 var(--sans); color: var(--ink); margin: 12px 0; }
.pg-roster { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; font: 12px var(--mono); color: var(--dim); }
.pg-roster li b { color: var(--ink); }
.pg-roster li.t0 b { color: var(--c0); } .pg-roster li.t1 b { color: var(--c1); }
.pg-bar { height: 6px; background: rgba(255,255,255,.1); border-radius: 3px; overflow: hidden; margin-top: 14px; }
.pg-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--c0), var(--gold), var(--c1)); transition: width .3s; }
.pg-load small { display: block; font: 11px var(--mono); color: var(--dim); margin-top: 6px; }
.pg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.pg-actions button { padding: 11px 20px; border-radius: 10px; border: 0; background: var(--gold); color: #1a120b; font: 800 14px var(--sans); cursor: pointer; }
.pg-actions button:disabled { opacity: .5; cursor: wait; }
.pg-note { flex: 1; min-width: 220px; font: 11px/1.4 var(--sans); color: var(--dim); }

/* about */
.about { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(10,7,4,.6); z-index: 12; padding: 16px; }
.about[hidden] { display: none; }
.about-card { position: relative; max-width: 680px; max-height: 86vh; overflow: auto; padding: 24px 26px; background: rgba(22,16,10,.96); border: 1px solid var(--line); border-radius: 16px; font: 14px/1.55 var(--sans); }
.about-card h2 { margin: 0 0 10px; font: 900 26px var(--sans); }
.about-card a { color: var(--gold); }
.about-card .close { position: absolute; top: 10px; right: 12px; background: none; border: 0; font-size: 26px; color: var(--dim); cursor: pointer; }
.about-card ol { padding-left: 18px; } .about-card li { margin-bottom: 6px; }
.about-links { font-size: 12px; }
body.clean .neuro-meter, body.clean .braincam, body.clean .brainpill, body.clean .tiles, body.clean .notebook, body.clean .ticker { display: none !important; }
body.no-map .notebook { display: none; }

@media (max-width: 1100px) { .tiles { display: none; } .notebook canvas { width: 190px; } .toolbar { left: auto; right: 12px; transform: none; } }
@media (max-width: 760px) {
  .scorebug { top: calc(6px + var(--safe-t)); border-radius: 10px; }
  .sb-brand { display: none; }
  .sb-team { min-width: 0; padding: 5px 8px; }
  .sb-name { font-size: 12px; } .sb-alive span { width: 16px; height: 5px; }
  .sb-clock { padding: 5px 8px; } .sb-clock b { font-size: 16px; }
  .neuro-meter { display: none; }
  .notebook { top: auto; bottom: calc(68px + var(--safe-b)); right: 8px; padding: 4px; } .notebook canvas { width: 140px; } .notebook figcaption { display: none; }
  .ticker { top: calc(64px + var(--safe-t)); left: 8px; right: 8px; max-width: none; } .tick { font-size: 11px; } .tick:nth-child(n+4) { display: none; }
  .braincam { left: 8px; right: 8px; width: auto; bottom: calc(8px + var(--safe-b)); max-height: 62vh; overflow: auto; }
  .bc-sensors { display: none; }
  .brainpill { left: 8px; bottom: calc(8px + var(--safe-b)); }
  .toolbar { display: none; flex-wrap: wrap; justify-content: center; bottom: calc(60px + var(--safe-b)); left: 8px; right: 8px; transform: none; }
  body.menu-open .toolbar { display: flex; }
  .menu-btn { display: block; position: fixed; right: 8px; bottom: calc(8px + var(--safe-b)); width: 44px; height: 44px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 18px; z-index: 6; }
  .pg-card { padding: 20px; } .pg-roster { grid-template-columns: 1fr; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .braincam { max-height: 80vh; overflow: auto; width: 320px; } .notebook { display: none; } .bc-sensors { display: none; }
}
@media (prefers-reduced-motion: reduce) { .banner.go, .tick, .live-dot { animation: none; } }

/* ---------- modes ---------- */
.pg-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.pg-modes button { text-align: left; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255,255,255,.04); cursor: pointer; }
.pg-modes button b { display: block; font: 800 15px var(--sans); }
.pg-modes button small { display: block; font: 12px/1.35 var(--sans); color: var(--dim); margin-top: 3px; }
.pg-modes button:hover:not(:disabled) { border-color: var(--gold); background: rgba(242,184,75,.1); }
.pg-modes button[data-mode="watch"] { background: var(--gold); color: #1a120b; border-color: var(--gold); }
.pg-modes button[data-mode="watch"] small { color: rgba(26,18,11,.75); }
.pg-modes button.hvf b::before { content: "YOU vs FLY · "; font: 700 9px var(--mono); letter-spacing: .1em; color: var(--gold); vertical-align: 2px; }
.pg-modes button:disabled { opacity: .45; cursor: wait; }
.pg-record { margin: 10px 0 0; font: 12px var(--mono); color: var(--dim); }
.pg-record b { color: var(--ink); }
.tile.you { border-left-color: var(--gold) !important; }
.tile.you .tl-act { color: var(--gold); }
.tile[hidden] { display: none; }
.sb-alive span.you { outline: 1.5px solid var(--gold); outline-offset: 1px; }

/* ---------- human vs fly HUD ---------- */
#player-ui { position: fixed; inset: 0; pointer-events: none; z-index: 6; }
#player-ui[hidden] { display: none; }
.pl-reticle, .pl-gundot, .pl-lock { position: absolute; left: 0; top: 0; will-change: transform; }
.pl-reticle { width: 0; height: 0; }
.pl-reticle i { position: absolute; background: rgba(255,245,225,.85); box-shadow: 0 0 4px rgba(0,0,0,.6); }
.pl-reticle i:nth-child(1) { left: -22px; top: -1px; width: 14px; height: 2px; } .pl-reticle i:nth-child(2) { left: 8px; top: -1px; width: 14px; height: 2px; }
.pl-reticle i:nth-child(3) { left: -1px; top: -22px; width: 2px; height: 14px; } .pl-reticle i:nth-child(4) { left: -1px; top: 8px; width: 2px; height: 14px; }
.pl-reticle.lock i { background: #ff9d5c; }
.pl-reticle.ready i { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.pl-gundot { width: 10px; height: 10px; margin: -5px 0 0 -5px; border: 2px solid rgba(255,245,225,.9); border-radius: 50%; box-shadow: 0 0 4px rgba(0,0,0,.6); }
.pl-lock { margin-left: -60px; width: 120px; text-align: center; font: 600 10px var(--mono); color: #ffd7b8; text-shadow: 0 1px 3px #000; transform-origin: center; }
.pl-lock b { color: var(--c1); display: block; font-size: 12px; }
.pl-hitmark { position: absolute; left: 50%; top: 42%; transform: translateX(-50%); font: 900 22px var(--sans); letter-spacing: .08em; opacity: 0; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.pl-hitmark.good { color: var(--gold); } .pl-hitmark.meh { color: #c9c2b2; } .pl-hitmark.big { font-size: 34px; }
.pl-hitmark.go { animation: hitmark 1.1s ease-out; }
@keyframes hitmark { 0% { opacity: 0; transform: translate(-50%, 8px) scale(1.4); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -14px); } }
.pl-vignette { position: absolute; inset: 0; box-shadow: inset 0 0 160px 40px rgba(200,30,20,.75); opacity: 0; }
.pl-vignette.go { animation: vig .8s ease-out; }
@keyframes vig { 0% { opacity: 1; } 100% { opacity: 0; } }
.pl-panel { position: absolute; left: 50%; bottom: calc(66px + var(--safe-b)); transform: translateX(-50%); display: grid; grid-template-columns: auto 150px 170px auto auto; gap: 14px; align-items: center; padding: 8px 14px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: 12px; backdrop-filter: blur(10px); }
.pl-who b { display: block; font: 900 16px var(--sans); color: var(--gold); } .pl-who small { font: 600 9px var(--mono); letter-spacing: .12em; color: var(--dim); }
.pl-bar { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; }
.pl-bar small { grid-column: 1 / -1; font: 600 9px var(--mono); letter-spacing: .1em; color: var(--dim); }
.pl-bar i { height: 7px; background: rgba(255,255,255,.1); border-radius: 4px; overflow: hidden; }
.pl-bar b { display: block; height: 100%; background: var(--c0); transition: width .15s; }
#pl-reload { background: var(--gold); }
.pl-bar em { font: 700 10px var(--mono); font-style: normal; color: var(--ink); }
.pl-chip { font: 700 10px var(--mono); padding: 5px 8px; border-radius: 7px; background: rgba(255,255,255,.12); color: var(--ink); white-space: nowrap; }
.pl-chip.off { opacity: .5; }
.pl-speed b { font: 800 20px var(--mono); } .pl-speed small { font: 9px var(--mono); color: var(--dim); margin-left: 3px; }
.pl-hint { position: absolute; left: 50%; top: calc(86px + var(--safe-t)); transform: translateX(-50%); max-width: min(560px, 90vw); padding: 8px 14px; background: var(--panel); border-radius: 10px; font: 500 13px/1.4 var(--sans); text-align: center; opacity: 0; transition: opacity .5s; }
.pl-hint.on { opacity: 1; }
.pl-joy, .pl-btn { display: none; }
#player-ui.touch .pl-joy { display: block; position: absolute; left: 18px; bottom: calc(24px + var(--safe-b)); width: 132px; height: 132px; border-radius: 50%; background: rgba(20,14,9,.45); border: 2px solid rgba(255,235,200,.3); pointer-events: auto; touch-action: none; }
.pl-joy span { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(242,184,75,.85); box-shadow: 0 4px 14px rgba(0,0,0,.4); }
#player-ui.touch .pl-btn { display: grid; place-items: center; position: absolute; right: 16px; border-radius: 50%; border: 0; pointer-events: auto; touch-action: none; font: 900 13px var(--sans); letter-spacing: .06em; color: #1a120b; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
#player-ui.touch .pl-fire { width: 92px; height: 92px; bottom: calc(96px + var(--safe-b)); background: var(--gold); }
#player-ui.touch .pl-smokebtn { width: 62px; height: 62px; bottom: calc(198px + var(--safe-b)); right: 30px; background: #e9e3d0; font-size: 10px; }
#player-ui .pl-btn.off { opacity: .45; }
body.playing .tiles { bottom: calc(126px + var(--safe-b)); }
body.playing.clean #player-ui .pl-panel { display: grid; }
@media (max-width: 1100px) { .pl-panel { grid-template-columns: auto 120px 140px; } .pl-chip, .pl-speed { display: none; } }
@media (max-width: 760px) {
  .pg-modes { grid-template-columns: 1fr; }
  #player-ui.touch .pl-panel { left: 8px; right: 8px; transform: none; top: calc(62px + var(--safe-t)); bottom: auto; grid-template-columns: auto 1fr 1fr; gap: 8px; padding: 6px 10px; }
  body.playing .ticker { top: calc(118px + var(--safe-t)); }
  body.playing .brainpill { left: auto; right: 8px; bottom: auto; top: calc(160px + var(--safe-t)); }
  body.playing .notebook, body.playing .menu-btn ~ .tiles { display: none; }
  body.playing .menu-btn { top: calc(160px + var(--safe-t)); bottom: auto; right: auto; left: 8px; }
  body.playing.menu-open .toolbar { bottom: auto; top: calc(210px + var(--safe-t)); }
  .pl-hint { top: auto; bottom: calc(240px + var(--safe-b)); font-size: 12px; }
}

.toolbar .hm-only { display: none; } body.human-mode .toolbar .hm-only { display: inline-block; }
body.human-mode .toolbar [data-cam="chase"] { display: none; }
@media (max-width: 760px) {
  .pg-roster { display: none; }
  body.playing .tick:nth-child(n+2) { display: none; }
  body.playing .brainpill { left: 60px; right: 8px; }
}

/* the pumpkin interlude */
.patch-only { display: none; }
body.has-patch .patch-only { display: inline-block; }
.patch-cap { position: fixed; left: 50%; bottom: calc(66px + var(--safe-b)); transform: translateX(-50%); z-index: 7; display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); white-space: nowrap; }
.patch-cap[hidden] { display: none; }
.patch-cap small { font: 600 10px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.patch-cap b { font: 600 13px var(--sans); color: var(--ink); }
.patch-cap button { background: rgba(255,255,255,.08); border: 1px solid var(--line); color: var(--ink); border-radius: 8px; padding: 5px 10px; font: 600 12px var(--sans); cursor: pointer; }
.patch-cap button:hover { background: var(--gold); color: #1a120b; }
body.patch-cut #player-ui, body.patch-cut .banner, body.patch-cut .braincam, body.patch-cut .tiles, body.patch-cut .brainpill { display: none !important; }
@media (max-width: 720px) { .patch-cap { bottom: calc(112px + var(--safe-b)); } .patch-cap small { display: none; } }
