﻿:root {
  --bg: #0f1419;
  --bg-card: #1a2332;
  --bg-deep: #0a0f15;
  --accent: #ffd700;
  --text: #e8edf2;
  --text-dim: #8b9bb0;
  --win: #4ade80;
  --neutral: #fbbf24;
  --loss: #f87171;
  --border: #2a3a52;
  --cyan: #38bdf8;
  --violet: #a78bfa;
  --pink: #f72585;
  --primary: linear-gradient(135deg, #ff6b35, #f72585);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overscroll-behavior: none; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(247, 37, 133, 0.16), transparent 22rem),
    radial-gradient(circle at 10% 80%, rgba(239, 68, 68, 0.10), transparent 18rem),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow-x: hidden;
  user-select: none;
  touch-action: manipulation;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.page-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 2px 0 4px;
}
.page-title { text-align: center; font-size: 16px; font-weight: 900; }
.nav-btn {
  min-width: 58px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 11px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-btn:active { transform: scale(0.97); }

.user-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.18), rgba(56, 189, 248, 0.06)), var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 14px;
}
.user-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #a78bfa, #38bdf8);
  display: grid;
  place-items: center;
  font-size: 28px;
  flex: 0 0 auto;
  color: white;
  box-shadow: 0 12px 24px rgba(56, 189, 248, 0.18);
}
.user-info { min-width: 0; }
.user-name {
  font-size: clamp(13px, 3.4vw, 16px);
  font-weight: 950;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0;
  line-height: 1.08;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.user-uid {
  display: inline-block;
  vertical-align: baseline;
  font-size: 1.12em;
  font-weight: 1000;
}
.user-login-id {
  display: inline-block;
  max-width: min(130px, 44vw);
  margin-left: 6px;
  color: #b7c9ee;
  font-size: 0.62em;
  font-weight: 850;
  vertical-align: baseline;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-summary {
  margin-top: 7px;
  font-size: 11px;
  color: #a7c7ff;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-summary b {
  color: #ff6b35;
  font-weight: 900;
  font-family: ui-monospace, monospace;
}
.user-summary .gold {
  color: var(--accent);
  font-weight: 900;
  font-family: ui-monospace, monospace;
}
.user-xp-track {
  width: min(220px, 100%);
  height: 5px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(10, 15, 21, 0.72);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(43, 60, 83, 0.8);
}
.user-xp-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a78bfa, #38bdf8);
  transition: width 0.25s ease;
}
.user-lv-pill {
  border: 1px solid rgba(167, 139, 250, 0.4);
  color: var(--accent);
  background: rgba(10, 15, 21, 0.34);
  border-radius: 14px;
  padding: 8px 11px;
  font-size: 18px;
  line-height: 1;
  font-weight: 950;
  font-family: ui-monospace, monospace;
  min-width: 68px;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(167, 139, 250, 0.12);
}

.topbar { display: grid; grid-template-columns: minmax(82px, 0.48fr) minmax(0, 1.72fr); gap: 8px; }
.topcard {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 10px;
  min-width: 0;
}
.topcard-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.topcard-value {
  font-size: clamp(17px, 5.5vw, 22px);
  font-weight: 900;
  margin-top: 4px;
  line-height: 1;
  min-width: 0;
  white-space: nowrap;
  letter-spacing: 0;
}
.topcard-value.power { color: #ff6b35; }
.topcard-value.power[data-digits="4"] { font-size: clamp(16px, 4.7vw, 21px); }
.topcard-value.power[data-digits="5"] { font-size: clamp(15px, 4.3vw, 20px); }
.topcard-value.power[data-digits="6"],
.topcard-value.power[data-digits="7"],
.topcard-value.power[data-digits="8"],
.topcard-value.power[data-digits="9"] { font-size: clamp(13px, 3.9vw, 18px); }
.topcard-value.shard { color: #38bdf8; font-size: clamp(15px, 4.9vw, 20px); }
.topcard-value.shard[data-digits="6"] { font-size: clamp(13px, 4.1vw, 18px); }
.topcard-value.shard[data-digits="7"] { font-size: clamp(12px, 3.8vw, 16px); }
.topcard-value.shard[data-digits="8"],
.topcard-value.shard[data-digits="9"],
.topcard-value.shard[data-digits="10"] { font-size: clamp(10px, 3.2vw, 14px); }
.topcard-sub { font-size: 10px; color: var(--text-dim); margin-top: 4px; }
.reward-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
  letter-spacing: 0;
  min-width: 0;
}
.reward-line .divider {
  color: var(--text-dim);
  font-size: 0.92em;
  text-align: center;
}
.reward-line .reward-daily,
.reward-line .reward-weekly {
  text-align: left;
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
}
.reward-line .reward-label {
  display: inline-block;
  font-size: 0.55em;
  font-weight: 900;
  transform: translateY(-0.04em);
  opacity: 0.92;
}

@media (max-width: 380px) {
  .topbar { grid-template-columns: minmax(74px, 0.42fr) minmax(0, 1.78fr); gap: 6px; }
  .topcard { padding: 10px 8px; }
  .reward-line { gap: 4px; }
  .reward-line .reward-label { font-size: 0.50em; }
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 2px 0;
  margin-top: 4px;
}
.section-title .sub {
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.75;
  font-weight: 700;
}

/* ==================== match-card (諛고? phase 癒몄떊) ==================== */
.match-card {
  position: relative;
  background:
    radial-gradient(circle at 50% 0%, rgba(239, 68, 68, 0.12), transparent 60%),
    linear-gradient(135deg, rgba(247, 37, 133, 0.18), rgba(255, 107, 53, 0.06)),
    var(--bg-card);
  border: 1px solid rgba(247, 37, 133, 0.4);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  box-shadow: 0 0 24px rgba(247, 37, 133, 0.18);
  overflow: hidden;
}
.match-card.hidden { display: none; }
.match-meta {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
}
.match-title { font-size: 22px; font-weight: 900; line-height: 1; }
.match-sub { font-size: 12px; color: var(--text-dim); }

.match-btn {
  margin-top: 6px;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  width: 100%;
  max-width: 260px;
  font-family: inherit;
}
.match-btn:active { transform: scale(0.98); }
.match-btn.ghost {
  background: var(--bg-deep);
  color: var(--text);
  border: 1px solid var(--border);
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 8px;
  width: 100%;
  max-width: 360px;
  margin-top: 6px;
}
.action-row.three {
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: 6px;
  max-width: 380px;
}
.action-row .match-btn { margin-top: 0; max-width: none; padding: 12px 8px; font-size: 14px; }
.action-row.three .match-btn { padding: 11px 4px; font-size: 13px; }
.action-row.three .match-btn.cancel { font-size: 12px; padding: 11px 0; opacity: 0.85; }

.match-spinner {
  font-size: 56px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.match-card.shake {
  animation: cardShake 0.18s ease-in-out infinite;
  border-color: var(--loss);
  box-shadow:
    0 0 28px rgba(239, 68, 68, 0.42),
    inset 0 0 32px rgba(239, 68, 68, 0.16);
}
@keyframes cardShake {
  0%   { transform: translate3d(0, 0, 0); }
  20%  { transform: translate3d(-5px, 1px, 0); }
  40%  { transform: translate3d(5px, -1px, 0); }
  60%  { transform: translate3d(-4px, 2px, 0); }
  80%  { transform: translate3d(4px, -2px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
.match-card.flash { animation: cardFlash 0.6s ease-out; }
@keyframes cardFlash {
  0%   { box-shadow: 0 0 0 transparent; border-color: var(--border); }
  40%  { box-shadow: 0 0 30px rgba(255, 215, 0, 0.65); border-color: var(--accent); }
  100% { box-shadow: 0 0 24px rgba(247, 37, 133, 0.18); border-color: rgba(247, 37, 133, 0.4); }
}

.found-banner {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--neutral);
  text-transform: uppercase;
  animation: bannerFade 0.45s ease;
}
@keyframes bannerFade {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.found-banner.fight {
  color: var(--loss);
  letter-spacing: 6px;
  font-size: 14px;
  animation: fightPulse 0.42s ease-in-out infinite alternate;
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.65);
}
@keyframes fightPulse {
  from { opacity: 0.6; transform: scale(1); }
  to   { opacity: 1; transform: scale(1.06); }
}

/* ?⑷툑 踰좏똿 諛곕꼫 ???덉씠 嫄몃┛ 臾닿쾶媛?*/
.stake-banner {
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 2px;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}
.stake-banner b {
  font-size: 16px;
  font-family: ui-monospace, monospace;
  margin: 0 4px;
}
.stake-banner.glow { animation: stakeGlow 0.7s ease-in-out infinite alternate; }
.stake-banner.pulse { animation: stakePulse 0.5s ease-in-out infinite alternate; }
@keyframes stakeGlow {
  from { text-shadow: 0 0 6px rgba(255, 215, 0, 0.4); transform: scale(1); }
  to   { text-shadow: 0 0 18px rgba(255, 215, 0, 0.85); transform: scale(1.04); }
}
@keyframes stakePulse {
  from { opacity: 0.85; }
  to   { opacity: 1; text-shadow: 0 0 14px rgba(255, 215, 0, 0.7); }
}

.bet-preview {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: baseline;
  width: 100%;
  max-width: 320px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.4px;
}
.bet-preview b { font-family: ui-monospace, monospace; font-size: 14px; font-weight: 900; }
.bet-preview .bet-win b { color: var(--win); }
.bet-preview .bet-loss b { color: var(--loss); }
.bet-preview .bet-divider { color: var(--text-dim); opacity: 0.6; }

.vs-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 4px 0;
}
.vs-side {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
}
.vs-pair {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  min-height: 64px;
}
.vs-sword {
  position: absolute;
  bottom: -4px;
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(247, 37, 133, 0.55));
  z-index: 2;
  pointer-events: none;
}
.vs-side.left .vs-sword,
.vs-side:not(.right) .vs-sword {
  right: calc(50% - 64px);
  bottom: 4px;
  transform: scale(-1, -1);
}
.vs-side.right .vs-sword {
  left: calc(50% - 64px);
  bottom: 4px;
  transform: scaleY(-1);
}
.vs-sword.glow { animation: swordGlow 0.5s ease-in-out infinite alternate; }
@keyframes swordGlow {
  from { filter: drop-shadow(0 0 4px rgba(247, 37, 133, 0.35)); }
  to   { filter: drop-shadow(0 0 14px rgba(239, 68, 68, 0.85)) brightness(1.15); }
}

.vs-avatar {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.25), rgba(247, 37, 133, 0.10)), var(--bg-deep);
  display: grid;
  place-items: center;
  font-size: 36px;
  line-height: 1;
  margin: 0 auto 6px;
  border: 1px solid rgba(255, 107, 53, 0.32);
  box-shadow: 0 0 14px rgba(247, 37, 133, 0.18);
}
.vs-row.vs-reveal .vs-avatar {
  animation: avatarPop 0.4s cubic-bezier(0.5, 1.6, 0.4, 1);
}
@keyframes avatarPop {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.vs-label {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 1px;
  font-weight: 800;
}

/* LV ?쇱씤 ??UID ??以?(紐⑤컮??媛?낆꽦) */
.vs-lv-line {
  font-size: 11px;
  font-weight: 900;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--neutral);
  letter-spacing: 0.5px;
  line-height: 1;
  margin: 0 0 3px;
  opacity: 0.95;
}

/* ?ъ슜???곷? 援щ텇 ??醫뚯륫 me ?쒖븞, ?곗륫 opp ?묓겕 */
.vs-side.left {
  border-color: rgba(56, 189, 248, 0.5);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.10), rgba(74, 222, 128, 0.03)), var(--bg-deep);
}
.vs-side.left .vs-avatar {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.32), rgba(74, 222, 128, 0.10)), var(--bg-deep);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
}
.vs-side.right {
  border-color: rgba(247, 37, 133, 0.5);
  background: linear-gradient(135deg, rgba(247, 37, 133, 0.10), rgba(248, 113, 133, 0.03)), var(--bg-deep);
}
.vs-side.right .vs-avatar {
  background: linear-gradient(135deg, rgba(247, 37, 133, 0.32), rgba(248, 113, 133, 0.12)), var(--bg-deep);
  border-color: rgba(247, 37, 133, 0.5);
  box-shadow: 0 0 14px rgba(247, 37, 133, 0.25);
}
.vs-label.me { color: var(--cyan); font-weight: 900; }
.vs-label.opp { color: var(--loss); font-weight: 900; }
.vs-stats {
  margin-top: 7px;
  font-size: 12px;
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.4px;
}
.vs-stats b {
  color: var(--accent);
  font-weight: 900;
  font-size: 16px;
  font-family: inherit;
}
.vs-mid {
  font-size: 12px;
  font-weight: 900;
  color: var(--text-dim);
  letter-spacing: 1px;
}
.vs-mid.spark {
  font-size: 42px;
  animation: sparkSpin 0.6s linear infinite;
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.5));
}
@keyframes sparkSpin {
  0%   { transform: rotate(-20deg) scale(1); }
  50%  { transform: rotate(20deg) scale(1.35); }
  100% { transform: rotate(-20deg) scale(1); }
}
.vs-power {
  font-size: 24px;
  font-weight: 900;
  margin-top: 4px;
  color: var(--accent);
  font-family: ui-monospace, monospace;
}

.battle-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 6px;
  background: linear-gradient(135deg, #ef4444, #f72585);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: battleGlow 0.6s ease-in-out;
}
@keyframes battleGlow {
  0%   { transform: scale(0.6); opacity: 0; filter: drop-shadow(0 0 0 transparent); }
  60%  { transform: scale(1.18); opacity: 1; filter: drop-shadow(0 0 16px rgba(239, 68, 68, 0.85)); }
  100% { transform: scale(1); opacity: 1; filter: drop-shadow(0 0 8px rgba(247, 37, 133, 0.5)); }
}

/* battling phase ??HP ?쇱슫??李④컧 (?쇳?湲곕뒗 紐⑤뱶) */
.vs-side.hp-side { position: relative; overflow: visible; }
.vs-row.vs-battle .vs-side {
  background: var(--bg-deep);
  border-color: rgba(239, 68, 68, 0.32);
}
.vs-row.vs-battle .vs-power {
  font-size: 22px;
  color: var(--text);
}
.hp-bar {
  height: 6px;
  background: var(--bg-deep);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}
.hp-bar-fill {
  height: 100%;
  transition: width 0.16s linear;
  background: linear-gradient(90deg, #ff6b35, #f72585);
  border-radius: inherit;
}
.hp-bar-fill.you { background: linear-gradient(90deg, var(--accent), #ff6b35); }
.hp-bar-fill.bot { background: linear-gradient(90deg, var(--loss), #7f1d1d); }

/* ?쇳?湲곕뒗 ?곕?吏 ????怨⑤뱶 ?먯떎 = ??*/
.damage-pop {
  position: absolute;
  left: 50%;
  top: 6px;
  transform: translateX(-50%);
  font-size: 22px;
  font-weight: 900;
  pointer-events: none;
  animation: damageRise 0.72s ease-out forwards;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  z-index: 3;
  white-space: nowrap;
  max-width: 100%;
  letter-spacing: -0.5px;
}
.damage-pop.blood {
  color: #fecaca;
  text-shadow:
    0 0 14px rgba(239, 68, 68, 0.95),
    0 0 6px rgba(127, 29, 29, 0.9),
    1px 1px 0 #7f1d1d,
    -1px -1px 0 #450a0a;
}
@keyframes damageRise {
  0%   { opacity: 0; transform: translate(-50%, 6px) scale(0.7) rotate(-3deg); }
  18%  { opacity: 1; transform: translate(-50%, -10px) scale(1.35) rotate(2deg); }
  60%  { opacity: 1; transform: translate(-50%, -34px) scale(1) rotate(-1deg); }
  100% { opacity: 0; transform: translate(-50%, -56px) scale(0.92); }
}

/* ==================== stake 카드 그리드 ==================== */
.stake-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.stake-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 12px;
  padding: 11px 14px;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: start;
  gap: 3px 10px;
  text-align: left;
}
.stake-card:active { transform: scale(0.99); }
.stake-card.cant { opacity: 0.42; cursor: not-allowed; }

.stake-card .stake-tag {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.4px;
  color: var(--text-dim);
  text-transform: uppercase;
  grid-column: 1;
  grid-row: 1;
}
.stake-card .stake-amount {
  font-size: 22px;
  font-weight: 900;
  color: var(--accent);
  font-family: ui-monospace, monospace;
  line-height: 1;
  grid-column: 1;
  grid-row: 2;
}
.stake-card .stake-unit {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 700;
  margin-left: 4px;
}
.stake-card .stake-reward {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  background: rgba(74, 222, 128, 0.10);
  border: 1px solid rgba(74, 222, 128, 0.26);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11px;
  color: var(--win);
  font-weight: 800;
  text-align: right;
  font-family: ui-monospace, monospace;
  white-space: nowrap;
}

.stake-card.green   { border-color: rgba(74, 222, 128, 0.22);  border-left-color: var(--win); }
.stake-card.cyan    { border-color: rgba(56, 189, 248, 0.22);  border-left-color: var(--cyan); }
.stake-card.violet  { border-color: rgba(167, 139, 250, 0.26); border-left-color: var(--violet); }
.stake-card.fire {
  border-color: rgba(255, 107, 53, 0.32);
  border-left-color: #ff6b35;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.08), rgba(247, 37, 133, 0.03)), var(--bg-card);
}
.stake-card.pink {
  border-color: rgba(247, 37, 133, 0.40);
  border-left-color: var(--pink);
  background: linear-gradient(135deg, rgba(247, 37, 133, 0.12), rgba(255, 107, 53, 0.04)), var(--bg-card);
  box-shadow: 0 0 14px rgba(247, 37, 133, 0.14);
}

#stake-section.hidden { display: none; }

.goldwar-foot {
  text-align: center;
  color: var(--text-dim);
  font-size: 10px;
  opacity: 0.65;
  margin-top: 8px;
  line-height: 1.6;
}
.goldwar-foot b { color: var(--accent); }

.goldwar-history-section {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}
.goldwar-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  font-size: 13px;
}
.gw-log-entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  border-left-width: 2px;
}
.gw-log-entry.win  { color: rgba(74, 222, 128, 0.60);  border-left-color: rgba(74, 222, 128, 0.32); }
.gw-log-entry.loss { color: rgba(248, 113, 113, 0.60); border-left-color: rgba(248, 113, 113, 0.32); }
.gw-log-entry.tie  { color: rgba(251, 191, 36, 0.55);  border-left-color: rgba(251, 191, 36, 0.28); }
.gw-log-entry.placeholder {
  color: var(--text-dim);
  justify-content: center;
  grid-template-columns: 1fr;
  text-align: center;
  border-left-width: 1px;
}
.gw-log-main {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}
.gw-log-delta {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0.75;
}

/* ==================== 紐⑤떖 ==================== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  animation: fadeIn 0.18s ease;
}
.overlay.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border-radius: 18px;
  padding: 22px 18px;
  text-align: center;
  border: 1px solid var(--border);
}
.confirm-icon { font-size: 48px; }
.confirm-icon.waiting-pulse { animation: waitingPulse 0.95s ease-in-out infinite alternate; }
@keyframes waitingPulse {
  from { transform: scale(0.96); opacity: 0.62; }
  to   { transform: scale(1.05); opacity: 1; }
}
.waiting-orbit {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto 8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.12), rgba(56, 189, 248, 0.04) 58%, transparent 60%);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.12);
}
.waiting-orbit::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  border: 1px solid rgba(255, 215, 0, 0.28);
  border-top-color: rgba(56, 189, 248, 0.86);
  border-right-color: rgba(247, 37, 133, 0.72);
  animation: waitSpin 1.35s linear infinite;
}
.waiting-core {
  position: relative;
  z-index: 1;
  font-size: 34px;
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.28));
  animation: waitBob 1.05s ease-in-out infinite alternate;
}
.waiting-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
  animation: waitDot 1.2s ease-in-out infinite;
}
.waiting-dot.d1 { left: 10px; top: 17px; animation-delay: 0s; }
.waiting-dot.d2 { right: 7px; top: 33px; background: var(--cyan); animation-delay: 0.16s; }
.waiting-dot.d3 { left: 30px; bottom: 6px; background: var(--pink); animation-delay: 0.32s; }
@keyframes waitSpin { to { transform: rotate(360deg); } }
@keyframes waitBob {
  from { transform: translateY(2px) scale(0.96); opacity: 0.72; }
  to { transform: translateY(-2px) scale(1.05); opacity: 1; }
}
@keyframes waitDot {
  0%, 100% { transform: scale(0.65); opacity: 0.38; }
  50% { transform: scale(1.08); opacity: 1; }
}
.waiting-progress {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(10, 15, 21, 0.78);
  border: 1px solid rgba(43, 60, 83, 0.75);
  margin: 0 0 8px;
}
.waiting-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--cyan), var(--accent), var(--pink));
  animation: waitProgress var(--wait-ms, 3000ms) linear forwards;
}
@keyframes waitProgress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.waiting-meta {
  color: var(--text-dim);
  font-size: 10px;
  margin-bottom: 14px;
}
.confirm-actions.waiting-actions { margin-top: 2px; }
.confirm-title { font-size: 22px; font-weight: 900; margin: 12px 0 10px; }
.confirm-title.countdown-title { font-size: 16px; margin: 14px 0 4px; color: var(--text); }
.confirm-sub {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 18px;
}
.confirm-sub b { color: var(--text); font-weight: 800; }
.confirm-sub b.gold { color: var(--accent); }
.confirm-sub b.loss { color: var(--loss); }
.confirm-sub b.uid { color: var(--cyan); font-family: ui-monospace, monospace; }
.confirm-sub .muted { color: var(--text-dim); opacity: 0.75; font-size: 11px; }
.confirm-sub.countdown-sub { margin-bottom: 10px; }

/* 5珥?移댁슫?몃떎??留?*/
.countdown-ring {
  width: 76px;
  height: 76px;
  margin: 6px auto 4px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 215, 0, 0.42);
  background: rgba(10, 15, 21, 0.55);
  color: var(--accent);
  font-family: ui-monospace, monospace;
  box-shadow: 0 0 24px rgba(247, 37, 133, 0.18);
  animation: countdownPulse 1s ease-in-out infinite alternate;
}
.countdown-ring span { font-size: 34px; font-weight: 950; line-height: 1; }
@keyframes countdownPulse {
  from { box-shadow: 0 0 12px rgba(255, 215, 0, 0.28); }
  to   { box-shadow: 0 0 28px rgba(255, 215, 0, 0.5); }
}

/* 紐⑤떖 ??VS 而댄뙥????留ㅼ튂移대뱶 64px ??52px */
.modal .vs-row { margin: 4px 0; gap: 8px; }
.modal .vs-side { padding: 10px 6px; }
.modal .vs-pair { min-height: 56px; margin-bottom: 4px; }
.modal .vs-avatar { width: 52px; height: 52px; font-size: 26px; margin: 0 auto 4px; }
.modal .vs-sword { font-size: 26px; }
.modal .vs-side.left .vs-sword,
.modal .vs-side:not(.right) .vs-sword { right: calc(50% - 52px); }
.modal .vs-side.right .vs-sword { left: calc(50% - 52px); }
.modal .vs-stats { font-size: 11px; margin-top: 4px; }
.modal .vs-stats b { font-size: 14px; }
.modal .vs-mid { font-size: 14px; }
.modal .bet-preview { font-size: 10px; margin: 6px auto 4px; max-width: 280px; }
.modal .bet-preview b { font-size: 13px; }
.modal .found-banner { margin-bottom: 4px; }

.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.confirm-actions.single { /* ?⑥씪 踰꾪듉 ??遺紐?flex濡?異⑸텇 */ }

/* 遺?ㅽ듃 ?꾩씠????踰좏똿 ?뺤씤 紐⑤떖 ???듭뀡 */
.boost-item {
  width: 100%;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin: 0 0 14px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.boost-item:active { transform: scale(0.99); }
.boost-item.active {
  border-color: rgba(255, 215, 0, 0.55);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.10), rgba(255, 107, 53, 0.04)), var(--bg-deep);
}
.boost-check {
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  position: relative;
  background: rgba(10, 15, 21, 0.5);
}
.boost-item.active .boost-check {
  border-color: var(--accent);
  background: var(--accent);
}
.boost-item.active .boost-check::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--bg);
  font-weight: 900;
  font-size: 14px;
  line-height: 1;
}
.boost-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.boost-name {
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
}
.boost-desc {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.3;
}
.boost-cost {
  font-size: 13px;
  font-weight: 900;
  color: var(--accent);
  font-family: ui-monospace, monospace;
  white-space: nowrap;
}
.boost-warning {
  font-size: 11px;
  color: var(--loss);
  margin: -8px 0 12px;
  font-weight: 800;
  text-align: center;
}

/* 諛고? ?붾㈃ ?묒륫 遺?ㅽ듃 ?ъ슜 ?щ? 移???而댄뙥??*/
.boost-badge {
  display: inline-block;
  margin: 5px 0 3px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1.2;
  white-space: nowrap;
}
.boost-badge.active {
  background: rgba(255, 215, 0, 0.16);
  border: 1px solid rgba(255, 215, 0, 0.62);
  color: var(--accent);
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.55);
  animation: boostBadgePulse 1.1s ease-in-out infinite alternate;
}
.boost-badge.off {
  background: rgba(20, 28, 40, 0.45);
  border: 1px solid var(--border);
  color: var(--text-dim);
  opacity: 0.55;
}
@keyframes boostBadgePulse {
  from { box-shadow: 0 0 6px rgba(255, 215, 0, 0.28); transform: scale(1); }
  to   { box-shadow: 0 0 16px rgba(255, 215, 0, 0.62); transform: scale(1.05); }
}

/* 怨⑤뱶???밸쪧 ?뚰듃 ??baseScore = stake, score = stake + ?꾪닾??*/
.win-rate-hint {
  margin: 6px 0 4px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 800;
  letter-spacing: 0.2px;
}
.win-rate-hint b {
  color: var(--accent);
  font-family: ui-monospace, monospace;
  font-size: 14px;
  font-weight: 950;
  margin: 0 2px;
}
.win-rate-hint .muted {
  color: var(--text-dim);
  opacity: 0.7;
  font-size: 10px;
  margin-left: 4px;
}

.result-headline {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 4px;
  margin-bottom: 10px;
}
.result-headline.win { color: var(--win); }
.result-headline.loss { color: var(--loss); }
.result-headline.tie { color: var(--neutral); }
.reward-row.tie b.down { color: var(--neutral); }
.reward-row.tie .cap { color: var(--text-dim); }

.score-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: stretch;
  margin: 12px 0;
}
.score-cell {
  background: var(--bg-deep);
  border-radius: 10px;
  padding: 10px 8px;
  border: 1px solid var(--border);
}
.score-cell.win { border-color: var(--win); background: rgba(74, 222, 128, 0.08); }
.score-label { font-size: 10px; color: var(--text-dim); letter-spacing: 0.8px; }
.score-value { font-size: 20px; font-weight: 900; margin-top: 4px; font-family: ui-monospace, monospace; }
.score-sub { font-size: 10px; color: var(--text-dim); margin-top: 2px; font-family: ui-monospace, monospace; }
.score-vs { align-self: center; font-size: 12px; color: var(--text-dim); font-weight: 900; }

.reward-row {
  background: var(--bg-deep);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  margin: 6px 0 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.reward-row b { color: var(--win); font-weight: 900; font-family: ui-monospace, monospace; }
.reward-row b.down { color: var(--loss); }
.reward-row.loss b { color: var(--loss); }
.reward-row .cap { color: var(--neutral); font-size: 10px; margin-left: 6px; }

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.close-btn {
  width: 100%;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 12px;
  padding: 13px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}
.close-btn:active { transform: scale(0.98); }
.close-btn:disabled,
.close-btn.is-ready {
  opacity: 0.7;
  cursor: not-allowed;
  filter: saturate(0.85);
}
.close-btn.ghost {
  background: var(--bg-deep);
  color: var(--text);
  border: 1px solid var(--border);
}
