/* Prop Hunt — UI styles. Toy-box palette: ink navy, warm yellow (you), coral red (hunters). */
:root {
  --ink: #141826;
  --panel: rgba(16, 20, 34, 0.72);
  --panel-solid: #1b2033;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f4f1ea;
  --muted: #a9adbd;
  --you: #ffcf3f;
  --you-deep: #f0a500;
  --hunt: #ff5a4e;
  --good: #4fd88a;
  --ice: #8fe3ff;
  --radius: 14px;
  --display: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--text); font-family: var(--body); user-select: none; -webkit-user-select: none; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
kbd { font-family: var(--body); font-weight: 800; font-size: 0.72em; padding: 1px 6px; border-radius: 5px; background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.18); }

/* ---------- screens */
.screen { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; z-index: 20; overflow-y: auto; }
#loading { background: radial-gradient(ellipse at 50% 30%, #262d48, var(--ink)); gap: 18px; align-content: center; }
#menu, #pause, #end { background: linear-gradient(180deg, rgba(20,24,38,0.25), rgba(20,24,38,0.75)); }
.logo { font-family: var(--display); font-size: clamp(44px, 9vw, 84px); letter-spacing: 1px; line-height: 0.9; text-align: center; color: var(--text); text-shadow: 0 4px 0 #0b0e18; }
.logo span { color: var(--you); display: inline-block; margin-left: 0.18em; transform: rotate(-4deg); }
.load-track { width: min(320px, 70vw); height: 10px; border-radius: 99px; background: rgba(255,255,255,0.1); overflow: hidden; }
#load-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--you-deep), var(--you)); transition: width .25s; }
#load-text { color: var(--muted); margin: 0; text-align: center; }

.menu-card { width: min(520px, 100%); background: var(--panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 22px; padding: 26px 24px 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.45); }
.menu-card.small { width: min(400px, 100%); text-align: center; }
.menu-card h2 { font-family: var(--display); font-weight: 400; font-size: 40px; margin: 0 0 6px; }
.menu-card h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 18px 0 8px; }
.tag { text-align: center; color: var(--muted); margin: 10px 0 4px; }
.maps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.map-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px; border-radius: var(--radius); border: 2px solid var(--line); background: rgba(255,255,255,0.04); text-align: left; transition: border-color .15s, transform .15s; }
.map-card:hover:not(:disabled) { transform: translateY(-2px); }
.map-card.active { border-color: var(--you); background: rgba(255, 207, 63, 0.1); }
.map-card.locked { opacity: .45; cursor: not-allowed; }
.map-name { font-weight: 800; }
.map-tag { font-size: 12px; color: var(--muted); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.segs { display: flex; background: rgba(255,255,255,0.06); border-radius: 12px; padding: 3px; }
.seg { flex: 1; border: 0; background: none; padding: 8px 0; border-radius: 9px; font-weight: 800; color: var(--muted); }
.seg.active { background: var(--text); color: var(--ink); }
.btn-primary { display: block; width: 100%; margin-top: 22px; border: 0; border-radius: 16px; padding: 15px; font-family: var(--display); font-size: 26px; letter-spacing: .5px; color: #2a1d00; background: linear-gradient(180deg, var(--you), var(--you-deep)); box-shadow: 0 5px 0 #a56f00, 0 10px 24px rgba(240,165,0,0.3); transition: transform .08s, box-shadow .08s; }
.btn-primary:active { transform: translateY(4px); box-shadow: 0 1px 0 #a56f00; }
.btn-ghost { display: block; width: 100%; margin-top: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: transparent; font-weight: 800; color: var(--muted); }
.howto { margin-top: 16px; color: var(--muted); font-size: 14px; }
.howto summary { cursor: pointer; font-weight: 800; color: var(--text); }
.howto ul { padding-left: 18px; line-height: 1.55; }
.howto b { color: var(--text); }
body.touch .desk-only, body:not(.touch) .touch-only { display: none; }

/* ---------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#top { position: absolute; top: calc(10px + var(--safe-t)); left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 8px 12px; }
#me { justify-self: start; min-width: 180px; }
.me-row { display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 6px; }
.badge { font-size: 11px; font-weight: 800; letter-spacing: .1em; padding: 2px 7px; border-radius: 6px; background: var(--ice); color: #06303d; }
.hp { position: relative; height: 14px; border-radius: 99px; background: rgba(255,255,255,0.1); overflow: hidden; }
#hp-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--you-deep), var(--you)); transition: width .2s; }
#hp-fill.low { background: var(--hunt); animation: pulse .6s infinite alternate; }
#hp-text { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 800; color: #1a1300; }
#clock { display: flex; flex-direction: column; align-items: center; padding: 6px 18px; }
#phase { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--you); font-weight: 800; }
body[data-phase="search"] #phase { color: var(--hunt); }
#timer { font-family: var(--display); font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.score { font-size: 11px; color: var(--muted); }
.score b { color: var(--text); }
#hunters { justify-self: end; display: grid; gap: 4px; min-width: 150px; }
.hunter-row { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; }
.hbar { height: 6px; border-radius: 99px; background: rgba(255,255,255,0.1); overflow: hidden; }
.hbar i { display: block; height: 100%; width: 100%; background: var(--hunt); transition: width .25s; }
.hunter-row.down { opacity: .4; text-decoration: line-through; }

#banner { position: absolute; top: calc(140px + var(--safe-t)); left: 50%; transform: translateX(-50%); text-align: center; background: var(--you); color: #241900; border-radius: 14px; padding: 8px 18px; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
#banner b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; }
#banner span { font-weight: 800; font-size: 13px; }

#prompt { position: absolute; left: 50%; top: calc(50% + 30px); transform: translateX(-50%); background: var(--panel); padding: 6px 12px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
#prompt b { color: var(--you); }
body.touch #prompt .desk, body:not(.touch) #prompt .mob { display: none; }
#center-msg { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); font-family: var(--display); font-size: clamp(36px, 7vw, 64px); color: var(--text); text-shadow: 0 4px 0 rgba(0,0,0,.45); white-space: nowrap; }
#center-msg.pop { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }

#feed { position: absolute; left: calc(10px + var(--safe-l)); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; max-width: min(340px, 45vw); }
.toast { background: var(--panel); border-left: 3px solid var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 13px; animation: slide .25s ease-out; transition: opacity .4s, transform .4s; }
.toast.good { border-color: var(--good); } .toast.great { border-color: var(--you); } .toast.info { border-color: var(--ice); }
.toast.out { opacity: 0; transform: translateX(-20px); }
.toast .neg { color: var(--hunt); font-weight: 800; }

#abilities { position: absolute; right: calc(14px + var(--safe-r)); bottom: calc(14px + var(--safe-b)); display: flex; gap: 8px; pointer-events: auto; }
.ability { position: relative; width: 64px; height: 64px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; overflow: hidden; touch-action: none; }
.ability svg { width: 24px; height: 24px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ab-taunt svg, .ab-jump svg { fill: var(--text); stroke: none; }
.ab-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ability kbd { position: absolute; top: 4px; right: 4px; font-size: 9px; padding: 0 4px; }
.ability .cd { position: absolute; inset: 0; background: conic-gradient(rgba(0,0,0,0.6) calc(var(--cd, 0) * 360deg), transparent 0); pointer-events: none; }
.ability .charges { position: absolute; top: 4px; left: 6px; font-size: 11px; font-weight: 800; color: var(--you); }
.ability.ready { border-color: var(--you); box-shadow: 0 0 0 2px rgba(255,207,63,.4); }
.ability.ready svg { stroke: var(--you); }
.ability.on { background: rgba(143,227,255,0.25); border-color: var(--ice); }
.ability.empty { opacity: .4; }
.ab-jump { display: none; }
body.touch .ab-jump { display: flex; }
body.touch .ability kbd { display: none; }
body.touch .ability { width: 66px; height: 66px; }
body.touch .ab-transform { width: 84px; height: 84px; border-radius: 26px; }

#btn-pause { position: absolute; top: calc(84px + var(--safe-t)); right: calc(10px + var(--safe-r)); width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); pointer-events: auto; display: grid; place-items: center; }
#btn-pause svg { width: 18px; fill: var(--text); }
body:not(.touch) #btn-pause { display: none; }

#joy { position: fixed; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.25); background: rgba(255,255,255,0.06); display: grid; place-items: center; }
#joy-knob { width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,0.4); }

#vignette { position: absolute; inset: 0; box-shadow: inset 0 0 160px 40px rgba(255, 30, 30, 0.75); opacity: 0; }
#vignette.flash { animation: hurt .5s ease-out; }

.big-score { display: flex; flex-direction: column; align-items: center; margin: 14px 0 6px; }
.big-score span { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.big-score b { font-family: var(--display); font-weight: 400; font-size: 56px; color: var(--you); line-height: 1; }
#end[data-result="lose"] h2 { color: var(--hunt); }
#end-reason { color: var(--muted); margin: 0; }
#end-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 14px; text-align: left; }
#end-stats div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 4px 0; font-size: 14px; }
#end-stats span { color: var(--muted); }

@keyframes pulse { to { opacity: .55; } }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.4); opacity: 0; } }
@keyframes slide { from { transform: translateX(-16px); opacity: 0; } }
@keyframes hurt { 0% { opacity: 1; } 100% { opacity: 0; } }

@media (max-width: 720px), (max-height: 480px) {
  #top { grid-template-columns: 1fr auto; }
  #hunters { display: none; }
  #me { min-width: 140px; padding: 6px 10px; }
  #timer { font-size: 26px; }
  #banner { top: calc(74px + var(--safe-t)); }
  #feed { top: auto; bottom: calc(100px + var(--safe-b)); transform: none; max-width: 60vw; }
  .ability { width: 56px; height: 56px; }
  .maps { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ===================================================================== v2 additions */
.menu-card.wide { width: min(760px, 100%); }
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role { display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--line); background: rgba(255,255,255,0.04); transition: border-color .15s, transform .15s; }
.role svg { grid-row: span 2; width: 48px; height: 48px; }
.role-name { font-family: var(--display); font-size: 24px; line-height: 1; }
.role-tag { font-size: 12px; color: var(--muted); }
.role:hover { transform: translateY(-2px); }
.role.active { border-color: var(--you); background: rgba(255, 207, 63, 0.1); }
.role[data-role="hunter"].active { border-color: var(--hunt); background: rgba(255, 90, 78, 0.12); }
body[data-role="hunter"] #btn-play { background: linear-gradient(180deg, #ff7a6e, #e0453a); color: #2a0703; box-shadow: 0 5px 0 #9b2a22, 0 10px 24px rgba(224,69,58,0.3); }
.tag b { color: var(--you); }

.tabs { display: flex; gap: 6px; margin: 10px 0 14px; background: rgba(255,255,255,0.06); padding: 4px; border-radius: 12px; }
.tab { flex: 1; border: 0; background: none; padding: 9px 6px; border-radius: 9px; font-weight: 800; color: var(--muted); }
.tab.active { background: var(--text); color: var(--ink); }
.tab-body { max-height: min(56vh, 460px); overflow-y: auto; padding-right: 4px; }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; line-height: 1.5; color: var(--muted); }
.steps b { color: var(--text); }
.steps li::marker { color: var(--you); font-weight: 800; }
.pill { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-weight: 800; font-size: 13px; color: #111; vertical-align: -3px; }
.pill.q { background: #ffd60a; } .pill.x { background: #ff3b30; color: #fff; }
.ctl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ctl-grid h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.ctl-grid dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; margin: 0; font-size: 14px; align-items: baseline; }
.ctl-grid dt { white-space: nowrap; font-weight: 800; }
.ctl-grid dd { margin: 0; color: var(--muted); }
.ctl-grid kbd { margin-right: 2px; }

.center-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
#compass { width: 260px; height: 30px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
#side { justify-self: end; min-width: 150px; }
#props-left { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; font-weight: 800; }
#props-left span { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
#props-left b { font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--hunt); }
#prop-pips { grid-column: span 2; display: flex; gap: 4px; }
#prop-pips i { width: 14px; height: 14px; border-radius: 4px; background: var(--you); }
#prop-pips i.found { background: rgba(255,255,255,0.15); }
.badge.wall { background: #c7a6ff; color: #2a0f52; }
#minimap { position: absolute; left: calc(12px + var(--safe-l)); bottom: calc(12px + var(--safe-b)); width: 180px; height: 180px; border-radius: 50%; pointer-events: auto; cursor: pointer; transition: width .2s, height .2s; filter: drop-shadow(0 4px 12px rgba(0,0,0,.4)); }
#minimap.big { width: 300px; height: 300px; }
#hitmarker { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; opacity: 0; pointer-events: none;
  background: linear-gradient(45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%), linear-gradient(-45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%); }
#hitmarker.show { animation: hit .35s ease-out; }
#hitmarker.hider { filter: drop-shadow(0 0 4px var(--you)); background-color: transparent; }
#hitmarker.miss { filter: hue-rotate(0deg) drop-shadow(0 0 3px var(--hunt)); }
@keyframes hit { 0% { opacity: 1; transform: scale(1.4); } 100% { opacity: 0; transform: scale(0.8); } }
.ability.filled svg { fill: var(--text); stroke: none; }
.ability.pressed { transform: scale(0.94); background: rgba(255,255,255,0.18); }
.ability.disabled { opacity: .35; }
.ab-rotL, .ab-rotR, .ab-lockRot { width: 50px; height: 50px; border-radius: 14px; align-self: flex-end; }
.ab-rotL .ab-label, .ab-rotR .ab-label, .ab-lockRot .ab-label { font-size: 9px; }
.ab-fire { width: 64px; height: 64px; }
body:not(.touch) .ab-fire { display: none; }
body.touch .ab-fire { display: flex; width: 96px; height: 96px; border-radius: 50%; border-color: rgba(255,90,78,0.6); background: rgba(255,90,78,0.25); }
body.touch .ab-fire svg { stroke: #fff; width: 36px; height: 36px; }
body:not(.touch) .ab-rotL, body:not(.touch) .ab-rotR, body:not(.touch) .ab-lockRot { width: 46px; height: 46px; }
.prompt-i, #prompt i { color: var(--muted); font-style: normal; font-size: 12px; }
#abilities { flex-wrap: wrap; justify-content: flex-end; max-width: min(620px, 70vw); }
body.touch #minimap { left: auto; right: calc(10px + var(--safe-r)); bottom: auto; top: 132px; width: 120px; height: 120px; }
body.touch #minimap.big { width: 220px; height: 220px; }

@media (max-width: 720px), (max-height: 480px) {
  #compass { width: 180px; height: 24px; }
  .roles { grid-template-columns: 1fr 1fr; }
  .role { grid-template-columns: 36px 1fr; padding: 10px; }
  .role svg { width: 36px; height: 36px; }
  .role-name { font-size: 20px; }
  .ctl-grid { grid-template-columns: 1fr; }
  body.touch #minimap { top: 104px; width: 104px; height: 104px; }
  .ab-rotL, .ab-rotR, .ab-lockRot { width: 44px; height: 44px; }
  #side { display: none; }
}

/* rotation tools sit in their own small row above the ability bar */
#rot-tools { position: absolute; right: calc(14px + var(--safe-r)); bottom: calc(88px + var(--safe-b)); display: flex; gap: 6px; pointer-events: auto; }
body.touch #rot-tools { bottom: calc(100px + var(--safe-b)); }
#abilities { flex-wrap: nowrap; }
body.touch #btn-pause { top: calc(8px + env(safe-area-inset-top, 0px)); left: 50%; right: auto; transform: translateX(-50%); width: 36px; height: 36px; }
body.touch #minimap { left: calc(10px + var(--safe-l)); right: auto; top: 78px; bottom: auto; width: 104px; height: 104px; }
body.touch #minimap.big { width: 200px; height: 200px; }
@media (max-width: 900px), (max-height: 480px) {
  body.touch .ability { width: 54px; height: 54px; border-radius: 15px; }
  body.touch .ab-transform { width: 66px; height: 66px; border-radius: 20px; }
  body.touch .ab-fire { width: 84px; height: 84px; }
  body.touch #rot-tools { bottom: calc(80px + var(--safe-b)); }
  body.touch #rot-tools .ability { width: 44px; height: 44px; }
  #banner { top: calc(64px + var(--safe-t)); padding: 5px 14px; }
  #banner b { font-size: 17px; }
  #banner span { font-size: 11px; }
  #me { min-width: 0; }
  .me-row { font-size: 13px; }
}

/* ===================================================================== v3 additions */
body.lang-ta { --display: 'Coiny', 'Lilita One', system-ui, sans-serif; --body: 'Mukta Malar', 'Nunito', system-ui, sans-serif; }
body.lang-ta .logo { font-family: 'Lilita One', system-ui, sans-serif; }
.logo-ta { font-family: 'Coiny', 'Mukta Malar', sans-serif; text-align: center; color: var(--you); font-size: clamp(18px, 3.4vw, 26px); margin-top: 4px; text-shadow: 0 2px 0 #0b0e18; }
.lang-row { display: flex; justify-content: center; gap: 6px; margin-bottom: 10px; }
.lang-btn { border: 1px solid var(--line); background: rgba(255,255,255,0.05); border-radius: 99px; padding: 6px 16px; font-weight: 800; color: var(--muted); }
.lang-btn[data-lang="ta"] { font-family: 'Mukta Malar', sans-serif; }
.lang-btn.active { background: var(--text); color: var(--ink); border-color: var(--text); }
body.lang-ta .steps, body.lang-ta .ctl-grid dd { line-height: 1.7; }

#fader { position: fixed; inset: 0; background: #07080d; opacity: 0; pointer-events: none; transition: opacity .35s ease; z-index: 50; }
#fader.on { opacity: 1; }

/* crosshair: four lines + dot; the gap follows weapon spread */
#crosshair { --gap: 5px; position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
#crosshair i { position: absolute; background: rgba(255,255,255,0.95); box-shadow: 0 0 0 1px rgba(0,0,0,0.45); border-radius: 1px; transition: transform .08s linear, background .12s; }
#crosshair .ch-dot { width: 4px; height: 4px; left: -2px; top: -2px; border-radius: 50%; }
#crosshair .ch-t, #crosshair .ch-b { width: 2px; height: 9px; left: -1px; }
#crosshair .ch-l, #crosshair .ch-r { width: 9px; height: 2px; top: -1px; }
#crosshair .ch-t { top: calc(-9px - var(--gap)); } #crosshair .ch-b { top: var(--gap); }
#crosshair .ch-l { left: calc(-9px - var(--gap)); } #crosshair .ch-r { left: var(--gap); }
body[data-role="prop"] #crosshair .ch-t, body[data-role="prop"] #crosshair .ch-b, body[data-role="prop"] #crosshair .ch-l, body[data-role="prop"] #crosshair .ch-r { display: none; }
body[data-role="prop"] #crosshair .ch-dot { width: 10px; height: 10px; left: -5px; top: -5px; background: transparent; border: 2px solid rgba(255,255,255,0.9); }
#crosshair.has-target .ch-dot { border-color: var(--you) !important; transform: scale(1.6); }
#crosshair.hunter i { background: #fff; }
#crosshair.hunter.aiming i:not(.ch-dot) { background: var(--hunt); }

/* blindfold: eyelids close, muffled countdown, then a blink awake */
#blindfold { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#blindfold .lid { position: absolute; left: -10%; right: -10%; height: 55%; background: radial-gradient(ellipse at 50% 100%, #1a0f12 0%, #050304 70%); transition: transform 1.1s cubic-bezier(.6,.05,.3,1); }
#blindfold .lid.top { top: 0; border-radius: 0 0 50% 50% / 0 0 30% 30%; transform: translateY(-105%); }
#blindfold .lid.bottom { bottom: 0; border-radius: 50% 50% 0 0 / 30% 30% 0 0; transform: translateY(105%); background: radial-gradient(ellipse at 50% 0%, #1a0f12 0%, #050304 70%); }
#blindfold.closing .lid, #blindfold.shut .lid { transform: translateY(0); }
#blindfold .blind-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 6px; opacity: 0; transition: opacity .6s .9s; }
#blindfold.closing .blind-text { opacity: 1; }
#blindfold .blind-text b { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 5.5vw, 52px); }
#blindfold .blind-text span { color: var(--muted); animation: breathe 2.4s ease-in-out infinite; }
#blindfold .blind-text em { font-style: normal; font-family: var(--display); font-size: 72px; color: var(--hunt); }
#blindfold.opening .lid { animation: blink-open 1.5s forwards; }
#blindfold.opening .lid.top { --dir: -1; } #blindfold.opening .lid.bottom { --dir: 1; }
#blindfold.opening .blind-text { opacity: 0; transition: opacity .2s; }
@keyframes blink-open {
  0% { transform: translateY(0); } 30% { transform: translateY(calc(var(--dir) * 60%)); }
  45% { transform: translateY(calc(var(--dir) * 12%)); } 100% { transform: translateY(calc(var(--dir) * 105%)); }
}
@keyframes breathe { 50% { opacity: .45; } }
canvas#game.waking { animation: wake-blur 2.2s ease-out; }
@keyframes wake-blur { 0% { filter: blur(10px) brightness(.6); } 100% { filter: blur(0) brightness(1); } }

.ab-aim, .ab-view { display: none; }
body.touch .ab-aim, body.touch .ab-view { display: flex; }
body:not(.touch) .ab-view { display: flex; width: 46px; height: 46px; align-self: flex-end; }
.ability.on { background: rgba(143,227,255,0.25); border-color: var(--ice); }
@media (prefers-reduced-motion: reduce) { #blindfold .lid { transition: none; } }

/* ===================================================================== v4: menu, settings, online, touch pad */
.menu-card { max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.menu-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pill-group { display: flex; gap: 4px; background: rgba(255,255,255,0.05); padding: 3px; border-radius: 99px; border: 1px solid var(--line); }
.pill-group .lang-btn { border: 0; background: none; }
.lang-row { display: none; }
.dev-btn { display: flex; align-items: center; gap: 6px; border: 0; background: none; border-radius: 99px; padding: 6px 12px; font-weight: 800; color: var(--muted); }
.dev-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dev-btn.active, .pill-group .lang-btn.active { background: var(--text); color: var(--ink); }

/* Tamil words are long: grids must be allowed to shrink, text to wrap */
.roles, .maps, .row, .teams, .rs-row, .set-grid, .eb-cols { grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)) !important; }
.maps { --cols: 3; }
.role, .map-card, .seg, .mode-tab { min-width: 0; }
.role-name, .role-tag, .map-name, .map-tag { overflow-wrap: anywhere; }
body.lang-ta .role-name { font-size: 19px; line-height: 1.15; }
body.lang-ta .role-tag, body.lang-ta .map-tag { font-size: 11.5px; line-height: 1.35; }
body.lang-ta .map-name { font-size: 14px; }
body.lang-ta .seg { font-size: 13px; padding: 8px 2px; }
body.lang-ta .btn-primary { font-size: 22px; }
body.lang-ta .menu-card h3 { letter-spacing: .04em; }

.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0 4px; }
.mode-tab { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 10px 6px; border-radius: 16px; border: 2px solid var(--line); background: rgba(255,255,255,0.04); }
.mode-tab b { font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.1; }
.mode-tab span { font-size: 12px; color: var(--muted); font-weight: 700; }
.mode-tab.active { border-color: var(--you); background: rgba(255,207,63,0.12); }
.mode-tab[data-mode="online"].active { border-color: #6cc4ff; background: rgba(108,196,255,0.12); }
.mode-panel { animation: slide .25s ease-out; }
.field { width: 100%; font: inherit; font-weight: 700; color: var(--text); background: rgba(0,0,0,0.25); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none; user-select: text; -webkit-user-select: text; }
.field:focus { border-color: var(--you); box-shadow: 0 0 0 3px rgba(255,207,63,0.2); }
.field.code { font-family: var(--display); font-size: 24px; letter-spacing: .3em; text-transform: uppercase; text-align: center; padding: 8px 10px; }
.btn-secondary { border: 0; border-radius: 12px; padding: 10px 18px; font-weight: 800; color: #06263a; background: linear-gradient(180deg, #8fd4ff, #4ba8e8); box-shadow: 0 3px 0 #2c74a8; }
.btn-secondary:active { transform: translateY(2px); box-shadow: 0 1px 0 #2c74a8; }
.btn-primary:disabled, .btn-secondary:disabled { opacity: .55; }
#panel-online .btn-primary { margin-top: 12px; }
.or-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 700; margin: 16px 0 8px; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.server-box { margin-top: 12px; color: var(--muted); font-size: 13px; }
.server-box summary { cursor: pointer; font-weight: 800; }
.server-box .field { margin-top: 8px; font-size: 14px; }
.help { color: var(--muted); font-size: 12.5px; line-height: 1.45; margin: 6px 0 0; }
.help.center, .center { text-align: center; }
.online-msg { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 700; }
.online-msg.err { background: rgba(255,90,78,0.15); color: #ffb3ab; }
.online-msg.info { background: rgba(108,196,255,0.12); color: #bfe6ff; }
.menu-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.menu-bottom .btn-ghost { display: flex; align-items: center; justify-content: center; gap: 8px; }
.menu-bottom svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
body[data-role="hunter"] #btn-create, body[data-role="hunter"] #btn-start { background: linear-gradient(180deg, var(--you), var(--you-deep)); color: #2a1d00; box-shadow: 0 5px 0 #a56f00; }

/* ---------- settings */
.settings-card { width: min(820px, 100%); }
.set-grid { display: grid; gap: 4px 26px; }
.set-label { font-size: 13px; font-weight: 800; margin: 14px 0 6px; }
.toggle, .slider { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin-top: 12px; font-weight: 700; font-size: 14px; }
.slider { grid-template-columns: minmax(0, 1fr) minmax(110px, 1.2fr) 52px; }
.slider output { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.slider input { width: 100%; accent-color: var(--you); }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle i { width: 44px; height: 26px; border-radius: 99px; background: rgba(255,255,255,0.15); position: relative; transition: background .15s; }
.toggle i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked + i { background: var(--you-deep); }
.toggle input:checked + i::after { transform: translateX(18px); }
.toggle { cursor: pointer; }

/* ---------- lobby */
.lobby-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; width: min(1000px, 100%); align-items: start; }
.lobby-card, .chat-card { width: 100%; }
.lobby-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.room-code { display: flex; align-items: baseline; gap: 8px; margin-right: 4px; }
.room-code span { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 800; }
.room-code b { font-family: var(--display); font-weight: 400; font-size: 38px; letter-spacing: .12em; color: var(--you); line-height: 1; user-select: text; -webkit-user-select: text; }
.chip { border: 1px solid var(--line); background: rgba(255,255,255,0.06); border-radius: 99px; padding: 6px 12px; font-weight: 800; font-size: 13px; color: var(--text); }
.chip:active { transform: scale(.96); }
.chip.danger { margin-left: auto; color: #ffb3ab; border-color: rgba(255,90,78,0.4); }
.muted { color: var(--muted); font-size: 13px; font-weight: 700; }
.conn { font-size: 12px; font-weight: 800; color: #ffd27a; animation: pulse .7s infinite alternate; }
.teams { display: grid; gap: 10px; margin-top: 14px; }
.team { border-radius: 16px; border: 2px solid var(--line); background: rgba(255,255,255,0.03); padding: 10px; min-height: 120px; }
.team.hiders { border-color: rgba(255,207,63,0.45); }
.team.seekers { border-color: rgba(255,90,78,0.45); }
.team-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.team-head b { font-family: var(--display); font-weight: 400; font-size: 22px; }
.team.hiders .team-head b { color: var(--you); } .team.seekers .team-head b { color: var(--hunt); }
.team ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pl { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 10px; background: rgba(255,255,255,0.05); font-weight: 800; font-size: 14px; min-width: 0; }
.pl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pl.me { outline: 2px solid rgba(255,255,255,0.35); }
.pl.away { opacity: .5; }
.pl.bot { color: var(--muted); background: transparent; border: 1px dashed var(--line); font-weight: 700; }
.pl .badge { font-size: 10px; letter-spacing: .04em; padding: 1px 6px; }
.badge.host { background: var(--you); color: #2a1d00; } .badge.you { background: #6cc4ff; color: #06263a; } .badge.away { background: #555; color: #ddd; }
.pl .ping { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.mini { border: 0; background: rgba(255,255,255,0.08); border-radius: 8px; width: 28px; height: 26px; font-size: 13px; }
.mini.kick { color: #ffb3ab; }
.room-settings { margin-top: 6px; }
.rs-row { display: grid; gap: 12px; }
.segs.small .seg { padding: 6px 0; font-size: 13px; }
.segs.locked { opacity: .55; pointer-events: none; }
#btn-start { margin-top: 14px; }
.chat-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; max-height: min(640px, calc(100dvh - 24px)); }
.chat-log { flex: 1; min-height: 120px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 1.35; user-select: text; -webkit-user-select: text; }
.chat-log .line { overflow-wrap: anywhere; }
.chat-log .who { color: #cfd3e0; } .chat-log .who.me { color: #fff; }
.chat-log .who.hiders { color: var(--you); } .chat-log .who.seekers { color: #ff8a80; }
.chat-log .sys { color: var(--muted); font-style: italic; font-size: 12.5px; }
.quick-row { display: flex; flex-wrap: wrap; gap: 5px; }
.chip.quick { padding: 4px 9px; font-size: 12px; }
.chat-form { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; }
#lobby-chat-form { grid-template-columns: minmax(0, 1fr) auto; }
.chat-form .field { padding: 9px 11px; font-size: 14px; }
.talk-row { display: flex; align-items: center; gap: 10px; }
.talk-btn { width: 54px; height: 54px; flex: none; border-radius: 50%; border: 2px solid rgba(108,196,255,0.5); background: radial-gradient(circle at 35% 30%, rgba(108,196,255,0.4), rgba(20,40,70,0.7)); display: grid; place-items: center; touch-action: none; }
.talk-btn svg, .tool-btn svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.talk-btn.on, .tool-btn.on { transform: scale(.94); }
.talk-btn.live, #btn-talk.live { border-color: var(--good); box-shadow: 0 0 0 4px rgba(79,216,138,0.3), 0 0 22px rgba(79,216,138,0.6); }

/* ---------- HUD extras */
.online-only { display: none !important; }
body.online .online-only { display: flex !important; }
#hud-tools { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); right: calc(10px + var(--safe-r)); display: flex; gap: 8px; pointer-events: auto; z-index: 3; }
body:not(.touch) #hud-tools { top: auto; right: auto; bottom: calc(14px + var(--safe-b)); left: calc(204px + var(--safe-l)); }
.tool-btn { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; touch-action: none; }
body:not(.touch) #btn-talk { display: none !important; }
#speakers { position: absolute; left: calc(12px + var(--safe-l)); top: calc(92px + var(--safe-t)); display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.spk { display: flex; align-items: center; gap: 6px; background: rgba(20,60,40,0.75); border: 1px solid rgba(79,216,138,0.5); border-radius: 99px; padding: 3px 10px 3px 6px; font-weight: 800; font-size: 13px; animation: slide .2s ease-out; }
.spk i { width: 10px; height: 10px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); animation: pulse .35s infinite alternate; }
#hud-chat { position: absolute; left: calc(12px + var(--safe-l)); bottom: calc(205px + var(--safe-b)); width: min(380px, 48vw); flex-direction: column; gap: 6px; pointer-events: none; }
#hud-chat.open { pointer-events: auto; }
#hud-chat-log { max-height: 170px; min-height: 0; overflow: hidden; text-shadow: 0 1px 2px #000; font-size: 13.5px; }
#hud-chat.open #hud-chat-log { overflow-y: auto; background: var(--panel); border-radius: 12px; padding: 8px; }
#hud-chat-log .line { transition: opacity 1s; }
#hud-chat-log .line.old { opacity: 0; }
#hud-chat.open #hud-chat-log .line.old { opacity: .8; }
#hud-chat-box { display: flex; flex-direction: column; gap: 6px; background: var(--panel); padding: 8px; border-radius: 14px; border: 1px solid var(--line); }
#chat-scope.team { background: rgba(255,207,63,0.2); border-color: rgba(255,207,63,0.5); }
body.touch #hud-chat { bottom: auto; top: 192px; width: min(360px, 44vw); }
body.touch #hud-chat.open { top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(520px, 92vw); z-index: 30; }
#spectate { position: absolute; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--panel); border: 1px solid var(--line); padding: 8px 18px; border-radius: 14px; font-size: 15px; text-align: center; }
#spectate i { font-style: normal; font-size: 12px; color: var(--muted); }
body.spectator #abilities, body.spectator #rot-tools, body.spectator #touch-left, body.spectator #crosshair, body.spectator #me, body.spectator #prompt { display: none !important; }
#lock-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8,10,18,0.45); pointer-events: auto; cursor: pointer; z-index: 4; }
#lock-overlay.soft { background: transparent; place-items: end center; padding-bottom: 120px; pointer-events: none; }
#lock-overlay.soft .lock-card { pointer-events: auto; }
.lock-card { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 18px 26px; max-width: min(460px, 90vw); }
.lock-card svg { width: 36px; height: 36px; fill: none; stroke: var(--you); stroke-width: 2; stroke-linecap: round; }
.lock-card b { font-family: var(--display); font-weight: 400; font-size: 30px; }
.lock-card span, .lock-card p { color: var(--muted); font-size: 13.5px; margin: 0; }
#fps { position: absolute; top: calc(6px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%) translateY(118px); font-size: 11px; font-weight: 800; color: var(--good); background: rgba(0,0,0,0.45); padding: 2px 8px; border-radius: 99px; pointer-events: none; font-variant-numeric: tabular-nums; }
body.reconnecting #hud::after { content: '⚠ ' attr(data-reconnect); }
#rotate-hint { position: fixed; inset: 0; z-index: 60; background: radial-gradient(ellipse at 50% 40%, #262d48, var(--ink)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px; }
#rotate-hint b { font-family: var(--display); font-weight: 400; font-size: 30px; }
#rotate-hint span { color: var(--muted); }
.phone-icon { width: 60px; height: 100px; border: 5px solid var(--text); border-radius: 14px; animation: turn-phone 1.8s ease-in-out infinite; margin-bottom: 14px; }
@keyframes turn-phone { 0%, 25% { transform: rotate(0); } 55%, 100% { transform: rotate(-90deg); } }
#joy.sprint { border-color: var(--you); box-shadow: 0 0 18px rgba(255,207,63,0.45); }

/* ---------- end: online scoreboard */
#end-board h3 { margin: 16px 0 6px; }
.eb-cols { display: grid; gap: 10px; text-align: left; }
.eb-col h4 { margin: 0 0 4px; font-family: var(--display); font-weight: 400; font-size: 18px; }
.eb-col.hiders h4 { color: var(--you); } .eb-col.seekers h4 { color: var(--hunt); }
.eb-row { display: flex; justify-content: space-between; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.eb-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eb-row.me { font-weight: 800; color: #fff; }
.eb-row.out span { text-decoration: line-through; opacity: .6; }
#end .menu-card.small { width: min(460px, 100%); }

/* ---------- mobile: game-style round buttons on both thumbs */
body.touch #abilities.pad { --u: calc(1px * var(--bs, 1)); position: absolute; right: calc(16px + var(--safe-r)); bottom: calc(14px + var(--safe-b)); width: calc(250 * var(--u)); height: calc(230 * var(--u)); display: block; max-width: none; opacity: var(--bo, .9); }
body.touch .pad .ability, body.touch #touch-left .ability, body.touch #rot-tools .ability {
  position: absolute; width: calc(62 * var(--u, 1px)); height: calc(62 * var(--u, 1px)); border-radius: 50%; gap: 0;
  border: 2px solid rgba(255,255,255,0.35);
  background: radial-gradient(circle at 35% 28%, rgba(255,255,255,0.32), rgba(255,255,255,0.06) 45%, rgba(10,14,26,0.6) 100%);
  box-shadow: inset 0 -4px 10px rgba(0,0,0,0.35), 0 4px 14px rgba(0,0,0,0.35);
  transition: transform .08s, box-shadow .08s;
}
body.touch .pad .ability svg, body.touch #touch-left .ability svg { width: 40%; height: 40%; }
body.touch .pad .ab-label, body.touch #touch-left .ab-label { font-size: calc(9 * var(--u, 1px)); margin-top: 1px; }
body.touch .ability.pressed { transform: scale(.9); box-shadow: inset 0 3px 10px rgba(0,0,0,0.45), 0 1px 4px rgba(0,0,0,0.35); }
body.touch .ability .cd { border-radius: 50%; }
body.touch .pad .ability.main, body.touch #touch-left .ability.main { width: calc(96 * var(--u, 1px)); height: calc(96 * var(--u, 1px)); }
body.touch .pad .ab-fire, body.touch #touch-left .ab-fire { border-color: rgba(255,120,110,0.85); background: radial-gradient(circle at 35% 28%, rgba(255,190,180,0.6), rgba(255,90,78,0.55) 45%, rgba(110,20,14,0.8) 100%); }
body.touch .pad .ab-fire svg, body.touch #touch-left .ab-fire svg { stroke: #fff; width: 46%; height: 46%; }
body.touch .pad .ab-transform, body.touch #touch-left .ab-transform { border-color: rgba(255,207,63,0.85); background: radial-gradient(circle at 35% 28%, rgba(255,235,160,0.6), rgba(255,190,40,0.5) 45%, rgba(110,70,0,0.8) 100%); }
body.touch .pad .ab-transform svg, body.touch #touch-left .ab-transform svg { stroke: #fff; }
body.touch .ability.ready { box-shadow: 0 0 0 4px rgba(255,207,63,0.45), 0 0 24px rgba(255,207,63,0.55); }
body.touch .ability kbd { display: none; }
/* hunter: fire in the corner, jump to its left, aim above, view between */
body.touch .pad.hunter .ab-fire { right: 0; bottom: 0; }
body.touch .pad.hunter .ab-jump { right: calc(110 * var(--u)); bottom: calc(4 * var(--u)); display: flex; }
body.touch .pad.hunter .ab-aim { right: calc(16 * var(--u)); bottom: calc(110 * var(--u)); display: flex; }
body.touch .pad.hunter .ab-view { right: calc(96 * var(--u)); bottom: calc(86 * var(--u)); width: calc(50 * var(--u)); height: calc(50 * var(--u)); display: flex; }
/* prop: copy in the corner; jump, freeze, taunt, decoy around it */
body.touch .pad.prop .ab-transform { right: 0; bottom: 0; }
body.touch .pad.prop .ab-jump { right: calc(110 * var(--u)); bottom: calc(4 * var(--u)); display: flex; }
body.touch .pad.prop .ab-freeze { right: calc(16 * var(--u)); bottom: calc(110 * var(--u)); }
body.touch .pad.prop .ab-taunt { right: calc(96 * var(--u)); bottom: calc(86 * var(--u)); width: calc(54 * var(--u)); height: calc(54 * var(--u)); }
body.touch .pad.prop .ab-decoy { right: calc(178 * var(--u)); bottom: calc(62 * var(--u)); width: calc(54 * var(--u)); height: calc(54 * var(--u)); }
body.touch #rot-tools { --u: calc(1px * var(--bs, 1)); right: calc(16px + var(--safe-r)); bottom: calc(14px + var(--safe-b) + 236 * var(--u)); opacity: var(--bo, .9); }
body.touch #rot-tools .ability { position: static; width: calc(44 * var(--u)); height: calc(44 * var(--u)); }
body.touch #touch-left { --u: calc(1px * var(--bs, 1)); position: absolute; left: calc(20px + var(--safe-l)); top: 40%; width: calc(96 * var(--u)); height: calc(96 * var(--u)); pointer-events: auto; opacity: var(--bo, .9); }
body.touch #touch-left .ability { left: 0; top: 0; }
body:not(.touch) #touch-left { display: none; }
body.touch #hud-tools { gap: 6px; }
body.touch #btn-pause { position: static; transform: none; width: 44px; height: 44px; border-radius: 14px; }
body.touch #hud-tools #btn-pause { display: grid; }
body.touch #side { margin-right: 160px; }
@media (max-height: 430px) {
  body.touch #abilities.pad { --u: calc(0.82px * var(--bs, 1)); }
  body.touch #rot-tools { --u: calc(0.82px * var(--bs, 1)); }
  body.touch #touch-left { --u: calc(0.82px * var(--bs, 1)); top: 36%; }
}

/* ---------- narrow screens */
@media (max-width: 860px) {
  .lobby-wrap { grid-template-columns: 1fr; }
  .chat-card { max-height: 360px; }
}
@media (max-width: 560px) {
  .maps { --cols: 1; }
  .set-grid { --cols: 1; }
  .room-code b { font-size: 30px; }
  .menu-card { padding: 20px 16px 16px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .menu-card { padding: 16px 18px 14px; }
  .logo { font-size: 44px; }
  .tag { display: none; }
}

.field.code::placeholder { letter-spacing: normal; font-family: var(--body); font-size: 16px; }

/* phone HUD: keep the clock centred, tools top-right, minimap under the tools, left fire clear of it */
body.touch #top { grid-template-columns: 1fr auto 1fr !important; }
body.touch #minimap { left: calc(10px + var(--safe-l)) !important; right: auto !important; top: calc(70px + env(safe-area-inset-top, 0px)) !important; }
body.touch #touch-left { top: 50%; }
body.touch #speakers { top: auto; bottom: calc(14px + var(--safe-b)); left: 50%; transform: translateX(-50%); flex-direction: row; }
body.touch #banner { top: calc(112px + var(--safe-t)); }
body.touch #hud-chat { top: calc(74px + var(--safe-t)); left: calc(126px + var(--safe-l)); width: min(300px, 34vw); }

/* ---------- hit feedback */
.dmg-pop { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-family: var(--display); font-size: 34px; color: var(--you); text-shadow: 0 2px 0 #000, 0 0 12px rgba(255,207,63,0.6); pointer-events: none; animation: dmg .9s ease-out forwards; }
@keyframes dmg { 0% { transform: translate(-50%, -50%) scale(.6); opacity: 1; } 20% { transform: translate(-50%, -70%) scale(1.3); } 100% { transform: translate(-50%, -150%) scale(1); opacity: 0; } }
#hitmarker.hider { width: 40px; height: 40px; margin: -20px 0 0 -20px; background: linear-gradient(45deg, transparent 44%, var(--you) 44%, var(--you) 56%, transparent 56%), linear-gradient(-45deg, transparent 44%, var(--you) 44%, var(--you) 56%, transparent 56%); }
.ability.pulse { animation: ab-pulse .6s ease-in-out infinite alternate; border-color: var(--you); }
@keyframes ab-pulse { from { box-shadow: 0 0 0 2px rgba(255,207,63,.4); } to { box-shadow: 0 0 0 6px rgba(255,207,63,.9), 0 0 24px rgba(255,207,63,.8); transform: scale(1.06); } }

.mute-btn { border: 1px solid var(--line); background: rgba(255,255,255,0.05); border-radius: 99px; width: 40px; height: 36px; font-size: 16px; }
.mute-btn.on, #btn-mute.on { background: rgba(255,90,78,0.2); border-color: rgba(255,90,78,0.5); }
#btn-mute { font-size: 17px; }

/* ---------- reveal tour + scoreboard */
body.revealing #top, body.revealing #abilities, body.revealing #rot-tools, body.revealing #crosshair, body.revealing #minimap, body.revealing #compass, body.revealing #hud-tools, body.revealing #prompt, body.revealing #banner, body.revealing #feed { display: none !important; }
#reveal { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 10px; padding-bottom: calc(40px + var(--safe-b)); pointer-events: none; }
.reveal-card { display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 12px 28px; text-align: center; }
.reveal-card.pop { animation: pop .4s cubic-bezier(.2,1.6,.4,1); }
.reveal-card span { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 800; }
.reveal-card b { font-family: var(--display); font-weight: 400; font-size: 34px; color: var(--you); line-height: 1.1; }
.reveal-card i { font-style: normal; font-weight: 800; font-size: 16px; }
#reveal small { color: var(--muted); font-weight: 700; }
#scoreboard { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(720px, 92vw); background: rgba(16,20,34,0.92); border: 1px solid var(--line); border-radius: 18px; padding: 14px; z-index: 5; }
.sb-cols { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; }
.sb-col h4 { margin: 0 0 6px; font-family: var(--display); font-weight: 400; font-size: 20px; }
.sb-col.hiders h4 { color: var(--you); } .sb-col.seekers h4 { color: var(--hunt); }
.sb-row { display: grid; grid-template-columns: minmax(0,1fr) auto 56px 56px; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 8px; font-size: 14px; font-weight: 700; }
.sb-row:nth-child(odd) { background: rgba(255,255,255,0.05); }
.sb-row.me { outline: 1px solid rgba(255,255,255,0.35); }
.sb-row.out span { text-decoration: line-through; opacity: .6; }
.sb-row em { font-style: normal; font-size: 11px; color: var(--hunt); }
.sb-row i { font-style: normal; font-size: 11px; color: var(--muted); text-align: right; }
.sb-row b { text-align: right; font-variant-numeric: tabular-nums; }
.sb-foot { margin-top: 8px; text-align: center; color: var(--muted); font-size: 13px; font-weight: 800; }
body.touch #btn-scores { font-size: 18px; }

body.ghost #abilities { display: flex !important; }
body.touch.ghost #abilities.pad { display: block !important; }
body.ghost .ability:not(.ab-transform):not(.ab-jump) { display: none !important; }
body.ghost #crosshair { display: block !important; }
body.ghost canvas#game { filter: saturate(.55) contrast(1.05); }

/* gadget buttons */
body[data-mode="tag"] .ab-fire, body[data-mode="tag"] .ab-aim, body[data-mode="tag"] #crosshair .ch-t, body[data-mode="tag"] #crosshair .ch-b, body[data-mode="tag"] #crosshair .ch-l, body[data-mode="tag"] #crosshair .ch-r { display: none !important; }
.ab-scan svg, .ab-shake svg, .ab-swap svg, .ab-shrink svg { stroke: #8fe3ff; }
body:not(.touch) .ab-scan, body:not(.touch) .ab-shake, body:not(.touch) .ab-swap, body:not(.touch) .ab-shrink { width: 56px; height: 56px; }
body.touch .pad.hunter .ab-scan { right: calc(190 * var(--u)); bottom: calc(60 * var(--u)); width: calc(50 * var(--u)); height: calc(50 * var(--u)); display: flex; }
body.touch .pad.hunter .ab-shake { right: calc(104 * var(--u)); bottom: calc(150 * var(--u)); width: calc(50 * var(--u)); height: calc(50 * var(--u)); display: flex; }
body.touch .pad.prop .ab-swap { right: calc(100 * var(--u)); bottom: calc(150 * var(--u)); width: calc(50 * var(--u)); height: calc(50 * var(--u)); }
body.touch .pad.prop .ab-shrink { right: calc(180 * var(--u)); bottom: calc(120 * var(--u)); width: calc(50 * var(--u)); height: calc(50 * var(--u)); }
body.touch #abilities.pad { height: calc(250 * var(--u)); }
#mode-pick { margin-bottom: 4px; }

/* record-your-own taunt (lobby) */
.taunt-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.taunt-row .btn-secondary.small { padding: 6px 12px; font-size: 13px; }
#btn-rec-taunt.rec { border-color: #ff5a4e; color: #ff5a4e; animation: recBlink 0.8s infinite; }
@keyframes recBlink { 50% { opacity: 0.5; } }
.badge.taunt { opacity: 0.9; } .badge.taunt.off { opacity: 0.35; text-decoration: line-through; }
.mini.mute-taunt.on { background: rgba(255,90,78,0.3); }

/* ---------- accounts, profile, locker, leaderboard (v5) ---------- */
.acct-strip { display: flex; gap: 8px; margin: 14px 0 0; align-items: stretch; }
.acct-btn { flex: 1; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,0.05); color: var(--text); text-align: left; position: relative; overflow: hidden; }
.acct-btn:hover { background: rgba(255,255,255,0.09); }
.acct-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,0.1); font-size: 18px; flex: none; }
.acct-avatar.lv { background: linear-gradient(135deg, #ffc83d, #ff7a3d); color: #2a1600; font-weight: 900; font-size: 15px; }
.acct-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.acct-text b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-text small { color: var(--muted); font-size: 12px; }
.xp-track { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,0.08); display: block; }
.xp-track > i { display: block; height: 100%; background: linear-gradient(90deg, #ffc83d, #ff7a3d); transition: width 0.4s; }
.xp-track.big { position: relative; height: 10px; border-radius: 6px; overflow: hidden; margin: 6px 0; }
.btn-ghost.small { width: auto; margin: 0; padding: 8px 14px; font-size: 13px; white-space: nowrap; }
.acct-card .lbl { display: block; text-align: left; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 12px 0 4px; }
.acct-card .field { width: 100%; }
.acct-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 8px; }
.acct-tab, .lb-tab { padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-weight: 800; }
.acct-tab.active, .lb-tab.active { background: var(--accent, #ffc83d); color: #1a1200; border-color: transparent; }
.online-msg[data-kind="err"] { background: rgba(255,90,78,0.15); color: #ffb3ab; }
.online-msg[data-kind="info"] { background: rgba(108,196,255,0.12); color: #bfe6ff; }
.prof-head { display: flex; align-items: center; gap: 14px; }
.prof-avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 900; background: linear-gradient(135deg, #ffc83d, #ff7a3d); color: #2a1600; flex: none; }
.prof-main { flex: 1; min-width: 0; } .prof-main h2 { margin: 0; }
.prof-level { display: flex; flex-direction: column; } .prof-level small { color: var(--muted); font-size: 12px; }
.prof-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; margin: 14px 0 6px; }
.prof-stats div { background: rgba(255,255,255,0.05); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; }
.prof-stats span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; } .prof-stats b { font-size: 18px; }
.daily { display: flex; flex-direction: column; gap: 6px; }
.dc { display: grid; grid-template-columns: 1fr 120px 52px; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,0.05); }
.dc.done { background: rgba(80,200,120,0.14); } .dc.done .dc-n { color: #7fe3a3; }
.dc-text { display: flex; flex-direction: column; } .dc-text small { color: #ffc83d; font-size: 12px; }
.dc-bar { height: 8px; border-radius: 5px; background: rgba(255,255,255,0.08); overflow: hidden; } .dc-bar i { display: block; height: 100%; background: #6cc4ff; }
.dc-n { text-align: right; font-weight: 800; font-size: 13px; }
.locker { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.lk-row h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.lk-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.lk-opt { width: 78px; padding: 8px 4px; border-radius: 12px; border: 2px solid var(--line); background: rgba(255,255,255,0.04); color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; }
.lk-opt.on { border-color: #ffc83d; background: rgba(255,200,61,0.12); }
.lk-opt.locked { opacity: 0.45; } .lk-opt.locked i { position: absolute; top: 4px; right: 6px; font-size: 10px; font-style: normal; color: #ffc83d; }
.lk-opt small { font-size: 11px; line-height: 1.1; text-align: center; }
.lk-ico { font-size: 24px; height: 30px; display: grid; place-items: center; }
.lk-ico.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.3); font-size: 14px; }
.lb-card { width: min(520px, 100%); }
.lb-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 8px 0; }
.lb-table { display: flex; flex-direction: column; gap: 4px; max-height: 46vh; overflow: auto; }
.lb-row { display: grid; grid-template-columns: 40px 1fr 40px 50px 70px; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,0.05); font-size: 14px; }
.lb-row.head { background: transparent; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.lb-row.me { background: rgba(255,200,61,0.16); } .lb-row b { text-align: right; } .lb-row span:nth-child(3), .lb-row span:nth-child(4) { text-align: center; }
#end-progress { margin: 10px 0; padding: 10px 12px; border-radius: 12px; background: rgba(255,200,61,0.1); text-align: left; }
.pg-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; } .pg-row b { font-size: 20px; color: #ffc83d; } .pg-row small { color: var(--muted); }
.pg-level { display: flex; align-items: center; gap: 10px; font-size: 13px; } .pg-level .xp-track { flex: 1; margin: 0; }
.pg-up { margin-top: 6px; font-weight: 800; color: #7fe3a3; }
@media (max-width: 600px) { .dc { grid-template-columns: 1fr 80px 46px; } .lb-row { grid-template-columns: 34px 1fr 34px 40px 60px; } }

/* phone top row: compact HP + clock, both always inside the safe area */
@media (max-height: 480px) {
  body.touch #me { min-width: 120px; padding: 5px 9px; }
  body.touch .me-row { margin-bottom: 4px; font-size: 13px; }
  body.touch #clock { padding: 4px 14px; }
  body.touch #timer { font-size: 24px; }
}
