/* Dead End: one canvas at night, a thin HUD at the top, touch sticks drawn where the thumbs land, banners and cards. */
* { box-sizing: border-box; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #07080b; overflow: hidden; overscroll-behavior: none; }
body { color: #eef0e8; font-family: 'Baloo 2', system-ui, sans-serif; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.app { position: fixed; inset: 0; touch-action: none; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

#mm, .sg-sheet {
  --sg-bg: radial-gradient(ellipse at 50% 30%, #2a2f24 0%, #12140f 60%, #07080b 100%);
  --sg-ink: #eef0e8; --sg-ink-soft: #b8bfa8; --sg-title: #e8f2c8; --sg-title-shadow: 0 3px 0 #2a3a12, 0 0 24px rgba(160, 220, 80, .35);
  --sg-accent: #c6f24a; --sg-accent-ink: #182008; --sg-card: rgba(40, 46, 32, .88); --sg-card-ink: #eef0e8;
  --sg-line: rgba(198, 242, 74, .22); --sg-sheet-bg: #171a12; --sg-sheet-ink: #eef0e8;
}

.vignette { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 55%, rgba(170, 20, 10, .55) 100%); }
.vignette.on { opacity: 1; transition: none; }
.vignette.low { opacity: .55; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.hud { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: flex-start; gap: 10px; pointer-events: none;
  padding: var(--sg-corner-top, max(10px, env(safe-area-inset-top))) max(12px, env(safe-area-inset-right)) 0 var(--sg-corner-left, max(10px, env(safe-area-inset-left))); }
.hud > * { pointer-events: auto; }
.hud-p { min-width: 0; width: 168px; max-width: 30vw; padding: 4px 8px 6px; border-radius: 12px; background: rgba(8, 10, 6, .55);
  border: 1px solid rgba(255, 255, 255, .08); font-size: 12px; line-height: 1.2; text-shadow: 0 1px 0 #000; }
.hud-p2 { margin-left: auto; text-align: right; }
.hud-p .who { display: flex; gap: 6px; align-items: baseline; justify-content: space-between; font-weight: 800; font-size: 13px; }
.hud-p2 .who { flex-direction: row-reverse; }
.hud-p .hp { height: 7px; margin: 3px 0 4px; border-radius: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.hud-p .hp i { display: block; height: 100%; width: 100%; border-radius: 4px; background: linear-gradient(90deg, #6ad04a, #b6f26a); transform-origin: left; transition: transform .15s; }
.hud-p .hp.low i { background: linear-gradient(90deg, #d0402a, #f2a04a); }
.hud-p .gun { display: flex; gap: 6px; justify-content: space-between; font-weight: 700; color: #ffe39a; white-space: nowrap; overflow: hidden; }
.hud-p2 .gun { flex-direction: row-reverse; }
.hud-p .gun small { color: #cfd6bf; font-weight: 700; }
.hud-p .pips { color: #7fe3ff; letter-spacing: 1px; font-size: 12px; }
.hud-p.down { border-color: rgba(255, 90, 70, .7); }
.hud-p.down .gun { color: #ff8a7a; }
.hud-mid { margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 0; font-weight: 800; text-shadow: 0 2px 0 #000; pointer-events: none; }
.hud-mid b { font-size: 16px; letter-spacing: .08em; text-transform: uppercase; color: #e8f2c8; }
.hud-mid span { font-size: 12px; color: #b8bfa8; }
.hud-mid .hud-score { font-size: 15px; color: #fff; font-variant-numeric: tabular-nums; }
.hud-mid .hud-chain { font-size: 14px; color: #ffd24a; }
.hud-chain.bump { animation: bump .25s ease-out; }
@keyframes bump { 0% { transform: scale(1.4); } 100% { transform: scale(1); } }
@media (max-width: 520px) { .hud-p { width: 128px; font-size: 11px; } .hud-mid b { font-size: 14px; } }

.sticks { position: absolute; inset: 0; pointer-events: none; }
.stick { position: absolute; width: 104px; height: 104px; margin: -52px 0 0 -52px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .06); }
.stick i { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  background: rgba(255, 255, 255, .35); }
.stick.aim { border-color: rgba(255, 210, 74, .5); }
.stick.aim i { background: rgba(255, 210, 74, .55); }
.stick.p2 { border-color: rgba(255, 138, 61, .5); }

.swaps { position: absolute; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom)); pointer-events: none; }
.swap { position: absolute; bottom: 0; width: 52px; height: 52px; border-radius: 50%; border: 2px solid rgba(255, 227, 154, .6);
  background: rgba(10, 12, 6, .55); color: #ffe39a; font: 800 22px/1 'Baloo 2', system-ui, sans-serif; pointer-events: auto; }
.swap.p1 { right: max(16px, env(safe-area-inset-right)); }
.swaps.duo .swap.p1 { right: auto; left: calc(50% - 68px); }
.swaps.duo .swap.p2 { right: max(16px, env(safe-area-inset-right)); }

.banner { position: absolute; left: 0; right: 0; top: 30%; display: flex; flex-direction: column; align-items: center; pointer-events: none;
  opacity: 0; transform: scale(.9); transition: opacity .25s, transform .25s; text-align: center; padding: 0 16px; }
.banner.on { opacity: 1; transform: scale(1); }
.banner b { font-size: clamp(30px, 8vw, 56px); line-height: 1; letter-spacing: .06em; text-transform: uppercase; color: #e8f2c8;
  text-shadow: 0 4px 0 #1a2208, 0 0 30px rgba(160, 220, 80, .45); }
.banner.boss b { color: #ff6a4a; text-shadow: 0 4px 0 #300, 0 0 34px rgba(255, 60, 30, .6); }
.banner.gun b { color: #ffe39a; font-size: clamp(22px, 6vw, 40px); }
.banner span { margin-top: 6px; font-size: 16px; font-weight: 700; color: #cfd6bf; text-shadow: 0 2px 0 #000; }

.card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(400px, calc(100% - 32px));
  max-height: calc(100% - 24px); overflow: auto; padding: 18px 18px 16px; border-radius: 20px; background: rgba(18, 21, 14, .94);
  border: 1px solid rgba(198, 242, 74, .25); box-shadow: 0 20px 60px rgba(0, 0, 0, .7); text-align: center; z-index: 20; }
.card .kicker { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #ff7a5a; }
.card h2 { margin: 2px 0 8px; font-size: 32px; line-height: 1.1; color: #e8f2c8; }
.over-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 0 0 8px; text-align: left; }
.over-stats div { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; padding: 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, .05); }
.over-stats dt { color: #b8bfa8; } .over-stats dd { margin: 0; font-weight: 800; }
.over-best { margin: 4px 0; color: #ffd24a; font-weight: 800; min-height: 1em; }
.over-new { list-style: none; margin: 0 0 8px; padding: 0; color: #7fe3ff; font-weight: 700; font-size: 14px; }
.over-new li.next { color: #b8bfa8; font-weight: 600; font-size: 13px; }
.de-row .dot.swatch { border: 2px solid rgba(255, 255, 255, .25); }
.btns { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }
.btn { min-height: 48px; min-width: 120px; padding: 0 18px; border-radius: 999px; border: 2px solid rgba(198, 242, 74, .45);
  background: transparent; color: #eef0e8; font: 800 16px/1 'Baloo 2', system-ui, sans-serif; }
.btn.primary { background: #c6f24a; color: #182008; border-color: #c6f24a; }

.toast { position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translate(-50%, 20px); margin: 0;
  padding: 8px 14px; border-radius: 999px; background: rgba(10, 12, 6, .85); color: #e8f2c8; font-weight: 700; font-size: 14px;
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* sheets: picking who plays and where */
.de-pick { display: grid; gap: 10px; }
.de-row { display: flex; gap: 10px; align-items: center; min-height: 56px; width: 100%; padding: 8px 12px; border-radius: 14px;
  border: 2px solid rgba(198, 242, 74, .18); background: rgba(255, 255, 255, .04); color: inherit; font: inherit; text-align: left; }
.de-row.on { border-color: #c6f24a; background: rgba(198, 242, 74, .12); }
.de-row:disabled { opacity: .45; }
.de-row b { display: block; font-size: 16px; }
.de-row small { display: block; color: #b8bfa8; font-size: 13px; line-height: 1.25; }
.de-row .dot { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #111; }
.de-h { margin: 8px 0 0; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #b8bfa8; }
.de-keys { margin: 4px 0 0; font-size: 13px; color: #b8bfa8; line-height: 1.4; }
.de-keys kbd { display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 5px; background: rgba(255, 255, 255, .12); font: 700 12px/18px ui-monospace, monospace; text-align: center; }
.de-art { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (prefers-reduced-motion: reduce) { .banner, .vignette, .toast { transition: none; } .hud-chain.bump { animation: none; } .vignette.low { animation: none; } }

/* the ⬇ button sits above ⇄ while a thing to put down is in hand */
.swap.drop { bottom: 62px; border-color: rgba(140, 255, 170, .7); }
/* first runs on a phone: what each thumb does, for a few seconds */
.thumbs { position: absolute; left: 0; right: 0; bottom: 22%; display: flex; pointer-events: none; z-index: 6;
  font-weight: 800; font-size: 15px; color: rgba(255, 255, 255, .85); text-shadow: 0 2px 6px #000; transition: opacity .6s; }
.thumbs span { flex: 1; text-align: center; padding: 18px 0; border: 2px dashed rgba(255, 255, 255, .25); border-radius: 18px; margin: 0 16px; }
.thumbs.duo .r { color: #9fd8ff; }
.thumbs.fade { opacity: 0; }

/* Play online: the room sheet */
.de-lobby { display: grid; gap: 10px; }
.de-lobby p { margin: 0; line-height: 1.4; }
.de-btn { min-height: 48px; width: 100%; border-radius: 14px; border: 2px solid rgba(198, 242, 74, .35); background: rgba(255, 255, 255, .05);
  color: inherit; font: inherit; font-weight: 800; font-size: 16px; }
.de-btn.primary { background: #c6f24a; border-color: #c6f24a; color: #141a08; }
.de-btn.off { opacity: .5; }
.de-join { display: flex; gap: 8px; }
.de-join .de-btn { width: auto; flex: none; padding: 0 22px; }
.de-code-in { flex: 1; min-width: 0; min-height: 48px; border-radius: 14px; border: 2px solid rgba(198, 242, 74, .35); background: rgba(0, 0, 0, .3);
  color: #fff; font: 800 22px/1 ui-monospace, monospace; letter-spacing: .3em; text-align: center; text-transform: uppercase; -webkit-user-select: text; user-select: text; }
.de-code { font: 800 44px/1.1 ui-monospace, monospace; letter-spacing: .25em; text-align: center; color: #c6f24a; -webkit-user-select: text; user-select: text; }
.de-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.de-people li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); }
.de-people li span { color: #b8bfa8; font-size: 13px; text-align: right; }
.de-people li.on b::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: #8cff9a; }
.de-people li.off, .de-people li.wait { opacity: .6; }
.de-small { font-size: 13px; color: #b8bfa8; margin: 0 0 8px; }
.de-note { min-height: 1em; color: #ffb59a; font-size: 14px; }
