:root {
  --bg: #0d1020;
  --bg-2: #141a30;
  --panel: #1b2138;
  --panel-2: #232b47;
  --line: #2e3757;
  --text: #eaf0ff;
  --muted: #8b96b8;
  --accent: #5b8cff;
  --accent-2: #7c5cff;
  --gold: #ffd166;
  --good: #4ade80;
  --bad: #ff6b7a;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

a { color: var(--accent); text-decoration: none; }

.logo {
  font-weight: 800;
  letter-spacing: 0.18em;
  background: linear-gradient(100deg, #8fb0ff, #b79bff 45%, #ffd166);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-transform: uppercase;
  user-select: none;
}

.logo.small { font-size: 1rem; letter-spacing: 0.14em; }
.logo.big { font-size: clamp(2.2rem, 8vw, 4rem); }

button, input, select {
  font-family: inherit;
  font-size: 1rem;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 0.7rem 1.1rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: #2b3557; }
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
}
.btn.primary:hover { filter: brightness(1.1); }
.btn.gold { background: linear-gradient(120deg, #ffce54, #ff9f43); color: #221a00; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: #633; color: #ffb3bd; background: transparent; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.input {
  width: 100%;
  background: #101528;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 0.8rem 1rem;
  outline: none;
}
.input:focus { border-color: var(--accent); }

.card-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.center-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}

.stack { display: flex; flex-direction: column; gap: 0.9rem; }
.row { display: flex; gap: 0.6rem; align-items: center; }
.muted { color: var(--muted); }
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.15rem 0.55rem; border-radius: 999px;
  background: #2a3354; font-size: 0.78rem; color: var(--muted);
}
.badge.gold { background: rgba(255,209,102,0.16); color: var(--gold); }

/* ---------------- landing ---------------- */
.landing { width: min(440px, 100%); padding: 2rem; text-align: center; }
.landing .subtitle { color: var(--muted); margin: 0.4rem 0 1.4rem; font-size: 0.9rem; }
.landing .field { text-align: left; }
.landing label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.35rem; }
.divider { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); font-size: 0.78rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------------- lobby ---------------- */
.lobby { width: min(960px, 100%); }
.lobby-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; }
@media (max-width: 780px) { .lobby-grid { grid-template-columns: 1fr; } }
.section-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 0 0 0.7rem; }
.player-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.7rem; border-radius: 12px;
  background: #101528; border: 1px solid transparent;
}
.player-row + .player-row { margin-top: 0.45rem; }
.player-row .name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.host-tag { color: var(--gold); font-size: 0.72rem; }

.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.45rem 0; border-bottom: 1px dashed var(--line); }
.setting-row:last-child { border-bottom: none; }
.setting-row label { color: var(--muted); font-size: 0.86rem; }
.setting-row select, .setting-row input { max-width: 150px; }

.share-link {
  display: flex; gap: 0.5rem; align-items: center;
  background: #101528; border: 1px solid var(--line); border-radius: 12px; padding: 0.5rem 0.6rem;
}
.share-link code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); }

/* ---------------- game table ---------------- */
.game-root { min-height: 100dvh; display: flex; flex-direction: column; gap: 0.6rem; padding: 0.7rem; max-width: 1200px; margin: 0 auto; }

.topbar {
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
  padding: 0.55rem 0.8rem;
}
.topbar .spacer { flex: 1; }
.topbar .stat { font-size: 0.92rem; font-weight: 600; }
.topbar .stat .muted { font-weight: 400; }

.players-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.5rem;
}
.player-card {
  padding: 0.6rem 0.7rem; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.player-card.self { border-color: rgba(91,140,255,0.6); }
.player-card.active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255,209,102,0.25); }
.player-card.disconnected { opacity: 0.5; }
.player-card .pn { display: flex; align-items: center; gap: 0.4rem; font-weight: 700; font-size: 0.92rem; }
.player-card .pn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.player-card .pn .dot.off { background: var(--muted); }
.hp {
  font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em;
}
.hp.hit { animation: hpShake 0.5s ease; }
.hp.up { color: var(--good); }
.hp.down { color: var(--bad); }
.hand-count { color: var(--muted); font-size: 0.84rem; }
.hp-flash { position: absolute; font-weight: 800; pointer-events: none; }
@keyframes hpShake { 0%,100% { transform: translateX(0);} 25% { transform: translateX(-4px);} 75% { transform: translateX(4px);} }

.stage {
  flex: 1; display: flex; align-items: center; justify-content: center;
  position: relative; min-height: 46vh;
  border-radius: 20px; background: var(--bg-2); border: 1px solid var(--line);
  overflow: hidden;
}

/* ---------------- bottom ---------------- */
.action-bar {
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
  padding: 0.5rem 0.7rem;
}
.timer {
  font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.1rem;
  min-width: 3.2rem; text-align: center;
}
.timer.warn { color: var(--bad); }

.hand {
  display: flex; gap: 0.6rem; overflow-x: auto; padding: 0.6rem 0.2rem 0.9rem;
  scrollbar-width: thin;
}
.hand-card {
  flex: 0 0 auto; width: 92px; border-radius: 12px; cursor: pointer;
  background: transparent; border: none; padding: 0;
  transition: transform 0.15s ease, filter 0.15s ease;
  animation: cardDeal 0.35s ease both;
}
.hand-card img { width: 100%; display: block; border-radius: 12px; box-shadow: var(--shadow); }
.hand-card:hover { transform: translateY(-8px); }
.hand-card:disabled { cursor: not-allowed; filter: grayscale(0.7) brightness(0.6); }
.hand-card { position: relative; }
.hand-card.blocked { cursor: not-allowed; filter: grayscale(0.85) brightness(0.55); }
.hand-card.blocked:hover { transform: none; }
.hand-card.cooling { filter: grayscale(0.5) brightness(0.7); }
.hand-card.playable { box-shadow: 0 0 0 2px rgba(255,209,102,0.5); }
.cd-badge {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(6,8,16,0.82); color: #ffd166; font-weight: 900; font-size: 0.82rem;
  padding: 0.15rem 0.45rem; border-radius: 8px; letter-spacing: 0.04em;
  border: 1px solid rgba(255,209,102,0.5); pointer-events: none; white-space: nowrap;
}
@keyframes cardDeal { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- wheel ---------------- */
.wheel-wrap { position: relative; width: min(72vw, 380px); aspect-ratio: 1; }
.wheel-ring {
  position: absolute; inset: -6px; border-radius: 50%;
  background: conic-gradient(from 0deg, #2b3557, #1b2138, #2b3557, #1b2138, #2b3557);
  box-shadow: inset 0 0 0 1px var(--line);
}
.wheel-canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; }
.wheel-pointer {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; z-index: 5;
  border-left: 14px solid transparent; border-right: 14px solid transparent;
  border-top: 26px solid var(--gold);
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.5));
}
.wheel-hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 34%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2a3354, #12172b);
  border: 1px solid var(--line); box-shadow: inset 0 6px 18px rgba(0,0,0,0.5);
  display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 4;
}
.wheel-hub .val { font-size: clamp(1.8rem, 7vw, 2.8rem); font-weight: 900; line-height: 1; }
.wheel-hub .lbl { font-size: 0.62rem; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; }
.wheel-hub.hit { animation: hubPop 0.6s ease; }
@keyframes hubPop { 0% { transform: translate(-50%,-50%) scale(1);} 40% { transform: translate(-50%,-50%) scale(1.15);} 100% { transform: translate(-50%,-50%) scale(1);} }

.calc-line {
  font-size: clamp(1.1rem, 4.5vw, 1.6rem); font-weight: 800; letter-spacing: 0.02em;
}
.calc-line .res { color: var(--gold); }
.calc-line .old { color: var(--muted); }

.stage-message { text-align: center; padding: 1rem; }
.stage-message .big { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.4rem; }

/* ---------------- overlays ---------------- */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.fx-card {
  position: fixed; width: 110px; height: 154px; perspective: 900px; z-index: 61;
  will-change: transform;
}
.fx-card .inner {
  position: relative; width: 100%; height: 100%; transform-style: preserve-3d;
}
.fx-card .face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 12px;
  background-size: cover; background-position: center; box-shadow: var(--shadow);
}
.fx-card .face.front { transform: rotateY(180deg); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(6,8,16,0.7); z-index: 80;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal { width: min(520px, 100%); padding: 1.2rem; max-height: 88dvh; overflow: auto; }
.target-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.5rem; margin: 0.6rem 0; }
.target-btn { text-align: left; }

.toast-layer { position: fixed; top: 0.8rem; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 0.4rem; align-items: center; pointer-events: none; }
.toast {
  background: #26143a; border: 1px solid #5b3a8a; color: #f2e6ff;
  padding: 0.5rem 0.9rem; border-radius: 999px; font-size: 0.88rem; box-shadow: var(--shadow);
  animation: toastIn 0.25s ease both;
}
.toast.error { background: #3a1420; border-color: #8a3a4a; color: #ffd9df; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px);} to { opacity: 1; transform: none;} }

.history-list { max-height: 42dvh; overflow: auto; font-size: 0.84rem; }
.history-entry { padding: 0.45rem 0; border-bottom: 1px dashed var(--line); }
.history-entry .h-round { color: var(--accent); font-weight: 700; }

.end-screen { text-align: center; }
.rank-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.8rem; border-radius: 12px; background: #101528; }
.rank-row + .rank-row { margin-top: 0.4rem; }
.rank-row.first { background: linear-gradient(100deg, rgba(255,209,102,0.22), rgba(255,209,102,0.05)); border: 1px solid rgba(255,209,102,0.4); }
.rank-row .rk { width: 2rem; font-weight: 800; color: var(--muted); }
.rank-row .rname { flex: 1; text-align: left; font-weight: 700; }
.rank-row .rhp { font-weight: 800; }

.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.3s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.lucky-banner {
  display: inline-flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
  max-width: 100%;
  padding: 0.25rem 0.7rem; border-radius: 999px;
  background: rgba(255,209,102,0.14); color: var(--gold); font-weight: 700; font-size: 0.9rem;
}
.lucky-burst {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.lucky-burst .txt {
  font-size: clamp(2rem, 10vw, 4rem); font-weight: 900; letter-spacing: 0.06em;
  color: var(--gold); text-shadow: 0 0 30px rgba(255,209,102,0.8);
  animation: luckyPop 1.4s ease both;
}
@keyframes luckyPop {
  0% { transform: scale(0.4) rotate(-8deg); opacity: 0; }
  35% { transform: scale(1.15) rotate(2deg); opacity: 1; }
  70% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.1); opacity: 0; }
}

@media (max-width: 620px) {
  .hand-card { width: 78px; }
  .fx-card { width: 90px; height: 126px; }
  .stage { min-height: 40vh; }
}

/* ---------------- events / eggs ---------------- */
.event-banner {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.5rem 0.8rem; border-radius: 14px;
  background: linear-gradient(100deg, rgba(124,92,255,0.25), rgba(91,140,255,0.12));
  border: 1px solid rgba(124,92,255,0.45);
  font-size: 0.9rem;
}
.event-banner .ev-icon { font-size: 1.15rem; }

.sys-error {
  position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none;
  background: rgba(20, 0, 0, 0.35);
  animation: sysFlicker 0.35s steps(2) 4;
}
.sys-error .sys-line {
  font-weight: 900; letter-spacing: 0.12em; color: #ff5b6e;
  font-size: clamp(1.6rem, 7vw, 3rem); text-shadow: 0 0 24px rgba(255,80,100,0.8);
}
.sys-error .sys-line.small { font-size: clamp(0.8rem, 3.5vw, 1.2rem); color: #ffb3bd; margin-top: 0.4rem; letter-spacing: 0.2em; }
@keyframes sysFlicker { 0% { opacity: 0.4; } 100% { opacity: 1; } }

.final-banner {
  position: absolute; top: 0.6rem; left: 50%; transform: translateX(-50%);
  z-index: 6; font-weight: 900; letter-spacing: 0.28em; font-size: clamp(0.9rem, 4vw, 1.4rem);
  color: var(--gold); text-shadow: 0 0 18px rgba(255,209,102,0.8);
  animation: finalPulse 1.2s ease-in-out infinite alternate;
}
@keyframes finalPulse { from { opacity: 0.6; } to { opacity: 1; } }

.wheel-wrap.final { width: min(84vw, 460px); }
.wheel-wrap.final .wheel-ring { box-shadow: inset 0 0 0 2px var(--gold), 0 0 40px rgba(255,209,102,0.35); }

/* ---------------- player tags / titles ---------------- */
.ptags { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; font-size: 0.72rem; }
.tag-bad { background: rgba(255,107,122,0.18); color: var(--bad); padding: 0.1rem 0.45rem; border-radius: 999px; }
.tag-exec { background: rgba(255,80,100,0.22); color: #ff9aa6; padding: 0.1rem 0.45rem; border-radius: 999px; }
.player-card.bankrupt { border-color: rgba(255,107,122,0.6); box-shadow: 0 0 0 1px rgba(255,107,122,0.4); }
.ptitles { font-size: 0.7rem; color: var(--gold); margin-top: 0.25rem; }

/* ---------------- mission / codex ---------------- */
.mission-box {
  border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem;
  background: #101528;
}
.mission-box.done { border-color: var(--gold); background: rgba(255,209,102,0.08); }
.mission-name { font-weight: 800; font-size: 1.05rem; margin-bottom: 0.2rem; }
.mission-progress { margin: 0.5rem 0; font-weight: 700; color: var(--accent); }

.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.6rem; }
.codex-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem; text-align: center;
  background: #101528; opacity: 0.75;
}
.codex-card.known { opacity: 1; border-color: rgba(255,209,102,0.5); background: rgba(255,209,102,0.06); }
.codex-icon { font-size: 1.6rem; }
.codex-name { font-weight: 800; margin: 0.25rem 0; }
.codex-recipe { font-size: 0.74rem; color: var(--muted); }

/* ---------------- rules guide ---------------- */
.rules-body { max-height: 70dvh; overflow: auto; }
.rules-body h4 { margin: 0.9rem 0 0.35rem; color: var(--accent); }
.rules-list { margin: 0; padding-left: 1.1rem; font-size: 0.86rem; line-height: 1.55; }
.rules-list code { background: #101528; padding: 0.05rem 0.35rem; border-radius: 6px; }
.rules-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.5rem; margin-top: 0.4rem; }
.rules-card { display: flex; gap: 0.5rem; align-items: center; background: #101528; border: 1px solid var(--line); border-radius: 12px; padding: 0.5rem; }
.rules-card img { width: 42px; border-radius: 7px; }
.rules-card-name { font-weight: 800; }
.rules-card-meta { font-size: 0.74rem; color: var(--gold); margin: 0.1rem 0; }

/* ---------------- replay ---------------- */
.replay-progress { flex: 1; min-width: 120px; height: 6px; accent-color: var(--accent); cursor: pointer; }
#replayBadge { background: rgba(124,92,255,0.25); color: #c8b6ff; }
.replay-bar { flex-wrap: wrap; }
.replay-step { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }

/* ---------------- chat ---------------- */
.chat-toggle { position: relative; }
.chat-unread {
  position: absolute; top: -6px; right: -6px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--bad); color: #fff; font-size: 10px; line-height: 16px;
  text-align: center; font-weight: 700;
}
.chat-panel {
  position: fixed; right: 12px; bottom: 12px; z-index: 75;
  width: min(340px, 92vw); height: min(440px, 62dvh);
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); overflow: hidden;
}
.chat-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--line); }
.chat-log { flex: 1; overflow-y: auto; padding: 0.6rem 0.7rem; display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.86rem; }
.chat-msg { line-height: 1.4; }
.chat-msg .who { font-weight: 700; color: var(--accent); margin-right: 0.3rem; }
.chat-msg.self .who { color: var(--gold); }
.chat-msg .txt { word-break: break-word; color: var(--text); }
.chat-input { display: flex; gap: 0.4rem; padding: 0.5rem 0.6rem; border-top: 1px solid var(--line); }
.chat-input .input { flex: 1; padding: 0.55rem 0.7rem; }
.chat-input .btn { padding: 0.55rem 0.9rem; }
@media (max-width: 620px) {
  .chat-panel { left: 8px; right: 8px; bottom: 8px; width: auto; height: 52dvh; }
}

/* ======================================================================
   TECH THEME  (overrides — sci-fi / cyber look)
   ====================================================================== */
:root {
  --bg: #04060e;
  --bg-2: #060d1c;
  --panel: #0a1326;
  --panel-2: #101c38;
  --line: #1c3054;
  --text: #dff2ff;
  --muted: #6f87b5;
  --accent: #35e0ff;
  --accent-2: #8b5cff;
  --gold: #ffd166;
  --good: #3cf2a0;
  --bad: #ff5b7a;
  --glow: 0 0 18px rgba(53, 224, 255, 0.35);
  --shadow: 0 0 0 1px rgba(53, 224, 255, 0.05), 0 16px 44px rgba(0, 0, 0, 0.6);
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 700px at 50% -10%, rgba(53, 224, 255, 0.10), transparent 60%),
    radial-gradient(900px 600px at 105% 115%, rgba(139, 92, 255, 0.12), transparent 60%),
    linear-gradient(rgba(53, 224, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 224, 255, 0.045) 1px, transparent 1px);
  background-size: auto, auto, 46px 46px, 46px 46px;
  background-attachment: fixed, fixed, fixed, fixed;
  font-family: "Rajdhani", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.logo {
  background: linear-gradient(100deg, #7ff0ff, #8b5cff 55%, #ffd166);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(53, 224, 255, 0.45));
}

.btn {
  background: linear-gradient(180deg, rgba(53, 224, 255, 0.10), rgba(53, 224, 255, 0.03));
  border: 1px solid rgba(53, 224, 255, 0.35);
  color: #dff2ff;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  text-transform: none; letter-spacing: 0.02em;
}
.btn:hover { background: rgba(53, 224, 255, 0.18); border-color: var(--accent); box-shadow: var(--glow); }
.btn.primary { background: linear-gradient(120deg, #35e0ff, #8b5cff); border-color: transparent; color: #04121c; font-weight: 800; }
.btn.primary:hover { filter: brightness(1.12) saturate(1.1); box-shadow: 0 0 22px rgba(53, 224, 255, 0.55); }
.btn.gold { background: linear-gradient(120deg, #ffce54, #ff9f43); color: #201600; border-color: transparent; font-weight: 800; }
.btn.danger { border-color: rgba(255, 91, 122, 0.6); color: #ffb3c0; background: rgba(255, 91, 122, 0.06); }
.btn.danger:hover { background: rgba(255, 91, 122, 0.16); box-shadow: 0 0 16px rgba(255, 91, 122, 0.35); }

.input {
  background: #060c19;
  border: 1px solid var(--line);
  color: var(--text);
}
.input:focus { border-color: var(--accent); box-shadow: var(--glow); }

.badge {
  background: rgba(53, 224, 255, 0.08);
  border: 1px solid rgba(53, 224, 255, 0.22);
  color: #9fe8ff;
}
.badge.gold { background: rgba(255, 209, 102, 0.14); border-color: rgba(255, 209, 102, 0.35); color: var(--gold); }

.card-panel {
  position: relative;
  background: linear-gradient(160deg, rgba(16, 28, 56, 0.92), rgba(7, 13, 27, 0.94));
  border: 1px solid var(--line);
  border-radius: 4px;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  box-shadow: none;
  filter: drop-shadow(0 0 1px rgba(53, 224, 255, 0.25)) drop-shadow(0 14px 30px rgba(0, 0, 0, 0.55));
}
.card-panel::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  border: 1px solid rgba(53, 224, 255, 0.12);
  clip-path: inherit;
}

.topbar { border-bottom: 1px solid rgba(53, 224, 255, 0.25); }
.stat { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.hp, .timer, .wheel-hub .val, .rank-row .rhp, .cd-badge, .replay-label, #replayLabel {
  font-family: ui-monospace, "Consolas", "SFMono-Regular", monospace;
}

.players-strip .player-card {
  background: linear-gradient(180deg, rgba(16, 28, 56, 0.75), rgba(8, 14, 28, 0.85));
  border: 1px solid rgba(53, 224, 255, 0.16);
  border-radius: 4px;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.player-card.active { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(255,209,102,0.45), 0 0 22px rgba(255,209,102,0.28); }
.player-card.self { border-color: rgba(53, 224, 255, 0.6); }
.hp { text-shadow: 0 0 12px rgba(53, 224, 255, 0.25); }

.stage {
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(53, 224, 255, 0.08), transparent 70%),
    linear-gradient(180deg, rgba(6, 12, 24, 0.92), rgba(4, 8, 16, 0.96));
  border: 1px solid rgba(53, 224, 255, 0.22);
  border-radius: 6px;
  box-shadow: inset 0 0 60px rgba(53, 224, 255, 0.06);
}

.wheel-ring {
  background: conic-gradient(from 0deg, #12325a, #0a1730, #2a1a5a, #0a1730, #12325a);
  box-shadow: inset 0 0 0 1px rgba(53, 224, 255, 0.35), 0 0 40px rgba(53, 224, 255, 0.22);
}
.wheel-hub { border: 1px solid rgba(53, 224, 255, 0.45); box-shadow: inset 0 6px 18px rgba(0,0,0,0.6), 0 0 24px rgba(53, 224, 255, 0.25); }
.wheel-hub .val { color: var(--gold); text-shadow: 0 0 16px rgba(255,209,102,0.6); }
.wheel-pointer { filter: drop-shadow(0 0 8px rgba(255,209,102,0.8)); }

.hand-card img { border-radius: 6px; box-shadow: 0 8px 22px rgba(0,0,0,0.6), 0 0 0 1px rgba(53,224,255,0.18); }
.hand-card.playable img { box-shadow: 0 8px 22px rgba(0,0,0,0.6), 0 0 0 2px rgba(53, 224, 255, 0.55), 0 0 20px rgba(53, 224, 255, 0.35); }
.hand-card.playable:hover { transform: translateY(-8px); }

.modal-backdrop { background: rgba(3, 6, 12, 0.72); backdrop-filter: blur(4px); }
.rank-row, .history-entry, .target-btn, .codex-card, .mission-box { border-radius: 4px; }
.rank-row { border: 1px solid rgba(53, 224, 255, 0.14); }
.rank-row.first { border-color: rgba(255, 209, 102, 0.5); box-shadow: 0 0 20px rgba(255, 209, 102, 0.18); }

/* scrollbars */
* { scrollbar-color: rgba(53, 224, 255, 0.35) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(53, 224, 255, 0.3); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

.chat-panel { border-radius: 4px; border: 1px solid rgba(53, 224, 255, 0.25); box-shadow: 0 0 0 1px rgba(53,224,255,0.08), 0 18px 44px rgba(0,0,0,0.6); }

.event-banner {
  background: linear-gradient(100deg, rgba(139, 92, 255, 0.22), rgba(53, 224, 255, 0.08));
  border: 1px solid rgba(53, 224, 255, 0.35);
  border-radius: 4px;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.final-banner { text-shadow: 0 0 20px rgba(255, 209, 102, 0.9), 0 0 40px rgba(255, 209, 102, 0.4); }

h1, h2, .section-title, .event-banner, .logo { letter-spacing: 0.06em; }
.section-title { color: #7ff0ff; text-shadow: 0 0 10px rgba(53,224,255,0.3); }

