/* Cabin Get Me – menus follow the Dead Center Games look (Hostile Takeover, Cram-It!, Cow Culling, Word Find Attack). */
:root {
  --bg: #0a0506;
  --card: #120b0b;
  --card-line: #2b1d1d;
  --amber: #e0a040;
  --blood: #b3001b;
  --blood-hot: #ff2d55;
  --bone: #efe4cc;
  --muted: #a8968f;
  --gold: #ffcf6a;
  --neon-green: #7ed321;
  --neon-red: #ff2d55;
  --neon-cyan: #22d3ee;
  --neon-purple: #a855f7;
  --neon-amber: #f59e0b;
  --title: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
  --serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --metal: 'Anton', Impact, 'Arial Narrow Bold', sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--bone); font-family: var(--serif); font-size: 17px; overscroll-behavior: none; }
body { touch-action: manipulation; user-select: none; -webkit-user-select: none; }
[hidden] { display: none !important; }
a { color: var(--amber); }
button { font-family: inherit; color: inherit; }
#app { position: fixed; inset: 0; }
#game, #fx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#fx { pointer-events: none; }
#peek { position: absolute; inset: 0; display: none; pointer-events: none; z-index: 5;
  background: repeating-linear-gradient(180deg, rgba(20, 12, 6, .92) 0 26px, rgba(20, 12, 6, 0) 26px 44px), radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, .85));
  align-items: flex-end; justify-content: center; padding-bottom: 18%; }
#peek.show { display: flex; }
#peek span { background: rgba(0, 0, 0, .6); padding: 6px 12px; border-radius: 10px; font-weight: 700; }

/* ---------- screens + panels (same as the other Dead Center games) ---------- */
.screen {
  position: absolute; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center;
  padding: calc(1rem + var(--safe-t)) calc(1rem + var(--safe-r)) calc(1rem + var(--safe-b)) calc(1rem + var(--safe-l));
  background: radial-gradient(ellipse 90% 55% at 50% 0%, rgba(120, 8, 24, 0.5), transparent 70%), rgba(10, 5, 6, 0.82);
  overflow-y: auto; touch-action: pan-y;
}
.screen.show { display: flex; }
.overlay { z-index: 30; }
.panel {
  width: min(540px, 100%); max-height: 100%; overflow-y: auto; margin: auto;
  background: rgba(14, 8, 9, 0.96); border: 2px solid var(--card-line); border-radius: 20px;
  padding: 1.4rem 1.4rem 1.2rem; box-shadow: 0 0 60px rgba(224, 16, 47, 0.16), 0 20px 60px rgba(0, 0, 0, 0.7);
}
h2 { font: 900 1.8rem/1.1 var(--title); margin: 0 0 1rem; text-shadow: 0 0 18px rgba(255, 45, 85, 0.25); }
h3 { font: 700 1.1rem/1.2 var(--title); margin: 1.1rem 0 0.5rem; }
p { line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }
.err { color: #ff6b81; min-height: 1.2em; margin: 0.6rem 0 0; }
.row { display: flex; gap: 0.75rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1.2rem; }
.row.left { justify-content: flex-start; margin-top: 0.6rem; }
.row.tight { margin-top: 0; margin-bottom: 0.8rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; text-decoration: none;
  font: 700 0.95rem/1 var(--title); letter-spacing: 0.02em; color: var(--bone);
  background: var(--card); border: 2px solid var(--card-line); border-radius: 14px;
  padding: 0.9rem 1.2rem; cursor: pointer; transition: transform 80ms, border-color 120ms;
}
.btn:hover { border-color: #4a3030; }
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn:focus-visible, .card-btn:focus-visible, .seg button:focus-visible, input:focus-visible, .best-pill:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.btn.primary { background: linear-gradient(180deg, #c8102e, #7a0012); border-color: #ff2d55; box-shadow: 0 0 18px rgba(255, 45, 85, 0.35); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { font-size: 0.8rem; padding: 0.6rem 0.9rem; }

/* title */
.title-screen { align-items: flex-start; background: radial-gradient(ellipse 85% 42% at 50% 12%, rgba(150, 10, 30, 0.7), rgba(40, 6, 10, 0.6) 55%, transparent 80%), rgba(10, 5, 6, 0.94); }
.title-wrap { width: min(470px, 100%); margin: 0 auto; padding-top: 0.4rem; display: grid; justify-items: center; gap: 1rem; }
.title-art { width: 100%; height: auto; border-radius: 14px; border: 3px solid #050304; box-shadow: 0 0 0 2px #3a1a22, 0 0 50px 8px rgba(224, 16, 47, 0.4), 0 18px 40px rgba(0, 0, 0, 0.7); }
.best-pill { display: flex; align-items: baseline; gap: 0.6rem; cursor: pointer; background: rgba(20, 6, 8, 0.85); color: var(--amber); border: 2px solid rgba(224, 160, 64, 0.6); border-radius: 999px; padding: 0.55rem 1.3rem; font-family: var(--serif); }
.best-pill b { font: 900 1.5rem/1 var(--title); color: var(--gold); }
.best-pill b::before { content: ""; display: inline-block; width: .95rem; height: .95rem; margin-right: .45rem; border-radius: 50%; vertical-align: -2px; width: 1.15rem; height: 1.15rem; background: url(/play/assets/dca-coin-48.png) center / contain no-repeat; }
.pill-sub { font-size: 0.95rem; color: #d9a45a; }
.cards { width: 100%; display: grid; gap: 0.75rem; }
.card-btn { display: flex; align-items: center; gap: 1.1rem; width: 100%; text-align: left; cursor: pointer; background: rgba(14, 9, 9, 0.94); border: 2px solid var(--card-line); border-radius: 18px; padding: 0.85rem 1.1rem; color: var(--bone); transition: transform 90ms, border-color 150ms; }
.card-btn:hover { border-color: #4a3030; }
.card-btn:active { transform: scale(0.985); }
.ico { flex: none; width: 3.3rem; height: 3.3rem; border-radius: 12px; border: 2px solid; display: grid; place-items: center; background: #080506; }
.ico svg { width: 1.7rem; height: 1.7rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.green { color: var(--neon-green); border-color: var(--neon-green); box-shadow: 0 0 12px rgba(126, 211, 33, 0.45); }
.ico.red { color: var(--neon-red); border-color: var(--neon-red); box-shadow: 0 0 12px rgba(255, 45, 85, 0.45); }
.ico.cyan { color: var(--neon-cyan); border-color: var(--neon-cyan); box-shadow: 0 0 12px rgba(34, 211, 238, 0.45); }
.ico.purple { color: var(--neon-purple); border-color: var(--neon-purple); box-shadow: 0 0 12px rgba(168, 85, 247, 0.45); }
.ico.amber { color: var(--neon-amber); border-color: var(--neon-amber); box-shadow: 0 0 12px rgba(245, 158, 11, 0.45); }
.card-txt { display: grid; gap: 0.2rem; min-width: 0; }
.card-title { font: 900 1.35rem/1.05 var(--title); color: #fff; }
.card-sub { font-size: 1.02rem; color: var(--muted); }
.acct-chip { font-size: 0.95rem; text-align: center; }
.acct-chip .who { color: var(--bone); }
.brand-foot { margin: 0 0 1rem; color: var(--muted); font-size: 0.92rem; text-align: center; }

/* forms */
.field { display: block; margin: 1rem 0 0.4rem; font: 700 0.85rem/1 var(--title); color: var(--amber); letter-spacing: 0.04em; }
.seg { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.seg button { flex: 1 1 0; min-width: 2.6rem; padding: 0.65rem 0.6rem; border-radius: 12px; border: 2px solid var(--card-line); background: #0d0708; color: var(--bone); font: 700 1rem/1 var(--serif); cursor: pointer; white-space: nowrap; }
.seg button.on { border-color: var(--blood-hot); background: #2a070f; box-shadow: 0 0 12px rgba(255, 45, 85, 0.35); color: #fff; }
.readonly .seg button, .readonly .check { pointer-events: none; opacity: 0.75; }
input:not([type]), input[type=text], #nameIn, #codeIn { width: 100%; padding: 0.8rem 0.9rem; border-radius: 12px; border: 2px solid var(--card-line); background: #0d0708; color: var(--bone); font: 600 1.1rem/1 var(--serif); user-select: text; -webkit-user-select: text; }
#codeIn { text-transform: uppercase; letter-spacing: 0.3em; font-family: var(--metal); }
.join-row { display: flex; gap: 0.6rem; }
.join-row input { flex: 1; min-width: 0; }
.check { display: flex; gap: 0.6rem; align-items: center; margin-top: 1rem; font-size: 1.05rem; cursor: pointer; }
.check input { width: 1.2rem; height: 1.2rem; accent-color: var(--blood-hot); }
.code { font-family: var(--metal); letter-spacing: 0.18em; color: var(--blood-hot); }

/* lobby + results lists */
.lobby-list, .results { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.45rem; }
.lobby-list li, .results li { display: flex; align-items: center; gap: 0.7rem; padding: 0.45rem 0.8rem; border: 2px solid var(--card-line); border-radius: 12px; background: #0d0708; min-width: 0; }
.lobby-list canvas, .results canvas { width: 40px; height: 40px; flex: none; }
.lobby-list .nm, .results .nm { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { margin-left: auto; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.results li.win { border-color: var(--amber); box-shadow: 0 0 14px rgba(224, 160, 64, 0.3); }
.results li.me .nm { color: var(--gold); }
.results .pts { font: 900 1.05rem/1 var(--title); color: var(--gold); min-width: 3.2rem; text-align: right; }
.score-line { font: 900 1.3rem/1.2 var(--title); color: var(--gold); text-align: center; min-height: 1.2em; margin: .8rem 0 0; }
.score-line a { color: inherit; }
.friend-list { display: grid; gap: 0.4rem; }
.friend-list button { display: flex; justify-content: space-between; align-items: center; padding: 0.55rem 0.8rem; border-radius: 12px; border: 2px solid var(--card-line); background: #0d0708; color: var(--bone); font: 600 1rem/1 var(--serif); cursor: pointer; }
.friend-list .on { color: var(--neon-green); font-size: 0.85rem; }
.how { padding-left: 1.2rem; display: grid; gap: 0.55rem; line-height: 1.45; margin: 0; }
.how b { color: var(--amber); }
.floor { display: grid; grid-template-columns: 10fr 12fr 9fr 7fr; border: 3px solid #4a3423; border-radius: 6px; overflow: hidden; margin: .4rem 0; }
.floor span { padding: 14px 4px; text-align: center; font-weight: 700; font-size: .85rem; border-right: 3px solid #4a3423; line-height: 1.2; }
.floor span:nth-child(1) { background: #3d2f52; } .floor span:nth-child(2) { background: #5a3d22; } .floor span:nth-child(3) { background: #6a6150; } .floor span:nth-child(4) { background: #2f4f5a; border: 0; }
.floor .door { position: relative; }
.floor .door::after { content: ""; position: absolute; left: 30%; right: 30%; bottom: -3px; height: 5px; background: var(--amber); }

/* ---------- HUD ---------- */
#hud { padding: 0; pointer-events: none; z-index: 10; overflow: hidden; background: none; }
#hud > * { pointer-events: auto; }
#pad { position: absolute; inset: 0; touch-action: none; -webkit-user-select: none; user-select: none; }
#hud > .where, #hud > .counting, #hud > .banner, #hud > .toasts, #hud > .keyhint, #hud > .stick { pointer-events: none; }
#hud > .actions { pointer-events: none; }
.actions .act { pointer-events: auto; }
.topbar { position: absolute; top: calc(8px + var(--safe-t)); left: calc(8px + var(--safe-l)); right: 136px; display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 2px solid var(--card-line); background: rgba(14, 8, 9, 0.9); font-size: 20px; cursor: pointer; color: var(--bone); }
.pill { display: inline-flex; gap: 6px; align-items: center; background: rgba(14, 8, 9, 0.88); border: 2px solid var(--card-line); border-radius: 99px; padding: 5px 12px; font: 700 1rem/1.1 var(--serif); white-space: nowrap; }
.pill b { font-family: var(--metal); font-weight: 400; letter-spacing: .04em; font-size: 1.05rem; }
.pill .ico { font-size: 14px; width: auto; height: auto; border: 0; background: none; display: inline; }
.pill.role { font: 400 .9rem/1 var(--metal); letter-spacing: .12em; border-color: var(--neon-cyan); color: var(--neon-cyan); box-shadow: 0 0 10px rgba(34, 211, 238, .35); }
.pill.role.hider { border-color: var(--neon-red); color: var(--neon-red); box-shadow: 0 0 10px rgba(255, 45, 85, .45); }
.pill.warn b { color: #ff6b81; }
.where { position: absolute; top: calc(60px + var(--safe-t)); left: calc(8px + var(--safe-l)); background: rgba(14, 8, 9, .75); border-radius: 10px; padding: 4px 10px; font: 600 .92rem/1.2 var(--serif); pointer-events: none; }
#miniMap { position: absolute; top: calc(8px + var(--safe-t)); right: calc(8px + var(--safe-r)); width: 120px; height: 100px; border-radius: 10px; cursor: pointer; border: 2px solid var(--card-line); }
.counting { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 22vh; background: rgba(6, 2, 3, .92); pointer-events: none; }
.counting.show { display: flex; }
.counting.hider { inset: auto; left: 50%; top: calc(8px + var(--safe-t)); transform: translateX(-50%); padding: 4px 14px 4px 6px; flex-direction: row; gap: 8px; align-items: center; background: rgba(14, 8, 9, .9); border: 2px solid var(--blood-hot); border-radius: 99px; box-shadow: 0 0 12px rgba(255, 45, 85, .4); }
.c-big { font: 400 120px/1 var(--metal); color: var(--blood-hot); text-shadow: 0 0 30px rgba(255, 45, 85, .5); }
.counting.hider .c-big { font-size: 22px; min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--blood-hot); color: #fff; text-shadow: none; }
.c-txt { font: 700 1.3rem/1.3 var(--title); text-align: center; padding: 0 20px; text-shadow: 0 2px 6px #000; }
.counting.hider .c-txt { font: 700 .95rem/1.1 var(--serif); padding: 0; white-space: nowrap; }
.banner { position: absolute; left: 50%; top: calc(54px + var(--safe-t)); transform: translate(-50%, 0) scale(.8); opacity: 0; transition: .3s; background: rgba(14, 8, 9, .94); border: 2px solid var(--blood-hot); box-shadow: 0 0 30px rgba(255, 45, 85, .35); border-radius: 14px; padding: 8px 16px; font: 900 1.1rem/1.15 var(--title); text-align: center; pointer-events: none; width: max-content; max-width: min(460px, 56vw); z-index: 7; }
.banner.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.banner small { display: block; font: 600 .9rem/1.25 var(--serif); color: var(--muted); margin-top: .3rem; }
.toasts { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(40px + var(--safe-b)); display: flex; flex-direction: column; gap: 5px; align-items: center; pointer-events: none; width: min(440px, calc(100% - 330px)); z-index: 7; }
.touch .toasts { bottom: calc(14px + var(--safe-b)); }
.toast { background: rgba(14, 8, 9, .86); border: 1.5px solid var(--card-line); border-radius: 10px; padding: 5px 12px; font: 600 .9rem/1.2 var(--serif); text-align: center; max-width: 100%; animation: tin .25s ease-out; }
.toast.alert { border-color: var(--blood-hot); background: rgba(90, 8, 20, .92); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
.actions { position: absolute; right: calc(10px + var(--safe-r)); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 10px; align-items: center; z-index: 8; }
.touch .actions { top: calc(118px + var(--safe-t)); transform: none; }
.act { display: none; position: relative; width: 54px; height: 54px; padding: 0; border-radius: 50%; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; border: 2px solid var(--neon-green); color: #e9ffd6; background: rgba(14, 8, 9, .82); box-shadow: 0 0 10px rgba(126, 211, 33, .35); cursor: pointer; transition: transform .08s; }
.act svg { width: 28px; height: 28px; display: block; margin: auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.act svg .fill { fill: currentColor; stroke: none; }
.act svg .x { display: none; }
.act.on svg .x { display: inline; stroke: #ff6b81; }
.act.hit { transform: scale(.88); }
.act .n { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #ffd23f; color: #1b1406; font: 800 12px/20px system-ui, sans-serif; font-style: normal; pointer-events: none; }
.act.cart.on { border-color: #4fc3ff; color: #d7f1ff; box-shadow: 0 0 10px rgba(79, 195, 255, .45); }
.act.out svg { transform: scaleX(-1); }
.act.show { display: grid; place-items: center; }
#bHide { border-color: var(--neon-purple); box-shadow: 0 0 14px rgba(168, 85, 247, .45); }
#bDoor { border-color: var(--neon-amber); box-shadow: 0 0 14px rgba(245, 158, 11, .45); }
.stick { position: absolute; width: 120px; height: 120px; border-radius: 50%; border: 2px solid rgba(239, 228, 204, .25); background: rgba(239, 228, 204, .05); display: none; pointer-events: none; transform: translate(-50%, -50%); opacity: .55; transition: opacity .15s; }
.touch .stick { display: block; }
.stick.live { opacity: 1; transition: none; }
.stick i { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(239, 228, 204, .4); box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.stick.aim i { background: rgba(255, 207, 106, .6); }
.stick b { position: absolute; left: 0; right: 0; top: 100%; margin-top: 6px; text-align: center; font: 400 11px/1 var(--metal); letter-spacing: 2px; opacity: .8; }
.stick.live b { display: none; }
.keyhint { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); font-size: 13px; opacity: .6; pointer-events: none; white-space: nowrap; transition: opacity 1.2s; }
.keyhint.gone { opacity: 0; }
.touch .keyhint { display: none; }

/* ---------- store ---------- */
#store { align-items: stretch; }
.store { width: 100%; max-width: 1000px; height: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.store-head { display: flex; align-items: center; gap: 10px; }
.store-head h2 { flex: 1; margin: 0; font-size: clamp(1.1rem, 4.5vw, 1.5rem); }
.goldpill { display: inline-flex; align-items: center; gap: 4px; background: rgba(20, 6, 8, .85); border: 2px solid rgba(224, 160, 64, .6); color: var(--gold); border-radius: 99px; padding: 3px 10px 3px 6px; font: 900 .95rem/1.2 var(--title); white-space: nowrap; }
.goldpill::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: url(/play/assets/dca-coin-48.png) center / contain no-repeat; }
.store-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.preview { background: rgba(14, 8, 9, .96); border: 2px solid var(--card-line); border-radius: 16px; padding: 8px; display: flex; flex-direction: column; align-items: center; }
.preview canvas { width: 180px; height: 150px; }
.prev-name { font: 700 .95rem/1.2 var(--title); }
.store-main { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.tabs, .subtabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: none; }
.tabs button, .subtabs button { flex: none; border: 2px solid var(--card-line); background: #0d0708; color: var(--muted); border-radius: 99px; padding: 8px 14px; font: 700 .95rem/1 var(--serif); cursor: pointer; }
.tabs button.on { background: #c1121f; border-color: #ff3348; color: #fff; }
.subtabs button.on { border-color: var(--amber); color: var(--bone); }
.subtabs:empty { display: none; }
.grid { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-content: start; padding-bottom: 12px; }
.item { background: #1f1318; border: 2px solid #3a2229; border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 6px; align-items: center; cursor: pointer; min-width: 0; }
.item.try { border-color: var(--amber); }
.item.worn { border-color: #2f7a3a; box-shadow: 0 0 0 2px #8cff6a inset; }
.item canvas { width: 100%; max-width: 140px; aspect-ratio: 13/10; height: auto; border-radius: 10px; }
.item .nm { font: 700 1rem/1.15 var(--serif); text-align: center; }
.item .pk { font-size: .8rem; color: var(--muted); text-align: center; }
.item .btn { width: 100%; padding: .55rem .5rem; font: 800 .9rem/1 system-ui, sans-serif; border-radius: 10px; }
.item .btn .goldpill { border: 0; background: none; padding: 0; }
.item .btn.primary { background: #8cff6a; color: #0f2a0a; border-color: #8cff6a; box-shadow: none; }
.item .btn.buy { background: #ffcc4d; color: #241400; border-color: #ffcc4d; }
.item .btn.buy .goldpill { color: #241400; }
.item .btn.confirm { background: #ffcc4d; color: #241400; border-color: #fff; }
.item .btn.egg { background: #ff8a2a; color: #240c00; border-color: #ff8a2a; font-size: .8rem; }
#storeNote .btn { margin-right: .5rem; }

/* big map */
#bigmap { background: rgba(6, 2, 3, .7); }
.mapwrap { position: relative; width: min(94vw, 750px); }
.mapwrap canvas { width: 100%; height: auto; display: block; border-radius: 14px; border: 2px solid var(--card-line); }
.mapwrap .btn { position: absolute; top: 8px; right: 8px; }

.modal { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0, 0, 0, .6); z-index: 50; padding: 20px; }
.modal.show { display: flex; }
.modal p { margin: 0; text-align: center; font-size: 1.1rem; }

@media (min-width: 700px) {
  .store-body { flex-direction: row; }
  .preview { width: 260px; flex: none; justify-content: center; }
  .preview canvas { width: 240px; height: 200px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .title-wrap { width: min(820px, 100%); grid-template-columns: 1fr 1.1fr; align-items: start; }
  .title-art { grid-row: span 3; }
  .store-body { flex-direction: row; }
  .preview { width: 200px; flex: none; }
  .preview canvas { width: 180px; height: 150px; }
  .where { top: calc(56px + var(--safe-t)); }
  .touch .actions { top: calc(100px + var(--safe-t)); gap: 8px; }
  .act { width: 48px; height: 48px; }
  .act svg { width: 25px; height: 25px; }
  .c-big { font-size: 80px; }
  .banner { top: calc(52px + var(--safe-t)); }
}
@media (max-width: 700px) {
  .counting.hider, .banner { top: calc(94px + var(--safe-t)); }
  .banner { max-width: 80vw; }
  .toasts { width: calc(100% - 24px); bottom: auto; top: calc(132px + var(--safe-t)); }
  .touch .toasts { bottom: auto; }
}
@media (max-width: 420px) {
  .topbar { right: 108px; gap: 4px; }
  .keyhint { display: none; }
  .icon-btn { width: 38px; height: 38px; }
  #miniMap { width: 100px; height: 84px; }
  .pill { font-size: .9rem; padding: 4px 9px; }
  .card-title { font-size: 1.2rem; }
}

/* end-of-match camera: hide the controls, keep the banner */
#hud.cine > *:not(.banner):not(.toasts) { display: none !important; }
.results li.lost { opacity: .8; }
.tag b.w { color: var(--neon-green); }
.tag b.l { color: var(--blood-hot); }
.results li .nm { flex: 1 1 auto; min-width: 3.5rem; }
.results li .tag { white-space: normal; text-align: right; font-size: .8rem; line-height: 1.25; }
#hud.cine .banner { top: auto; bottom: calc(9% + var(--safe-b)); transform: translate(-50%, 0) scale(.8); }
#hud.cine .banner.show { transform: translate(-50%, 0) scale(1); }

/* map layout editor (solo setup + room host) */
.layout-ed { margin-top: 0.6rem; border-top: 1px solid var(--card-line); padding-top: 0.4rem; }
.seg.small button { padding: 0.5rem 0.45rem; font-size: 0.9rem; min-width: 2.2rem; }
.lay-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.lay-prev { margin-top: 0.8rem; border-radius: 12px; overflow: hidden; border: 2px solid var(--card-line); background: #16301f; }
.lay-prev canvas { display: block; width: 100%; height: auto; }
.lay-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.45rem 0.6rem; background: rgba(0, 0, 0, 0.35); font-size: 0.9rem; }
.readonly [data-shuffle] { display: none; }
.readonly .layout-ed .seg button { pointer-events: none; }
@media (max-width: 420px) { .lay-two { grid-template-columns: 1fr; } }

/* ---- map size: auto (5 cabins per player) greys out loops / cabins ---- */
.layout-ed.auto .lay-custom { opacity: .45; }
.layout-ed .lay-custom { transition: opacity .2s; }

/* ---- searched cabins that changed since ---- */
.pill.flag { border-color: #e5242b; box-shadow: 0 0 10px rgba(229, 36, 43, .5); }
.pill.flag .bang { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #e5242b; color: #fff; font: 900 15px/1 system-ui; }

/* ---- hider hint: flashing icon on the screen edge, or a yellow frame ---- */
#beacon { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; display: none; pointer-events: none; z-index: 6; }
#beacon.show { display: block; animation: beaconBlink .5s ease-in-out infinite alternate; }
#beacon canvas { position: absolute; inset: 6px; width: 72px; height: 72px; border-radius: 50%; background: radial-gradient(circle, #fff7d1 0%, #ffd54d 70%); border: 4px solid #ffd54d; box-shadow: 0 0 22px 6px rgba(255, 213, 77, .85); }
#beacon span { position: absolute; left: 50%; bottom: -20px; transform: translateX(-50%); background: #e5242b; color: #fff; border-radius: 8px; padding: 1px 8px; font: 900 12px/1.4 system-ui; letter-spacing: .08em; }
#beacon .arrow { position: absolute; inset: 0; }
#beacon .arrow i { position: absolute; right: -16px; top: 50%; margin-top: -12px; border: 12px solid transparent; border-left: 16px solid #ffd54d; filter: drop-shadow(0 0 4px rgba(0,0,0,.6)); }
@keyframes beaconBlink { from { opacity: 1; transform: scale(1.05); } to { opacity: .18; transform: scale(.92); } }
#yframe { position: absolute; inset: 0; display: none; pointer-events: none; z-index: 6; border: 12px solid #ffd54d; box-shadow: inset 0 0 40px 10px rgba(255, 213, 77, .7); }
#yframe.show { display: block; animation: frameBlink .5s ease-in-out infinite alternate; }
@keyframes frameBlink { from { opacity: 1; } to { opacity: .25; } }

/* ---- search + turbo buttons ---- */
.act.search { border-color: #ffd54d; color: #ffe58a; box-shadow: 0 0 14px rgba(255, 213, 77, .55); animation: pulseBtn 1s ease-in-out infinite alternate; }
.act.boost { border-color: #ffb020; box-shadow: 0 0 16px rgba(255, 176, 32, .55); }
.act.boost { color: #ffd23f; }
.act.boost.on { background: radial-gradient(circle, #ffd23f, #ff7a1c); color: #1b1406; }
@keyframes pulseBtn { from { box-shadow: 0 0 6px rgba(255, 213, 77, .35); } to { box-shadow: 0 0 18px rgba(255, 213, 77, .8); } }
#hud.cine #beacon, #hud.cine #yframe { display: none !important; }

/* ---- how to play: picture slides ---- */
.panel.how-panel { max-width: 760px; width: min(760px, 94vw); }
.how-tabs { display: flex; gap: 8px; margin: .2rem 0 .7rem; }
.how-tabs button { flex: 1; padding: .6rem; border-radius: 12px; border: 2px solid var(--card-line); background: rgba(0,0,0,.35); color: inherit; font: 700 1rem/1 var(--serif); cursor: pointer; }
.how-tabs button.on { border-color: var(--neon-cyan); color: var(--neon-cyan); box-shadow: 0 0 12px rgba(34, 211, 238, .35); }
.how-tabs button[data-track=hide].on { border-color: var(--neon-red); color: var(--neon-red); box-shadow: 0 0 12px rgba(255, 45, 85, .35); }
.slide { position: relative; border-radius: 14px; overflow: hidden; border: 2px solid var(--card-line); background: #000; aspect-ratio: 16 / 9; cursor: pointer; }
.slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.slide-n { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.7); border-radius: 8px; padding: 2px 8px; font-size: .8rem; }
.slide-title { margin: .7rem 0 .2rem; font-size: 1.3rem; }
.slide-text { margin: 0 0 .6rem; line-height: 1.45; min-height: 4.4em; }
.slide-nav { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.slide-nav .dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.slide-nav .dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.25); }
.slide-nav .dots i.on { background: #ffd54d; }
.how-more { margin-top: .8rem; border-top: 1px solid var(--card-line); padding-top: .5rem; }
.how-more summary { cursor: pointer; font-weight: 700; }

/* ---- crosshairs / tracking ---- */
.pill.trk { border-color: #ff3b3b; color: #ff8080; box-shadow: 0 0 12px rgba(255, 59, 59, .55); animation: trkPulse .8s ease-in-out infinite alternate; }
.pill.trk b { font-size: .85rem; letter-spacing: .06em; }
.pill.trk.me { background: rgba(120, 0, 0, .9); color: #fff; }
.pill.trk.soon { border-color: #ffb020; color: #ffd27a; box-shadow: 0 0 12px rgba(255, 176, 32, .5); }
@keyframes trkPulse { from { opacity: 1; } to { opacity: .6; } }
@media (max-width: 700px) { .pill.trk b { font-size: .75rem; } .pill.trk .ico { display: none; } }
/* hider heartbeat: red edges when a seeker is close */
#heart { position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 5; box-shadow: inset 0 0 90px 30px rgba(220, 0, 20, .75); transition: opacity .12s linear; }
/* decoy button */
.act.decoy { border-color: #ffa028; box-shadow: 0 0 16px rgba(255, 160, 40, .55); }
.act.decoy { color: #ffd27a; }
/* results: per-player stats line */
.results .nm small.st { display: block; font: 600 .78rem/1.3 var(--serif); color: var(--muted); margin-top: 2px; }
#hud.cine #heart { display: none !important; }
/* the hider's countdown pill and a banner never sit on top of each other */
.counting.hider.show ~ .banner { top: calc(66px + var(--safe-t)); }
@media (max-width: 700px) { .counting.hider.show ~ .banner { top: calc(140px + var(--safe-t)); } }
