:root {
  --bg: #0b0f14;
  --bg2: #121923;
  --card: rgba(20, 28, 38, 0.92);
  --line: rgba(255, 255, 255, 0.09);
  --text: #e8eef5;
  --dim: #8d9aab;
  --atk: #ff8a1f;
  --atk2: #ffb05c;
  --def: #3d8bff;
  --def2: #7fb2ff;
  --good: #3fd08a;
  --bad: #ff4d5e;
  --gold: #ffc940;
  --display: 'Black Han Sans', 'Rajdhani', system-ui, sans-serif;
  --num: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; overflow: hidden; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 700; transition: transform .08s, filter .15s, background .15s; }
button:active { transform: scale(0.97); }
button:disabled { opacity: .45; cursor: default; }
.hidden { display: none !important; }
.primary { background: linear-gradient(180deg, #ff9a36, #f26b0f); color: #1a0d02; box-shadow: 0 6px 24px rgba(255, 120, 20, .25); }
.primary:hover { filter: brightness(1.08); }
.secondary { background: #243142; border: 1px solid var(--line); }
.secondary:hover { background: #2c3c51; }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--dim); }
.ghost:hover { color: var(--text); border-color: rgba(255,255,255,.25); }
.small { padding: 6px 10px; font-size: 13px; }
.big { padding: 16px 20px; font-size: 19px; width: 100%; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 99px; background: rgba(255,255,255,.07); font-size: 13px; color: var(--dim); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; backdrop-filter: blur(6px); }
.card h3 { margin: 0 0 12px; font-size: 15px; color: var(--dim); letter-spacing: .04em; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 13px; color: var(--dim); }
.field input:not([type]), .field input[type=text], .field select, .code-row input, .chat-form input {
  background: #0d141c; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; color: var(--text); font-size: 16px; outline: none;
}
.field input:focus, .code-row input:focus { border-color: var(--atk); }
.field.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); }
.field input[type=range] { accent-color: var(--atk); }
.note { font-size: 13px; color: var(--dim); margin: 6px 0 10px; min-height: 1em; }
.screen { position: fixed; inset: 0; }

/* ---------------------------------------------------------------- home */
#home { overflow-y: auto; padding: 22px clamp(14px, 3vw, 40px) 40px; }
.home-bg::after { content: ''; position: fixed; inset: 0; z-index: -1; background: url('home-bg.webp') center 35% / cover no-repeat; opacity: .22; filter: blur(2px) saturate(1.1); }
.home-bg { position: fixed; inset: 0; z-index: -1; background:
  radial-gradient(1200px 600px at 80% -10%, rgba(255,138,31,.16), transparent 60%),
  radial-gradient(900px 600px at -10% 110%, rgba(61,139,255,.16), transparent 60%),
  repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 64px),
  repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 64px), var(--bg); }
.brand { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-bottom: 22px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark { font-size: 40px; color: var(--atk); letter-spacing: -8px; line-height: 1; text-shadow: 0 0 24px rgba(255,138,31,.45); }
.logo h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(34px, 5vw, 52px); letter-spacing: .02em; line-height: 1; }
.logo-en { font-family: var(--num); font-weight: 700; letter-spacing: .42em; color: var(--atk2); font-size: 13px; margin-top: 4px; }
.tagline { margin: 0; color: var(--dim); font-size: 16px; flex: 1; min-width: 220px; }
.top-tools { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.home-grid { display: grid; grid-template-columns: minmax(280px, 380px) minmax(260px, 1fr) minmax(280px, 1.1fr); gap: 16px; align-items: start; }
@media (max-width: 1050px) { .home-grid { grid-template-columns: 1fr 1fr; } .how-card { grid-column: 1 / -1; } }
@media (max-width: 680px) { .home-grid { grid-template-columns: 1fr; } }
.play-card { display: flex; flex-direction: column; gap: 12px; }
.play-card .field { margin: 0; }
#quickBtn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px; font-size: 22px; }
#quickBtn small { font-size: 13px; font-weight: 600; opacity: .7; }
.glow { animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 6px 34px rgba(255, 138, 31, .5); } }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .3em; font-family: var(--num); font-weight: 700; }
.invite { background: rgba(255,138,31,.1); border: 1px solid rgba(255,138,31,.4); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.invite b { font-family: var(--num); letter-spacing: .2em; color: var(--atk2); font-size: 18px; }
.room-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.room-item { display: flex; align-items: center; gap: 10px; background: #0f1720; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.room-item:hover { border-color: rgba(255,138,31,.5); }
.room-item .rn { flex: 1; min-width: 0; }
.room-item .rn b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-item .rn small { color: var(--dim); }
.room-item .cnt { font-family: var(--num); font-weight: 700; font-size: 18px; }
.empty { color: var(--dim); font-size: 14px; line-height: 1.5; padding: 8px 2px; }
.how { margin: 0 0 14px; padding-left: 20px; line-height: 1.6; font-size: 14px; }
.how li { margin-bottom: 4px; }
.keys { color: var(--dim); font-size: 12px; line-height: 1.6; margin: 10px 0 0; }
.ops-showcase { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.op-mini { background: #0f1720; border-radius: 10px; padding: 8px; border-top: 3px solid var(--c, #888); font-size: 12px; }
.op-mini b { display: block; font-family: var(--num); font-size: 15px; letter-spacing: .06em; }
.op-mini span { color: var(--dim); display: block; line-height: 1.35; margin-top: 2px; }
.op-mini.atk { --side: var(--atk); }
.op-mini.def { --side: var(--def); }
.home-foot { margin-top: 26px; text-align: center; }
.home-foot a { color: var(--dim); text-decoration: none; font-size: 14px; }

/* ---------------------------------------------------------------- room */
#room { overflow-y: auto; padding: 18px clamp(12px, 3vw, 36px); }
.room-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.room-code { flex: 1; text-align: center; color: var(--dim); }
.room-code b { font-family: var(--num); font-size: 28px; letter-spacing: .25em; color: var(--text); margin: 0 6px; }
.room-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .room-grid { grid-template-columns: 1fr; } }
.teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; }
@media (max-width: 560px) { .teams { grid-template-columns: 1fr; } .vs { display: none; } }
.vs { font-family: var(--num); font-weight: 700; color: var(--dim); padding-top: 60px; font-size: 20px; }
.team-col { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.team-col[data-team="0"] { border-top: 3px solid #d9a441; }
.team-col[data-team="1"] { border-top: 3px solid #5bc0be; }
.team-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.team-head h3 { margin: 0; font-size: 18px; color: var(--text); }
.team-side { font-size: 12px; color: var(--dim); }
.slots { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.slot { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 9px; background: #0f1720; min-height: 40px; }
.slot.me { outline: 1px solid rgba(255,138,31,.6); }
.slot.bot { opacity: .72; }
.slot.empty-slot { color: var(--dim); font-size: 13px; justify-content: center; border: 1px dashed var(--line); background: transparent; }
.slot .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: 11px; padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.08); color: var(--dim); }
.tag.host { background: rgba(255,201,64,.18); color: var(--gold); }
.tag.you { background: rgba(255,138,31,.2); color: var(--atk2); }
.kick { padding: 2px 8px; font-size: 12px; background: transparent; color: var(--dim); }
.team-join { width: 100%; }
.side-panel { display: flex; flex-direction: column; gap: 16px; }
.chat-log { display: flex; flex-direction: column; gap: 4px; font-size: 14px; overflow-y: auto; max-height: 220px; min-height: 80px; margin-bottom: 8px; word-break: break-word; }
.chat-log .sys { color: var(--dim); font-size: 13px; }
.chat-log .who { color: var(--atk2); font-weight: 700; margin-right: 6px; }
.chat-log .team-line .who { color: var(--good); }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- game */
#game { background: #000; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#hud { position: absolute; inset: 0; pointer-events: none; user-select: none; -webkit-user-select: none; font-family: var(--num); }
#overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; }
.vignette { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(200, 0, 20, .55) 100%); transition: opacity .3s; }
.noise { position: absolute; inset: 0; opacity: .5; background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.12) 0 1px, transparent 1px 3px); animation: noise .2s steps(3) infinite; }
@keyframes noise { 0% { background-position: 0 0; } 50% { background-position: 0 7px; } 100% { background-position: 0 3px; } }
.view-tag { position: absolute; top: 90px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.2); padding: 6px 14px; border-radius: 8px; font-size: 16px; font-weight: 700; letter-spacing: .08em; text-align: center; }
.view-tag small { display: block; font-size: 12px; font-weight: 600; opacity: .75; letter-spacing: 0; font-family: system-ui, sans-serif; }

.hud-top { position: absolute; top: 10px; left: 0; right: 0; display: flex; justify-content: center; align-items: flex-start; gap: 14px; }
.team-bar { display: flex; gap: 4px; padding-top: 4px; }
.team-bar .op-ico { width: 34px; height: 34px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--c); border-bottom: 3px solid rgba(0,0,0,.35); position: relative; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.team-bar .op-ico.dead { filter: grayscale(1) brightness(.35); }
.team-bar .op-ico .hpb { position: absolute; left: 2px; right: 2px; bottom: -6px; height: 3px; background: rgba(0,0,0,.5); }
.team-bar .op-ico .hpb i { display: block; height: 100%; background: #fff; }
.clock { text-align: center; }
.score { display: flex; align-items: stretch; background: rgba(8, 12, 17, .78); border-radius: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,.1); }
.score > span:first-child, .score > span:last-child { min-width: 42px; display: grid; place-items: center; font-size: 26px; font-weight: 700; }
#scoreA { background: rgba(255,138,31,.85); color: #1b0e03; }
#scoreB { background: rgba(61,139,255,.85); color: #041225; }
.clock-mid { padding: 2px 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#timer { font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: .04em; }
#timer.urgent { color: var(--bad); }
#phaseTag { font-size: 11px; color: var(--dim); letter-spacing: .12em; font-weight: 700; font-family: system-ui, sans-serif; }
.objective { margin-top: 6px; font-size: 14px; font-weight: 700; background: rgba(0,0,0,.45); padding: 4px 12px; border-radius: 8px; display: inline-block; font-family: system-ui, sans-serif; }
.objective:empty { display: none; }
.minimap { position: absolute; top: 12px; left: 12px; width: 190px; height: 160px; border-radius: 10px; background: rgba(6, 10, 14, .7); border: 1px solid rgba(255,255,255,.12); }
.feed { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; font-family: system-ui, sans-serif; }
.feed div { background: rgba(0,0,0,.55); padding: 5px 10px; border-radius: 6px; font-size: 14px; animation: feedIn .2s; white-space: nowrap; }
.feed .a { color: var(--atk2); font-weight: 700; }
.feed .d { color: var(--def2); font-weight: 700; }
.feed .mine { outline: 1px solid rgba(255,255,255,.5); }
.feed em { font-style: normal; color: #fff; margin: 0 6px; opacity: .85; }
@keyframes feedIn { from { transform: translateX(20px); opacity: 0; } }
.banner { position: absolute; top: 24%; left: 50%; transform: translate(-50%, -50%); text-align: center; font-family: var(--display); font-size: clamp(28px, 5vw, 54px); text-shadow: 0 4px 24px rgba(0,0,0,.8); white-space: nowrap; animation: bannerIn .35s; }
.banner small { display: block; font-family: system-ui, sans-serif; font-size: clamp(13px, 1.7vw, 18px); font-weight: 600; color: #d9e2ec; margin-top: 8px; white-space: normal; max-width: 80vw; }
@keyframes bannerIn { from { transform: translate(-50%, -50%) scale(1.25); opacity: 0; } }
.hint { position: absolute; bottom: 175px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.6); padding: 8px 14px; border-radius: 8px; font-family: system-ui, sans-serif; font-size: 14px; text-align: center; max-width: 90vw; }
.hint b { color: var(--atk2); }

.cross { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.cross i { position: absolute; background: rgba(255,255,255,.92); box-shadow: 0 0 2px rgba(0,0,0,.9); }
.cross i:nth-child(1), .cross i:nth-child(2) { width: 2px; height: 9px; left: -1px; }
.cross i:nth-child(3), .cross i:nth-child(4) { width: 9px; height: 2px; top: -1px; }
.cross b { position: absolute; width: 2px; height: 2px; left: -1px; top: -1px; background: #fff; }
.cross.hide, #game:has(#roundEnd:not(.hidden)) .cross { display: none; }
.hitmark { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; opacity: 0;
  background: linear-gradient(45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%), linear-gradient(-45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%);
  -webkit-mask: radial-gradient(circle, transparent 5px, #000 6px); mask: radial-gradient(circle, transparent 5px, #000 6px); }
.hitmark.on { animation: hit .25s; }
.hitmark.head { filter: drop-shadow(0 0 3px #ff4d5e) sepia(1) saturate(20) hue-rotate(-30deg); }
.hitmark.kill { width: 36px; height: 36px; margin: -18px 0 0 -18px; filter: sepia(1) saturate(30) hue-rotate(-40deg); }
@keyframes hit { 0% { opacity: 1; transform: scale(1.3); } 100% { opacity: 0; transform: scale(1); } }
.prompt { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.6); padding: 8px 14px 8px 8px; border-radius: 10px; font-family: system-ui, sans-serif; font-size: 15px; font-weight: 600; }
.key { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 6px; background: #fff; color: #111; font-weight: 800; font-family: var(--num); padding: 0 6px; }
.ring { width: 30px; height: 30px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke: rgba(255,255,255,.2); stroke-width: 4; }
.ring #ringArc { stroke: var(--atk); stroke-dasharray: 94.25; stroke-dashoffset: 94.25; }

.hud-bottom { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; align-items: flex-end; gap: 14px; }
.me { display: flex; align-items: center; gap: 10px; background: rgba(6,10,14,.7); padding: 8px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.08); }
.op-badge { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 14px; font-weight: 700; background: var(--c, #555); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.hp { display: flex; align-items: center; gap: 10px; }
.hp-bar { width: 170px; height: 10px; background: rgba(255,255,255,.12); border-radius: 5px; overflow: hidden; }
.hp-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #fff, #dfe8f1); transition: width .15s; }
.hp-bar i.low { background: linear-gradient(90deg, #ff4d5e, #ff7a86); }
#hpText { font-size: 28px; font-weight: 700; min-width: 44px; }
.slot-row { display: flex; gap: 6px; margin-left: auto; }
.gslot { min-width: 54px; background: rgba(6,10,14,.7); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; padding: 5px 8px; text-align: center; font-size: 12px; font-family: system-ui, sans-serif; }
.gslot .k { font-family: var(--num); font-weight: 700; color: var(--dim); font-size: 12px; display: block; }
.gslot .ic { font-size: 20px; line-height: 1.2; display: block; }
.gslot .n { font-family: var(--num); font-weight: 700; font-size: 15px; }
.gslot.on { border-color: var(--atk); background: rgba(255,138,31,.15); }
.gslot.out { opacity: .35; }
.ammo { background: rgba(6,10,14,.7); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 6px 14px; text-align: right; min-width: 130px; }
#ammoMag { font-size: 38px; font-weight: 700; line-height: 1; }
#ammoMag.low { color: var(--bad); }
#ammoRes { font-size: 18px; color: var(--dim); margin-left: 4px; }
#weaponName { display: block; font-size: 12px; color: var(--dim); letter-spacing: .1em; }
.spec { position: absolute; bottom: 96px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.6); padding: 8px 16px; border-radius: 10px; font-family: system-ui, sans-serif; font-size: 14px; text-align: center; }
.spec b { font-size: 17px; }
.chat-box { position: absolute; left: 14px; bottom: 100px; width: min(420px, 60vw); font-family: system-ui, sans-serif; }
.chat-box .chat-log { max-height: 160px; min-height: 0; margin: 0; text-shadow: 0 1px 2px #000; font-size: 13px; }
.chat-box .chat-log div { animation: fadeOut 9s forwards; }
.chat-box.open .chat-log div { animation: none; opacity: 1; }
@keyframes fadeOut { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
#gameChatForm { pointer-events: auto; }
#gameChatInput { width: 100%; background: rgba(0,0,0,.7); border: 1px solid var(--atk); border-radius: 8px; padding: 8px 10px; color: #fff; font-size: 15px; outline: none; }

/* ---------------------------------------------------------------- overlays */
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#pick { background: linear-gradient(180deg, rgba(8,12,17,.55), rgba(8,12,17,.92) 65%); padding: 16px; justify-content: flex-start; overflow-y: auto; }
.pick-head { width: min(1200px, 100%); display: flex; justify-content: space-between; align-items: flex-end; margin: 4px 0 12px; }
.pick-round { font-family: var(--num); font-weight: 700; letter-spacing: .2em; color: var(--dim); }
.pick-head h2 { margin: 2px 0; font-family: var(--display); font-weight: 400; font-size: clamp(28px, 4vw, 44px); }
.pick-head h2.atk { color: var(--atk); }
.pick-head h2.def { color: var(--def2); }
.pick-map { color: var(--dim); font-size: 14px; }
.pick-timer { font-family: var(--num); font-weight: 700; font-size: 54px; line-height: 1; }
.op-cards { width: min(1200px, 100%); display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 900px) { .op-cards { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .op-cards { grid-template-columns: repeat(2, 1fr); } }
.op-card { position: relative; background: #111a24; border: 2px solid rgba(255,255,255,.08); border-radius: 14px; padding: 12px; cursor: pointer; text-align: left; overflow: hidden; font-weight: 400; }
.op-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--c); }
.op-card:hover { border-color: rgba(255,255,255,.25); }
.op-card.sel { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 10px 30px rgba(0,0,0,.4); }
.op-card.taken { opacity: .38; cursor: not-allowed; }
.op-card .op-name { font-family: var(--num); font-weight: 700; font-size: 21px; letter-spacing: .06em; }
.op-card .op-ko { color: var(--dim); font-size: 13px; }
.op-card .op-armor { font-size: 12px; color: var(--dim); margin: 6px 0 8px; }
.op-card .op-gadget { font-size: 13px; line-height: 1.4; }
.op-card .op-gadget b { color: var(--c); }
.op-card .op-by { position: absolute; top: 12px; right: 12px; font-size: 12px; background: rgba(0,0,0,.5); padding: 2px 8px; border-radius: 6px; }
.op-card .op-icon { font-size: 30px; float: right; margin-top: 6px; }
.pick-bottom { width: min(1200px, 100%); display: grid; grid-template-columns: 1fr 1fr 240px; gap: 14px; margin-top: 12px; align-items: end; }
@media (max-width: 800px) { .pick-bottom { grid-template-columns: 1fr; } }
.loadout { display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--dim); }
.choice { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.choice button { background: #1b2632; border: 1px solid var(--line); padding: 8px 12px; font-size: 14px; }
.choice button.sel { border-color: var(--atk); background: rgba(255,138,31,.15); color: #fff; }
.pick-team { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.pick-team div { display: flex; justify-content: space-between; background: rgba(255,255,255,.04); padding: 5px 10px; border-radius: 6px; }
.pick-team .rd { color: var(--good); }

.board { background: rgba(4, 7, 10, .72); padding: 20px; }
.board table { border-collapse: collapse; width: min(760px, 96vw); font-family: system-ui, sans-serif; font-size: 14px; }
.board th { text-align: left; color: var(--dim); font-weight: 600; padding: 6px 8px; font-size: 12px; }
.board td { padding: 7px 8px; border-top: 1px solid rgba(255,255,255,.06); }
.board td.n { text-align: right; font-family: var(--num); font-weight: 700; font-size: 16px; }
.board tr.dead td { opacity: .5; }
.board tr.me td { background: rgba(255,255,255,.06); }
.board .tt { font-family: var(--display); font-size: 22px; padding-top: 16px; }
.board .tt.atk { color: var(--atk); }
.board .tt.def { color: var(--def2); }
.result { background: radial-gradient(ellipse at center, rgba(0,0,0,.45), rgba(0,0,0,.85)); pointer-events: auto; overflow-y: auto; padding: 20px; justify-content: flex-start; text-align: center; }
/* centred while it fits, scrollable from the top when it does not (short landscape phones) */
.result > :first-child { margin-top: auto; }
.result > :last-child { margin-bottom: auto; }
.result.final { background: rgba(6, 9, 13, .97); }
.result h1 { font-family: var(--display); font-weight: 400; font-size: clamp(38px, 7vw, 84px); margin: 0; letter-spacing: .02em; text-shadow: 0 6px 30px rgba(0,0,0,.6); }
.result h1.win { color: var(--gold); }
.result h1.lose { color: #c9d3de; }
.result .why { font-size: 18px; color: #dfe7ef; margin: 6px 0 18px; }
.result .big-score { font-family: var(--num); font-size: 44px; font-weight: 700; margin-bottom: 16px; }
.result .big-score .a { color: var(--atk); }
.result .big-score .b { color: var(--def2); }
.result .mvp { background: rgba(255,201,64,.12); border: 1px solid rgba(255,201,64,.4); padding: 10px 18px; border-radius: 12px; margin-bottom: 14px; }
.result .mvp b { color: var(--gold); }
.result .my-line { color: #dfe7ef; }
.result .next { color: var(--dim); margin-top: 14px; }
.result .res-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
.result .note { margin-top: 14px; }
.relay-pick { width: min(720px, 100%); margin-top: 18px; }
.relay-pick h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--dim); letter-spacing: .04em; }
.relay-games { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.relay-games button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px; }
.relay-games small { font-size: 12px; font-weight: 500; color: var(--dim); }
.relay { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 90; width: min(560px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 12px; background: #1d2a38; border: 1px solid rgba(255,138,31,.6); border-radius: 12px; padding: 12px 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.55); animation: relayIn .25s; }
.relay p { margin: 0; flex: 1; font-size: 15px; line-height: 1.4; }
.relay-btns { display: flex; gap: 8px; flex-shrink: 0; }
@keyframes relayIn { from { transform: translate(-50%, -16px); opacity: 0; } }
@media (max-width: 480px) { .relay { flex-direction: column; align-items: stretch; } .relay-btns > * { flex: 1; } }
.menu-ov { background: rgba(0,0,0,.6); pointer-events: auto; }
.menu-card { width: min(380px, 92vw); display: flex; flex-direction: column; gap: 10px; }
.menu-card h2 { margin: 0 0 6px; font-family: var(--display); font-weight: 400; }
.click-play { background: rgba(0,0,0,.35); cursor: pointer; font-family: var(--display); font-size: 28px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 50; }
.modal-card { width: min(440px, 92vw); max-height: 92vh; overflow-y: auto; }
.modal-card h2 { margin-top: 0; }
.modal-card .field { flex-direction: row; align-items: center; justify-content: space-between; }
.modal-card .field span { flex: 1; }
.modal-card .field b { width: 42px; text-align: right; font-family: var(--num); color: var(--text); }
.modal-card .field input[type=range] { flex: 1.3; }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 30px); background: #1d2a38; border: 1px solid var(--line); padding: 12px 18px; border-radius: 10px; opacity: 0; transition: .25s; z-index: 60; pointer-events: none; max-width: 90vw; text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.conn { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); background: #3a1d1d; border: 1px solid #7a3131; padding: 8px 16px; border-radius: 10px; z-index: 70; font-size: 14px; }
.rotate { position: fixed; inset: 0; background: var(--bg); z-index: 80; display: grid; place-content: center; text-align: center; font-size: 20px; }
.rotate div { font-size: 60px; }

/* ---------------------------------------------------------------- touch */
.touch { position: absolute; inset: 0; pointer-events: none; }
.touch .stick { position: absolute; left: 4vw; bottom: 6vh; width: 150px; height: 150px; border-radius: 50%; background: rgba(255,255,255,.07); border: 2px solid rgba(255,255,255,.15); pointer-events: auto; touch-action: none; }
.touch .stick i { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px; border-radius: 50%; background: rgba(255,255,255,.3); }
.touch .look-pad { position: absolute; right: 0; top: 0; width: 60%; height: 100%; pointer-events: auto; touch-action: none; }
.tbtns { position: absolute; right: 2vw; bottom: 3vh; width: 330px; height: 250px; pointer-events: none; }
.tb { position: absolute; width: 54px; height: 54px; border-radius: 50%; background: rgba(20,28,38,.55); border: 2px solid rgba(255,255,255,.25); color: #fff; font-weight: 800; font-size: 17px; padding: 0; pointer-events: auto; touch-action: none; font-family: var(--num); }
.tb.on { background: rgba(255,138,31,.55); border-color: var(--atk); }
.tb { width: 48px; height: 48px; font-size: 15px; }
.tb.fire { width: 78px; height: 78px; right: 8px; bottom: 56px; background: rgba(255,77,94,.4); font-size: 28px; }
.tb.ads { right: 94px; bottom: 96px; }
.tb[data-k=reload] { right: 94px; bottom: 38px; }
.tb[data-k=crouch] { right: 150px; bottom: 6px; }
.tb[data-k=vault] { right: 206px; bottom: 6px; }
.tb[data-k=leanL] { right: 150px; bottom: 132px; }
.tb[data-k=leanR] { right: 94px; bottom: 154px; }
.tb[data-k=use] { right: 22px; bottom: 148px; }
.tb[data-k=g3] { right: 206px; bottom: 66px; }
.tb[data-k=g4] { right: 150px; bottom: 70px; }
.tb[data-k=swap] { right: 22px; bottom: 2px; }
.tb[data-k=view] { right: 206px; bottom: 126px; }
.tb[data-k=melee] { right: 262px; bottom: 66px; }
.tb.menu { position: fixed; top: 114px; left: 8px; width: 40px; height: 40px; font-size: 18px; }
body.touch-ui .minimap { width: 120px; height: 100px; top: 8px; left: 8px; }
body.touch-ui .hud-top { top: 4px; gap: 8px; }
body.touch-ui #timer { font-size: 22px; }
body.touch-ui .clock-mid { padding: 2px 10px; }
body.touch-ui .score > span:first-child, body.touch-ui .score > span:last-child { min-width: 30px; font-size: 20px; }
body.touch-ui .objective { font-size: 12px; padding: 3px 8px; margin-top: 4px; }
body.touch-ui .feed { top: 50px; }
body.touch-ui .hud-bottom { left: calc(4vw + 158px); right: auto; transform: none; bottom: 6px; gap: 6px; }
body.touch-ui .hud-bottom .slot-row, body.touch-ui .chat-box { display: none; }
body.touch-ui .me { padding: 5px 8px; gap: 8px; }
body.touch-ui .hp-bar { width: 90px; }
body.touch-ui #hpText { font-size: 20px; min-width: 34px; }
body.touch-ui .ammo { min-width: 84px; padding: 4px 10px; }
body.touch-ui #ammoMag { font-size: 26px; }
body.touch-ui #ammoRes { font-size: 14px; }
body.touch-ui .op-badge { width: 30px; height: 30px; font-size: 11px; }
body.touch-ui .team-bar .op-ico { width: 22px; height: 22px; font-size: 9px; }
body.touch-ui .feed div { font-size: 11px; padding: 3px 8px; }
body.touch-ui .prompt { pointer-events: auto; top: 54%; }
body.touch-ui .banner { font-size: 30px; }
body.touch-ui .hint { bottom: auto; top: 90px; font-size: 12px; }
body.touch-ui .spec { bottom: 70px; font-size: 12px; }
body.touch-ui .view-tag { top: 64px; font-size: 13px; }
@media (max-height: 520px) {
  #pick { padding: 8px 12px; }
  .pick-head { margin: 0 0 8px; }
  .pick-head h2 { font-size: 22px; }
  .pick-round { font-size: 11px; }
  .pick-map { font-size: 12px; }
  .pick-timer { font-size: 34px; }
  .op-cards { grid-template-columns: repeat(5, 1fr) !important; gap: 6px; }
  .op-card { padding: 7px 8px; border-radius: 10px; }
  .op-card .op-name { font-size: 15px; }
  .op-card .op-icon { font-size: 20px; margin-top: 0; }
  .op-card .op-armor, .op-card .op-gadget small, .op-card .op-ko { display: none; }
  .op-card .op-gadget { font-size: 11px; line-height: 1.3; }
  .op-card .op-by { top: auto; bottom: 4px; right: 4px; font-size: 10px; }
  .pick-bottom { grid-template-columns: 1fr 1fr 170px; gap: 8px; margin-top: 8px; }
  .pick-team { display: none; }
  .choice button { padding: 6px 9px; font-size: 12px; }
  .loadout { gap: 4px; font-size: 11px; }
  #readyBtn { padding: 12px; font-size: 16px; }
  .result h1 { font-size: 36px; }
  .result .big-score { font-size: 30px; margin-bottom: 6px; }
  .result .why { margin: 4px 0 6px; }
  .result { padding: 12px 16px; }
  .result .mvp { padding: 6px 14px; margin-bottom: 6px; }
  .result .next, .result .res-actions { margin-top: 8px; }
  .relay-pick { margin-top: 8px; }
  .relay-pick h3 { margin-bottom: 6px; }
  .relay-games button { padding: 6px 8px; }
}
@media (max-height: 500px) { .banner { top: 30%; } }

@media (max-width: 1250px) and (min-width: 681px) { .ops-showcase { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .ops-showcase { grid-template-columns: repeat(2, 1fr); } }
.ping { position: absolute; top: 176px; left: 14px; font-size: 12px; font-weight: 700; color: rgba(255,255,255,.7); text-shadow: 0 1px 2px #000; }
.ping.bad { color: #ff7a86; }
body.touch-ui .ping { top: 112px; left: 56px; }
