/* Card Duel — Intuition vs Clairvoyance vs AI (patch #223 frontend).
   Shares the rewards/dice visual language: dark navy shell, gold and
   purple neon frames, big-number team cards with a 50% baseline. */

/* --- borrowed dice primitives (this page loads no dice.css) --- */
.dc-betrow { display: flex; justify-content: center; gap: 10px; max-width: 560px; margin: 14px auto 0; }
.dc-betbtn { padding: 9px 22px; border-radius: 999px; border: 1px solid #39415F; background: transparent; color: inherit; font-weight: 800; cursor: pointer; }
.dc-betbtn.on { border-color: #FFD700; color: #FFE873; box-shadow: 0 0 14px rgba(255,215,0,.30); background: rgba(255,215,0,.10); }
.dc-betbtn:disabled { opacity: .45; cursor: default; }
.dc-meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 560px; margin: 14px auto 0; }
.dc-meter { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; border: 1px solid #39415F; background: rgba(0,0,0,.25); }
.dc-meter-k { color: #8B90A5; font-size: .68rem; font-weight: 800; letter-spacing: .14em; }
.dc-meter-v { font-weight: 800; font-variant-numeric: tabular-nums; }
.dc-status { text-align: center; min-height: 1.4em; margin: 10px auto 0; max-width: 560px; color: #A7ACC2; }
.dc-status.win { color: #FFE873; font-weight: 800; }
.dc-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.dc-table td, .dc-table th { padding: 8px 6px; border-bottom: 1px solid #39415F; text-align: right; font-variant-numeric: tabular-nums; }
.dc-table td:first-child, .dc-table th:first-child { text-align: left; font-weight: 700; }
.dc-table th { color: #8B90A5; font-size: .74rem; letter-spacing: .08em; }
.dc-rtp { color: #A7ACC2; font-size: .86rem; margin-top: 10px; }
.dc-how { padding-left: 20px; color: #A7ACC2; }
.dc-how li { margin: 6px 0; }

/* --- stage --- */
.cd-stage-card { max-width: 860px; margin: 0 auto; }
.cd-roundbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.cd-roundbar b { color: #FFE873; }
.cd-live-dot { width: 9px; height: 9px; border-radius: 50%; background: #39415F; margin-left: auto; }
.cd-live-dot.on { background: #3DDc84; box-shadow: 0 0 10px rgba(61,220,132,.8); }
.cd-commit { margin-top: 6px; color: #8B90A5; font-size: .78rem; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cd-commit code { font-size: .72rem; word-break: break-all; color: #A7ACC2; }

.cd-aibar { display: flex; gap: 14px; align-items: center; margin: 16px auto 0; max-width: 560px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(179,136,255,.55); background: linear-gradient(90deg, rgba(138,43,226,.16), rgba(0,0,0,.25)); box-shadow: 0 0 16px rgba(138,43,226,.25); }
.cd-noir { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; flex: 0 0 auto; }
.cd-ai-line { font-size: 1.02rem; }
.cd-ai-line b { color: #D9C6FF; font-size: 1.15rem; margin-left: 6px; }
.cd-ai-basis { color: #A7ACC2; font-size: .82rem; margin-top: 3px; font-variant-numeric: tabular-nums; }

.cd-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 560px; margin: 16px auto 0; }
.cd-mode { display: flex; flex-direction: column; gap: 2px; align-items: center; padding: 12px 8px; border-radius: 14px; border: 1px solid #39415F; background: rgba(0,0,0,.25); color: inherit; cursor: pointer; }
.cd-mode-name { font-weight: 800; font-size: 1.05rem; }
.cd-mode-desc { color: #8B90A5; font-size: .78rem; font-weight: 700; }
.cd-mode.on { border-color: #FFD700; box-shadow: 0 0 14px rgba(255,215,0,.30); background: rgba(255,215,0,.08); }
.cd-mode.on .cd-mode-name { color: #FFE873; }
.cd-mode:disabled { opacity: .5; cursor: default; }

.cd-startbtn { display: block; width: 100%; max-width: 560px; margin: 16px auto 0; padding: 15px; border: none; border-radius: 14px; font-weight: 800; font-size: 1.15rem; letter-spacing: .12em; cursor: pointer; color: #1A1206; background: linear-gradient(90deg, #FFD700, #FFB300); box-shadow: 0 0 18px rgba(255,215,0,.45); }
.cd-startbtn:disabled { opacity: .45; cursor: default; box-shadow: none; }

.cd-timer { max-width: 560px; margin: 14px auto 0; text-align: center; }
.cd-timer-num { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; color: #FFE873; }
.cd-timer-track { height: 10px; border-radius: 999px; border: 1px solid #39415F; background: rgba(0,0,0,.35); overflow: hidden; margin-top: 6px; }
.cd-timer-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #8A2BE2, #FFD700); transition: width .1s linear; }
.cd-timer-note { color: #A7ACC2; font-size: .84rem; margin-top: 6px; min-height: 1.3em; }

.cd-cards { display: flex; justify-content: center; gap: 18px; margin: 18px auto 0; max-width: 560px; }
.cd-cardbtn { flex: 1 1 0; max-width: 240px; background: none; border: none; color: inherit; cursor: pointer; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cd-cardbtn:disabled { cursor: default; }
.cd-card-face { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 5 / 7; border-radius: 16px; border: 2px solid rgba(255,215,0,.55); background: radial-gradient(circle at 50% 38%, #1B2450 0%, #0A0F1E 68%); box-shadow: 0 0 18px rgba(138,43,226,.35), inset 0 0 0 6px rgba(255,215,0,.08); transition: transform .15s ease, box-shadow .15s ease; }
.cd-cardbtn:not(:disabled):hover .cd-card-face { transform: translateY(-4px); box-shadow: 0 0 26px rgba(255,215,0,.5), inset 0 0 0 6px rgba(255,215,0,.12); }
.cd-card-emblem { width: 54px; height: 54px; border-radius: 50%; border: 2px solid rgba(255,215,0,.8); background: radial-gradient(circle, rgba(255,215,0,.28) 0%, rgba(255,215,0,.05) 70%); position: relative; }
.cd-card-emblem::after { content: ""; position: absolute; inset: 12px; border: 2px solid rgba(217,198,255,.75); transform: rotate(45deg); border-radius: 4px; }
.cd-cardbtn.picked .cd-card-face { border-color: #FFD700; box-shadow: 0 0 24px rgba(255,215,0,.55); }
.cd-cardbtn.winner .cd-card-face { background: radial-gradient(circle at 50% 38%, #4A3603 0%, #141A38 70%); border-color: #FFD700; box-shadow: 0 0 30px rgba(255,215,0,.75); }
.cd-cardbtn.winner .cd-card-emblem { background: radial-gradient(circle, #FFE873 0%, #B8860B 75%); }
.cd-cardbtn.loser .cd-card-face { opacity: .55; }
.cd-card-pos { font-weight: 800; letter-spacing: .18em; color: #A7ACC2; }
.cd-card-tag { font-size: .78rem; font-weight: 800; color: #D9C6FF; }
.cd-result { text-align: center; margin: 14px auto 0; max-width: 560px; font-size: 1.05rem; font-weight: 800; }
.cd-result.win { color: #FFE873; }
.cd-result.lose { color: #A7ACC2; }
.cd-mystats { text-align: center; color: #8B90A5; font-size: .84rem; margin: 10px auto 0; font-variant-numeric: tabular-nums; }

/* --- live data --- */
.cd-updated { color: #8B90A5; font-size: .82rem; }
.cd-teams { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cd-team { border: 1px solid rgba(179,136,255,.5); border-radius: 16px; padding: 14px; background: rgba(0,0,0,.25); box-shadow: 0 0 14px rgba(138,43,226,.18); }
.cd-team-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cd-team-name { font-weight: 800; }
.cd-team-acc { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; color: #FFE873; }
.cd-team-acc.below { color: #B388FF; }
.cd-team-acc.none { color: #8B90A5; font-size: 1.2rem; }
.cd-accbar { position: relative; height: 12px; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid #39415F; margin: 10px 0 8px; }
.cd-accbar-fill { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, #FFD700, #FFE873); }
.cd-accbar-fill.below { background: linear-gradient(90deg, #8A2BE2, #B388FF); }
.cd-accbar-base { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: #E8EAF6; opacity: .85; }
.cd-team-nums { color: #A7ACC2; font-size: .84rem; font-variant-numeric: tabular-nums; }
.cd-team-last20 { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 8px; min-height: 10px; }
.cd-dot { width: 10px; height: 10px; border-radius: 50%; background: #39415F; }
.cd-dot.w { background: #FFD700; box-shadow: 0 0 6px rgba(255,215,0,.6); }
.cd-dot.l { background: #4A3B78; }
.cd-baseline-note { color: #8B90A5; font-size: .84rem; margin-top: 10px; }
.cd-data-grid { margin-top: 14px; }
.cd-dist-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; margin: 8px 0; font-size: .88rem; }
.cd-dist-track { height: 12px; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid #39415F; overflow: hidden; }
.cd-dist-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #FFD700, #FFE873); }
.cd-dist-fill.alt { background: linear-gradient(90deg, #8A2BE2, #B388FF); }
.cd-dist-nums { font-variant-numeric: tabular-nums; color: #A7ACC2; font-size: .8rem; }
.cd-dist-note, .cd-hist-note { color: #8B90A5; font-size: .82rem; }
.cd-feed { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.cd-feed-row { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border: 1px solid #39415F; border-radius: 10px; font-size: .84rem; font-variant-numeric: tabular-nums; }
.cd-feed-row .w { color: #FFE873; font-weight: 800; }
.cd-feed-row .l { color: #8B90A5; }
.cd-feed-empty, .cd-hist-empty { color: #8B90A5; font-size: .88rem; }
.cd-history { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.cd-hist-row { padding: 7px 10px; border: 1px solid #39415F; border-radius: 10px; font-size: .8rem; font-variant-numeric: tabular-nums; }
.cd-hist-main { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cd-hist-main .win { color: #FFE873; font-weight: 800; }
.cd-hist-main .lose { color: #8B90A5; }
.cd-hist-hash { color: #8B90A5; font-size: .7rem; word-break: break-all; margin-top: 3px; }
.cd-hist-hash code { color: #A7ACC2; }
.cd-verified { color: #3DDc84; font-weight: 800; }

/* --- period --- */
.cd-period-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.cd-period-head b { color: #FFE873; }
.cd-predict-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.cd-predict { padding: 12px 8px; border-radius: 14px; border: 1px solid #39415F; background: rgba(0,0,0,.25); color: inherit; font-weight: 800; cursor: pointer; }
.cd-predict.on { border-color: #FFD700; color: #FFE873; box-shadow: 0 0 14px rgba(255,215,0,.3); background: rgba(255,215,0,.08); }
.cd-predict:disabled { opacity: .5; cursor: default; }
.cd-mypred { margin-top: 10px; color: #A7ACC2; font-size: .9rem; min-height: 1.3em; }
.cd-pdist { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.cd-pdist-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; font-size: .86rem; }
.cd-pstand { margin-top: 10px; color: #A7ACC2; font-size: .88rem; font-variant-numeric: tabular-nums; }
.cd-lastper-line, .cd-elig-line { color: #A7ACC2; font-variant-numeric: tabular-nums; }
.cd-lastper-line b { color: #FFE873; }
#cdClaim { margin-top: 10px; }

/* --- related --- */
.cd-related { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cd-rel-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 14px; border: 1px solid rgba(255,215,0,.4); background: rgba(0,0,0,.25); color: inherit; text-decoration: none; }
.cd-rel-card b { color: #FFE873; }
.cd-rel-card span { color: #A7ACC2; font-size: .84rem; }

@media (max-width: 760px) {
  .cd-teams { grid-template-columns: 1fr; }
  .cd-related { grid-template-columns: 1fr 1fr; }
  .cd-predict-btns { grid-template-columns: 1fr; }
  .cd-dist-row, .cd-pdist-row { grid-template-columns: 86px 1fr auto; }
}

/* --- Progressive jackpot banner (patch #232) --- */
.cd-jp {
  margin: 0 0 14px;
  padding: 12px 16px 13px;
  border-radius: 14px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 183, 0, .10), rgba(138, 43, 226, .10)), #070B18;
  border: 1px solid rgba(255, 183, 0, .55);
  box-shadow: 0 0 18px rgba(255, 183, 0, .18), inset 0 0 24px rgba(255, 183, 0, .05);
}
.cd-jp-head {
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.cd-jp-label {
  font-size: .78rem; font-weight: 800; letter-spacing: .22em; color: #FFD700;
  text-shadow: 0 0 10px rgba(255, 183, 0, .6);
}
.cd-jp-amount {
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 2.3rem; font-weight: 700; line-height: 1.15;
  color: #FFC933; text-shadow: 0 0 18px rgba(255, 176, 0, .8);
}
.cd-jp.live .cd-jp-amount { animation: cdJpPulse 2.6s ease-in-out infinite; }
@keyframes cdJpPulse {
  0%, 100% { text-shadow: 0 0 14px rgba(255, 176, 0, .65); }
  50% { text-shadow: 0 0 26px rgba(255, 176, 0, 1); }
}
.cd-jp-pt { font-size: 1rem; font-weight: 800; color: #B8860B; margin-left: 6px; }
.cd-jp-sub { margin: 4px 0 0; font-size: .82rem; color: #A7ACC2; }
.cd-jp-last { margin: 3px 0 0; font-size: .78rem; font-weight: 700; color: #FFD700; }

@media (prefers-reduced-motion: reduce) {
  .cd-jp.live .cd-jp-amount { animation: none; }
}
