* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #020503; color: #e8ffe0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif; touch-action: none; user-select: none; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

#hud { position: fixed; inset: 0; pointer-events: none; }
.hud-top { display: flex; gap: 12px; padding: 14px 16px 0; align-items: flex-start; }
.panel { flex: 1; background: rgba(4, 14, 6, .62); border: 1px solid rgba(118, 185, 0, .35); border-radius: 10px; padding: 8px 12px; backdrop-filter: blur(6px); }
.panel.center { text-align: center; }
.panel.right { text-align: right; }
.label { font-size: 13px; letter-spacing: .5px; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 10px; background: rgba(255,255,255,.1); border-radius: 5px; overflow: hidden; }
.bar.thin { height: 5px; }
.bar > div { height: 100%; width: 50%; background: #76b900; border-radius: 5px; transition: width .2s, background .2s; }
#progBar { width: 0; background: #e8ffe0; }
#voteDots { display: flex; gap: 4px; justify-content: flex-end; }
#voteDots i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid #ffcc33; opacity: .45; }
#voteDots i.on { background: #ffcc33; opacity: 1; box-shadow: 0 0 8px #ffcc33; }
#voteDots i.miss { border-color: #ff4d4d; background: rgba(255,77,77,.5); opacity: .8; }

#ticker { margin: 10px 16px 0; background: rgba(180, 20, 20, .78); border-radius: 6px; font-size: 13px; padding: 5px 10px; overflow: hidden; white-space: nowrap; }
#ticker::before { content: "快讯"; background: #fff; color: #b01414; font-weight: 700; padding: 1px 6px; border-radius: 3px; margin-right: 8px; }
#banner { position: absolute; top: 34%; left: 0; right: 0; text-align: center; font-size: clamp(22px, 4.5vw, 44px); font-weight: 800; letter-spacing: 2px;
  text-shadow: 0 0 24px #76b900, 0 2px 4px #000; opacity: 0; transition: opacity .4s; padding: 0 16px; }
#banner.show { opacity: 1; }
#banner small { display: block; font-size: .45em; font-weight: 500; margin-top: 8px; letter-spacing: 1px; opacity: .9; }
#toast { position: absolute; bottom: 22%; left: 0; right: 0; text-align: center; font-size: 20px; font-weight: 700; opacity: 0; transition: opacity .25s; text-shadow: 0 2px 6px #000; }
#toast.show { opacity: 1; }

#overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: linear-gradient(90deg, rgba(2,5,3,.15), rgba(2,5,3,.8)); }
.card { width: min(560px, 100%); max-height: 100%; overflow: auto; background: rgba(6, 18, 8, .88); border: 1px solid rgba(118,185,0,.5); border-radius: 16px; padding: 26px 26px 20px; text-align: center;
  box-shadow: 0 0 60px rgba(118,185,0,.18); }
.tag { display: inline-block; background: #b01414; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 1.5px; padding: 3px 10px; border-radius: 4px; }
h1 { font-size: clamp(34px, 8vw, 56px); margin-top: 12px; color: #76b900; letter-spacing: 4px; }
h2 { font-size: clamp(16px, 3.6vw, 22px); font-weight: 500; letter-spacing: 6px; margin-top: 2px; }
#ovText { font-size: 14px; line-height: 1.75; margin: 16px 0; color: #cfe6c6; text-align: left; }
#ovText b { color: #ffcc33; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 12.5px; text-align: left; margin-bottom: 12px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.dot.green { background: #76b900; } .dot.gold { background: #ffcc33; border-radius: 50%; } .dot.red { background: #ff3b3b; } .dot.orange { background: #ff8a1f; }
.keys { font-size: 12px; opacity: .7; margin-bottom: 14px; }
#loading { font-size: 12px; opacity: .7; margin-bottom: 8px; min-height: 16px; }
#startBtn { pointer-events: auto; cursor: pointer; border: 0; border-radius: 10px; background: #76b900; color: #041005; font-size: 18px; font-weight: 800; letter-spacing: 3px; padding: 12px 44px; transition: transform .1s, opacity .2s; }
#startBtn:disabled { opacity: .35; cursor: default; }
#startBtn:not(:disabled):hover { transform: scale(1.04); }
.disclaimer { font-size: 11px; opacity: .45; margin-top: 14px; }

@media (min-width: 900px) { #overlay { justify-content: flex-end; padding-right: 6vw; } .card { width: min(500px, 100%); } }
@media (max-width: 640px) {
  .hud-top { gap: 6px; padding: 8px 8px 0; } .panel { padding: 6px 8px; } .label { font-size: 11px; }
  #voteDots i { width: 8px; height: 8px; } #ticker { margin: 6px 8px 0; font-size: 11px; }
}
#flash { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(255, 30, 30, .55)); opacity: 0; }
#flash.on { animation: flash .5s ease-out; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
