:root {
  --bg-base: #0a0a0a;
  --bg-surface: #111113;
  --bg-elevated: #18181b;
  --bg-hover: #202024;
  --border: #232326;
  --border-strong: #323238;
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --emerald: #10b981;
  --emerald-dim: rgba(16, 185, 129, 0.14);
  --danger: #ef4444;
  --danger-dim: rgba(239, 68, 68, 0.14);
  --amber: #f59e0b;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --radius: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

.mono {
  font-family: var(--font-mono);
}

.uppercase {
  text-transform: uppercase;
}

.emerald {
  color: var(--emerald);
}

.danger {
  color: var(--danger);
}

.muted {
  color: var(--text-muted);
}

/* BUTTONS */
.btn {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: #4b4b54;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-base);
  border-color: var(--text-primary);
}

.btn-primary:hover:not(:disabled) {
  background: #e4e4e7;
  border-color: #e4e4e7;
}

.btn-secondary {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

.btn-emerald {
  background: var(--emerald-dim);
  border-color: var(--emerald);
  color: var(--emerald);
}

.btn-emerald:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.24);
}

.btn-danger {
  background: var(--danger-dim);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.24);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.btn-ghost.active-toggle {
  border-color: var(--emerald);
  color: var(--emerald);
  background: var(--emerald-dim);
}

.btn-xs {
  padding: 4px 9px;
  font-size: 11px;
}

.btn-full {
  width: 100%;
}

/* INPUTS */
input, select {
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 8px 10px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease;
}

input:focus, select:focus {
  border-color: var(--text-secondary);
}

.mini-select, .mini-input {
  padding: 4px 8px;
  font-size: 11px;
}

.mini-input {
  width: 84px;
}

/* LOBBY OVERLAY */
.lobby-overlay {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.03), transparent 55%),
    var(--bg-base);
}

.lobby-card {
  width: 100%;
  max-width: 680px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lobby-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-mark-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.account-box {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.account-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.relay-advanced {
  font-size: 11px;
  color: var(--text-muted);
}

.relay-advanced summary {
  cursor: pointer;
  letter-spacing: 0.06em;
  user-select: none;
}

.relay-advanced input {
  width: 100%;
  font-size: 11px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.65);
  display: inline-block;
}

.lobby-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.lobby-split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: stretch;
}

.lobby-panel {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.panel-desc {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
}

.lobby-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.lobby-status {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* APP SHELL */
.app-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  min-height: 50px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  flex-shrink: 0;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-text {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
}

.room-pill {
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 11px;
}

.room-pill:hover {
  border-color: var(--text-secondary);
}

.pill-label {
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.copy-hint {
  color: var(--emerald);
  font-size: 10px;
  font-weight: 600;
}

.transport-badge {
  font-size: 10px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 3px 6px;
  border-radius: 4px;
}

.game-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  padding: 3px;
  border-radius: var(--radius);
}

.nav-tab {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 6px 11px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-tab:hover {
  color: var(--text-primary);
}

.nav-tab.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.tab-pips {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.pip {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-secondary);
}

.pip.is-me {
  background: var(--emerald);
}

.host-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-balance {
  background: var(--bg-base);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.top-balance .unit {
  font-size: 10px;
  color: var(--text-muted);
}

.party-lock-banner {
  background: rgba(16, 185, 129, 0.08);
  border-bottom: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--emerald);
  text-align: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* WORKSPACE GRID */
.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
}

.stage {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px 20px;
}

.game-view {
  display: none;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
}

.game-view.active {
  display: flex;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.view-title-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.view-title-group h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.sub-tag {
  font-size: 11px;
  color: var(--text-muted);
}

.view-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-text {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.timer-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.inline-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* WHEEL GAME */
.wheel-history {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hist-dot {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
}

.hist-dot.black {
  background: #141416;
  color: #f4f4f5;
}

.hist-dot.white {
  background: #f4f4f5;
  color: #0a0a0a;
}

.hist-dot.green {
  background: var(--emerald);
  color: #042f2e;
  border-color: var(--emerald);
}

.wheel-stage {
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  flex: 1;
}

.wheel-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 390px;
  aspect-ratio: 1;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

#wheelCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.wheel-pointer {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 16px solid var(--text-primary);
  z-index: 4;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.wheel-center-readout {
  position: absolute;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  gap: 2px;
}

.center-label {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.center-value {
  font-size: 18px;
  font-weight: 700;
}

.wheel-betting-area {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chip-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: var(--radius);
}

.chip-bar-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-right: 4px;
}

.chip-btn {
  appearance: none;
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.chip-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.chip-btn.active {
  background: var(--text-primary);
  color: var(--bg-base);
  border-color: var(--text-primary);
}

.wheel-zones {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.bet-zone {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
}

.bet-zone.winner-flash {
  border-color: var(--emerald);
  box-shadow: inset 0 0 0 1px var(--emerald);
}

.zone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.zone-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.zone-odds {
  font-size: 11px;
  color: var(--text-muted);
}

.zone-total {
  font-size: 20px;
  font-weight: 700;
}

.btn-zone {
  width: 100%;
  background: #141416;
  border-color: var(--border-strong);
}

.btn-zone-green {
  background: var(--emerald-dim);
  border-color: rgba(16, 185, 129, 0.45);
  color: var(--emerald);
}

.btn-zone-green:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.24);
}

.btn-zone-white {
  background: #f4f4f5;
  color: #0a0a0a;
  border-color: #f4f4f5;
}

.btn-zone-white:hover:not(:disabled) {
  background: #e4e4e7;
}

.zone-bets {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  overflow-y: auto;
  max-height: 150px;
}

.zone-bet-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  padding: 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* PLAYING CARDS (SHARED FOR BLACKJACK & POKER) */
.cards-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 62px;
}

.playing-card {
  width: 44px;
  height: 62px;
  border-radius: 5px;
  background: #f4f4f5;
  color: #0a0a0a;
  border: 1px solid #d4d4d8;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 5px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  user-select: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.playing-card.sm {
  width: 34px;
  height: 48px;
  font-size: 10px;
  padding: 3px 4px;
}

.playing-card.suit-red {
  color: #dc2626;
}

.playing-card.back {
  background: repeating-linear-gradient(
    45deg,
    #18181b,
    #18181b 4px,
    #232328 4px,
    #232328 8px
  );
  border-color: #3f3f46;
  color: transparent;
}

.playing-card.highlight-win {
  box-shadow: 0 0 0 2px var(--emerald);
}

.card-suit-center {
  align-self: center;
  font-size: 14px;
  line-height: 1;
}

.playing-card.sm .card-suit-center {
  font-size: 11px;
}

/* BLACKJACK */
.bj-table {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
}

.bj-dealer-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.dealer-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-badge {
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-primary);
}

.bj-seats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.bj-seat {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 156px;
}

.bj-seat.active-turn {
  border-color: var(--emerald);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.3);
}

.bj-seat.is-empty {
  align-items: center;
  justify-content: center;
  border-style: dashed;
}

.bj-seat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.bj-hand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px;
  border-radius: 4px;
  border: 1px solid transparent;
}

.bj-hand-block.active-hand {
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.05);
}

.bj-hand-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.outcome-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.06em;
}

.outcome-win, .outcome-blackjack {
  background: var(--emerald-dim);
  color: var(--emerald);
}

.outcome-lose, .outcome-bust {
  background: var(--danger-dim);
  color: var(--danger);
}

.outcome-push {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

/* ACTION BAR */
.action-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 52px;
}

/* POKER */
.poker-felt-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
}

.poker-oval {
  width: 100%;
  min-height: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 28px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.poker-board-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.poker-sidepots {
  font-size: 11px;
  color: var(--text-secondary);
}

.showdown-banner {
  font-size: 12px;
  font-weight: 600;
  color: var(--emerald);
  background: var(--emerald-dim);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 5px 12px;
  border-radius: 4px;
}

.poker-seats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.poker-seat {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 116px;
}

.poker-seat.active-turn {
  border-color: var(--emerald);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.35);
}

.poker-seat.folded {
  opacity: 0.45;
}

.poker-seat.is-empty {
  align-items: center;
  justify-content: center;
  border-style: dashed;
}

.seat-badges {
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge-d, .badge-sb, .badge-bb, .badge-bot {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
}

.badge-d {
  background: var(--text-primary);
  color: var(--bg-base);
}

.badge-bot {
  color: var(--text-muted);
}

.poker-raise-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* RUSSIAN ROULETTE */
.rr-stage {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: space-between;
}

.rr-stage.bang-flash {
  animation: bangShake 0.45s ease;
  border-color: var(--danger);
}

@keyframes bangShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 3px); background: rgba(239, 68, 68, 0.12); }
  40% { transform: translate(6px, -3px); }
  60% { transform: translate(-4px, -2px); }
  80% { transform: translate(4px, 2px); }
}

.rr-hud-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.hud-stat {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hud-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.hud-val {
  font-size: 18px;
  font-weight: 700;
}

.rr-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.cylinder-wrap {
  position: relative;
  width: 210px;
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cylinder-svg {
  width: 100%;
  height: 100%;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.cylinder-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  padding: 1px 6px;
  border-radius: 3px;
}

.rr-status-banner {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 8px 16px;
  border-radius: var(--radius);
  background: var(--bg-base);
  border: 1px solid var(--border);
  text-align: center;
}

.rr-players-ring {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.rr-player-card {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rr-player-card.active-turn {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35);
}

.rr-player-card.eliminated {
  opacity: 0.42;
  border-color: rgba(239, 68, 68, 0.4);
  text-decoration: line-through;
}

.rr-player-card.survived {
  border-color: var(--emerald);
}

/* SIDEBAR */
.sidebar {
  border-left: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel {
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.role-tag {
  font-size: 9px;
  border: 1px solid var(--border-strong);
  padding: 1px 6px;
  border-radius: 3px;
}

.ledger-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.ledger-stats.four-col, .loan-actions.four-col {
  grid-template-columns: repeat(4, 1fr);
}

.stat-box {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.stat-num {
  font-size: 12px;
  font-weight: 700;
}

.loan-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.loan-actions .btn, .vault-actions .btn {
  padding: 4px 5px;
  font-size: 10px;
}

.vault-actions {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 5px;
}

.modal-card.modal-wide {
  max-width: 580px;
}

.guide-body {
  gap: 16px;
}

.guide-section {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  color: var(--text-secondary);
}

.guide-section h4 {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.guide-list {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.code-block {
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 11px;
  color: var(--emerald);
  overflow-x: auto;
}

.leaderboard-panel {
  max-height: 220px;
  min-height: 120px;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
}

.lb-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
}

.lb-name {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-game-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0 4px;
  border-radius: 3px;
}

.feed-panel {
  flex: 1;
  min-height: 0;
  border-bottom: none;
}

.feed-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}

.feed-item {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.35;
  word-break: break-word;
}

.feed-item.system {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.feed-item.bailout-card {
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-form {
  display: flex;
  gap: 6px;
}

.chat-form input {
  flex: 1;
  padding: 6px 8px;
  font-size: 12px;
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 12px;
  letter-spacing: 0.08em;
}

.modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bank-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-secondary);
}

.bank-players-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.bank-players-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.bank-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 12px;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .sidebar {
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .wheel-stage {
    grid-template-columns: 1fr;
  }
  .bj-seats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .poker-seats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .lobby-split, .account-fields {
    grid-template-columns: 1fr;
  }
  .lobby-divider {
    padding: 4px 0;
  }
  .topbar {
    height: auto;
    flex-wrap: wrap;
    padding: 10px;
  }
  .bj-seats-grid, .poker-seats, .wheel-zones, .rr-hud-grid {
    grid-template-columns: 1fr;
  }
}
