/* =============================================================================
   骰子視圖 — 黑金奢華(所有選擇器加 .gv-dice 前綴)
   一律沿用 style.css 的 :root 變數:felt / gold / panel / grad-gold …
   俯視平面——桌面「絕不」3D 傾斜(任何角度,含 rotateX/perspective;使用者明確退貨過)。
   立體感只做「物件級」:滑桿金鈕的高光、指針的厚度陰影、大數字的金屬漸層。
   熱區 hover 才亮;繁中文案;手機 375px 可用。
   ============================================================================= */

.gv-dice {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  --dc-win: #3fae6e;   /* 贏區綠(清楚但不螢光,與 felt 有別) */
  --dc-lose: #a83a40;  /* 輸區紅(比 --red 深沉,當底色不刺眼) */
}

/* ---------- 共用面板(深絨布底 + 金色頂線,與掃雷/輪盤同一套質感) ---------- */
.gv-dice .dc-panel {
  position: relative;
  background:
    radial-gradient(120% 96% at 50% 26%, rgba(255, 240, 200, .06), transparent 56%),
    radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--felt) 86%, #fff 6%) 0%, var(--felt) 44%, var(--felt-dark) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, .42),
    inset 0 1px 0 rgba(255, 255, 255, .05),
    0 8px 24px rgba(0, 0, 0, .4);
  padding: 16px;
}
.gv-dice .dc-panel::before { /* 頂端金色細線飾條 */
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 2px;
  background: var(--grad-gold-line);
  opacity: .6;
  pointer-events: none;
}

/* ---------- 版面:左舞台+控制 / 右動態牆 ---------- */
.gv-dice .dc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 14px;
  align-items: start;
}
.gv-dice .dc-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* ---------- 結果舞台:大數字 + 橫軸 + 徽章列 ---------- */
.gv-dice .dc-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 24px;
}
.gv-dice .dc-num {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 11vw, 5.4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: .04em;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .55));
  transition: filter .25s ease;
}
.gv-dice .dc-num.idle { opacity: .4; }
.gv-dice .dc-num.rolling { opacity: .92; }
.gv-dice .dc-num.win {
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .55)) drop-shadow(0 0 18px rgba(240, 214, 122, .55));
}
.gv-dice .dc-num.lose { opacity: .62; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .55)) saturate(.55); }

.gv-dice .dc-verdict {
  min-height: 1.35em;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .04em;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity .25s ease, transform .25s ease;
  font-variant-numeric: tabular-nums;
}
.gv-dice .dc-verdict.show { opacity: 1; transform: translateY(0); }
.gv-dice .dc-verdict.win { color: var(--gold-bright); text-shadow: 0 0 12px rgba(240, 214, 122, .4); }
.gv-dice .dc-verdict.lose { color: var(--red); }

/* 橫軸:贏區綠/輸區紅(JS 依大小與勝率畫 gradient)、門檻線、落點指針 */
.gv-dice .dc-axis {
  position: relative;
  width: 100%;
  max-width: 560px;
  height: 14px;
  margin-top: 22px; /* 給門檻標籤留空間 */
}
.gv-dice .dc-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, .5);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .55), inset 0 -1px 0 rgba(255, 255, 255, .08);
  overflow: hidden;
}
.gv-dice .dc-thresh {
  position: absolute;
  top: -5px;
  bottom: -5px;
  width: 2px;
  transform: translateX(-50%);
  background: var(--grad-gold);
  box-shadow: 0 0 8px rgba(212, 175, 55, .55);
  pointer-events: none;
}
.gv-dice .dc-threshlabel {
  position: absolute;
  top: -19px;
  left: 50%;
  transform: translateX(-50%);
  font-size: .68rem;
  font-weight: 700;
  color: var(--gold-bright);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .7);
  white-space: nowrap;
}
.gv-dice .dc-pointer {
  position: absolute;
  top: -12px;
  transform: translateX(-50%);
  transition: left .18s ease-out;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6));
}
.gv-dice .dc-pointer-tip { /* 落點三角指針(物件級立體:高光邊) */
  display: block;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 10px solid var(--gold-bright);
}
.gv-dice .dc-pointer.win .dc-pointer-tip { border-top-color: var(--gold-bright); }
.gv-dice .dc-pointer.lose .dc-pointer-tip { border-top-color: var(--red); }
.gv-dice .dc-scale {
  width: 100%;
  max-width: 560px;
  display: flex;
  justify-content: space-between;
  font-size: .68rem;
  color: var(--muted);
}

/* 近 20 局徽章列 */
.gv-dice .dc-recentwrap {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  min-width: 0;
}
.gv-dice .dc-recentlabel {
  flex: 0 0 auto;
  font-size: .72rem;
  color: var(--muted);
  letter-spacing: .06em;
}
.gv-dice .dc-recent {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}
.gv-dice .dc-recent::-webkit-scrollbar { display: none; }
.gv-dice .dc-badge {
  flex: 0 0 auto;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  border: 1px solid;
  background: rgba(0, 0, 0, .3);
}
.gv-dice .dc-badge.win {
  color: color-mix(in srgb, var(--dc-win) 70%, #fff);
  border-color: color-mix(in srgb, var(--dc-win) 60%, var(--line-soft));
}
.gv-dice .dc-badge.lose {
  color: color-mix(in srgb, var(--red) 78%, #fff);
  border-color: color-mix(in srgb, var(--red) 45%, var(--line-soft));
}
.gv-dice .dc-recentempty { font-size: .72rem; }

/* ---------- 控制面板 ---------- */
.gv-dice .dc-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gv-dice .dc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.gv-dice .dc-row-label {
  flex: 0 0 auto;
  width: 3em;
  font-size: .85rem;
  color: var(--muted);
  letter-spacing: .1em;
}

/* 大/小切換(金框膠囊,active 漸層金) */
.gv-dice .dc-ou {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, .3);
}
.gv-dice .dc-oubtn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  letter-spacing: .2em;
  text-indent: .2em;
  padding: 8px 26px;
  cursor: pointer;
  transition: filter .15s ease;
}
.gv-dice .dc-oubtn:hover { filter: brightness(1.2); }
.gv-dice .dc-oubtn.active {
  background: var(--grad-gold);
  color: #33270a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 12px rgba(212, 175, 55, .3);
}

/* 勝率滑桿:深色內凹軌 + 已填滿金漸層(--gvd-fill 由 JS 更新)+ 漸層金圓鈕
   (沿用 holdem 滑桿的客製樣式語彙) */
.gv-dice .dc-slider {
  flex: 1;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  height: 30px;
  background: transparent;
  cursor: pointer;
  accent-color: var(--gold); /* 極舊瀏覽器後援 */
}
.gv-dice .dc-slider:focus { outline: none; }
.gv-dice .dc-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background:
    linear-gradient(90deg,
      var(--gold-deep) 0%,
      var(--gold) calc(var(--gvd-fill, 50%) - 12%),
      var(--gold-bright) var(--gvd-fill, 50%),
      rgba(255, 255, 255, .08) var(--gvd-fill, 50%));
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(0, 0, 0, .35);
}
.gv-dice .dc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -8px;
  border-radius: 50%;
  background: radial-gradient(60% 55% at 38% 30%, var(--gold-hi), var(--gold-bright) 42%, var(--gold) 72%, var(--gold-deep));
  border: 1px solid rgba(20, 14, 4, .7);
  box-shadow:
    0 3px 8px rgba(0, 0, 0, .55),
    inset 0 1px 1px rgba(255, 255, 255, .65),
    inset 0 -2px 4px rgba(0, 0, 0, .3);
}
.gv-dice .dc-slider:active::-webkit-slider-thumb {
  box-shadow:
    0 2px 5px rgba(0, 0, 0, .6),
    0 0 14px rgba(240, 214, 122, .5),
    inset 0 1px 1px rgba(255, 255, 255, .65);
}
.gv-dice .dc-slider::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(0, 0, 0, .35);
}
.gv-dice .dc-slider::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold) 70%, var(--gold-bright));
}
.gv-dice .dc-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(60% 55% at 38% 30%, var(--gold-hi), var(--gold-bright) 42%, var(--gold) 72%, var(--gold-deep));
  border: 1px solid rgba(20, 14, 4, .7);
  box-shadow:
    0 3px 8px rgba(0, 0, 0, .55),
    inset 0 1px 1px rgba(255, 255, 255, .65),
    inset 0 -2px 4px rgba(0, 0, 0, .3);
}
.gv-dice .dc-chanceval {
  flex: 0 0 auto;
  min-width: 3.2em;
  text-align: right;
  color: var(--gold-bright);
  font-size: 1.05rem;
}

/* 即時倍率/勝率/門檻/可贏 */
.gv-dice .dc-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.gv-dice .dc-stat {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--line-soft);
}
.gv-dice .dc-stat-label { font-size: .68rem; color: var(--muted); letter-spacing: .08em; white-space: nowrap; }
.gv-dice .dc-stat-val { font-size: .95rem; color: var(--ink); white-space: nowrap; }
.gv-dice .dc-stat.gold .dc-stat-val { color: var(--gold-bright); }

/* 下注列 + 快捷(½、2×、最大) */
.gv-dice .dc-betinput {
  flex: 1;
  min-width: 0;
  max-width: 150px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .35);
  color: var(--gold-bright);
  font: inherit;
  font-weight: 700;
  text-align: right;
  -moz-appearance: textfield;
  appearance: textfield;
}
.gv-dice .dc-betinput::-webkit-outer-spin-button,
.gv-dice .dc-betinput::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.gv-dice .dc-betinput:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--gold) 60%, var(--line));
  box-shadow: 0 0 0 2px rgba(212, 175, 55, .2);
}
.gv-dice .dc-badj { display: flex; gap: 6px; margin-left: auto; }
.gv-dice .dc-qbtn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: filter .15s ease, border-color .15s ease;
}
.gv-dice .dc-qbtn:hover { filter: brightness(1.15); border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
.gv-dice .dc-qbtn:active { transform: scale(.96); }

.gv-dice .dc-roll { width: 100%; font-size: 1.05rem; padding: 12px 18px; }

/* ---------- 右側動態牆(與掃雷同一套語彙) ---------- */
.gv-dice .dc-side { min-width: 0; }
.gv-dice .dc-feedpanel { padding: 12px; }
.gv-dice .dc-feedtitle {
  margin: 0 0 10px;
  font-size: .95rem;
  color: var(--gold-bright);
  letter-spacing: .1em;
}
.gv-dice .dc-feedlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 460px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.gv-dice .dc-feedrow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .26);
  border: 1px solid var(--line-soft);
  min-width: 0;
}
.gv-dice .dc-feedrow.winrow { border-color: color-mix(in srgb, var(--gold) 35%, var(--line-soft)); }
.gv-dice .dc-feedrow.new { animation: gv-dice-feedin .3s ease-out; }
@keyframes gv-dice-feedin {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gv-dice .dc-fava {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  color: var(--gold-bright);
  font-size: .8rem;
  font-weight: 800;
}
.gv-dice .dc-fava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gv-dice .dc-fmain { flex: 1; min-width: 0; }
.gv-dice .dc-fname {
  font-size: .8rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gv-dice .dc-flabel { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gv-dice .dc-fright {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.gv-dice .dc-fmult { font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.gv-dice .dc-famt { font-size: .85rem; font-variant-numeric: tabular-nums; }
.gv-dice .dc-famt.win { color: var(--gold-bright); }
.gv-dice .dc-famt.lose { color: var(--red); }
.gv-dice .dc-feedempty { text-align: center; padding: 14px 0; }

/* ---------- 響應式(375px 手機可用) ---------- */
@media (max-width: 900px) {
  .gv-dice .dc-layout { grid-template-columns: 1fr; }
  .gv-dice .dc-feedlist { max-height: 240px; }
}
@media (max-width: 430px) {
  .gv-dice .dc-panel { padding: 12px; }
  .gv-dice .dc-num { font-size: clamp(2.6rem, 15vw, 3.4rem); }
  .gv-dice .dc-row { flex-wrap: wrap; }
  .gv-dice .dc-row-label { width: auto; }
  .gv-dice .dc-betrow .dc-badj { margin-left: 0; width: 100%; }
  .gv-dice .dc-badj .dc-qbtn { flex: 1; padding: 8px 6px; }
  .gv-dice .dc-betinput { max-width: none; }
  .gv-dice .dc-oubtn { padding: 8px 20px; }
  .gv-dice .dc-stat-val { font-size: .85rem; }
}

/* 動畫減量:尊重使用者設定 */
@media (prefers-reduced-motion: reduce) {
  .gv-dice .dc-pointer { transition: none; }
  .gv-dice .dc-verdict { transition: none; }
  .gv-dice .dc-feedrow.new { animation: none; }
}
