:root {
  --bg-main: #0c0d12;
  --bg-panel: #161822;
  --bg-panel-elevated: #1e2130;
  --bg-input: #0e1017;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f5fa;
  --text-muted: #8b93a7;

  --accent-red: #e51a4b;
  --accent-red-glow: rgba(229, 26, 75, 0.45);
  --accent-green: #28a745;
  --accent-green-hover: #2ec250;
  --accent-amber: #e68a00;
  --accent-amber-hover: #ff9d0a;
  --accent-cancel: #c82333;

  --pill-blue: #34b4ff;
  --pill-purple: #913ef8;
  --pill-pink: #c017b4;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  touch-action: manipulation;
}

.hidden {
  display: none !important;
}

.show-xs {
  display: none;
}

/* Home / Splash Screen */
.home-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: radial-gradient(circle at 50% 38%, #1a1428 0%, #0c0d12 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.32s ease, visibility 0.32s ease;
}

.home-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.home-bg-glow {
  position: absolute;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(229, 26, 75, 0.24) 0%, rgba(145, 62, 248, 0.12) 45%, transparent 72%);
  filter: blur(24px);
  pointer-events: none;
}

.home-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 500px;
  background: rgba(22, 24, 34, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 42px 34px 36px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.home-plane-badge {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  background: linear-gradient(135deg, #ff2b5e, #b8113c);
  display: grid;
  place-items: center;
  font-size: 36px;
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(229, 26, 75, 0.48);
  animation: floatPlane 2.8s ease-in-out infinite;
}

@keyframes floatPlane {
  0%, 100% { transform: translateY(0px) rotate(-6deg); }
  50% { transform: translateY(-7px) rotate(-2deg); }
}

.home-demo-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.1px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(52, 180, 255, 0.14);
  color: var(--pill-blue);
  border: 1px solid rgba(52, 180, 255, 0.32);
}

.home-title {
  font-size: 46px;
  font-weight: 900;
  letter-spacing: 0.6px;
  line-height: 1.05;
  background: linear-gradient(90deg, #ffffff 10%, #ff5c82 60%, #ff9966 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-subtitle {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 360px;
}

.home-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 6px;
}

.home-features span {
  font-size: 12px;
  font-weight: 600;
  color: #d7deee;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 5px 12px;
}

.home-play-btn {
  margin-top: 6px;
  width: 100%;
  max-width: 310px;
  padding: 18px 28px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(180deg, #32d158 0%, #22993d 100%);
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 1.2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(40, 167, 69, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.home-play-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 38px rgba(46, 194, 80, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  filter: brightness(1.05);
}

.home-play-btn:active {
  transform: translateY(0px) scale(0.99);
}

.play-triangle {
  font-size: 20px;
}

.home-balance-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.home-balance-note strong {
  color: #36d96a;
}

/* Top Bar */
.topbar {
  height: 54px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.brand-icon {
  color: var(--accent-red);
  font-size: 20px;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.4px;
  background: linear-gradient(90deg, #ff3b6b, #ff8f5c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.demo-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(52, 180, 255, 0.14);
  color: var(--pill-blue);
  border: 1px solid rgba(52, 180, 255, 0.3);
}

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

.balance-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 6px 14px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.balance-amount {
  color: #36d96a;
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.balance-currency {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.btn-subtle,
.btn-icon {
  background: var(--bg-panel-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-subtle:hover,
.btn-icon:hover {
  background: #272b3e;
  border-color: rgba(255, 255, 255, 0.18);
}

/* History Bar */
.history-bar {
  background: #11131b;
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 18px;
  overflow: hidden;
}

.history-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.history-pills::-webkit-scrollbar {
  display: none;
}

.history-pill {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: transform 0.12s;
}

.history-pill:hover {
  transform: translateY(-1px);
}

.history-pill.blue {
  color: var(--pill-blue);
  border-color: rgba(52, 180, 255, 0.25);
}

.history-pill.purple {
  color: #b77bff;
  border-color: rgba(145, 62, 248, 0.35);
}

.history-pill.pink {
  color: #ff4fe0;
  border-color: rgba(192, 23, 180, 0.45);
}

/* Main Grid */
.main-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 12px;
  padding: 12px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* Sidebar */
.sidebar {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: calc(100vh - 120px);
}

.sidebar-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px;
  gap: 4px;
  background: #12141d;
}

.tab-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 999px;
  padding: 7px 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tab-btn.active {
  background: var(--bg-panel-elevated);
  color: var(--text-primary);
}

.sidebar-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.summary-count {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

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

.summary-right {
  text-align: right;
}

.summary-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.summary-total {
  font-size: 14px;
  font-weight: 800;
  color: #36d96a;
  font-variant-numeric: tabular-nums;
}

.bets-table-header {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.7fr 1fr;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.bets-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bet-row {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.7fr 1fr;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
}

.bet-row.won {
  background: rgba(40, 167, 69, 0.14);
  border-color: rgba(40, 167, 69, 0.35);
}

.bet-row.is-me {
  border-color: rgba(52, 180, 255, 0.45);
}

.bet-player {
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bet-x {
  font-weight: 700;
  color: #b77bff;
}

.bet-win {
  text-align: right;
  font-weight: 700;
  color: #36d96a;
}

.sidebar-footer {
  padding: 9px 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

/* Game Area */
.game-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stage-wrapper {
  position: relative;
  background: #090a0f;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  height: 420px;
  overflow: hidden;
}

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

.stage-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.hotkey-hint {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
  pointer-events: none;
}

.hotkey-hint kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.65);
}

.waiting-ui {
  text-align: center;
  width: 280px;
}

.waiting-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 100%;
  background: var(--accent-red);
  transition: width 0.05s linear;
}

.waiting-sub {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.flying-ui {
  text-align: center;
}

.crashed-label {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent-red);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.multiplier-text {
  font-size: 76px;
  font-weight: 900;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.75);
  line-height: 1;
}

.multiplier-text.crashed {
  color: var(--accent-red);
  text-shadow: 0 0 28px var(--accent-red-glow);
}

/* Toasts */
.toast-container {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(20, 42, 28, 0.92);
  border: 1px solid #36d96a;
  color: #e9fff0;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  animation: slideIn 0.2s ease-out;
}

.toast.warn {
  background: rgba(54, 34, 16, 0.94);
  border-color: #ff9d0a;
  color: #fff3dd;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dual Bet Panels */
.bet-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.bet-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.panel-mode-tabs {
  background: var(--bg-input);
  border-radius: 999px;
  padding: 3px;
  display: inline-flex;
  gap: 4px;
}

.auto-status-pill {
  position: absolute;
  right: 0;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(40, 167, 69, 0.2);
  color: #36d96a;
  border: 1px solid rgba(40, 167, 69, 0.45);
}

.mode-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 999px;
  padding: 5px 22px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.mode-btn.active {
  background: var(--bg-panel-elevated);
  color: var(--text-primary);
}

.panel-body {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 12px;
  align-items: stretch;
}

.bet-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stepper {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 4px 6px;
}

.step-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--bg-panel-elevated);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.step-btn:hover {
  background: #2b3045;
}

.bet-input {
  flex: 1;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  outline: none;
  font-variant-numeric: tabular-nums;
}

.bet-input::-webkit-inner-spin-button,
.bet-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.quick-amounts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.chip-btn {
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 5px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.chip-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.action-btn {
  position: relative;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #ffffff;
  font-weight: 800;
  transition: transform 0.08s, filter 0.15s;
  min-height: 82px;
}

.action-btn:active {
  transform: scale(0.98);
}

.action-btn.state-bet {
  background: linear-gradient(180deg, #2ec250, #23963d);
  box-shadow: 0 4px 16px rgba(40, 167, 69, 0.35);
}

.action-btn.state-cancel {
  background: linear-gradient(180deg, #dc3545, #a71d2a);
  box-shadow: 0 4px 16px rgba(220, 53, 69, 0.35);
}

.action-btn.state-cashout {
  background: linear-gradient(180deg, #ff9d0a, #d97b00);
  box-shadow: 0 4px 18px rgba(230, 138, 0, 0.45);
}

.action-title {
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.action-sub {
  font-size: 14px;
  opacity: 0.95;
  font-variant-numeric: tabular-nums;
}

.action-key {
  position: absolute;
  bottom: 6px;
  right: 9px;
  font-size: 9px;
  font-weight: 700;
  opacity: 0.55;
  letter-spacing: 0.5px;
}

/* Auto Controls */
.auto-controls {
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.auto-left-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-autoplay {
  background: rgba(52, 180, 255, 0.14);
  color: var(--pill-blue);
  border: 1px solid rgba(52, 180, 255, 0.35);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.btn-autoplay:hover {
  background: rgba(52, 180, 255, 0.24);
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.toggle-row input {
  display: none;
}

.toggle-slider {
  width: 34px;
  height: 18px;
  background: #2b3042;
  border-radius: 999px;
  position: relative;
  transition: background 0.15s;
  flex-shrink: 0;
}

.toggle-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}

.toggle-row input:checked + .toggle-slider {
  background: var(--accent-green);
}

.toggle-row input:checked + .toggle-slider::after {
  transform: translateX(16px);
}

.auto-cashout-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cashout-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 4px 8px;
}

.cashout-input {
  width: 58px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  outline: none;
}

.x-suffix {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-card {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 16px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}

.modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.modal-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

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

.field-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.field-group input[type="text"] {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: monospace;
  width: 100%;
}

.input-action-row {
  display: flex;
  gap: 8px;
}

.round-proof-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #c5cde0;
  word-break: break-all;
}

/* Auto-Play Modal Controls */
.round-count-chips {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.round-chip {
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.round-chip.active {
  background: rgba(52, 180, 255, 0.18);
  color: var(--pill-blue);
  border-color: rgba(52, 180, 255, 0.5);
}

.autoplay-rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.btn-primary-green {
  background: linear-gradient(180deg, #2ec250, #23963d);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* Operator Modal & GGR Estimator */
.operator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.operator-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.std-input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  width: 100%;
  outline: none;
}

.ggr-box {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ggr-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.ggr-results {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
}

.ggr-results div {
  display: flex;
  justify-content: space-between;
}

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

.text-green {
  color: #36d96a;
}

.ggr-note {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
}

/* Responsive — Tablet & Narrow Desktop */
@media (max-width: 980px) {
  .main-grid {
    grid-template-columns: 1fr;
    padding: 8px;
    gap: 10px;
  }
  .sidebar {
    order: 2;
    max-height: 360px;
  }
  .bet-panels {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .stage-wrapper {
    height: 290px;
  }
  .multiplier-text {
    font-size: 54px;
  }
  .hotkey-hint,
  .action-key {
    display: none;
  }
}

/* Responsive — Mobile Phones */
@media (max-width: 600px) {
  .hide-xs {
    display: none;
  }

  .show-xs {
    display: inline;
  }

  .topbar {
    height: auto;
    padding: 8px 10px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .topbar-left {
    flex: 1 1 auto;
  }

  .brand {
    gap: 6px;
  }

  .brand-name {
    font-size: 16px;
  }

  .demo-badge {
    display: none;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
  }

  .balance-box {
    padding: 5px 10px;
    gap: 4px;
  }

  .balance-amount {
    font-size: 14px;
  }

  .btn-subtle,
  .btn-icon {
    padding: 6px 8px;
    font-size: 11px;
    white-space: nowrap;
  }

  .history-bar {
    padding: 6px 10px;
  }

  .history-pill {
    font-size: 11px;
    padding: 3px 8px;
  }

  .stage-wrapper {
    height: 235px;
    border-radius: 12px;
  }

  .waiting-ui {
    width: min(250px, 84%);
  }

  .waiting-title {
    font-size: 12px;
    letter-spacing: 0.9px;
  }

  .crashed-label {
    font-size: 15px;
  }

  .multiplier-text {
    font-size: 44px;
  }

  .toast-container {
    top: 8px;
    right: 8px;
    left: 8px;
    align-items: center;
  }

  .toast {
    font-size: 12px;
    padding: 8px 12px;
  }

  .bet-panel {
    padding: 10px;
    border-radius: 12px;
    gap: 9px;
  }

  .panel-body {
    grid-template-columns: 1fr 1.15fr;
    gap: 8px;
  }

  .stepper {
    padding: 3px 5px;
  }

  .step-btn {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  /* 16px prevents iOS Safari auto-zoom on focus */
  .bet-input,
  .cashout-input,
  .std-input,
  .field-group input[type="text"] {
    font-size: 16px;
  }

  .chip-btn {
    padding: 6px 4px;
    font-size: 12px;
  }

  .action-btn {
    min-height: 76px;
    border-radius: 12px;
  }

  .action-title {
    font-size: 16px;
  }

  .action-sub {
    font-size: 13px;
  }

  .auto-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .auto-left-group,
  .auto-cashout-group {
    justify-content: space-between;
  }

  .sidebar {
    border-radius: 12px;
    max-height: 340px;
  }

  .tab-btn {
    font-size: 11px;
    padding: 8px 4px;
  }

  /* Home Screen Mobile */
  .home-screen {
    padding: 16px;
  }

  .home-card {
    padding: 28px 20px 24px;
    border-radius: 20px;
    gap: 12px;
  }

  .home-plane-badge {
    width: 62px;
    height: 62px;
    font-size: 30px;
    border-radius: 18px;
  }

  .home-title {
    font-size: 34px;
  }

  .home-subtitle {
    font-size: 14px;
  }

  .home-features span {
    font-size: 11px;
    padding: 4px 10px;
  }

  .home-play-btn {
    max-width: 100%;
    padding: 16px 20px;
    font-size: 19px;
  }

  /* Modals Mobile */
  .modal-backdrop {
    padding: 10px;
  }

  .modal-body {
    padding: 14px;
    gap: 12px;
  }

  .operator-grid,
  .operator-grid-3 {
    grid-template-columns: 1fr;
  }

  .autoplay-rule-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .autoplay-rule-row .cashout-input-wrap {
    justify-content: flex-end;
  }
}
