/**
 * style.css — App shell layout, header, sidebar, stage frame, bet panels, modals.
 * Branding overlay styles live in branding.css.
 */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

:root {
  --bg: #101010;
  --panel: #1b1c1d;
  --panel2: #232426;
  --border: #2d2e30;
  --red: #e50539;
  --red-dim: rgba(229, 5, 57, 0.15);
  --green: #28a909;
  --green-dim: rgba(40, 169, 9, 0.15);
  --orange: #f0a020;
  --orange-dim: rgba(240, 160, 32, 0.22);
  --text: #ffffff;
  --muted: #8b8d91;
  --radius: 10px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-h: 52px;
  --bet-btn-w: 128px;
  --live-row-h: 30px;
  --live-feed-visible-rows: 5;
}

html { -webkit-text-size-adjust: 100%; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9375rem;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

body.modal-open,
body.sidebar-open { overflow: hidden; }

.app {
  height: calc(100vh - var(--safe-top) - var(--safe-bottom));
  height: calc(100dvh - var(--safe-top) - var(--safe-bottom));
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0 auto;
  min-height: 0;
}

.mobile-only { display: none !important; }

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: var(--header-h);
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.top-wallet-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-wallet-btn {
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 34px;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.top-wallet-btn.deposit {
  background: var(--green);
  color: #fff;
}

.top-wallet-btn.deposit:hover {
  filter: brightness(1.08);
}

.top-wallet-btn.withdraw {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--border);
}

.top-wallet-btn.withdraw:hover {
  border-color: var(--muted);
}

/* App menu */
.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.menu-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.app-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 92vw);
  max-width: 100%;
  background: #0c0c0c;
  border-right: 1px solid var(--border);
  z-index: 210;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

.app-menu.open {
  transform: translateX(0);
}

.app-menu-profile {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px 12px;
  padding: 18px 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  background: #101010;
}

.menu-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
  background: hsl(200, 42%, 38%);
  border: 2px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.75);
  overflow: hidden;
  position: relative;
}

.menu-avatar-img,
.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.menu-avatar-img[hidden],
.profile-avatar-img[hidden] {
  display: none;
}

.menu-avatar-fallback,
.profile-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-avatar-fallback[hidden],
.profile-avatar-fallback[hidden] {
  display: none;
}

.menu-profile-name {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  min-width: 0;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.menu-profile-name:hover .menu-profile-id {
  color: #fff;
}

.profile-modal-hint {
  font-size: 0.72rem;
  color: var(--muted);
  margin: -4px 0 12px;
  line-height: 1.4;
}

.profile-modal-error {
  font-size: 0.75rem;
  color: #ff6b6b;
  margin-bottom: 12px;
  line-height: 1.4;
}

.profile-modal input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.profile-avatar-section {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.profile-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex-shrink: 0;
  background: hsl(200, 42%, 38%);
  border: 2px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.75);
  overflow: hidden;
}

.profile-avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.profile-photo-btn {
  cursor: pointer;
  font-size: 0.75rem;
  padding: 8px 12px;
}

.profile-remove-photo {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.profile-remove-photo:hover {
  color: var(--text);
}

.profile-remove-photo[hidden] {
  display: none;
}

.menu-profile-id {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  min-width: 0;
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-change-avatar {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #3a3b3e;
  border-radius: 22px;
  padding: 7px 10px;
  background: transparent;
  color: #9a9c9f;
  font-size: 0.58rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.menu-change-avatar-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}

.menu-change-avatar:hover {
  color: var(--text);
  border-color: var(--muted);
}

.app-menu-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-toggle-list {
  display: flex;
  flex-direction: column;
  padding: 0 14px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.menu-play-mode .menu-toggle-label {
  transition: color 0.15s ease;
}

.menu-play-mode.is-fun-active .menu-toggle-label {
  color: #f5b820;
}

.menu-toggle-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.menu-toggle-label {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.menu-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  color: #8b8d91;
  flex-shrink: 0;
}

.menu-switch .switch-slider {
  background: #2a2b2e;
}

.menu-switch input:checked + .switch-slider {
  background: #5a5c60;
}

.menu-switch .switch-slider::before {
  background: #1a1a1c;
}

.menu-switch input:checked + .switch-slider::before {
  background: #d8d9db;
}

.menu-nav-list {
  list-style: none;
  padding: 4px 0 0;
  margin: 0;
}

.menu-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 13px 18px;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease;
}

.menu-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.menu-nav-logout {
  color: var(--muted);
}

.menu-nav-logout:hover {
  color: var(--text);
}

.info-modal {
  padding: 0;
  max-width: 400px;
  overflow: hidden;
  min-height: 0;
}

.info-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.info-modal-head h2 {
  font-size: 0.95rem;
  font-weight: 700;
}

.info-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px 18px 20px;
  font-size: 0.78rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
  scrollbar-width: thin;
  scrollbar-color: #3a3b3e transparent;
}

.info-modal-body::-webkit-scrollbar {
  width: 5px;
}

.info-modal-body::-webkit-scrollbar-thumb {
  background: #3a3b3e;
  border-radius: 4px;
}

.info-modal-body .bet-history-modal .list-head {
  margin-bottom: 8px;
}

.info-modal-body .bet-user-head {
  margin-bottom: 12px;
  padding: 0;
  border-bottom: none;
}

.info-modal-body .bet-history-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 50vh;
  overflow-y: auto;
}

.info-modal-body .bet-history-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 6px;
  padding: 8px 4px;
  font-size: 0.75rem;
  border-radius: 6px;
}

.info-modal-body .bet-history-row.win {
  background: rgba(40, 169, 9, 0.08);
}

.info-modal-body .bet-history-row.loss {
  background: rgba(255, 255, 255, 0.03);
}

.info-modal-body p:last-child {
  margin-bottom: 0;
}

.info-modal-body ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.info-modal-body li {
  margin-bottom: 6px;
}

.app-menu-title {
  font-size: 1rem;
  font-weight: 700;
}

.app-menu-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-menu-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-menu-mode {
  width: 100%;
}

.app-menu-mode .mode-btn {
  flex: 1;
  min-height: 38px;
}

.app-menu-hint {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}

.app-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.app-menu-toggle-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
}

.app-menu-toggle-sub {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 2px;
}

.app-menu-account {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--panel2);
  border-radius: 8px;
}

.app-menu-account-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.app-menu-account-email {
  font-size: 0.72rem;
  color: var(--muted);
}

.app-menu-logout {
  margin-top: 4px;
}

.app-menu-actions {
  gap: 8px;
}

.app-menu-action {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.app-menu-action:hover {
  border-color: var(--muted);
  background: #2a2b2e;
}

.app-menu-action-icon {
  display: flex;
  color: var(--muted);
  flex-shrink: 0;
}

.app-menu-action-text {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
}

.app-menu-action-arrow {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
}

body.menu-open {
  overflow: hidden;
}

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

.logo-text {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--red);
}

.mode-switch {
  display: flex;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.mode-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.15s, color 0.15s;
  min-height: 34px;
}

.mode-btn.active {
  background: var(--red);
  color: white;
}

.mode-btn[data-mode="real"].active {
  background: var(--green);
}

/* top-bar-right moved above */

.icon-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel2);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn:hover { color: var(--text); border-color: var(--muted); }
.icon-btn.muted { opacity: 0.45; }

.balance-chip {
  display: flex;
  align-items: baseline;
  gap: 4px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
}

.balance-amount {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.balance-currency {
  font-size: 0.7rem;
  color: var(--muted);
}

.balance-chip.mode-demo .balance-amount,
.balance-chip.mode-demo .balance-currency {
  color: var(--green);
}

.balance-chip.mode-demo .balance-currency {
  color: #6ee74f;
}

.mode-tag {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 4px 7px;
  border-radius: 4px;
  letter-spacing: 0.06em;
}

.mode-tag.demo { background: var(--red-dim); color: var(--red); }
.mode-tag.real { background: var(--green-dim); color: var(--green); }

.real-banner {
  background: rgba(40, 169, 9, 0.1);
  border-bottom: 1px solid rgba(40, 169, 9, 0.25);
  color: var(--green);
  font-size: 0.72rem;
  padding: 6px 12px;
  text-align: center;
  flex-shrink: 0;
}

/* Game shell */
.game-shell {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(220px, 280px);
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.game-shell.chat-collapsed {
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
}

.left-rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  height: 100%;
  background: #141416;
  border-right: 1px solid var(--border);
}

.left-rail .sidebar {
  flex: 1 1 auto;
  min-height: 0;
  border-right: none;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.25s;
}

.sidebar-backdrop.open {
  display: block;
  opacity: 1;
}

/* Sidebar */
.sidebar {
  background: #141416;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  z-index: 1;
}

.sidebar-head-mobile {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.85rem;
  background: #121213;
}

.sidebar-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 8px 6px;
  flex-shrink: 0;
  background: #121213;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-tab {
  flex: 1;
  padding: 8px 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 20px;
  min-height: 32px;
  transition: background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

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

.sidebar-tab.active {
  color: var(--text);
  background: #2b2c2f;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.sidebar-panel {
  display: none;
  flex: 1;
  overflow: hidden;
  flex-direction: column;
  min-height: 0;
}

.sidebar-panel.active { display: flex; }

.sidebar-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #141416;
}

.sidebar-foot {
  flex-shrink: 0;
  padding: 8px 10px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #121213;
}

.sidebar-foot-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease, background 0.15s ease;
}

.sidebar-foot-logout:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-foot-logout svg {
  flex-shrink: 0;
  opacity: 0.85;
}

/* Chat — Betika-style panel */
.right-rail {
  display: none;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  height: 100%;
  background: #141416;
  border-left: 1px solid var(--border);
}

.right-rail.chat-off {
  display: none;
}

.game-shell.chat-collapsed .right-rail {
  display: none;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  background: #141416;
}

.mobile-chat.chat-panel {
  flex-shrink: 0;
  height: auto;
  min-height: 0;
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.chat-modal-panel.mobile-chat.chat-panel {
  flex-shrink: 1;
  height: 100%;
  min-height: 0;
  border-top: none;
}

.chat-off.mobile-chat {
  display: none;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 8px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: #121213;
}

.chat-info-btn,
.chat-close-btn,
.chat-emoji-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
}

.chat-info-btn:hover,
.chat-close-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.chat-emoji-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.chat-online-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.chat-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(40, 169, 9, 0.55);
}

.chat-online {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--green);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chat-messages-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.mobile-chat .chat-messages-wrap {
  min-height: 72px;
  max-height: 120px;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 10px;
  scrollbar-width: thin;
  scrollbar-color: #3a3b3e transparent;
}

.chat-new-messages-btn {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: none;
  border-radius: 999px;
  background: #58d671;
  color: #0a0a0a;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  -webkit-tap-highlight-color: transparent;
  transition: filter 0.15s ease;
}

.chat-new-messages-btn[hidden] {
  display: none;
}

.chat-new-messages-btn:hover {
  filter: brightness(1.06);
}

.chat-new-messages-btn:active {
  filter: brightness(0.95);
}

.chat-new-messages-btn svg {
  flex-shrink: 0;
  opacity: 0.9;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #3a3b3e;
  border-radius: 4px;
}

.chat-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 10px;
}

.chat-msg-row:last-child {
  margin-bottom: 0;
}

.chat-msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: #2b2c2f;
}

.chat-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-msg-body {
  flex: 1;
  min-width: 0;
}

.chat-msg-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  font-size: 0.68rem;
  line-height: 1.2;
}

.chat-msg-user {
  color: #e8eaed;
  font-weight: 600;
}

.chat-tag-user {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.chat-tag-user:hover {
  color: #7eb8ff;
  text-decoration: underline;
}

.chat-win-name.chat-tag-user {
  font-size: 0.68rem;
  font-weight: 600;
  color: #e8eaed;
}

.chat-msg-time {
  color: #6b6d72;
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
}

.chat-msg-text {
  color: #b8bac0;
  font-size: 0.72rem;
  line-height: 1.35;
  word-break: break-word;
}

.chat-like-btn {
  border: none;
  background: transparent;
  color: #6b6d72;
  padding: 2px 4px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 22px;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s, transform 0.1s;
}

.chat-like-btn:hover {
  color: #e91e63;
}

.chat-like-btn.is-liked {
  color: #e91e63;
}

.chat-like-btn:active {
  transform: scale(0.92);
}

.chat-like-count {
  font-size: 0.58rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #8b8d91;
}

.chat-like-btn.is-liked .chat-like-count {
  color: #e91e63;
}

.chat-msg.system {
  text-align: center;
  color: var(--muted);
  font-size: 0.62rem;
  padding: 4px 0 6px;
  margin-bottom: 8px;
}

.chat-win-row .chat-msg-body {
  flex: 1;
  min-width: 0;
}

.chat-win-card {
  border: 1px solid rgba(156, 39, 176, 0.45);
  background: rgba(80, 30, 90, 0.35);
  border-radius: 8px;
  padding: 8px 10px;
  position: relative;
}

.chat-win-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.chat-win-user {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.chat-win-user .chat-msg-avatar {
  width: 22px;
  height: 22px;
}

.chat-win-name {
  font-size: 0.68rem;
  font-weight: 600;
  color: #e8eaed;
}

.chat-win-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-win-line {
  font-size: 0.68rem;
  color: #b0b3b8;
  margin-bottom: 2px;
}

.chat-win-line strong {
  font-weight: 700;
}

.chat-win-mult {
  color: #e91e63;
}

.chat-win-amount {
  color: var(--green);
}

.chat-win-meta {
  font-size: 0.62rem;
  color: #8b8d91;
  margin-top: 4px;
  line-height: 1.35;
}

.chat-panel.chat-locked .chat-form {
  opacity: 0.85;
}

.chat-panel.chat-balance-locked .chat-input:disabled {
  cursor: not-allowed;
}

.chat-panel.chat-locked .chat-send:disabled,
.chat-panel.chat-locked .chat-input:disabled {
  opacity: 0.55;
}

.chat-send:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 8px 10px 10px;
  align-items: flex-end;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #121213;
}

.chat-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #2d2e30;
  background: #1a1b1d;
  border-radius: 8px;
  padding: 4px 8px 4px 4px;
}

.chat-input-wrap:focus-within {
  border-color: rgba(40, 169, 9, 0.45);
}

.chat-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 6px 4px;
  font-size: 0.72rem;
  color: var(--text);
  outline: none;
}

.chat-input::placeholder {
  color: #6b6d72;
}

.chat-char-count {
  font-size: 0.62rem;
  color: #6b6d72;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 24px;
  text-align: right;
}

.chat-send {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #d0d2d6;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.15s, background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.chat-send:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.chat-send:active {
  transform: scale(0.96);
}

.chat-rules-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.chat-rules-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #c8cacd;
  margin-bottom: 10px;
}

.chat-rules-list li::before {
  content: '›';
  color: var(--red);
  font-weight: 700;
  flex-shrink: 0;
}

.affiliate-modal {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.affiliate-lead {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #c8cacd;
}

.affiliate-highlight {
  color: var(--green);
  font-weight: 800;
}

.affiliate-rate-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 12px;
  border-radius: 10px;
  background: rgba(40, 169, 9, 0.1);
  border: 1px solid rgba(40, 169, 9, 0.35);
}

.affiliate-rate-value {
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1;
  color: var(--green);
}

.affiliate-rate-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
}

.affiliate-subhead {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 4px 0 0;
}

.affiliate-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.affiliate-steps li {
  font-size: 0.78rem;
  line-height: 1.4;
  color: #b8bac0;
  padding-left: 14px;
  position: relative;
}

.affiliate-steps li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--green);
}

.affiliate-link-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.affiliate-link-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #1a1b1d;
  color: var(--text);
  font-size: 0.72rem;
  font-family: inherit;
}

.affiliate-copy-btn {
  flex-shrink: 0;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: var(--green);
  color: #0a0a0a;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.affiliate-copy-btn:hover {
  filter: brightness(1.06);
}

.affiliate-note {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}

.partner-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.partner-summary-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #1a1b1d;
  border: 1px solid var(--border);
}

.partner-summary-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.partner-summary-value {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.partner-summary-green {
  color: var(--green);
}

.partner-table-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.partner-table-wrap-paged {
  overflow: visible;
}

.partner-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.partner-page-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 52px;
  text-align: center;
}

.partner-page-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #1a1b1d;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.partner-page-btn:hover:not(:disabled) {
  background: #242528;
  border-color: #3a3b3e;
}

.partner-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.partner-table-wrap::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.partner-table-wrap::-webkit-scrollbar-thumb {
  background: #3a3b3e;
  border-radius: 4px;
}

.partner-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.68rem;
}

.partner-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #1c1c1e;
}

.partner-table th {
  padding: 8px 10px;
  text-align: left;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.partner-table td {
  padding: 8px 10px;
  color: #c8cacd;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.partner-table tbody tr:last-child td {
  border-bottom: none;
}

.partner-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.partner-amount {
  color: var(--green);
  font-weight: 700;
}

.partner-ref {
  font-size: 0.62rem;
  color: var(--muted);
  font-family: ui-monospace, monospace;
}

.partner-ref-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.partner-ref-text {
  font-size: 0.62rem;
  color: var(--muted);
  font-family: ui-monospace, monospace;
  white-space: nowrap;
}

.partner-ref-copy {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease, background 0.15s ease;
}

.partner-ref-copy:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.partner-ref-copy:active {
  transform: scale(0.94);
}

.partner-status {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: capitalize;
}

.partner-status.is-good {
  color: var(--green);
}

.partner-status.is-pending {
  color: #f5b820;
}

.partner-status.is-muted {
  color: var(--muted);
}

.partner-empty {
  font-size: 0.72rem;
  color: var(--muted);
  padding: 10px 0;
  margin: 0;
  line-height: 1.4;
}

.wallet-modal {
  padding: 20px;
  max-width: 360px;
}

.wallet-modal h2 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.wallet-modal-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.45;
}

.wallet-field {
  margin-bottom: 16px;
}

.wallet-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.wallet-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel2);
  color: var(--text);
  font-size: 0.88rem;
  min-height: 44px;
}

.wallet-field input:focus {
  outline: none;
  border-color: rgba(229, 5, 57, 0.55);
}

.wallet-actions {
  display: flex;
  gap: 8px;
}

.wallet-actions .btn-primary,
.wallet-actions .btn-secondary {
  flex: 1;
  width: auto;
}

/* Top wins panel */
.top-filters {
  flex-shrink: 0;
  padding: 8px 10px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.top-filter-row {
  display: flex;
  gap: 6px;
}

.top-filter-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 7px 4px;
  border-radius: 16px;
  cursor: pointer;
  min-height: 34px;
  -webkit-tap-highlight-color: transparent;
}

.top-filter-btn.active {
  background: #2b2c2f;
  color: var(--text);
}

.top-wins-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.top-wins-list.is-rounds-log {
  padding: 4px 8px 10px;
  gap: 0;
}

.top-rounds-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.top-rounds-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px 6px;
  font-size: 0.62rem;
  color: #8e8e93;
}

.top-rounds-head-x {
  margin-right: 34px;
}

.top-rounds-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.top-round-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1c1c1e;
  border-radius: 22px;
  padding: 8px 8px 8px 12px;
  min-height: 40px;
}

.top-round-date {
  flex: 0 0 auto;
  font-size: 0.62rem;
  color: #8e8e93;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.top-round-mult {
  flex: 1;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #e91e63;
  font-variant-numeric: tabular-nums;
  padding: 0 4px;
  min-width: 0;
}

.top-round-mult-btn {
  flex: 1;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #e91e63;
  font-variant-numeric: tabular-nums;
  padding: 0 4px;
  min-width: 0;
  border: none;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.top-round-mult-btn:hover {
  color: #f48fb1;
}

.top-round-fair {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: #2b2c2f;
  color: #8b8d91;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.top-round-fair:hover {
  color: #fff;
}

.top-empty {
  padding: 16px 8px;
}

.top-win-card {
  background: #1c1c1e;
  border-radius: 12px;
  padding: 8px 10px;
  flex-shrink: 0;
}

.top-win-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.top-win-user {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.top-win-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #3a3a3e;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-win-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.top-win-user-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.top-win-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
}

.top-win-date {
  font-size: 0.66rem;
  color: #8e8e93;
}

.top-win-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.top-win-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: #2b2c2f;
  color: #8b8d91;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.top-win-icon-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.top-win-icon-btn:not(:disabled):hover {
  color: #fff;
}

.top-win-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

.top-win-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.top-win-label {
  font-size: 0.66rem;
  color: #8e8e93;
}

.top-win-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.top-win-value.top-win-bold {
  font-weight: 700;
}

.top-win-value.top-win-pink {
  color: #e91e63;
  font-weight: 700;
}

.sidebar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.02);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.meta-item span {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}

.meta-item strong {
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.list-head,
.sb-row {
  display: grid;
  grid-template-columns: 1.3fr 0.75fr 0.65fr 0.75fr;
  gap: 4px;
  padding: 7px 12px;
  font-size: 0.78rem;
  align-items: center;
}

.list-head.has-player-avatar,
.sb-row.has-player-avatar {
  grid-template-columns: 1.6fr 0.7fr 0.6fr 0.7fr;
}

.sb-player-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.bet-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bet-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bet-user-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.bet-user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-bets-rows {
  padding-top: 4px;
}

.list-head {
  color: var(--muted);
  font-size: 0.68rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.player-list,
.my-bets-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sb-row {
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-variant-numeric: tabular-nums;
}

.sb-row .pname {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-row.win span:last-child,
.sb-row.win span:nth-child(3) { color: var(--green); font-weight: 600; }
.sb-row.loss span:nth-child(3) { color: var(--red); }

.rank { font-weight: 700; color: var(--muted); }

.empty-msg {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

/* Center */
.center-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.history-panel {
  flex-shrink: 0;
  background: #141415;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.history-panel.hidden { display: none !important; }

.history-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  min-height: 36px;
}

.history-panel:not(.is-expanded) .history-bar {
  align-items: center;
}

.history-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 28px;
  order: 1;
}

.history-panel.is-expanded .history-bar {
  padding: 10px 12px;
  background: #1a1a1c;
  align-items: flex-start;
}

.history-panel.is-expanded .history-body {
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
}

.history-panel.is-expanded .history-toggle {
  align-self: flex-start;
  margin-top: 1px;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  width: 100%;
}

.history-head[hidden] {
  display: none !important;
}

.history-title {
  font-size: 0.88rem;
  font-weight: 700;
}

.history-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border: none;
  border-radius: 6px;
  background: #2b2c2f;
  color: #8b8d91;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.history-close:hover {
  color: #fff;
  background: #333436;
}

.history-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  flex-wrap: nowrap;
}

.history-panel:not(.is-expanded) .history-strip {
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 20px), transparent 100%);
  mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 20px), transparent 100%);
}

.history-panel.is-expanded .history-strip {
  flex-wrap: wrap;
  overflow: visible;
  align-items: flex-start;
  padding-top: 2px;
  gap: 6px;
  -webkit-mask-image: none;
  mask-image: none;
}

.history-strip:empty::before,
.history-empty {
  font-size: 0.65rem;
  font-weight: 500;
  color: #5a5c60;
  white-space: nowrap;
}

.history-strip:empty::before {
  content: 'Waiting for round results…';
}

.history-empty {
  margin: 0;
}

.history-toggle {
  flex-shrink: 0;
  order: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #8b8d91;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

.history-toggle-icon {
  display: block;
  flex-shrink: 0;
}

.history-toggle:hover,
.history-panel.is-expanded .history-toggle {
  background: #2b2c2f;
  color: #c4c6c9;
}

.chat-toggle {
  order: 3;
}

.chat-toggle.is-open,
.chat-toggle:hover {
  background: #2b2c2f;
  color: #c4c6c9;
}

.chat-toggle.hidden,
.chat-modal-backdrop.chat-off {
  display: none !important;
}

.chat-modal-backdrop {
  z-index: 350;
  align-items: flex-end;
  padding: 0;
  padding-bottom: var(--safe-bottom);
}

.chat-modal-panel {
  width: 100%;
  max-width: 100%;
  height: min(88vh, calc(100dvh - var(--header-h) - 8px));
  max-height: 88vh;
  border-radius: 12px 12px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  overflow: hidden;
  background: var(--panel);
}

.chat-modal-panel .chat-messages-wrap {
  min-height: 0;
  max-height: none;
  flex: 1;
}

.chat-modal-panel.chat-off {
  display: none !important;
}

.hist-pill {
  border: none;
  padding: 5px 9px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  cursor: pointer;
  line-height: 1.15;
  background: #2b2c2f;
  transition: transform 0.12s ease, background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.hist-pill:hover {
  background: #35363a;
  transform: scale(1.04);
}

.hist-pill-latest {
  animation: hist-pill-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes hist-pill-in {
  from {
    opacity: 0;
    transform: translateX(-10px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.hist-pill.c-blue { color: #6eb5e8; }
.hist-pill.c-green { color: #28a909; }
.hist-pill.c-gold { color: #f0a020; }

.no-animations .hist-pill { animation: none; }
.no-animations .mult-display { animation: none !important; }
.no-animations .mult-display.mult-bump { animation: none !important; }
.no-animations .crash-mult { animation: none !important; }
.no-animations .flew-away { animation: none !important; }

/* Stage */
.stage-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 8px 10px 8px;
  gap: 8px;
  overflow: hidden;
}

.stage {
  position: relative;
  flex: 1 1 0;
  min-height: min(200px, 38vh);
  min-width: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0a0a0c;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.stage-playfield {
  position: relative;
  flex: 1 1 0;
  min-height: min(160px, 32vh);
  min-width: 0;
}

.fun-mode-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 22px;
  padding: 3px 10px;
  background: linear-gradient(180deg, #fcd34d 0%, #f5b820 42%, #e8a318 100%);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  border-bottom: 1px solid rgba(180, 120, 20, 0.35);
  line-height: 1;
}

.fun-mode-header.hidden {
  display: none;
}

@media (min-width: 900px) {
  .fun-mode-header {
    min-height: 24px;
    font-size: 0.74rem;
  }
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  z-index: 1;
}

.game-plane {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 4;
  will-change: transform, opacity;
  transition: opacity 0.35s ease;
  transform-origin: 0 0;
}

.plane-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.game-plane.crashed {
  opacity: 0 !important;
}

.plane-fallback {
  font-size: 2rem;
  color: #e50539;
}

.no-animations .plane-art {
  animation: none !important;
}

.stage-ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}

.stage-ui.hidden { display: none !important; }

/* Flying + crash multiplier */
.mult-display,
.crash-mult {
  font-size: clamp(2.5rem, 11vw, 5rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.phase-flying .mult-display {
  color: var(--green);
  text-shadow: 0 0 50px rgba(40, 169, 9, 0.45);
  animation: mult-pulse 2.2s ease-in-out infinite;
  will-change: transform;
}

@keyframes mult-pulse {
  0%, 100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.018);
    filter: brightness(1.06);
  }
}

.phase-flying .mult-display.mult-bump {
  animation: mult-bump 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes mult-bump {
  0% { transform: scale(1); }
  45% { transform: scale(1.045); }
  100% { transform: scale(1); }
}

.mult-x { font-size: 0.55em; font-weight: 900; }

.phase-crashed .crash-mult {
  color: var(--red);
  text-shadow: 0 0 40px rgba(229, 5, 57, 0.45);
  animation: crash-mult-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes crash-mult-in {
  from { opacity: 0; transform: scale(0.88); }
  to { opacity: 1; transform: scale(1); }
}

.flew-away {
  margin-top: 6px;
  font-size: clamp(0.85rem, 3.5vw, 1.5rem);
  font-weight: 800;
  letter-spacing: 0.18em;
  animation: flew-in 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes flew-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.fair-strip {
  position: absolute;
  bottom: 5px;
  left: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  gap: 5px;
  font-size: 0.58rem;
  color: var(--muted);
}

.fair-strip code {
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* Bet cards */
.bet-slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
  width: 100%;
  padding: 0 6px;
  box-sizing: border-box;
  align-items: stretch;
}

.bet-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(76px, 0.88fr);
  grid-template-rows: auto auto;
  gap: 8px 10px;
  align-items: stretch;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  --bet-controls-w: 150px;
}

.bet-card:has(.auto-switches-row:not(.hidden)) {
  grid-template-columns: minmax(0, 1.12fr) minmax(76px, 0.88fr);
  grid-template-rows: auto auto auto;
  gap: 8px 10px;
  padding-bottom: 8px;
}

.bet-card-tabs {
  display: flex;
  gap: 4px;
  grid-column: 1 / -1;
  grid-row: 1;
  justify-content: center;
  align-items: center;
  width: min(240px, 72%);
  max-width: calc(100% - 16px);
  margin-inline: auto;
  background: var(--panel2);
  border-radius: 999px;
  padding: 3px 4px;
  box-sizing: border-box;
}

.bet-card-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 3px 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 24px;
  line-height: 1.1;
  transition: background 0.15s, color 0.15s;
}

.bet-card-tab.active {
  background: #3a3b3e;
  color: var(--text);
}

.bet-card .panel-tab-bet,
.bet-card .panel-tab-auto {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  align-self: start;
}

.bet-card .panel-tab-auto {
  gap: 3px;
}

.bet-card .panel-tab-auto .panel-controls {
  gap: 3px;
}

.bet-card .panel-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  width: 100%;
  padding: 0;
  box-sizing: border-box;
  container-type: inline-size;
  container-name: bet-controls;
}

.bet-card .amount-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 5px;
  width: 100%;
}

.bet-card .amount-chip-row {
  display: contents;
}

@container bet-controls (min-width: 280px) {
  .bet-card .amount-chips {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Small amount + quick chips (left side) */
.bet-card .amt-chip {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  padding: 0 3px;
  border: 1px solid #3a3b3e;
  border-radius: 5px;
  background: linear-gradient(180deg, #2c2d30 0%, #1f2022 100%);
  color: #b0b3b8;
  font-size: 0.64rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  cursor: pointer;
  min-height: 22px;
  min-width: 32px;
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.bet-card .amt-chip:hover {
  border-color: rgba(40, 169, 9, 0.55);
  color: var(--text);
}

.bet-card .amt-chip:active {
  transform: scale(0.97);
}

.bet-card .amt-chip.active {
  border-color: var(--green);
  color: #6ee74f;
  background: linear-gradient(180deg, rgba(40, 169, 9, 0.28) 0%, rgba(40, 169, 9, 0.1) 100%);
  box-shadow: 0 0 0 1px rgba(40, 169, 9, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.bet-card .amount-input-box {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 4px 7px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: #161718;
  border: 1px solid #3a3b3e;
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.bet-card .step-btn {
  width: 26px;
  min-width: 26px;
  height: 26px;
  border: 1px solid #454548;
  border-radius: 5px;
  background: linear-gradient(180deg, #2e2f32 0%, #252628 100%);
  color: #d8d9dc;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.bet-card .step-btn:hover {
  border-color: rgba(40, 169, 9, 0.5);
  color: #fff;
  background: linear-gradient(180deg, #353638 0%, #2a2b2d 100%);
}

.bet-card .step-btn:active {
  transform: scale(0.96);
}

.bet-card .bet-amount-input,
.bet-card .auto-amount-input,
.bet-card .amount-field {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  padding: 4px 10px;
  border: 1px solid #2d2e30;
  border-radius: 5px;
  background: #0e0e10;
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
  min-height: 28px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.bet-card .bet-amount-input:focus,
.bet-card .auto-amount-input:focus,
.bet-card .amount-field:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(40, 169, 9, 0.25);
}

.bet-card .bet-amount-input::-webkit-outer-spin-button,
.bet-card .bet-amount-input::-webkit-inner-spin-button,
.bet-card .auto-amount-input::-webkit-outer-spin-button,
.bet-card .auto-amount-input::-webkit-inner-spin-button,
.bet-card .amount-field::-webkit-outer-spin-button,
.bet-card .amount-field::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.bet-card .bet-amount-input,
.bet-card .auto-amount-input,
.bet-card .amount-field {
  -moz-appearance: textfield;
  appearance: textfield;
}

.bet-card .auto-switches-row {
  grid-column: 1 / -1;
  grid-row: 3;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  min-width: 0;
  min-height: 0;
  padding: 6px 8px;
  margin: 2px 0 0;
  border-top: 1px solid rgba(45, 46, 48, 0.85);
  border-radius: 6px;
  background: rgba(35, 36, 38, 0.45);
  box-sizing: border-box;
}

.bet-card .auto-switches-row.hidden {
  display: none !important;
}

.bet-card .auto-switch-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: none;
  background: none;
  overflow: visible;
  box-sizing: border-box;
}

.bet-card .auto-switch-item:not(.auto-cashout-item) {
  flex: 0 1 auto;
}

.bet-card .auto-cashout-item {
  flex: 1 1 0;
  min-width: 0;
  justify-content: flex-end;
  gap: 6px;
}

.bet-card .auto-switch-label {
  font-size: 0.58rem;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  flex: 0 0 auto;
  line-height: 1.1;
}

.bet-card .auto-cashout-item .auto-switch-label {
  font-size: 0.56rem;
}

.bet-card .auto-switches-row .switch {
  width: 32px;
  height: 18px;
  flex-shrink: 0;
}

.bet-card .auto-switches-row .switch-slider::before {
  width: 14px;
  height: 14px;
  left: 2px;
  top: 2px;
}

.bet-card .auto-switches-row .switch input:checked + .switch-slider::before {
  transform: translateX(14px);
}

.bet-card .cashout-inline {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  min-width: 0;
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.bet-card .cashout-inline .auto-cashout-input {
  width: 44px;
  min-width: 36px;
  max-width: 52px;
  flex: 1 1 auto;
  min-height: 24px;
  height: 24px;
  padding: 2px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  box-sizing: border-box;
  -moz-appearance: textfield;
  appearance: textfield;
}

.bet-card .cashout-inline .auto-cashout-input::-webkit-outer-spin-button,
.bet-card .cashout-inline .auto-cashout-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.bet-card .cashout-inline .auto-cashout-input:focus {
  outline: none;
}

.bet-card .cashout-inline:focus-within {
  border-color: rgba(40, 169, 9, 0.55);
}

.bet-card .cashout-x {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
  line-height: 1;
}

.bet-card .auto-cashout-item.active .cashout-inline {
  border-color: rgba(40, 169, 9, 0.55);
}

.bet-card .auto-cashout-item.active .cashout-inline .auto-cashout-input {
  color: var(--text);
}

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #3a3b3e;
  border-radius: 20px;
  transition: background 0.2s ease;
}

.switch-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.switch input:checked + .switch-slider {
  background: var(--green);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(14px);
}

.switch input:focus-visible + .switch-slider {
  box-shadow: 0 0 0 2px rgba(40, 169, 9, 0.35);
}

.cashout-inline {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.cashout-inline .auto-cashout-input {
  width: 40px;
  min-width: 40px;
  min-height: 24px;
  height: 24px;
  padding: 2px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel2);
  color: var(--text);
  -moz-appearance: textfield;
  appearance: textfield;
}

.cashout-inline .auto-cashout-input::-webkit-outer-spin-button,
.cashout-inline .auto-cashout-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cashout-inline .auto-cashout-input:focus {
  outline: none;
  border-color: var(--green);
}

.cashout-x {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
}

.auto-field { display: flex; flex-direction: column; gap: 4px; }
.auto-field label { font-size: 0.7rem; color: var(--muted); }

.check-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--muted);
  cursor: pointer;
  min-height: 32px;
}

.check-row input { accent-color: var(--green); width: 16px; height: 16px; }

.btn-action {
  width: 100%;
  padding: 8px 6px;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  min-height: 42px;
  -webkit-tap-highlight-color: transparent;
}

.bet-card .btn-slot-action {
  grid-column: 2;
  grid-row: 2;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 48px;
  padding: 0;
  border-radius: 6px;
  border: none;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.bet-card .bet-btn-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 6px 8px;
  box-sizing: border-box;
}

.bet-card .bet-btn-label {
  font-size: clamp(0.62rem, 2.5vw, 0.78rem);
  line-height: 1.15;
  font-weight: 800;
  text-align: center;
  max-width: 100%;
}

.bet-card .bet-btn-amount {
  font-size: clamp(0.68rem, 2.8vw, 0.9rem);
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: center;
  max-width: 100%;
}

.bet-card .btn-slot-action.mode-bet {
  background: var(--green);
  box-shadow: 0 4px 14px rgba(40, 169, 9, 0.28);
}

.bet-card .btn-slot-action.mode-locked {
  background: var(--red);
  box-shadow: 0 4px 14px rgba(229, 5, 57, 0.28);
  cursor: not-allowed;
}

.bet-card .btn-slot-action.mode-cashed {
  background: linear-gradient(165deg, #2a9e12 0%, var(--green) 50%, #1e7a0e 100%);
  cursor: default;
  box-shadow: 0 4px 16px rgba(40, 169, 9, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.bet-card .btn-slot-action.mode-cashed:disabled {
  opacity: 1;
  cursor: default;
}

.bet-card .btn-slot-action.mode-cashed .bet-btn-label {
  font-size: clamp(0.58rem, 2.2vw, 0.82rem);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bet-card .btn-slot-action.mode-cashed .bet-btn-amount {
  font-size: clamp(0.72rem, 3vw, 1rem);
}

.bet-card .btn-slot-action.mode-cashout {
  background: var(--orange);
  border: 1px solid rgba(0, 0, 0, 0.22);
  box-shadow: 0 4px 14px var(--orange-dim);
}

.bet-card .btn-slot-action.mode-disabled:disabled,
.bet-card .btn-slot-action.mode-bet:disabled,
.bet-card .btn-slot-action.mode-locked:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bet-card .btn-slot-action.mode-locked:disabled,
.bet-card .btn-slot-action.mode-cashed:disabled {
  opacity: 1;
}

/* Mobile live feed — same table as desktop sidebar */
.mobile-live-feed {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: calc(96px + var(--live-row-h) * var(--live-feed-visible-rows) + 34px);
  margin: 0 8px 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}

.mobile-live-head {
  flex-shrink: 0;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--panel2);
}

.mobile-live-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.mobile-live-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
}

.mobile-live-feed .player-list {
  flex: 1 1 auto;
  min-height: calc(var(--live-row-h) * var(--live-feed-visible-rows));
  max-height: calc(var(--live-row-h) * var(--live-feed-visible-rows));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-live-feed .sb-row {
  min-height: var(--live-row-h);
  box-sizing: border-box;
}

/* All Bets card footer */
.all-bets-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  padding: 10px 12px;
  background: #121213;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.all-bets-footer-fair {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.all-bets-footer-fair:hover span,
.all-bets-footer-fair:hover .all-bets-footer-shield {
  color: #a8aaad;
}

.all-bets-footer-shield {
  flex-shrink: 0;
  color: #8b8d91;
}

.all-bets-footer-fair span {
  font-size: 0.62rem;
  font-weight: 500;
  color: #8b8d91;
  white-space: nowrap;
}

.all-bets-footer-powered {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-shrink: 0;
}

.all-bets-footer-muted {
  font-size: 0.58rem;
  font-weight: 400;
  color: #6e7074;
}

.all-bets-footer-spribe {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.all-bets-footer-spribe:hover {
  opacity: 0.85;
}

.mobile-live-feed.players-off .mobile-live-head,
.mobile-live-feed.players-off .mobile-live-body {
  display: none;
}

#panelAll.players-off::after,
.mobile-live-feed.players-off::after {
  display: none;
}

.hidden { display: none !important; }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-top: calc(16px + var(--safe-top));
  padding-bottom: calc(16px + var(--safe-bottom));
}

.modal-backdrop.hidden { display: none !important; }

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.settings-modal { max-width: 480px; }

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

.modal-header h2 { font-size: 1rem; font-weight: 700; }

.modal-body {
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.settings-group {
  margin-bottom: 18px;
}

.settings-group h3 {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-hint {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.4;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.settings-row label {
  font-size: 0.8rem;
  flex-shrink: 0;
}

.settings-row input,
.settings-row select {
  flex: 1;
  max-width: 160px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel2);
  color: var(--text);
  font-size: 0.85rem;
  min-height: 40px;
}

.settings-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  margin-bottom: 10px;
  cursor: pointer;
  min-height: 36px;
}

.settings-check input { accent-color: var(--green); width: 18px; height: 18px; }

.balance-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-primary,
.btn-secondary,
.btn-save-settings {
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
}

.btn-primary,
.btn-save-settings { background: var(--red); color: white; width: 100%; }
.btn-secondary {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--border);
  width: 100%;
}

/* Provably Fair modal */
.provably-fair-modal {
  max-width: 520px;
  background: #0f1812;
  border-color: rgba(72, 168, 88, 0.2);
}

.provably-fair-header {
  background: #1a1a1c;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.provably-fair-header h2 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.provably-fair-close {
  color: var(--muted);
}

.provably-fair-body {
  padding: 20px 18px 24px;
  color: #e8e8e8;
}

.pf-hero {
  text-align: center;
  margin-bottom: 22px;
}

.pf-hero-shield {
  color: #6ab82e;
  margin-bottom: 10px;
}

.pf-hero-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #6ab82e;
  margin-bottom: 12px;
}

.pf-intro {
  font-size: 0.72rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
}

.pf-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #6ab82e;
  text-align: center;
  margin: 20px 0 12px;
  letter-spacing: 0.03em;
}

.pf-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.pf-text {
  font-size: 0.7rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 14px;
}

.pf-diagram {
  margin: 18px 0 22px;
  text-align: center;
}

.pf-diagram-icons {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 8px;
}

.pf-diagram-icon {
  color: rgba(255, 255, 255, 0.75);
}

.pf-diagram-seeds {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.pf-seed-box {
  display: inline-block;
  min-width: 28px;
  padding: 3px 6px;
  background: #1a1a1c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pf-plus {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 2px;
}

.pf-diagram-equals {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 4px 0;
}

.pf-combined-box {
  display: inline-block;
  padding: 5px 12px;
  background: #1a1a1c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.pf-diagram-arrow {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  margin: 4px 0;
}

.pf-hash-box {
  background: #1a1a1c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 0 auto;
  max-width: 100%;
}

.pf-hash-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 4px;
}

.pf-hash-value {
  display: block;
  font-size: 0.58rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.75);
  word-break: break-all;
  font-variant-numeric: tabular-nums;
}

.pf-result-box {
  display: inline-block;
  padding: 6px 16px;
  background: #1a1a1c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 4px;
}

.pf-check-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pf-check-list li {
  font-size: 0.7rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 10px;
  padding-left: 14px;
  position: relative;
}

.pf-check-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: rgba(255, 255, 255, 0.45);
}

/* Round Provably Fair modal */
.round-fair-modal {
  max-width: 480px;
  background: #141416;
  border-color: rgba(255, 255, 255, 0.08);
}

.round-fair-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #1a1a1c;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.round-fair-header-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.round-fair-header-main h2 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
}

.round-fair-mult {
  font-size: 0.95rem;
  font-weight: 800;
  color: #e91e63;
  font-variant-numeric: tabular-nums;
}

.round-fair-header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.round-fair-time {
  font-size: 0.72rem;
  color: #8e8e93;
  font-variant-numeric: tabular-nums;
}

.round-fair-close {
  color: var(--muted);
}

.round-fair-body {
  padding: 16px 16px 20px;
  overflow-y: auto;
  max-height: min(72vh, 520px);
}

.round-fair-section {
  margin-bottom: 14px;
}

.round-fair-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.round-fair-label-sub {
  font-weight: 400;
  color: #8e8e93;
}

.round-fair-seed-box {
  background: #1c1c1e;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.62rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
  word-break: break-all;
  font-variant-numeric: tabular-nums;
}

.round-fair-players {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.round-fair-player-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.round-fair-player-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.round-fair-player-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.round-fair-player-label {
  font-size: 0.62rem;
  color: #8e8e93;
}

.round-fair-player-name {
  font-size: 0.68rem;
  font-weight: 600;
  color: #fff;
}

.round-fair-hash-desc {
  font-size: 0.65rem;
  line-height: 1.5;
  color: #8e8e93;
  margin: 14px 0 8px;
}

.round-fair-hash-box {
  background: #1c1c1e;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.58rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
  word-break: break-all;
  font-variant-numeric: tabular-nums;
  margin-bottom: 14px;
}

.round-fair-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.round-fair-table th {
  font-size: 0.62rem;
  font-weight: 600;
  color: #8e8e93;
  text-align: left;
  padding: 0 8px 8px;
}

.round-fair-table td {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.88);
  padding: 8px;
  background: #1c1c1e;
  font-variant-numeric: tabular-nums;
  vertical-align: top;
}

.round-fair-table tr td:first-child {
  border-radius: 8px 0 0 8px;
}

.round-fair-table tr td:last-child {
  border-radius: 0 8px 8px 0;
}

.round-fair-result {
  font-weight: 700;
  color: #e91e63;
}

.round-fair-info-link {
  display: block;
  width: 100%;
  border: none;
  background: none;
  font-size: 0.68rem;
  color: #8e8e93;
  text-align: center;
  cursor: pointer;
  padding: 4px 0;
  -webkit-tap-highlight-color: transparent;
}

.round-fair-info-link span {
  color: #6ab82e;
  font-weight: 600;
}

.round-fair-info-link:hover span {
  text-decoration: underline;
}

.confirm-modal {
  padding: 20px;
  text-align: center;
}

.confirm-modal h2 { font-size: 1rem; margin-bottom: 8px; }
.confirm-modal p { font-size: 0.85rem; color: var(--muted); margin-bottom: 16px; }

.confirm-actions {
  display: flex;
  gap: 8px;
}

.confirm-actions .btn-primary,
.confirm-actions .btn-secondary { flex: 1; }

/* Toasts */
.toast-container {
  position: fixed;
  top: calc(56px + var(--safe-top));
  right: 12px;
  left: 12px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  align-items: center;
}

.toast {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  max-width: 300px;
}

.toast:not(.toast-win-banner) {
  align-self: flex-end;
}

.toast-win { border-color: rgba(40,169,9,0.4); color: var(--green); }

.toast-win-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(520px, 96vw);
  max-width: none;
  padding: 10px 16px;
  background: linear-gradient(180deg, #1e4a2e 0%, #163322 100%);
  border: 1px solid rgba(40, 169, 9, 0.45);
  border-radius: 8px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5);
  animation: toast-win-in 0.4s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

@keyframes toast-win-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast-win-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.toast-cashout-msg {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
}

.toast-win-mult-inline {
  font-size: 0.95rem;
  font-weight: 900;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.toast-win-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.toast-win-star {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(40, 169, 9, 0.5);
}

.toast-win-prize {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

.toast-win-prize strong {
  font-weight: 800;
  color: #fff;
}

.no-animations .toast-win-banner {
  animation: none !important;
}

.toast-crash, .toast-error { border-color: rgba(229,5,57,0.4); color: var(--red); }
.toast.out { opacity: 0; transform: translateY(-6px); transition: opacity 0.35s ease, transform 0.35s ease; }

/* Players feed disabled */
.players-off .sidebar-meta,
.players-off .list-head,
.players-off .player-list { display: none; }
.players-off::after {
  content: 'Live feed hidden';
  display: block;
  padding: 20px 12px;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

/* Sidebar hidden via settings - removed */

/* ===== RESPONSIVE ===== */

/* Desktop — live feed sidebar always visible */
@media (min-width: 901px) {
  .mobile-only { display: none !important; }

  .top-bar {
    padding: 10px 20px;
  }

  .logo-text { font-size: 1.15rem; }

  .game-shell {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(240px, 280px);
  }

  .game-shell.chat-collapsed {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  }

  .left-rail {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
  }

  .left-rail .sidebar {
    flex: 1 1 auto;
    min-height: 0;
  }

  .right-rail,
  .center-column {
    min-height: 0;
    height: 100%;
  }

  .right-rail:not(.chat-off) {
    display: flex;
  }

  .desktop-chat-rail {
    display: flex;
  }

  .sidebar-backdrop {
    display: none !important;
  }

  .sidebar,
  .center-column {
    min-height: 0;
    height: 100%;
  }

  .sidebar {
    display: flex !important;
    position: relative;
    transform: none !important;
    width: auto;
    box-shadow: none;
    padding-top: 0;
    border-right: none;
  }

  .sidebar-head-mobile {
    display: none !important;
  }

  .center-column {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }

  .history-bar {
    padding: 0 14px;
  }

  .stage-wrap {
    padding: 10px 14px 14px;
    gap: 10px;
    flex: 1 1 0;
    min-height: 0;
  }

  .stage {
    flex: 1 1 0;
    min-height: min(220px, 42vh);
  }

  .bet-slots {
    gap: 10px;
    flex-shrink: 0;
  }

  .bet-card {
    --bet-controls-w: 154px;
  }

  .bet-card .auto-switch-label {
    font-size: 0.6rem;
  }

  .bet-card .auto-cashout-item .auto-switch-label {
    font-size: 0.58rem;
  }

  .bet-card .cashout-inline .auto-cashout-input {
    width: 48px;
    min-width: 40px;
    max-width: 56px;
    min-height: 24px;
    height: 24px;
    font-size: 0.7rem;
  }
}

/* Large desktop */
@media (min-width: 1200px) {
  :root {
    --bet-btn-w: 136px;
  }

  .bet-card {
    --bet-controls-w: 156px;
  }

  .bet-card .auto-switch-label {
    font-size: 0.62rem;
  }

  .bet-card .auto-cashout-item .auto-switch-label {
    font-size: 0.6rem;
  }

  .bet-card .auto-switches-row {
    gap: 8px 12px;
  }

  .game-shell {
    grid-template-columns: minmax(230px, 250px) minmax(0, 1fr) minmax(250px, 290px);
  }

  .game-shell.chat-collapsed {
    grid-template-columns: minmax(230px, 250px) minmax(0, 1fr);
  }

  .stage {
    min-height: min(240px, 44vh);
  }

  .mult-display,
  .crash-mult {
    font-size: clamp(3rem, 7vw, 5.5rem);
  }

  .list-head,
  .sb-row {
    font-size: 0.78rem;
    padding: 8px 14px;
  }
}

/* Ultra-wide */
@media (min-width: 1600px) {
  .app {
    max-width: 1680px;
    margin: 0 auto;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }

  .stage {
    min-height: min(220px, 36vh);
  }

  .game-shell {
    grid-template-columns: minmax(220px, 240px) minmax(0, 1fr) minmax(220px, 260px);
  }

  .game-shell.chat-collapsed {
    grid-template-columns: minmax(220px, 240px) minmax(0, 1fr);
  }
}

/* Narrow bet controls: keep quick amounts in 2×2 pairs */
@media (max-width: 1024px) {
  .bet-card .amount-chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 6px;
  }

  .bet-card .amount-chip-row {
    display: contents;
  }

  .bet-card .amt-chip {
    min-height: 24px;
    font-size: 0.66rem;
    padding: 0 4px;
  }
}

/* Tablet */
@media (max-width: 1024px) and (min-width: 901px) {
  :root {
    --bet-btn-w: 132px;
  }

  .game-shell { grid-template-columns: minmax(200px, 220px) minmax(0, 1fr) minmax(200px, 240px); }

  .game-shell.chat-collapsed {
    grid-template-columns: minmax(200px, 220px) minmax(0, 1fr);
  }

  .stage {
    min-height: min(170px, 28vh);
  }
}

/* Short desktop / embedded preview windows */
@media (min-width: 901px) and (max-height: 780px) {
  .stage {
    min-height: min(160px, 28vh);
  }

  .bet-card {
    padding: 8px 12px 10px;
    gap: 8px 12px;
  }

  .bet-card .btn-slot-action {
    padding: 6px 8px;
  }

  .bet-card .bet-btn-label {
    font-size: 0.68rem;
  }

  .bet-card .bet-btn-amount {
    font-size: 0.8rem;
  }

  .bet-card .auto-switch-label {
    font-size: 0.54rem;
  }

  .bet-card .auto-cashout-item .auto-switch-label {
    font-size: 0.52rem;
  }

  .bet-card .auto-switches-row .switch {
    width: 28px;
    height: 16px;
  }

  .bet-card .auto-switches-row .switch-slider::before {
    width: 12px;
    height: 12px;
  }

  .bet-card .auto-switches-row .switch input:checked + .switch-slider::before {
    transform: translateX(12px);
  }

  .bet-card .cashout-inline .auto-cashout-input {
    width: 40px;
    min-width: 32px;
    max-width: 44px;
    min-height: 22px;
    height: 22px;
    font-size: 0.64rem;
  }

  .bet-card-tab {
    min-height: 24px;
    padding: 3px 8px;
    font-size: 0.76rem;
  }

  .bet-card .amt-chip {
    min-height: 20px;
    font-size: 0.6rem;
  }

  .bet-card .step-btn,
  .bet-card .bet-amount-input,
  .bet-card .auto-amount-input,
  .bet-card .amount-field,
  .bet-card .auto-cashout-input {
    min-height: 26px;
  }
}

/* Mobile landscape + small tablet */
@media (max-width: 900px) {
  .mobile-only { display: flex !important; }

  :root {
    --header-h: 48px;
    --bet-btn-w: 96px;
    --radius: 8px;
  }

  .top-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    min-height: var(--header-h);
  }

  .top-bar-left {
    flex: 0 1 auto;
    min-width: 0;
  }

  .top-bar-right {
    gap: 6px;
    flex-shrink: 0;
  }

  .top-wallet-btn {
    padding: 6px 8px;
    font-size: 0.65rem;
    min-height: 32px;
  }

  .top-wallet-actions {
    gap: 4px;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }

  .balance-chip {
    padding: 4px 8px;
    max-width: 110px;
  }

  .balance-amount {
    font-size: 0.78rem;
  }

  .balance-currency {
    font-size: 0.58rem;
  }

  .logo-text {
    font-size: 0.95rem;
  }

  .logo-svg {
    width: 22px;
    height: 22px;
  }

  .real-banner {
    font-size: 0.65rem;
    padding: 4px 10px;
  }

  .game-shell {
    grid-template-columns: 1fr;
    min-height: 0;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .left-rail {
    display: contents;
  }

  .right-rail,
  .desktop-chat-rail {
    display: none !important;
  }

  .center-column {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    padding-bottom: 8px;
  }

  .stage-wrap {
    padding: 6px 8px 4px;
    gap: 6px;
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
    max-height: none;
  }

  .fun-mode-header {
    min-height: 20px;
    padding: 2px 8px;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
  }

  .stage {
    flex: 0 0 auto;
    height: clamp(110px, 28vh, 200px);
    min-height: 100px;
    max-height: none;
  }

  .stage-playfield {
    min-height: 72px;
  }

  .history-bar {
    padding: 0 8px;
    min-height: 32px;
  }

  .history-toggle,
  .chat-toggle {
    width: 26px;
    height: 26px;
  }

  .history-head {
    padding-bottom: 6px;
    margin-bottom: 4px;
  }

  .history-title {
    font-size: 0.82rem;
  }

  .history-strip {
    gap: 5px;
    padding: 5px 0;
  }

  .hist-pill {
    padding: 4px 8px;
    font-size: 0.68rem;
    border-radius: 5px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 88vw);
    z-index: 300;
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    padding-top: var(--safe-top);
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }

  .sidebar.open { transform: translateX(0); }
  .sidebar-head-mobile { display: flex; }

  .mult-display,
  .crash-mult {
    font-size: clamp(2rem, 9vw, 3.25rem);
  }

  .flew-away {
    font-size: clamp(0.72rem, 3vw, 0.95rem);
    letter-spacing: 0.12em;
  }

  .fair-strip {
    font-size: 0.52rem;
    bottom: 4px;
  }

  .mobile-live-feed {
    flex-shrink: 0;
    min-height: calc(96px + var(--live-row-h) * var(--live-feed-visible-rows) + 34px);
  }

  .mobile-live-feed .player-list {
    min-height: calc(var(--live-row-h) * var(--live-feed-visible-rows));
    max-height: calc(var(--live-row-h) * var(--live-feed-visible-rows));
  }

  .bet-slots {
    grid-template-columns: 1fr;
    gap: 8px;
    flex-shrink: 0;
    padding: 0 6px;
  }

  .bet-card {
    padding: 8px 12px 10px;
    gap: 8px 12px;
    --bet-controls-w: 144px;
  }

  .bet-card:has(.auto-switches-row:not(.hidden)) {
    padding-bottom: 8px;
  }

  .bet-card-tabs {
    width: min(250px, 84%);
  }

  .bet-card-tab {
    min-height: 24px;
    padding: 3px 8px;
    font-size: 0.76rem;
  }

  .bet-card .amt-chip {
    min-height: 20px;
    font-size: 0.6rem;
  }

  .bet-card .step-btn {
    width: 24px;
    min-width: 24px;
    height: 24px;
    font-size: 0.78rem;
  }

  .bet-card .bet-amount-input,
  .bet-card .auto-amount-input,
  .bet-card .amount-field {
    min-height: 26px;
    font-size: 0.8rem;
  }

  .bet-card .auto-switch-label {
    font-size: 0.5rem;
  }

  .bet-card .auto-cashout-item .auto-switch-label {
    font-size: 0.48rem;
  }

  .bet-card .auto-switches-row {
    flex-wrap: nowrap;
    gap: 4px 6px;
    padding: 5px 6px;
  }

  .bet-card .auto-switch-item {
    gap: 4px;
  }

  .bet-card .auto-cashout-item {
    flex: 1 1 0;
    min-width: 0;
    justify-content: flex-end;
    gap: 4px;
  }

  .bet-card .cashout-inline .auto-cashout-input {
    width: 36px;
    min-width: 30px;
    max-width: 40px;
    min-height: 20px;
    height: 20px;
    font-size: 0.58rem;
  }

  .bet-card .btn-slot-action {
    padding: 6px 10px;
  }

  .bet-card .bet-btn-label {
    font-size: 0.68rem;
  }

  .bet-card .bet-btn-amount {
    font-size: 0.8rem;
  }
}

/* Phone */
@media (max-width: 600px) {
  :root {
    --bet-btn-w: 92px;
    --live-feed-visible-rows: 4;
  }

  .mode-tag { display: none; }

  .stage {
    max-height: none;
    min-height: 120px;
    height: clamp(120px, 32vh, 240px);
  }

  .modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: var(--radius) var(--radius) 0 0;
    align-self: flex-end;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
    padding-bottom: var(--safe-bottom);
  }

  .settings-row {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-row input,
  .settings-row select { max-width: 100%; }

  .toast-win-banner {
    width: min(480px, 96vw);
    padding: 8px 12px;
    gap: 8px;
  }

  .toast-cashout-msg {
    font-size: 0.72rem;
  }

  .toast-win-mult-inline {
    font-size: 0.85rem;
  }

  .toast-win-star {
    width: 30px;
    height: 30px;
  }

  .toast-win-prize {
    font-size: 0.72rem;
  }
}

/* Narrow phones */
@media (max-width: 480px) {
  :root {
    --bet-btn-w: 84px;
  }

  .bet-slots {
    gap: 5px;
    padding: 0 6px;
  }

  .bet-card {
    padding: 8px 12px 10px;
    gap: 8px 12px;
    --bet-controls-w: 140px;
  }

  .bet-card .amount-input-box {
    gap: 5px;
    padding: 4px 6px;
  }

  .bet-card .btn-slot-action {
    padding: 6px 8px;
  }

  .bet-card .bet-btn-label {
    font-size: 0.78rem;
  }

  .bet-card .bet-btn-amount {
    font-size: 0.9rem;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  :root {
    --bet-btn-w: 76px;
  }

  .bet-card {
    --bet-controls-w: 136px;
    padding: 8px 10px 10px;
    gap: 8px 10px;
  }

  .bet-card .amt-chip {
    max-width: none;
    font-size: 0.56rem;
    min-height: 19px;
  }

  .top-bar {
    padding: 5px 8px;
    gap: 6px;
  }

  .bet-card-tab {
    font-size: 0.74rem;
    min-height: 22px;
    padding: 2px 8px;
  }

  .bet-card .step-btn {
    width: 22px;
    min-width: 22px;
    height: 22px;
  }

  .bet-card .bet-amount-input,
  .bet-card .auto-amount-input,
  .bet-card .amount-field {
    font-size: 0.76rem;
    min-height: 24px;
  }

  .bet-card .btn-slot-action {
    padding: 6px 8px;
  }

  .bet-card .bet-btn-label {
    font-size: 0.64rem;
  }

  .bet-card .bet-btn-amount {
    font-size: 0.76rem;
  }
}

/* Landscape phone */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 900px) {
  .stage {
    min-height: 90px;
    max-height: min(48vh, 48dvh);
  }

  .stage-wrap {
    padding: 4px 6px 6px;
    gap: 4px;
  }

  .bet-slots {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .bet-card {
    padding: 5px 8px 6px;
    gap: 5px 8px;
  }

  .bet-card-tabs {
    width: min(240px, 82%);
  }

  .bet-card-tab {
    min-height: 22px;
    padding: 2px 8px;
    font-size: 0.74rem;
  }

  .bet-card .panel-tab-bet .amt-chip {
    min-height: 17px;
  }

  .bet-card .panel-tab-bet .step-btn,
  .bet-card .panel-tab-bet .bet-amount-input,
  .bet-card .panel-tab-bet .auto-amount-input,
  .bet-card .auto-cashout-input {
    min-height: 22px;
  }
}

.maintenance-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.maintenance-overlay.hidden {
  display: none !important;
}

.maintenance-card {
  text-align: center;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 24px;
}

.maintenance-card h2 {
  font-size: 1.1rem;
  margin: 16px 0 8px;
}

.maintenance-card p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.maintenance-admin-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .mult-display { animation: none !important; }
}
