/* ================================================================= BATTLES */
.mode-ic { display: inline-flex; align-items: center; gap: 3px; }
.mode-ic i { width: 9px; height: 13px; border-radius: 4px 4px 2px 2px; background: currentColor; opacity: 0.85; }
.mode-ic b { font-size: 9px; font-weight: 800; color: var(--muted-2); text-transform: uppercase; margin: 0 2px; }

.battle-list { display: flex; flex-direction: column; gap: 10px; }
.battle-row {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) 210px 120px 170px; align-items: center; gap: 16px;
  padding: 12px 16px; border-radius: 14px; background: linear-gradient(90deg, #20242c, #1d2027); border: 1px solid var(--line);
  animation: fadeUp 0.3s var(--ease);
}
.battle-row.mine { border-color: rgba(255, 198, 26, 0.4); background: linear-gradient(90deg, rgba(255, 198, 26, 0.08), #1d2027 50%); }
.br-mode { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text-2); flex-wrap: wrap; }
.br-mode .mode-ic { color: var(--yellow); }
.br-cases { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bcase-strip { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; }
.bcase { position: relative; width: 54px; flex: none; }
.bcase i { position: absolute; right: -2px; bottom: 0; font-style: normal; font-size: 10.5px; font-weight: 700; padding: 1px 4px; border-radius: 4px; background: rgba(0, 0, 0, 0.75); }
.bcase-more { font-size: 12px; color: var(--muted); font-weight: 700; padding: 0 6px; }
.br-seats { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.bseat { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.bseat.open-seat { border: 1.5px dashed var(--line-2); color: var(--muted-2); }
.bseat.you .avatar { box-shadow: 0 0 0 2px var(--yellow); }
.bstat { margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.bstat.live { color: var(--green-1); }
.bstat.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green-1); animation: pulse 1.2s infinite; }
.bstat.done { color: var(--muted-2); }
.br-cost { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.br-act { display: flex; justify-content: flex-end; }
.br-act .btn { min-width: 150px; }

/* create */
.bc-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; align-items: start; }
.bc-side { position: sticky; top: calc(var(--topbar-h) + 16px); padding: 18px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - var(--topbar-h) - 32px); overflow: auto; }
.bc-h { font-size: 14px; display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.bc-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bc-mode { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border-radius: 10px; background: var(--bg-1); border: 1px solid var(--line); color: var(--muted); transition: border-color 0.15s, background 0.15s; }
.bc-mode b { color: #fff; font-size: 14px; }
.bc-mode span { font-size: 11px; }
.bc-mode .mode-ic { color: var(--muted); height: 16px; }
.bc-mode.on { border-color: var(--yellow); background: rgba(255, 198, 26, 0.08); }
.bc-mode.on .mode-ic { color: var(--yellow); }
.bc-crazy { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border-radius: 10px; background: var(--bg-1); border: 1px solid var(--line); cursor: pointer; }
.bc-crazy span { display: flex; flex-direction: column; }
.bc-crazy small { color: var(--muted); font-size: 12px; }
.bc-picks { display: flex; flex-direction: column; gap: 6px; }
.bc-empty { padding: 18px 10px; text-align: center; border: 1.5px dashed var(--line-2); border-radius: 10px; }
.bc-pick { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; background: var(--bg-1); }
.bc-pick .case-visual { width: 46px; flex: none; }
.bp-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 12.5px; }
.bp-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-qty { display: flex; align-items: center; gap: 6px; }
.bp-qty button { width: 26px; height: 26px; border-radius: 7px; background: var(--bg-4); display: grid; place-items: center; color: var(--muted); }
.bp-qty button:hover { color: #fff; }
.bp-qty .ic { width: 13px; height: 13px; }
.bp-qty span { min-width: 16px; text-align: center; font-weight: 700; }
.bc-total { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 4px; border-top: 1px solid var(--line); }
.bc-total b .amt { font-size: 18px; }
.bc-note { text-align: center; }
.bc-tools { margin-bottom: 12px; max-width: 320px; }
.bc-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.bc-card { cursor: pointer; }
.bc-card .bc-add { position: absolute; inset: auto 10px 10px 10px; height: 34px; border-radius: 8px; display: none; align-items: center; justify-content: center; gap: 6px; background: linear-gradient(180deg, #2fd56f, #1ea955); font-weight: 600; z-index: 3; }
.bc-card:hover .bc-add { display: flex; }
.bc-card.picked { border-color: var(--yellow); }
.bc-n { position: absolute; top: 10px; right: 10px; z-index: 3; min-width: 26px; height: 26px; border-radius: 99px; background: var(--yellow); color: #241900; font-weight: 800; display: grid; place-items: center; font-size: 13px; }

/* battle view */
.bt-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 12px 0 14px; flex-wrap: wrap; }
.bt-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bt-title h1 { font-size: 26px; }
.bt-meta { display: flex; gap: 22px; }
.bt-meta > span { display: flex; flex-direction: column; gap: 2px; font-size: 16px; }
.bt-rounds { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; }
.bt-round { position: relative; width: 74px; flex: none; padding: 6px; border-radius: 10px; background: var(--bg-3); border: 1px solid var(--line); opacity: 0.7; transition: all 0.25s; }
.bt-round .r-n { position: absolute; top: 4px; left: 6px; font-size: 11px; font-weight: 700; color: var(--muted); z-index: 2; }
.bt-round.cur { opacity: 1; border-color: var(--yellow); box-shadow: 0 0 18px -4px rgba(255, 198, 26, 0.5); transform: translateY(-2px); }
.bt-round.past { opacity: 0.35; }
.bt-status { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; margin: 6px 0 14px; border-radius: 12px; background: var(--bg-3); border: 1px solid var(--line); font-size: 15px; color: var(--text-2); flex-wrap: wrap; }
.bt-status .ic { color: var(--yellow); }
.bt-status b { color: #fff; }
.bt-status .cd { font-size: 20px; color: var(--yellow); animation: pop 0.5s var(--ease); }
.bt-status.st-done { border-color: rgba(255, 198, 26, 0.4); background: linear-gradient(90deg, rgba(255, 198, 26, 0.1), var(--bg-3), rgba(255, 198, 26, 0.1)); }
.bt-arena { display: flex; gap: 10px; align-items: stretch; }
.bt-team { flex: 1; display: flex; gap: 10px; min-width: 0; }
.bt-vs { display: flex; align-items: center; justify-content: center; flex: none; width: 34px; }
.bt-vs span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-4); border: 1px solid var(--line-2); font-size: 11px; font-weight: 800; color: var(--yellow); }
.seat { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; background: linear-gradient(180deg, #20242c, #1b1e25); border: 1px solid var(--line); position: relative; transition: border-color 0.3s, opacity 0.3s, box-shadow 0.3s; }
.seat.you { border-color: rgba(255, 198, 26, 0.35); }
.seat.leading { border-color: rgba(36, 198, 97, 0.55); }
.seat.winner { border-color: var(--yellow); box-shadow: 0 0 34px -10px rgba(255, 198, 26, 0.7); background: radial-gradient(80% 40% at 50% 0%, rgba(255, 198, 26, 0.16), transparent 70%), linear-gradient(180deg, #23252a, #1b1e25); }
.seat.loser { opacity: 0.55; }
.seat-player { display: flex; align-items: center; gap: 8px; min-height: 32px; flex-wrap: wrap; }
.seat-player b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.seat-wait { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; flex: 1; }
.seat-reel { height: 270px; }
.seat-reel .reel { height: 100%; }
.seat-reel.is-empty .reel { opacity: 0.25; }
.seat-total { text-align: center; font-size: 18px; font-weight: 700; padding: 6px; border-radius: 9px; background: rgba(0, 0, 0, 0.25); }
.seat-banner { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: linear-gradient(180deg, #ffd84a, #f5b400); color: #241900; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; box-shadow: 0 8px 20px rgba(255, 190, 0, 0.35); animation: pop 0.5s var(--ease); z-index: 3; }
.seat-banner .ic { width: 14px; height: 14px; }
.seat-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.seat-item { --rc: #8b93a4; padding: 6px 4px 5px; border-radius: 8px; background: radial-gradient(90% 70% at 50% 110%, color-mix(in srgb, var(--rc) 30%, transparent), transparent 70%), #20242c; border-bottom: 2px solid var(--rc); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; }
.seat-item img { height: 40px; width: 100%; object-fit: contain; }
.seat-item.new { animation: pop 0.45s var(--ease); }
.bt-foot { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.bt-result { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; margin-right: 8px; }
.bt-result > div { display: flex; flex-direction: column; }
.bt-result .ic { width: 26px; height: 26px; }
.bt-result.win { background: rgba(255, 198, 26, 0.1); border: 1px solid rgba(255, 198, 26, 0.4); }
.bt-result.win .ic { color: var(--yellow); }
.bt-result.lose { background: rgba(255, 77, 94, 0.08); border: 1px solid rgba(255, 77, 94, 0.3); }
.bt-result.lose .ic { color: var(--red); }
.bt-result a { color: var(--yellow); text-decoration: underline; }

@media (max-width: 1100px) {
  .battle-row { grid-template-columns: 1fr auto; grid-template-areas: 'mode act' 'cases cases' 'seats cost'; }
  .br-mode { grid-area: mode; } .br-cases { grid-area: cases; } .br-seats { grid-area: seats; } .br-cost { grid-area: cost; align-items: flex-end; } .br-act { grid-area: act; }
  .bc-layout { grid-template-columns: 1fr; }
  .bc-side { position: static; max-height: none; }
  .bt-arena.seats-4 { flex-wrap: wrap; }
  .bt-arena.seats-4 .bt-team { flex-basis: 100%; }
  .bt-arena.seats-4:not(.teams) { display: grid; grid-template-columns: 1fr 1fr; }
  .bt-arena.seats-4:not(.teams) .bt-vs { display: none; }
}
@media (max-width: 640px) {
  .bt-arena { flex-direction: column; }
  .bt-arena.seats-4:not(.teams) { grid-template-columns: 1fr; }
  .bt-vs { width: 100%; height: 30px; }
  .seat-reel { height: 200px; }
  .br-act .btn { min-width: 0; }
}

/* ================================================================ UPGRADER */
.upg-stage { display: grid; grid-template-columns: minmax(0, 1fr) 320px minmax(0, 1fr); gap: 16px; align-items: stretch; }
.upg-box { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 16px; background: linear-gradient(180deg, #20242c, #1b1e25); border: 1px solid var(--line); }
.upg-box-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; color: var(--text-2); }
.upg-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.upg-slot { --rc: transparent; position: relative; aspect-ratio: 1.15; border-radius: 10px; border: 1.5px dashed var(--line-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11.5px; }
.upg-slot.full { border: 1px solid color-mix(in srgb, var(--rc) 50%, transparent); background: radial-gradient(90% 70% at 50% 110%, color-mix(in srgb, var(--rc) 30%, transparent), transparent 70%), #22262e; }
.upg-slot img { height: 58%; width: 90%; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5)); }
.upg-slot i { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 50%; display: none; place-items: center; background: rgba(0, 0, 0, 0.6); }
.upg-slot i .ic { width: 11px; height: 11px; }
.upg-slot.full:hover i { display: grid; }
.upg-coins { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.upg-coins .bet-input { height: 40px; }
.upg-value { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.upg-value b .amt { font-size: 18px; }
.upg-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.upg-dial { position: relative; width: 280px; height: 280px; }
.upg-ring { width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: #2a2f3a; stroke-width: 16; }
.ring-win { fill: none; stroke: var(--green); stroke-width: 16; stroke-linecap: butt; filter: drop-shadow(0 0 6px rgba(36, 198, 97, 0.6)); transition: stroke-dasharray 0.4s var(--ease); }
.ring-inner { fill: #181b21; stroke: rgba(255, 255, 255, 0.05); stroke-width: 1; }
.upg-needle { position: absolute; inset: 0; pointer-events: none; }
.upg-needle i { position: absolute; left: 50%; top: 6px; width: 0; height: 0; margin-left: -11px; border-left: 11px solid transparent; border-right: 11px solid transparent; border-top: 22px solid var(--yellow); filter: drop-shadow(0 2px 6px rgba(255, 198, 26, 0.7)); }
.upg-readout { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; }
.upg-readout b { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.upg-readout span { font-size: 12.5px; color: var(--muted); max-width: 150px; }
.upg-dial.won .ring-win { stroke: var(--yellow); }
.upg-dial.won .upg-readout b { color: var(--green-1); }
.upg-dial.lost .ring-bg { stroke: rgba(255, 77, 94, 0.45); }
.upg-dial.lost .upg-readout b { color: var(--red); }
.upg-center .btn { min-width: 260px; }
.upg-target { flex: 1; display: grid; place-items: center; min-height: 200px; }
.upg-tcard { --rc: #888; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px; border-radius: 12px; text-align: center;
  background: radial-gradient(80% 60% at 50% 100%, color-mix(in srgb, var(--rc) 30%, transparent), transparent 70%); animation: pop 0.35s var(--ease); }
.upg-tcard img { width: 80%; max-height: 130px; object-fit: contain; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.6)); margin-bottom: 6px; }
.upg-tcard b { color: var(--rc); filter: brightness(1.3); }
.upg-tempty { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); text-align: center; font-size: 13px; }
.upg-tempty .ic { width: 40px; height: 40px; color: var(--muted-2); }
.upg-mults { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.upg-mults button { height: 34px; border-radius: 8px; background: var(--bg-4); color: var(--text-2); font-weight: 700; font-size: 12.5px; }
.upg-mults button:hover { background: rgba(255, 198, 26, 0.14); color: var(--yellow); }
.upg-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.upg-list { padding: 14px; }
.upg-list-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.upg-list-head h3 { font-size: 16px; margin-right: auto; }
.upg-list-head .input-icon { width: 180px; }
.upg-list .item-grid { max-height: 560px; overflow-y: auto; padding-right: 4px; }

@media (max-width: 1180px) {
  .upg-stage { grid-template-columns: 1fr 1fr; }
  .upg-center { grid-column: 1 / -1; order: -1; }
  .upg-lists { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .upg-stage { grid-template-columns: 1fr; }
  .upg-dial { width: 240px; height: 240px; }
}

/* ================================================================== DOUBLE */
.side-t { color: #ff6b6b; } .side-ct { color: #8fb6ff; } .side-bonus { color: var(--green-1); }
.dbl-hist { display: flex; gap: 5px; }
.dh { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.dh .face { width: 22px; height: 22px; }
.dh.t, .dtile.t, .dbl-btn.t, .l100.t .face { background: linear-gradient(180deg, #e65151, #b72f31); }
.dh.ct, .dtile.ct, .dbl-btn.ct, .l100.ct .face { background: linear-gradient(180deg, #e9edf3, #aeb7c4); }
.dh.bonus, .dtile.bonus, .dbl-btn.bonus, .l100.bonus .face { background: linear-gradient(180deg, #3fe07f, #179b49); }
.dh:first-child { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6); }
.dbl-wheel { padding: 16px; }
.dbl-status { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 15px; color: var(--text-2); }
.dbl-status b { color: #fff; font-variant-numeric: tabular-nums; }
.dbl-bar { flex: 1; height: 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.06); overflow: hidden; order: 2; }
.dbl-bar i { display: block; height: 100%; width: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--yellow), #ffe58a); }
.dbl-status > span { min-width: 220px; }
.dbl-strip { position: relative; height: 108px; overflow: hidden; border-radius: 12px; background: #15171c; border: 1px solid var(--line); }
.dbl-strip::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, #15171c, transparent 14%, transparent 86%, #15171c); }
.dbl-track { position: absolute; top: 12px; left: 0; display: flex; gap: 6px; will-change: transform; }
.dtile { position: relative; width: 84px; height: 84px; flex: none; border-radius: 12px; display: grid; place-items: center; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.18); transition: transform 0.3s var(--ease), opacity 0.3s, box-shadow 0.3s; }
.dtile .face { width: 58%; height: 58%; }
.dtile span { position: absolute; bottom: 4px; right: 7px; font-size: 10px; font-weight: 800; color: rgba(0, 0, 0, 0.45); }
.dbl-strip.done .dtile:not(.win) { opacity: 0.35; }
.dtile.win { transform: scale(1.08); box-shadow: 0 0 0 3px #fff, 0 0 26px rgba(255, 255, 255, 0.45); z-index: 2; }
.dbl-marker { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: var(--yellow); box-shadow: 0 0 14px rgba(255, 198, 26, 0.8); z-index: 3; }
.dbl-marker::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); border: 8px solid transparent; border-top-color: var(--yellow); }
.dbl-last100 { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; }
.l100 { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.l100 .face { width: 22px; height: 22px; border-radius: 6px; padding: 3px; }
.dbl-controls { margin-top: 14px; padding: 14px; }
.dbl-controls .bet-control { flex-direction: row; align-items: center; }
.dbl-controls .bet-input { flex: 1; max-width: 360px; }
.dbl-controls .bet-quick { flex: 1; }
.dbl-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.dbl-col { display: flex; flex-direction: column; gap: 10px; transition: opacity 0.3s; }
.dbl-col.lose { opacity: 0.5; }
.dbl-btn { display: flex; align-items: center; justify-content: center; gap: 12px; height: 60px; border-radius: 12px; color: #fff; font-size: 15px; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.2); transition: filter 0.15s, transform 0.08s; }
.dbl-btn .face { width: 34px; height: 34px; }
.dbl-btn span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.dbl-btn i { font-style: normal; font-size: 12px; opacity: 0.85; }
.dbl-btn.ct { color: #1d2633; }
.dbl-btn:hover { filter: brightness(1.1); }
.dbl-btn:active { transform: translateY(1px); }
.dbl-btn:disabled { filter: saturate(0.4) brightness(0.7); cursor: not-allowed; }
.dbl-sum { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--bg-3); border: 1px solid var(--line); }
.dbl-n { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.dbl-col.win .dbl-sum { border-color: rgba(36, 198, 97, 0.5); background: rgba(36, 198, 97, 0.08); }
.dbl-bets { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow-y: auto; }
.dbl-bet { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 9px; background: rgba(255, 255, 255, 0.025); animation: fadeUp 0.25s var(--ease); }
.dbl-bet .avatar { width: 24px; height: 24px; }
.db-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text-2); }
.dbl-bet b { font-size: 13px; font-variant-numeric: tabular-nums; }
.dbl-bet.you { background: rgba(255, 198, 26, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 198, 26, 0.35); }
@media (max-width: 900px) {
  .dbl-cols { grid-template-columns: 1fr; }
  .dbl-controls .bet-control { flex-direction: column; align-items: stretch; }
  .dbl-controls .bet-input { max-width: none; }
  .page-double .page-title .right { width: 100%; }
}

/* =================================================================== CRASH */
.cr-hist { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.cr-pill { padding: 4px 8px; border-radius: 7px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--bg-4); }
.cr-pill.bad { color: #ff8592; }
.cr-pill.good { color: var(--green-1); }
.cr-pill.gold { color: var(--yellow); background: rgba(255, 198, 26, 0.12); }
.cr-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; }
.cr-graph { position: relative; height: 420px; overflow: hidden; background: radial-gradient(80% 80% at 70% 100%, rgba(36, 198, 97, 0.07), transparent 70%), var(--bg-3); }
.cr-graph canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cr-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; gap: 6px; }
.cr-center b { font-size: 64px; font-weight: 800; font-variant-numeric: tabular-nums; text-shadow: 0 6px 30px rgba(0, 0, 0, 0.6); }
.cr-center.wait b { font-size: 46px; color: var(--yellow); }
.cr-center.bust b, .cr-center.bust span { color: var(--red); }
.cr-center.bust { animation: shake 0.45s; }
.cr-cd { width: 220px; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.cr-cd i { display: block; height: 100%; background: var(--yellow); }
.cr-side { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.cr-label { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.cr-side .bet-quick { grid-template-columns: repeat(4, 1fr); }
.cr-auto .cr-x { color: var(--muted); font-weight: 700; font-size: 18px; width: 20px; text-align: center; }
.cr-auto input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; font-size: 17px; font-weight: 700; color: #fff; }
.cr-auto-q { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.cr-auto-q button { height: 30px; border-radius: 7px; background: var(--bg-4); color: var(--muted); font-size: 12px; font-weight: 600; }
.cr-auto-q button:hover { color: #fff; }
.cr-side #act { margin-top: 8px; }
.cr-note { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--bg-1); font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.cr-note .ic { width: 16px; height: 16px; color: var(--yellow); }
.cr-note.good { color: var(--green-1); background: rgba(36, 198, 97, 0.08); }
.cr-note.good .ic { color: var(--green-1); }
.cr-note.bad { color: var(--red); background: rgba(255, 77, 94, 0.08); }
.cr-note.bad .ic { color: var(--red); }
.cr-players { margin-top: 16px; padding: 14px; }
.cr-ph { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.cr-ph h3 { font-size: 16px; }
.cr-who { display: inline-flex; align-items: center; gap: 8px; }
.cr-who .avatar { width: 24px; height: 24px; }
.cr-players tr.you td { background: rgba(255, 198, 26, 0.06); }
.cr-players tr.lost td { opacity: 0.6; }
@media (max-width: 980px) {
  .cr-layout { grid-template-columns: 1fr; }
  .cr-graph { height: 320px; }
  .cr-center b { font-size: 48px; }
}

/* ================================================================== PLINKO */
.pl-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.pl-side { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.pl-side .bet-quick { grid-template-columns: repeat(4, 1fr); }
.pl-seg { display: grid; grid-template-columns: repeat(3, 1fr); }
.pl-seg button { width: 100%; }
.pl-seg button:disabled { opacity: 0.5; cursor: not-allowed; }
.pl-side #drop { margin-top: 8px; }
.pl-auto { display: flex; gap: 6px; }
.pl-auto .btn { flex: 1; }
.pl-recent { display: flex; flex-wrap: wrap; gap: 5px; min-height: 26px; }
.pl-res { padding: 3px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 800; color: #1b1300; animation: pop 0.3s var(--ease); }
.pl-board { position: relative; height: 620px; background: radial-gradient(60% 50% at 50% 0%, rgba(255, 198, 26, 0.06), transparent 70%), var(--bg-3); }
.pl-board canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (max-width: 980px) {
  .pl-layout { grid-template-columns: 1fr; }
  .pl-board { height: 460px; order: -1; }
}

/* =================================================================== TILES */
.ti-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.ti-side { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ti-side .bet-quick { grid-template-columns: repeat(4, 1fr); }
.bet-control.locked { opacity: 0.6; pointer-events: none; }
.ti-mines { display: flex; gap: 8px; }
.ti-mines .select { width: 86px; }
.ti-mq { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.ti-mq button { height: 40px; border-radius: 8px; background: var(--bg-4); color: var(--muted); font-weight: 700; }
.ti-mq button.on { color: var(--yellow); box-shadow: inset 0 0 0 1px rgba(255, 198, 26, 0.5); }
.ti-mq button:disabled { opacity: 0.5; cursor: not-allowed; }
.ti-side #act { margin-top: 6px; }
.ti-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.ti-info div { padding: 10px 12px; border-radius: 10px; background: var(--bg-1); display: flex; flex-direction: column; gap: 2px; }
.ti-info b { font-size: 16px; font-variant-numeric: tabular-nums; }
.ti-board { padding: 22px; display: grid; place-items: center; background: radial-gradient(60% 50% at 50% 0%, rgba(36, 198, 97, 0.06), transparent 70%), var(--bg-3); }
.ti-grid { width: min(100%, 560px); display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.tile {
  position: relative; aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(180deg, #343a47, #2a2f3a); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.3), 0 4px 10px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s, background 0.2s, box-shadow 0.2s, opacity 0.3s;
}
.tile .t-n { font-weight: 700; color: rgba(255, 255, 255, 0.18); font-size: 14px; }
.tile.live:hover:not(:disabled) { transform: translateY(-3px); background: linear-gradient(180deg, #3f4656, #313745); }
.tile:disabled { cursor: default; }
.tile .t-ic { width: 58%; height: 58%; animation: pop 0.35s var(--ease); }
.tile .t-ic svg { width: 100%; height: 100%; }
.tile.gem { background: linear-gradient(180deg, #1f3a2b, #183025); box-shadow: inset 0 0 0 2px rgba(63, 224, 127, 0.5), 0 0 22px -6px rgba(63, 224, 127, 0.6); }
.tile.ghost { opacity: 0.4; box-shadow: none; }
.tile.bomb { background: linear-gradient(180deg, #3a2226, #2c1a1d); box-shadow: inset 0 0 0 2px rgba(255, 77, 94, 0.35); opacity: 0.75; }
.tile.hit { opacity: 1; background: linear-gradient(180deg, #ff6170, #c42a38); box-shadow: 0 0 30px rgba(255, 77, 94, 0.7); }
@media (max-width: 980px) {
  .ti-layout { grid-template-columns: 1fr; }
  .ti-board { order: -1; padding: 14px; }
  .ti-grid { gap: 7px; }
}

/* ================================================================ COINFLIP */
.cf-create { display: flex; align-items: center; gap: 16px; padding: 16px; flex-wrap: wrap; }
.cf-sides { display: flex; gap: 8px; }
.cf-side { display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 14px; border-radius: 11px; background: var(--bg-1); border: 1px solid var(--line); color: var(--muted); font-weight: 600; }
.cf-side .face { width: 30px; height: 30px; border-radius: 50%; padding: 3px; }
.cf-side.t .face { background: linear-gradient(160deg, #ffd96a, #e08b00); }
.cf-side.ct .face { background: linear-gradient(160deg, #8fb6ff, #3360c9); }
.cf-side.on { color: #fff; border-color: var(--yellow); background: rgba(255, 198, 26, 0.08); }
.cf-create .bet-control { flex: 1; min-width: 280px; flex-direction: row; align-items: center; }
.cf-create .bet-input { flex: 1; }
.cf-create .bet-quick { flex: 1.3; }
.cf-list { display: flex; flex-direction: column; gap: 10px; }
.cf-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr) 210px; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; background: linear-gradient(90deg, #20242c, #1d2027); border: 1px solid var(--line); animation: fadeUp 0.3s var(--ease); }
.cf-row.mine { border-color: rgba(255, 198, 26, 0.4); }
.cf-player { display: flex; align-items: center; gap: 10px; min-width: 0; transition: opacity 0.3s; }
.cf-player > div { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cf-player b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-player.win b { color: var(--yellow); }
.cf-player.lose { opacity: 0.45; }
.cf-q { width: 30px; height: 30px; border-radius: 50%; border: 1.5px dashed var(--line-2); display: grid; place-items: center; color: var(--muted-2); font-weight: 700; }
.cf-chip { width: 28px; height: 28px; border-radius: 50%; padding: 3px; flex: none; margin-left: auto; }
.cf-chip .face { width: 100%; height: 100%; }
.cf-chip.t { background: linear-gradient(160deg, #ffd96a, #e08b00); }
.cf-chip.ct { background: linear-gradient(160deg, #8fb6ff, #3360c9); }
.cf-mid { display: flex; flex-direction: column; align-items: center; gap: 6px; perspective: 600px; }
.cf-amt { font-size: 15px; }
.cf-coin { position: relative; width: 56px; height: 56px; transform-style: preserve-3d; }
.cf-face { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; backface-visibility: hidden; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.2), inset 0 3px 0 rgba(255, 255, 255, 0.3); }
.cf-face .face { width: 64%; height: 64%; }
.cf-face.front { background: linear-gradient(160deg, #ffd96a, #e08b00); }
.cf-face.back { background: linear-gradient(160deg, #8fb6ff, #3360c9); transform: rotateY(180deg); }
.cf-coin.flipping { animation: cfFlip var(--dur) cubic-bezier(0.15, 0.6, 0.2, 1) forwards; }
.cf-coin.landed[data-result='ct'] { transform: rotateY(180deg); }
@keyframes cfFlip { from { transform: rotateY(0deg) translateY(0); } 40% { transform: rotateY(calc(var(--turns) * 140deg)) translateY(-12px); } to { transform: rotateY(calc(var(--turns) * 360deg)) translateY(0); } }
.cf-act { display: flex; justify-content: flex-end; }
.cf-act .btn { min-width: 150px; }
.cf-won { display: inline-flex; align-items: center; gap: 6px; color: var(--yellow); font-weight: 600; font-size: 13px; text-align: right; }
@media (max-width: 900px) {
  .cf-row { grid-template-columns: 1fr auto 1fr; }
  .cf-act { grid-column: 1 / -1; justify-content: center; }
  .cf-create .bet-control { flex-direction: column; align-items: stretch; }
}
