/* 輪盤視圖 — 所有選擇器加 .gv-roulette 前綴 */

.gv-roulette {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------- 共用面板(絨布) ---------- */
.gv-roulette .rl-panel {
  background: radial-gradient(ellipse at 50% 0%, var(--felt) 0%, var(--felt-dark) 78%);
  border: 1px solid rgba(230, 193, 90, .35);
  border-radius: var(--radius);
  box-shadow: inset 0 0 46px rgba(0, 0, 0, .35), 0 4px 14px rgba(0, 0, 0, .3);
  padding: 14px;
}

/* ---------- 上排:轉盤 + 資訊 ---------- */
.gv-roulette .rl-top {
  display: grid;
  grid-template-columns: minmax(220px, 250px) 1fr;
  gap: 14px;
  align-items: start;   /* 資訊框只佔內容高度,不再被撐大 */
}

.gv-roulette .rl-wheel-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.gv-roulette .rl-wheel-wrap {
  position: relative;
  width: 224px;
  height: 224px;
  border-radius: 50%;
  box-shadow: 0 14px 46px rgba(0, 0, 0, .6), inset 0 0 0 3px rgba(0, 0, 0, .35);
  flex: none;
}

.gv-roulette .rl-rotor {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.gv-roulette .rl-wheel-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.gv-roulette .rl-wheel-num {
  fill: #f7f3e6;
  font-size: 12.5px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: central;
  font-family: inherit;
}

/* 玻璃光澤(不隨轉盤旋轉) */
.gv-roulette .rl-wheel-gloss {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle at 32% 25%, rgba(255, 255, 255, .30), rgba(255, 255, 255, .05) 32%, transparent 56%);
}

/* 滾動的球(繞行軌道 + 螺旋落袋) */
.gv-roulette .rl-ball-track {
  position: absolute;
  inset: 0;
  z-index: 2;
  transform-origin: 50% 50%;
  pointer-events: none;
}

.gv-roulette .rl-ball {
  position: absolute;
  left: 50%;
  top: 8%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 34% 30%, #ffffff, #d7d2c4 60%, #9a9484);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .7), inset 0 0 2px rgba(0, 0, 0, .35);
  opacity: 0;
}

.gv-roulette .rl-wheel-wrap.rl-spinning .rl-ball { opacity: 1; }

/* 頂端固定指針 */
.gv-roulette .rl-pointer {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 20px solid var(--gold-bright);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .65));
  z-index: 5;
  pointer-events: none;
}

/* 結果彈標(壓在轉軸上) */
.gv-roulette .rl-result-pop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  pointer-events: none;
}

.gv-roulette .rl-pop-badge {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 4px solid var(--gold-bright);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .65);
  color: #fff;
  animation: rl-pop-in .38s cubic-bezier(.2, 1.4, .4, 1);
}

.gv-roulette .rl-pop-badge.red { background: radial-gradient(circle at 35% 28%, #d64350, #8f1a24); }
.gv-roulette .rl-pop-badge.black { background: radial-gradient(circle at 35% 28%, #3a3d46, #0c0d10); }
.gv-roulette .rl-pop-badge.green { background: radial-gradient(circle at 35% 28%, #27ae60, #0c5c30); }

.gv-roulette .rl-pop-num {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}

.gv-roulette .rl-pop-color {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .3em;
  margin-left: .3em;
  opacity: .9;
}

@keyframes rl-pop-in {
  from { opacity: 0; transform: scale(.4); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- 資訊區 ---------- */
.gv-roulette .rl-info {
  background: var(--panel);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
  min-width: 0;
}

.gv-roulette .rl-phase-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.gv-roulette .rl-phase {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: .04em;
  flex: 1;
  min-width: 0;
}

.gv-roulette .rl-round {
  color: var(--muted);
  font-size: .8rem;
  white-space: nowrap;
}

.gv-roulette .rl-timer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.gv-roulette .rl-timer-track {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .45);
  overflow: hidden;
}

.gv-roulette .rl-timer-bar {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-bright), #c99b2f);
  transition: width .2s linear;
}

.gv-roulette .rl-timer-bar.urgent {
  background: linear-gradient(90deg, #ff8d8d, var(--red));
}

.gv-roulette .rl-timer-txt {
  font-size: .85rem;
  font-weight: 700;
  color: var(--gold-bright);
  min-width: 68px;
  text-align: right;
  white-space: nowrap;
}

.gv-roulette .rl-h4 {
  margin: 14px 0 6px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--muted);
}

.gv-roulette .rl-empty {
  color: var(--muted);
  font-size: .82rem;
}

/* 歷史色帶 */
.gv-roulette .rl-hist-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.gv-roulette .rl-hist-cell {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 800;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 1px 3px rgba(0, 0, 0, .4);
  flex: none;
}

.gv-roulette .rl-hist-cell.red { background: #b8232f; }
.gv-roulette .rl-hist-cell.black { background: #17181c; }
.gv-roulette .rl-hist-cell.green { background: #128a45; }
.gv-roulette .rl-hist-cell:first-child { outline: 2px solid var(--gold-bright); outline-offset: 1px; }

/* 玩家下注列表 / 結算列表 */
.gv-roulette .rl-players,
.gv-roulette .rl-pay-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 150px;
  overflow-y: auto;
}

.gv-roulette .rl-player-row,
.gv-roulette .rl-pay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  font-size: .85rem;
}

.gv-roulette .rl-player-row.me {
  background: rgba(230, 193, 90, .12);
  box-shadow: inset 2px 0 0 var(--gold);
}

.gv-roulette .rl-legend-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 0 0 2px rgba(255, 255, 255, .18), 0 1px 3px rgba(0, 0, 0, .5);
}

.gv-roulette .rl-p-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gv-roulette .rl-p-amt {
  color: var(--gold-bright);
  font-weight: 700;
  white-space: nowrap;
}

.gv-roulette .rl-p-net { font-weight: 800; white-space: nowrap; }
.gv-roulette .rl-p-net.pos { color: #7ee2a0; }
.gv-roulette .rl-p-net.neg { color: #ff9aa0; }
.gv-roulette .rl-p-net.zero { color: var(--muted); }

/* ---------- 下注板(綠絨 + 木紋金邊) ---------- */
.gv-roulette .rl-board-panel {
  padding: 14px;
  background: radial-gradient(ellipse at 50% -12%, #23844f 0%, #0b3c25 82%);
  border: 3px solid #3a2a12;
  box-shadow:
    inset 0 0 0 2px rgba(230, 193, 90, .55),
    inset 0 0 70px rgba(0, 0, 0, .5),
    0 8px 26px rgba(0, 0, 0, .5);
}

.gv-roulette .rl-board-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 4px 6px;
}

.gv-roulette .rl-hint {
  margin-top: 8px;
  font-size: .72rem;
  color: var(--muted);
  line-height: 1.4;
}

.gv-roulette .rl-board {
  position: relative;
  display: grid;
  grid-template-columns: 52px repeat(12, minmax(52px, 1fr)) 60px;
  grid-template-rows: repeat(3, 68px) 28px 50px 50px;
  gap: 5px;
  min-width: 760px;
}

.gv-roulette .rl-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(240, 205, 110, .7);
  border-radius: 6px;
  background: rgba(0, 0, 0, .22);
  color: var(--ink);
  font-family: inherit;
  font-weight: 800;
  font-size: 1.6rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
  cursor: pointer;
  padding: 0;
  transition: filter .1s, transform .06s;
}

/* 頂端光澤,增加立體感(不擋點擊、不擋籌碼) */
.gv-roulette .rl-cell::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 42%);
  pointer-events: none;
  z-index: 1;
}

.gv-roulette .rl-cell-label { position: relative; z-index: 2; }

.gv-roulette .rl-cell:hover { filter: brightness(1.25); }
.gv-roulette .rl-cell:active { transform: scale(.96); }

.gv-roulette .rl-cell.red { background: linear-gradient(180deg, #c3323e, #8f1a24); }
.gv-roulette .rl-cell.black { background: linear-gradient(180deg, #24262d, #0e0f12); }
.gv-roulette .rl-cell.green { background: linear-gradient(180deg, #1f9455, #0f5c33); }

.gv-roulette .rl-cell.out {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.gv-roulette .rl-cell.out.red,
.gv-roulette .rl-cell.out.black {
  letter-spacing: .2em;
}

.gv-roulette .rl-board.locked .rl-cell {
  pointer-events: none;
  opacity: .72;
  cursor: default;
}

.gv-roulette .rl-board.locked .rl-hot {
  pointer-events: none;
  opacity: .5;
}

/* hover 預覽:高亮被覆蓋的號碼格 */
.gv-roulette .rl-cell.rl-num-hi {
  box-shadow: inset 0 0 0 2px var(--gold-bright), 0 0 10px rgba(255, 217, 112, .55);
  filter: brightness(1.35);
  z-index: 3;
}

.gv-roulette .rl-cell.win {
  box-shadow: 0 0 0 2px var(--gold-bright), 0 0 20px rgba(255, 217, 112, .85);
  z-index: 3;
  opacity: 1 !important;
  animation: rl-win-pulse 1s ease-in-out infinite;
}

@keyframes rl-win-pulse {
  50% { filter: brightness(1.45); }
}

/* ---------- 內圍注熱區(疊在數字格上的線 / 交叉點) ---------- */
.gv-roulette .rl-hot {
  position: relative;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(230, 193, 90, .05);
  cursor: pointer;
  z-index: 4;
  align-self: stretch;
  justify-self: stretch;
  border-radius: 5px;
  transition: background .1s, box-shadow .1s;
}

.gv-roulette .rl-hot:hover {
  background: rgba(255, 215, 112, .34);
  box-shadow: 0 0 0 1.5px var(--gold-bright), 0 0 8px rgba(255, 217, 112, .5);
  z-index: 9;
}

/* 縱向細條(左右分注,置中於兩欄間直線) */
.gv-roulette .rl-hot.v {
  justify-self: center;
  align-self: stretch;
  width: 20px;
  margin: 7px 0;
}

/* 橫向細條(上下分注,置中於兩列間橫線) */
.gv-roulette .rl-hot.h {
  align-self: center;
  justify-self: stretch;
  height: 20px;
  margin: 0 8px;
}

/* 角注方塊(內部十字) */
.gv-roulette .rl-hot.x {
  justify-self: center;
  align-self: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  z-index: 5;
}

/* 街注(底部細條格,整欄 3 號) */
.gv-roulette .rl-hot.street {
  align-self: stretch;
  justify-self: stretch;
  margin: 2px 1px;
  background: rgba(0, 0, 0, .18);
  box-shadow: inset 0 0 0 1px rgba(230, 193, 90, .16);
}

/* 線注(底部欄界方塊,置於街注之上) */
.gv-roulette .rl-hot.six {
  justify-self: center;
  align-self: center;
  width: 22px;
  height: 100%;
  border-radius: 5px;
  background: rgba(230, 193, 90, .12);
  z-index: 6;
}

/* 首四(0 與 1/2/3 的左上外角) */
.gv-roulette .rl-hot.four {
  justify-self: center;
  align-self: start;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  margin-top: 1px;
  z-index: 6;
}

/* 0 相關分注(0 格與第 1 欄交界的縱向細條) */
.gv-roulette .rl-hot.v0 {
  justify-self: center;
  align-self: center;
  width: 18px;
  height: 20px;
  border-radius: 5px;
  z-index: 4;
}

/* 0 三數注(交界角) */
.gv-roulette .rl-hot.x0 {
  justify-self: center;
  align-self: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  z-index: 5;
}

/* ---------- 桌上多人籌碼(疊高、每人一色) ---------- */
/* 定位層:壓在格/線中心,不擋點擊 */
.gv-roulette .rl-chip-host {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 8;
}

/* 一疊籌碼(以 left/top 微幅錯位並排,translate 置中) */
.gv-roulette .rl-stack {
  position: absolute;
  width: 42px;
  height: 42px;
  pointer-events: none;
}

.gv-roulette .rl-stack .rl-disk,
.gv-roulette .rl-stack .rl-chip-top {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  transform: translateY(calc(var(--i, 0) * -3.5px));
}

/* 底層陰影盤(疊高外觀) */
.gv-roulette .rl-stack .rl-disk {
  border-radius: 50%;
  background: var(--chip, #888);
  border: 1px solid rgba(0, 0, 0, .35);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, .22),
    inset 0 -3px 5px rgba(0, 0, 0, .4),
    0 1px 2px rgba(0, 0, 0, .45);
}

/* 頂片:沿用 .casino-chip 外觀,顯示金額,字放大好讀 */
.gv-roulette .rl-chip-top.casino-chip {
  width: 100%;
  height: 100%;
  font-size: .66rem;
  font-weight: 800;
  border-width: 2.5px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, .55), inset 0 0 0 3px rgba(255, 255, 255, .16);
}

.gv-roulette .rl-chip-top.casino-chip::before { inset: 5px; }

/* 金額文字:蓋在內盤之上,白字加深色描邊,任何籌碼色都讀得到 */
.gv-roulette .rl-chip-amt {
  position: relative;
  z-index: 3;
  font-size: .82rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.02em;
  text-shadow:
    0 0 2px #000, 0 0 3px #000,
    1px 1px 0 rgba(0, 0, 0, .9), -1px 1px 0 rgba(0, 0, 0, .9);
}

/* 自己的籌碼:金色描邊(醒目) */
.gv-roulette .rl-stack.me .rl-chip-top.casino-chip {
  box-shadow:
    0 0 0 2.5px var(--gold-bright),
    0 0 10px rgba(255, 217, 112, .8),
    0 3px 6px rgba(0, 0, 0, .55);
}

.gv-roulette .rl-stack.me .rl-disk {
  box-shadow:
    inset 0 0 0 2px rgba(255, 217, 112, .55),
    inset 0 -3px 5px rgba(0, 0, 0, .4),
    0 1px 2px rgba(0, 0, 0, .45);
}

/* ---------- 沒收 / 派彩飛行層 ---------- */
.gv-roulette .rl-fly-layer {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 60;
}

.gv-roulette .rl-fly {
  position: absolute;
  will-change: transform, opacity;
}

.gv-roulette .rl-fly.rl-pulse {
  animation: rl-chip-pulse .5s ease-in-out;
}

@keyframes rl-chip-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.42); }
}

/* 贏注浮字 +ret */
.gv-roulette .rl-float {
  position: absolute;
  transform: translate(-50%, -50%);
  color: var(--gold-bright);
  font-weight: 800;
  font-size: .95rem;
  white-space: nowrap;
  text-shadow: 0 2px 5px rgba(0, 0, 0, .8), 0 0 10px rgba(255, 217, 112, .6);
  pointer-events: none;
  z-index: 62;
  animation: rl-float-up 1.25s ease-out forwards;
}

@keyframes rl-float-up {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
  22% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -175%) scale(1.12); }
}

/* ---------- 操作列 ---------- */
.gv-roulette .rl-actionbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  background: var(--panel);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}

.gv-roulette .rl-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gv-roulette .rl-bar-label {
  font-size: .8rem;
  color: var(--muted);
  letter-spacing: .1em;
  margin-right: 2px;
}

.gv-roulette .rl-chipbtn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px dashed rgba(255, 255, 255, .85);
  color: #fff;
  font-family: inherit;
  font-weight: 800;
  font-size: .78rem;
  cursor: pointer;
  flex: none;
  box-shadow: 0 3px 7px rgba(0, 0, 0, .5), inset 0 0 0 3px rgba(0, 0, 0, .28);
  transition: transform .1s, outline-color .1s;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}

.gv-roulette .rl-chipbtn:hover { transform: translateY(-2px); }

.gv-roulette .rl-chipbtn.sel {
  outline: 3px solid var(--gold-bright);
  outline-offset: 2px;
  transform: translateY(-3px) scale(1.07);
}

.gv-roulette .rl-chipbtn[data-v="50"] { background: radial-gradient(circle at 35% 30%, #6f9fd8, #2f5b96); }
.gv-roulette .rl-chipbtn[data-v="100"] { background: radial-gradient(circle at 35% 30%, #57b97e, #1f6e42); }
.gv-roulette .rl-chipbtn[data-v="500"] { background: radial-gradient(circle at 35% 30%, #a86fc9, #5f2f86); }
.gv-roulette .rl-chipbtn[data-v="1000"] { background: radial-gradient(circle at 35% 30%, #e8a54b, #a05f14); }
.gv-roulette .rl-chipbtn[data-v="5000"] { background: radial-gradient(circle at 35% 30%, #e05b52, #8f1f1a); }

.gv-roulette .rl-ctl {
  display: flex;
  gap: 8px;
}

.gv-roulette .rl-totals {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: .88rem;
}

.gv-roulette .rl-total-item b {
  color: var(--gold-bright);
  font-weight: 800;
}

.gv-roulette .rl-limits {
  color: var(--muted);
  font-size: .75rem;
  white-space: nowrap;
}

/* ---------- 響應式 ---------- */
@media (max-width: 900px) {
  .gv-roulette .rl-top {
    grid-template-columns: 1fr;
  }

  .gv-roulette .rl-wheel-panel {
    padding: 20px 12px 14px;
  }

  .gv-roulette .rl-wheel-wrap {
    width: 240px;
    height: 240px;
  }
}

@media (max-width: 480px) {
  .gv-roulette {
    gap: 10px;
  }

  .gv-roulette .rl-panel {
    padding: 10px;
  }

  .gv-roulette .rl-wheel-panel {
    padding: 16px 8px 10px;
  }

  .gv-roulette .rl-wheel-wrap {
    width: 196px;
    height: 196px;
  }

  .gv-roulette .rl-ball {
    width: 10px;
    height: 10px;
  }

  .gv-roulette .rl-pointer {
    border-left-width: 8px;
    border-right-width: 8px;
    border-top-width: 15px;
    top: -7px;
  }

  .gv-roulette .rl-pop-badge {
    width: 72px;
    height: 72px;
    border-width: 3px;
  }

  .gv-roulette .rl-pop-num { font-size: 1.5rem; }

  /* 下注板橫向捲動 */
  .gv-roulette .rl-board {
    min-width: 540px;
    grid-template-columns: 38px repeat(12, minmax(35px, 1fr)) 48px;
    grid-template-rows: repeat(3, 46px) 22px 38px 38px;
    gap: 3px;
  }

  .gv-roulette .rl-cell { font-size: 1.02rem; }
  .gv-roulette .rl-cell.out { font-size: .72rem; }

  .gv-roulette .rl-stack {
    width: 29px;
    height: 29px;
  }

  .gv-roulette .rl-chip-top.casino-chip { font-size: .58rem; }

  .gv-roulette .rl-hot.x { width: 22px; height: 22px; }
  .gv-roulette .rl-hot.six { width: 20px; }
  .gv-roulette .rl-hot.v { width: 18px; margin: 5px 0; }
  .gv-roulette .rl-hot.h { height: 18px; margin: 0 6px; }

  .gv-roulette .rl-chipbtn {
    width: 40px;
    height: 40px;
    font-size: .7rem;
  }

  .gv-roulette .rl-totals {
    margin-left: 0;
    width: 100%;
  }

  .gv-roulette .rl-hist-cell {
    width: 23px;
    height: 23px;
    font-size: .66rem;
  }
}
