/* 1boombet Crash 1-to-1 Pure Game Stylesheet (No Outer Casino Header) */
:root {
  --bg-main: #0a0d1e;
  --bg-card: #10152e;
  --bg-inner: #0b0f24;
  --border-color: #1e264f;
  --text-main: #ffffff;
  --text-muted: #62719a;
  --primary-orange: #f35b1d;
  --primary-orange-hover: #ff6a2d;
  --primary-green: #00e676;
  --primary-yellow: #ffc700;
  --danger-red: #ff334b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

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

/* Master Game Layout (Only the game!) */
.game-viewport {
  display: flex;
  gap: 16px;
  padding: 16px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* Left Sidebar: Live Bets */
.live-bets-sidebar {
  width: 320px;
  flex-shrink: 0;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.live-bets-header {
  background: linear-gradient(90deg, #f25522 0%, #ea2c59 100%);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  gap: 6px;
  align-items: center;
  color: #ffffff;
}

.stat-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-title {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.9;
  white-space: nowrap;
}

.stat-value {
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.stat-icon {
  font-size: 10px;
}

.live-bets-table-head {
  display: grid;
  grid-template-columns: 0.95fr 1.25fr 1fr 1fr;
  padding: 8px 10px;
  background-color: #0c1026;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
  gap: 2px;
  align-items: center;
}

.col-head-login { text-align: left; }
.col-head-coef { text-align: center; }
.col-head-bet { text-align: right; }
.col-head-win { text-align: right; }

.live-bets-list {
  flex: 1;
  overflow-y: auto;
  max-height: calc(100vh - 120px);
}

.live-bet-row {
  display: grid;
  grid-template-columns: 0.95fr 1.25fr 1fr 1fr;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  align-items: center;
  gap: 2px;
}

.live-bet-row.won {
  background-color: rgba(0, 230, 118, 0.08);
}

.live-bet-user {
  color: #7b8ba8;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-bet-coef {
  color: #475579;
  font-weight: 700;
  text-align: center;
}

.live-bet-coef.cashed {
  color: var(--primary-green);
}

.live-bet-amount {
  color: #ffffff;
  text-align: right;
  white-space: nowrap;
}

.live-bet-win {
  color: #475579;
  text-align: right;
  white-space: nowrap;
}

.live-bet-win.won {
  color: var(--primary-green);
  font-weight: 700;
}

/* Right Main Area */
.game-right-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Arena Card */
.arena-card {
  position: relative;
  width: 100%;
  height: 440px;
  background-color: hsl(233, 41%, 16%); /* Original rgb(24, 28, 58) */
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#crashCanvas {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: block;
}

/* Official Vector Mountain Layers (Parallax) */
@keyframes mountain-move {
  to {
    background-position-x: -43.125em;
  }
}

.crash-game__mountains {
  opacity: .22;
  position: absolute;
  bottom: 2.8125em;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 1;
}

.crash-game__mountains--game .crash-game__mountain {
  animation-play-state: running;
}

.crash-game__mountain {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 100%;
  height: 7.8125em;
  background: url('assets/mountain-1.svg') 0 2.5em/contain repeat-x;
  transform: translateX(-50%);
  pointer-events: none;
  will-change: background-position;
  transition: background-position .3s ease-in-out;
  animation: mountain-move 5s paused linear infinite;
}

.crash-game__mountain--2 {
  height: 9.5625em;
  background-image: url('assets/mountain-2.svg');
  background-position-y: 4.375em;
  animation-duration: 9s;
}

.crash-game__mountain--3 {
  height: 15.3125em;
  background-image: url('assets/mountain-3.svg');
  background-position-y: 6.25em;
  animation-duration: 18s;
}

.crash-game__mountain--4 {
  height: 18.25em;
  background-image: url('assets/mountain-4.svg');
  background-position-y: 8.125em;
  animation-duration: 30s;
}

.crash-game__mountain--5 {
  height: 22.25em;
  background-image: url('assets/mountain-5.svg');
  background-position-y: 10em;
  animation-duration: 50s;
}

/* Official Countdown Timer Dial (Bottom-Right) */
@keyframes circle-bounce {
  70% { transform: rotate(-100deg); }
  80% { transform: rotate(-111deg); }
  90% { transform: rotate(-102deg); }
  0%, 40%, 100% { transform: rotate(-107deg); }
}

.crash-game__timer {
  font-size: 15px;
  position: absolute;
  right: -5.5em;
  bottom: -5.3125em;
  width: 26.875em;
  height: 26.875em;
  clip: rect(0px, 271.875px, 271.875px, 0px);
  z-index: 5;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.crash-game__timer.hidden {
  display: none !important;
}

.crash-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  direction: ltr;
}

.crash-timer__counter {
  font-family: 'Roboto', sans-serif;
  font-size: 5.1875em;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
}

.crash-timer__segments {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(180deg);
  will-change: transform;
  transition: transform .7s ease-in-out;
}

.crash-timer__segment {
  position: absolute;
  top: 0;
  right: 50%;
  height: 13.4375em;
  transform: translateX(50%);
  transform-origin: center bottom;
}

.crash-timer__segment::before {
  content: "";
  position: absolute;
  top: 1.875em;
  left: 0;
  width: .5em;
  height: 1.1875em;
  border-radius: .25em;
  background-color: #ffffff;
}

.crash-timer__segment:nth-child(1) { transform: rotate(165deg); }
.crash-timer__segment:nth-child(2) { transform: rotate(135deg); }
.crash-timer__segment:nth-child(3) { transform: rotate(105deg); }
.crash-timer__segment:nth-child(4) { transform: rotate(75deg); }
.crash-timer__segment:nth-child(5) { transform: rotate(45deg); }
.crash-timer__segment:nth-child(6) { transform: rotate(15deg); }
.crash-timer__segment:nth-child(7) { transform: rotate(-15deg); }
.crash-timer__segment:nth-child(8) { transform: rotate(-45deg); }
.crash-timer__segment:nth-child(9) { transform: rotate(-75deg); }
.crash-timer__segment:nth-child(10) { transform: rotate(-105deg); }
.crash-timer__segment:nth-child(11) { transform: rotate(-135deg); }
.crash-timer__segment:nth-child(12) { transform: rotate(-165deg); }

.crash-timer--countdown .crash-timer__segment:first-child::before {
  width: .75em;
  height: 1.875em;
  border-radius: .375em;
  background-color: hsl(22, 88%, 51%); /* #f06514 bright orange */
  box-shadow: 0 0 10px hsl(22, 88%, 51%);
}

.crash-timer--countdown .crash-timer__segment:nth-child(n+8) {
  display: none;
}

.crash-timer__circle {
  position: absolute;
  top: 0;
  right: 50%;
  height: 13.4375em;
  transform: rotate(-107deg);
  transform-origin: center bottom;
  animation: circle-bounce 1s .7s linear infinite;
}

.crash-timer__circle::before {
  content: "";
  position: absolute;
  top: 4.0625em;
  width: 1.5625em;
  height: 1.5625em;
  border-radius: 50%;
  background-color: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* In-Arena Rules Button */
.btn-in-arena-rules {
  position: absolute;
  top: 18px;
  left: 18px;
  background-color: rgba(14, 19, 41, 0.7);
  border: 1px solid rgba(243, 91, 29, 0.6);
  color: #d1d5db;
  padding: 6px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Roboto', sans-serif;
  cursor: pointer;
  z-index: 20;
  transition: all 0.2s;
}

.btn-in-arena-rules:hover {
  background-color: rgba(243, 91, 29, 0.2);
  color: #ffffff;
  border-color: var(--primary-orange);
}

/* In-Arena Multiplier (Right-Bottom) */
.multiplier-box {
  position: absolute;
  right: 45px;
  bottom: 45px;
  text-align: right;
  z-index: 20;
  pointer-events: none;
}

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

.multiplier-status {
  font-size: 20px;
  font-weight: 900;
  color: var(--danger-red);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 4px;
  text-shadow: 0 0 16px rgba(255, 51, 75, 0.8);
}

/* Bottom Split Row */
.bottom-split-row {
  display: flex;
  gap: 16px;
  flex: 1;
}

/* History Card */
.history-card {
  flex: 1.35;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.history-card-header {
  background: linear-gradient(90deg, #ff414d 0%, #f35b1d 100%);
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-table-head {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1.1fr 1.1fr 1fr;
  padding: 10px 14px;
  background-color: #0c1026;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
}

.history-table-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  overflow-y: auto;
}

.history-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #4b587e;
  font-size: 14px;
  font-weight: 600;
}

.history-empty-state svg {
  width: 48px;
  height: 48px;
  stroke: #333e63;
}

.history-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1.1fr 1.1fr 1fr;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

/* Bet Controls Column (Two Stacked Panels) */
.bet-controls-column {
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Bet Panel 2-Column Card */
.bet-panel-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.bet-panel-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 10px;
}

/* Left Subcolumn */
.bet-left-subcol {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bet-input-container {
  display: flex;
  align-items: center;
  background-color: #ffffff;
  border: 1px solid hsl(219, 34%, 54%); /* rgb(98, 126, 178) */
  border-radius: 4px;
  padding: 0 8px 0 10px;
  height: 32px;
  transition: border-color 0.2s;
}

.bet-input-container:focus-within {
  outline: 1px solid hsl(22, 88%, 51%);
  border-color: hsl(22, 88%, 51%);
}

.bet-input-field {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #000000;
}

.bet-input-clear {
  background: transparent;
  border: none;
  color: hsl(233, 33%, 27%);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.15s;
}

.bet-input-clear:hover {
  color: hsl(358, 57%, 52%);
}

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

.chip-btn {
  background-color: hsl(233, 33%, 27%); /* rgb(46, 51, 92) */
  border: 1px solid hsl(241, 37%, 36%); /* rgb(59, 58, 126) */
  color: #ffffff;
  height: 30px;
  padding: 0;
  border-radius: 4px;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.chip-btn:hover {
  background-color: hsl(22, 88%, 51%);
  border-color: hsl(22, 88%, 51%);
  color: #ffffff;
}

/* Right Subcolumn */
.bet-right-subcol {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-auto-toggle {
  height: 32px;
  background-color: transparent;
  border: 1px solid hsl(22, 88%, 51%);
  border-radius: 4px;
  color: hsl(22, 88%, 51%);
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.btn-auto-toggle:hover {
  border-color: hsl(358, 57%, 52%);
  color: hsl(358, 57%, 52%);
}

.btn-auto-toggle.active {
  background-color: hsl(353, 77%, 58%); /* rgb(231, 65, 87) */
  border-color: transparent;
  color: #ffffff;
}

.btn-auto-toggle.active:hover {
  background-color: hsl(351, 55%, 51%);
  color: #ffffff;
}

.btn-main-action {
  flex: 1;
  min-height: 68px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: 'Roboto', sans-serif;
  transition: background-color 0.15s, transform 0.05s;
}

.btn-main-action.bet {
  background-color: hsl(22, 88%, 51%); /* Solid orange rgb(240, 101, 20) */
  color: #ffffff;
  box-shadow: none;
}

.btn-main-action.bet:hover {
  background-color: hsl(22, 100%, 65%); /* #ff7a24 */
}

.btn-main-action.bet:active {
  background-color: hsl(22, 100%, 41%); /* #d14f00 */
  transform: scale(0.99);
}

.btn-main-action.cashout {
  background-color: hsl(39, 100%, 50%); /* Golden yellow #ffaa00 */
  color: #ffffff;
  box-shadow: none;
}

.btn-main-action.cashout:hover {
  background-color: hsl(39, 100%, 59%);
}

.btn-main-action.cashout:active {
  background-color: hsl(39, 100%, 43%);
  transform: scale(0.99);
}

.btn-main-action.waiting {
  background-color: #232c4e;
  color: #7b8ba8;
  cursor: not-allowed;
}

.main-action-title {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  line-height: 1.15;
}

.main-action-subtext {
  font-family: 'Roboto', sans-serif;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
  text-transform: none;
  text-align: center;
}

/* Auto Cashout Options Box */
.auto-cashout-box {
  display: none;
  background-color: #0a0e20;
  border: 1px solid #232c58;
  border-radius: 6px;
  padding: 6px 10px;
  margin-top: 8px;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.auto-cashout-box.visible {
  display: flex;
}

.auto-cashout-input {
  width: 65px;
  background-color: #141a36;
  border: 1px solid #293463;
  border-radius: 4px;
  padding: 4px 6px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  outline: none;
}

/* Official Right Sidebar: 5 Flush Dark Cells with Thin 1px Dividers (1-to-1) */
.ourgames-sidebar {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 1001;
  font-size: 14px;
}

.ourgames-sidebar__list {
  display: flex;
  flex-direction: column;
  list-style-type: none;
  padding: 1px;
  margin: 0;
  background: hsl(38, 11%, 15%); /* rgb(43, 40, 34) */
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.5);
}

.ourgames-sidebar__item {
  position: relative;
}

.ourgames-sidebar__item:not(:last-of-type) {
  margin-bottom: 1px;
}

.ourgames-sidebar__link {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  width: 48.9px; /* 3.4375em */
  height: 48px;   /* 3.375em */
  padding: 0;
  border: none;
  box-shadow: none;
  background: hsl(38, 11%, 7%); /* rgb(20, 18, 16) */
  cursor: pointer;
  outline: none;
  transition: background 0.15s;
}

.ourgames-sidebar__link::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  z-index: 1;
  width: 2px;
  height: calc(100% + 2px);
  background: transparent;
  transition: background 0.2s linear;
  will-change: background;
}

.ourgames-sidebar__link:hover::before,
.ourgames-sidebar__link.open::before {
  background: hsl(49, 100%, 63%); /* #ffe843 yellow active indicator */
}

.ourgames-sidebar__ico {
  max-width: 22px;
  max-height: 22px;
  width: 22px;
  height: 22px;
  fill: hsl(0, 0%, 83%); /* rgb(212, 212, 212) */
  transition: fill 0.2s linear;
}

.ourgames-sidebar__link:hover .ourgames-sidebar__ico,
.ourgames-sidebar__link.open .ourgames-sidebar__ico {
  fill: hsl(49, 100%, 63%);
}

.ourgames-sidebar__tooltip {
  display: none;
  position: absolute;
  top: 50%;
  right: calc(100% + 15px);
  transform: translateY(-50%);
  min-width: 110px;
  padding: 5px 10px;
  border: 1px solid hsl(0, 0%, 83%);
  border-radius: 4px;
  background: hsl(38, 11%, 7%);
  color: #ffffff;
  font-family: 'Roboto', sans-serif;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  z-index: 1002;
}

.ourgames-sidebar__tooltip::before {
  content: "";
  position: absolute;
  top: 50%;
  right: -5px;
  width: 8px;
  height: 8px;
  border-top: inherit;
  border-left: inherit;
  background: inherit;
  transform: translateY(-50%) rotate(135deg);
}

.ourgames-sidebar__item:hover .ourgames-sidebar__tooltip {
  display: block;
}

/* Official Rules Modal Window (.crash-popup--rules) */
.crash-modal-rules-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1005;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vfm__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
}

.vfm__content {
  position: relative;
  z-index: 1006;
}

.crash-popup--rules {
  position: relative;
  width: 650px;
  max-width: 92vw;
  max-height: 85vh;
  color: #ffffff;
  background-color: hsl(233, 41%, 16%); /* rgb(24, 28, 58) */
  border-radius: 22px; /* 1.375em */
  padding: 30px 40px 25px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  font-family: 'Roboto', sans-serif;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.crash-popup--rules::before {
  content: "";
  opacity: 0.1;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 0 0 22px 22px;
  background: url('assets/mountains.png') center bottom / contain no-repeat;
  pointer-events: none;
}

.crash-popup__close {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 2;
  width: 22px;
  height: 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s;
}

.crash-popup__close::before,
.crash-popup__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 20px;
  border-radius: 2px;
  background-color: #ffffff;
  transition: background-color 0.2s ease-in;
}

.crash-popup__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.crash-popup__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.crash-popup__close:hover::before,
.crash-popup__close:hover::after,
.crash-popup__close:focus::before,
.crash-popup__close:focus::after {
  background-color: hsl(358, 57%, 52%); /* #cb3e41 red on hover */
}

.crash-popup--rules .crash-popup__title {
  text-transform: uppercase;
  font-size: 26px; /* ~2.1875em */
  font-weight: 700;
  margin: 0 0 16px;
  color: #ffffff;
  text-align: center;
}

.crash-popup__overflow {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
}

.crash-popup__overflow::-webkit-scrollbar {
  width: 6px;
}

.crash-popup__overflow::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.crash-popup__overflow::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.crash-popup__overflow::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

.crash-popup--rules .crash-popup__list {
  margin: 0 0 16px;
  padding-left: 24px;
}

.crash-popup--rules .crash-popup__text {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 10px;
}

.crash-popup--rules .crash-popup__text p {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.75);
}

.crash-popup--rules .crash-popup__subtitle {
  text-transform: uppercase;
  font-size: 16px;
  font-weight: 700;
  margin: 20px 0 12px;
  text-align: center;
  color: #ffffff;
}

.crash-popup--rules .crash-popup__claim {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 16px;
  margin-bottom: 6px;
  text-align: center;
}

/* Mobile Top Bar (Hidden on desktop) */
.mobile-top-bar {
  display: none;
  padding: 10px 12px;
  background-color: #0b0f24;
  border-bottom: 1px solid #1e264f;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.mobile-top-bar .btn-in-arena-rules {
  position: static;
  background-color: #141a3a;
  border: 1px solid #2c386b;
  color: #ffffff;
  padding: 8px 18px;
  font-size: 13px;
  border-radius: 6px;
}

.btn-mobile-history {
  background: linear-gradient(90deg, #f25522 0%, #ea2c59 100%);
  border: none;
  color: #ffffff;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 800;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Responsive Desktop vs Mobile text helpers */
.mobile-txt {
  display: none;
}
.desktop-txt {
  display: inline;
}

/* Mobile View Layout (1-to-1 with reference screenshots) */
@media (max-width: 900px) {
  .desktop-txt {
    display: none;
  }
  .mobile-txt {
    display: inline;
  }

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

  body {
    background-color: hsl(232, 63%, 10%); /* #0a0e27 */
  }

  .game-viewport {
    flex-direction: column;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    padding: 8px 8px 24px;
    gap: 8px;
  }

  /* Flatten structure so flex ordering controls the flow */
  .game-right-area {
    display: contents;
  }

  .bottom-split-row {
    display: contents;
  }

  /* 1. Mobile Top Bar (Rules + History) */
  .mobile-top-bar {
    order: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    margin-bottom: 4px;
    padding: 0;
  }

  .btn-mobile-rules {
    flex: 1;
    height: 27px;
    min-height: 27px;
    background-color: transparent;
    border: 1px solid #f06514;
    border-radius: 6px;
    color: #f06514;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1px 4px;
    line-height: 25px;
    transition: background-color 0.15s;
  }

  .btn-mobile-rules:active {
    background-color: rgba(240, 101, 20, 0.15);
  }

  .btn-mobile-history {
    flex: 1;
    height: 27px;
    min-height: 27px;
    background: linear-gradient(90deg, #f06814 0%, #e6414a 100%);
    border: none;
    border-radius: 6px;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 1px 4px;
    line-height: 25px;
    transition: opacity 0.15s;
  }

  .btn-mobile-history svg {
    width: 13px;
    height: 13px;
  }

  .btn-mobile-history:active {
    opacity: 0.9;
  }

  /* 2. Arena Card */
  .arena-card {
    order: 2;
    width: 100%;
    height: 200px;
    background-color: hsl(233, 41%, 16%); /* #181c3a */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
  }

  .arena-card .btn-in-arena-rules {
    display: none; /* Shown in mobile-top-bar instead */
  }

  /* Official Mountain Layers on Mobile */
  .crash-game__mountains {
    opacity: 0.18;
    bottom: 1.25em;
  }

  .crash-game__mountain {
    height: 4.5em;
  }
  .crash-game__mountain--2 {
    height: 5.5em;
  }
  .crash-game__mountain--3 {
    height: 8.5em;
  }
  .crash-game__mountain--4 {
    height: 10.5em;
  }
  .crash-game__mountain--5 {
    height: 12.5em;
  }

  /* Countdown Dial on Mobile */
  .crash-game__timer {
    font-size: 16px;
    position: absolute;
    right: -3em;
    bottom: -2.4375em;
    width: 10em;
    height: 10em;
    clip: rect(0em, 8.4375em, 6.25em, 0em);
    z-index: 5;
  }

  .crash-timer__counter {
    font-size: 2.1em;
    font-weight: 700;
  }

  .crash-timer__segment {
    height: 5em;
  }

  .crash-timer__segment::before {
    top: .625em;
    left: 50%;
    width: .25em;
    height: .625em;
    border-radius: .125em;
    transform: translateX(-50%);
  }

  .crash-timer--countdown .crash-timer__segment:first-child::before {
    width: .375em;
    height: .75em;
    border-radius: .1875em;
    background-color: hsl(22, 88%, 51%);
    box-shadow: 0 0 10px hsl(22, 88%, 51%);
  }

  .crash-timer__circle {
    height: 5em;
  }

  .crash-timer__circle::before {
    top: 1.5625em;
    left: 0;
    width: .625em;
    height: .625em;
  }

  /* In-Arena Multiplier on Mobile */
  .multiplier-box {
    right: 16px;
    bottom: 12px;
  }

  .multiplier-number {
    font-size: 40px;
    font-weight: 800;
  }

  .multiplier-status {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 2px;
  }

  /* 3. Bet Controls Column */
  .bet-controls-column {
    order: 3;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .bet-panel-card {
    background-color: hsl(233, 41%, 16%); /* #181c3a */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 6px 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  }

  .bet-panel-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 8px;
    align-items: stretch;
  }

  .bet-left-subcol {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .bet-input-container {
    height: 32px;
    background-color: #ffffff;
    border: 1px solid hsl(219, 34%, 54%);
    border-radius: 5px;
    padding: 0 8px 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .bet-input-field {
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #000000;
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
  }

  .bet-input-clear {
    color: #1a2247;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0 2px;
  }

  .chips-2x3-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }

  .chip-btn {
    height: 25px;
    background-color: #2b3558;
    border: 1px solid #3c4973;
    border-radius: 4px;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .chip-btn:active {
    background-color: #f06514;
    border-color: #f06514;
  }

  .bet-right-subcol {
    display: flex;
    flex-direction: column;
    gap: 5px;
    justify-content: space-between;
  }

  .btn-auto-toggle {
    height: 32px;
    background-color: transparent;
    border: 1px solid #f06514;
    border-radius: 4px;
    color: #f06514;
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    padding: 0 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }

  .btn-auto-toggle.active {
    background-color: hsl(353, 77%, 58%);
    border-color: transparent;
    color: #ffffff;
  }

  .btn-main-action {
    height: 54px;
    min-height: 54px;
    border-radius: 5px;
    border: none;
    padding: 3px 4px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-align: center;
  }

  .btn-main-action.bet {
    background-color: #f06514;
    color: #ffffff;
  }

  .btn-main-action.bet:active {
    background-color: #d14f00;
  }

  .btn-main-action.cashout {
    background-color: #ffaa00;
    color: #ffffff;
  }

  .btn-main-action.waiting {
    background-color: #1e2648;
    color: #59668d;
    cursor: default;
  }

  .main-action-title {
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.15;
    text-align: center;
  }

  .btn-main-action.waiting .main-action-title {
    font-size: 11px;
    font-weight: 700;
    color: #59668d;
  }

  .main-action-subtext {
    font-family: 'Roboto', sans-serif;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    opacity: 0.95;
    margin-top: 2px;
    white-space: nowrap;
  }

  /* 4. Live Bets Sidebar (Players Board on Mobile) */
  .live-bets-sidebar {
    order: 4;
    width: 100%;
    background-color: hsl(233, 41%, 16%); /* #181c3a */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    margin-bottom: 16px;
  }

  .live-bets-header {
    background: linear-gradient(90deg, #d3541b 0%, #d83b4b 100%);
    border-radius: 6px 6px 0 0;
    padding: 6px 6px;
    display: grid;
    grid-template-columns: 0.95fr 1.35fr 1.05fr;
    gap: 2px;
    align-items: center;
  }

  .stat-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    white-space: nowrap !important;
    min-width: 0;
  }

  .stat-title {
    font-family: 'Roboto', sans-serif;
    font-size: 10.5px;
    font-weight: 600;
    opacity: 0.95;
    color: #ffffff;
    margin-bottom: 2px;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
  }

  .stat-value {
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    white-space: nowrap !important;
    letter-spacing: -0.2px;
  }

  .stat-icon {
    font-size: 11px;
  }

  .live-bets-table-head {
    background-color: #121633;
    padding: 6px 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    display: grid;
    grid-template-columns: 1.15fr 0.9fr 1.1fr 1.1fr;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .col-head-login {
    text-align: left;
  }
  .col-head-coef {
    text-align: center;
  }
  .col-head-bet {
    text-align: right;
  }
  .col-head-win {
    text-align: right;
  }

  .live-bets-list {
    max-height: 380px;
    overflow-y: auto;
    background-color: #141836;
  }

  .live-bet-row {
    display: grid;
    grid-template-columns: 1.15fr 0.9fr 1.1fr 1.1fr;
    padding: 6px 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    font-weight: 600;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  }

  .live-bet-user {
    color: rgba(255, 255, 255, 0.85);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
  }

  .live-bet-coef {
    color: rgba(255, 255, 255, 0.65);
    font-size: 11px;
    text-align: center;
  }

  .live-bet-coef.cashed {
    color: #22c55e;
    font-weight: 700;
  }

  .live-bet-amount {
    color: #ffffff;
    font-weight: 700;
    font-size: 11px;
    white-space: nowrap !important;
    text-align: right;
  }

  .live-bet-win {
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    white-space: nowrap !important;
    text-align: right;
  }

  .live-bet-win.won {
    color: #22c55e;
    font-weight: 700;
  }

  /* 5. History Card Modal on Mobile */
  .history-card {
    order: 5;
    display: none;
  }

  .history-card.mobile-open {
    display: flex;
    position: fixed;
    top: 45px;
    left: 10px;
    right: 10px;
    bottom: 25px;
    z-index: 9999;
    background-color: hsl(233, 41%, 16%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
    flex-direction: column;
    overflow: hidden;
  }

  .history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
  }

  .history-card-close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
  }

  .history-table-head {
    display: grid;
    grid-template-columns: 0.9fr 0.9fr 0.8fr 1fr 1.1fr 1fr 0.8fr;
    gap: 3px;
    padding: 8px 6px;
    font-size: 9px;
    text-align: center;
    overflow-x: auto;
  }

  .history-row {
    display: grid;
    grid-template-columns: 0.9fr 0.9fr 0.8fr 1fr 1.1fr 1fr 0.8fr;
    gap: 3px;
    padding: 6px 6px;
    font-size: 10px;
    text-align: center;
  }
}
