/* 抢地盘 · 共用样式 */
:root {
  --red: #d8402f; --red-soft: #f3c2b9; --black: #2a2622; --black-soft: #b9b1a6;
  --paper: #f4efe4; --zone: #e6dfcf; --ink: #2b2620; --muted: #7d7365; --line: #cfc5b2;
  --good: #2e7d4f;
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button { font: inherit; cursor: pointer; }

/* ---------- 地图 ---------- */
.qmap { width: 100%; height: auto; display: block; user-select: none; -webkit-user-select: none; }
.qmap .zone { stroke: #fff; stroke-width: .7; transition: fill .35s; }
.qmap .zone.none { fill: var(--zone); }
.qmap .zone.red { fill: var(--red); }
.qmap .zone.black { fill: var(--black); }
.qmap .zone.preview { stroke: #f5b400; stroke-width: 1.4; stroke-dasharray: 2 1.2; }
.qmap .zname { font-size: 3.3px; font-weight: 600; fill: var(--ink); text-anchor: middle; pointer-events: none; }
.qmap .zname.on { fill: #fff; }
.qmap .icon { fill: #fff; stroke: var(--ink); stroke-width: .6; }
.qmap .icon.on { fill: #fff; stroke: #fff; }
.qmap .voidtxt { font-size: 2.8px; fill: var(--muted); text-anchor: middle; }
.qmap .pt circle { fill: #fff; stroke: #6b6255; stroke-width: .6; }
.qmap .pt text { font-size: 3.2px; font-weight: 700; text-anchor: middle; dominant-baseline: central; fill: var(--ink); pointer-events: none; }
.qmap .pt.tap { cursor: pointer; }
.qmap .pt.tap:hover circle { stroke-width: 1; stroke: #f5b400; }
.qmap .pt.here circle { stroke-width: 1.2; }
.qmap .pt.here.red circle { stroke: var(--red); }
.qmap .pt.here.black circle { stroke: var(--black); }
.qmap .pt.start text.flag { font-size: 2.6px; font-weight: 700; }
.qmap .halo { fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; }
.qmap .path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.qmap .path.red { stroke: var(--red); } .qmap .path.black { stroke: var(--black); }
.qmap .ghost { fill: none; stroke-dasharray: 1.6 1.4; stroke-width: .9; opacity: .8; }
.qmap .ghost.red { stroke: var(--red); } .qmap .ghost.black { stroke: var(--black); }
.qmap .pulse { fill: none; stroke-width: .8; animation: pulse 1.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.qmap .pulse.red { stroke: var(--red); } .qmap .pulse.black { stroke: var(--black); }
@keyframes pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.4); opacity: 0; } }
.qmap .zone.flash { animation: zflash .45s steps(1) 4; }
.qmap .zone.flash-steal { animation: zflash .3s steps(1) 8; }
@keyframes zflash { 50% { fill: #ffd54a; } }
.qmap .fake { font-size: 2.6px; fill: #a3998a; }

/* ---------- 比例条 ---------- */
.ratio { display: flex; height: 100%; border-radius: 999px; overflow: hidden; background: var(--zone); }
.ratio > div { transition: width .6s ease; }
.ratio .r { background: var(--red); } .ratio .n { background: var(--zone); } .ratio .b { background: var(--black); }

/* ---------- 手机 ---------- */
.phone { position: relative; width: 100%; max-width: 430px; margin: 0 auto; min-height: 100%; background: var(--paper); overflow: hidden; display: flex; flex-direction: column; }
.phone .top { display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: #fff; }
.phone .top.red { background: var(--red); } .phone .top.black { background: var(--black); }
.phone .who { font-weight: 700; font-size: 17px; flex: 1; }
.phone .clock { font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 700; }
.phone .mini { display: flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 13px; color: var(--muted); }
.phone .mini .bar { flex: 1; height: 10px; }
.phone .tabs { display: flex; gap: 6px; padding: 4px 12px; }
.phone .tabs button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px; font-weight: 600; color: var(--muted); }
.phone .tabs button.on { border-color: var(--ink); color: var(--ink); }
.phone .tabs button .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 4px; vertical-align: middle; }
.phone .mapwrap { padding: 4px 8px; }
.phone .msg { margin: 6px 12px; padding: 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); font-size: 17px; line-height: 1.45; min-height: 74px; }
.phone .msg.good { border-color: var(--good); }
.phone .msg.warn { border-color: #e08a00; background: #fff6e5; }
.phone .hint { margin: 0 12px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.phone .rules { margin: 10px 12px 14px; font-size: 14px; line-height: 1.6; color: var(--ink); }
.phone .rules b { display: inline-block; width: 1.4em; }
.phone .tapnote { margin: 0 12px; font-size: 12px; color: #a3998a; }
.phone .join { padding: 28px 20px; text-align: center; }
.phone .join h1 { font-size: 30px; margin: 10px 0 4px; }
.phone .join p { color: var(--muted); margin: 0 0 22px; }
.phone .join button.team { display: block; width: 100%; margin: 12px 0; padding: 22px; border: 0; border-radius: 16px; color: #fff; font-size: 24px; font-weight: 700; }
.phone .join .team.red { background: var(--red); } .phone .join .team.black { background: var(--black); }
.phone .join input { width: 100%; padding: 10px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; }

.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; z-index: 20; padding: 24px; }
.overlay.count { background: rgba(20, 17, 14, .92); color: #fff; }
.overlay.count .big { font-size: 120px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.overlay.count .at { font-size: 22px; font-weight: 700; margin: 18px 0 6px; }
.overlay.count .sub { font-size: 16px; opacity: .8; }
.overlay.count button { margin-top: 30px; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 999px; padding: 10px 22px; }
.overlay.ring svg { width: 210px; height: 210px; }
.overlay.alert { color: #fff; font-size: 28px; font-weight: 800; animation: alertbg .25s steps(1) 6; background: var(--black); }
.overlay.alert.red { background: var(--red); }
.overlay.alert small { display: block; font-size: 18px; font-weight: 600; margin-top: 12px; }
@keyframes alertbg { 50% { background: #fff; color: var(--ink); } }
.overlay.win { color: #fff; font-size: 30px; font-weight: 800; animation: pop .5s ease-out; }
.overlay.win.red { background: rgba(216, 64, 47, .94); } .overlay.win.black { background: rgba(42, 38, 34, .94); }
.overlay.win small { display: block; font-size: 18px; font-weight: 600; margin-top: 10px; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.fog .qmap .zone { fill: #cfc9bd !important; } .fog .qmap .zname.on { fill: var(--ink); } .fog .qmap .icon.on { stroke: var(--ink); } .fog .qmap .path, .fog .qmap .ghost { opacity: .25; }

/* ---------- 大屏 ---------- */
.screen { container-type: size; position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; background: var(--paper); border: 6px solid transparent; overflow: hidden; }
.screen header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2.2cqmin; padding: 1.6cqmin 2.4cqmin .8cqmin; }
.screen .title { font-size: 4.2cqmin; font-weight: 800; letter-spacing: .1em; }
.screen .clock { font-size: 7cqmin; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 4.5em; text-align: right; }
.screen .score { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.4cqmin; font-weight: 800; }
.screen .score .pct { font-size: 5cqmin; font-variant-numeric: tabular-nums; }
.screen .score .pct.r { color: var(--red); } .screen .score .pct.b { color: var(--black); }
.screen .score .lab { font-size: 2.2cqmin; color: var(--muted); font-weight: 600; text-align: center; grid-column: 1 / -1; }
.screen .score .bar { height: 4cqmin; }
.screen main { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 2cqmin; padding: 0 2.4cqmin; min-height: 0; }
.screen main section { display: flex; flex-direction: column; min-height: 0; position: relative; }
.screen main h2 { margin: 0 0 .6cqmin; font-size: 3cqmin; }
.screen .m { flex: 1; min-height: 0; } .screen .m svg { width: 100%; height: 100%; }
.screen .fogmsg { display: none; position: absolute; inset: 4cqmin 0 0; align-items: center; justify-content: center; font-size: 4cqmin; font-weight: 800; color: var(--ink); text-shadow: 0 0 12px #fff; text-align: center; }
.screen.fog .fogmsg { display: flex; }
.screen footer { display: grid; grid-template-columns: 1fr 1.2fr; gap: 2cqmin; padding: .6cqmin 2.4cqmin 1cqmin; font-size: 1.9cqmin; line-height: 1.5; }
.screen .ticker div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen .ticker .d { display: inline-block; width: 1.2cqmin; height: 1.2cqmin; border-radius: 50%; margin-right: .8cqmin; }
.screen .rules3 { color: var(--muted); }
.screen.final { animation: border 1s steps(2) infinite; }
.screen.final .clock { color: var(--red); }
.screen.fog .clock { color: var(--red); font-size: 9cqmin; }
@keyframes border { 50% { border-color: var(--red); } }
.screen .reveal { position: absolute; inset: 0; background: rgba(244, 239, 228, .96); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3cqmin; z-index: 30; }
.screen .reveal .t { font-size: 8cqmin; font-weight: 800; }
.screen .reveal .bar { width: 78%; height: 9cqmin; }
.screen .reveal .bar .r, .screen .reveal .bar .b, .screen .reveal .bar .n { transition: width 2.2s cubic-bezier(.2, .8, .2, 1); }
.screen .reveal .nums { display: flex; justify-content: space-between; width: 78%; font-size: 6cqmin; font-weight: 800; }
.screen .reveal .nums .r { color: var(--red); } .screen .reveal .nums .b { color: var(--black); }
.screen .reveal .w { font-size: 9cqmin; font-weight: 900; opacity: 0; transition: opacity .6s; }
.screen .reveal .w.show { opacity: 1; animation: pop .5s ease-out; }
.screen .lobby { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.screen .lobby div { background: rgba(255,255,255,.92); padding: 2cqmin 4cqmin; border-radius: 2cqmin; font-size: 4cqmin; font-weight: 800; box-shadow: 0 2px 20px rgba(0,0,0,.08); }
.admin { position: relative; z-index: 40; margin: 0 1.4cqmin 1.2cqmin auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; font-size: 13px; max-width: 96%; }
.admin button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 4px 10px; }
.admin button.main { background: var(--ink); color: #fff; border-color: var(--ink); }
.admin button:disabled { opacity: .35; cursor: default; }
.admin input[type=number] { width: 52px; padding: 3px; }
.admin.min > :not(.tog) { display: none; }
