/* ============ 火箭发射台 · FlapRocket Crash · Game Page ============ */

body.page-game {
  background: #000;
  overflow-y: auto;
}

/* Compact nav for game */
.nav-game {
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  padding: 14px 32px;
}
.nav-links a.active {
  color: #fff;
}
.nav-links a.active::after {
  width: 100%;
  background: var(--blue);
}

/* Balance pill in nav */
.balance-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  background: rgba(124,200,255,0.04);
  font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px;
}
.balance-pill .bp-label {
  color: var(--muted-2);
}
.balance-pill b {
  font-family: var(--display); font-weight: 700;
  font-size: 14px; letter-spacing: 1px;
  background: linear-gradient(180deg, #fff 0%, #7CC8FF 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.balance-pill .bp-unit {
  color: var(--muted-2);
}
.balance-pill-bnb {
  background: rgba(74,222,128,0.04);
  border-color: rgba(74,222,128,0.25);
}
.balance-pill-bnb b {
  background: linear-gradient(180deg, #fff 0%, #4ade80 100%);
  -webkit-background-clip: text; background-clip: text;
}

/* ===== Layout ===== */
.game-main {
  padding: 90px 24px 24px;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(80,99,255,0.10) 0%, transparent 50%),
    #000;
}
.game-wrap {
  max-width: 1480px; margin: 0 auto;
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 18px;
}

/* ===== Side panels ===== */
.g-side {
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--line);
  padding: 18px;
  height: calc(100vh - 130px);
  display: flex; flex-direction: column;
  position: sticky; top: 90px;
  min-height: 0;
}
.g-side-left { overflow: hidden; }
.g-side-right {
  overflow-y: auto;
  scrollbar-width: thin;
}
.g-side-right::-webkit-scrollbar { width: 4px; }
.g-side-right::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }
.side-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.side-head .kicker { margin-bottom: 0; font-size: 10px; }
.side-head .online {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px;
  color: #4ade80;
}
.side-head .online i {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4ade80; box-shadow: 0 0 10px #4ade80;
  animation: pulseDot 1.6s ease-in-out infinite;
}

/* Player list */
.player-list {
  flex: 1;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
  padding-right: 4px;
}
.player-list::-webkit-scrollbar { width: 4px; }
.player-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }
.player-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px; align-items: center;
  padding: 9px 10px;
  background: rgba(255,255,255,0.02);
  border-left: 2px solid transparent;
  font-family: var(--mono); font-size: 11px;
  transition: background .25s, border-color .25s;
}
.player-row.cashed {
  border-left-color: #4ade80;
  background: rgba(74,222,128,0.06);
}
.player-row.busted {
  border-left-color: #ff5050;
  background: rgba(255,80,80,0.04);
  opacity: 0.55;
}
.player-row .pr-name {
  color: var(--muted);
  letter-spacing: 0.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-row .pr-bet {
  color: rgba(255,255,255,0.85);
  font-weight: 500;
}
.player-row .pr-result {
  font-family: var(--display); font-size: 11px; letter-spacing: 1px;
  font-weight: 700;
  min-width: 50px; text-align: right;
}
.player-row.cashed .pr-result { color: #4ade80; }
.player-row.busted .pr-result { color: #ff5050; }
.player-row.pending .pr-result { color: var(--muted-2); }

.totals {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.totals > div {
  text-align: center;
  padding: 10px 6px;
  background: rgba(255,255,255,0.02);
}
.totals span {
  display: block;
  font-family: var(--mono); font-size: 9px; letter-spacing: 1.5px;
  color: var(--muted-2); margin-bottom: 4px;
}
.totals b {
  font-family: var(--display); font-size: 13px; letter-spacing: 1px;
}

/* ===== Stage ===== */
.g-stage {
  display: flex; flex-direction: column; gap: 14px;
  min-height: calc(100vh - 130px);
}

/* History bar */
.history-bar {
  display: flex; gap: 6px;
  overflow-x: auto;
  padding: 10px 12px;
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--line);
  scrollbar-width: thin;
}
.history-bar::-webkit-scrollbar { height: 4px; }
.history-bar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }
.hist-pill {
  flex-shrink: 0;
  padding: 6px 12px;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: 1px;
  border: 1px solid;
}
.hist-pill.low {
  color: #ff5050;
  border-color: rgba(255,80,80,0.3);
  background: rgba(255,80,80,0.05);
}
.hist-pill.mid {
  color: #FFC447;
  border-color: rgba(255,196,71,0.3);
  background: rgba(255,196,71,0.05);
}
.hist-pill.high {
  color: #4ade80;
  border-color: rgba(74,222,128,0.4);
  background: rgba(74,222,128,0.06);
}
.hist-pill.epic {
  color: #fff;
  border-color: var(--blue);
  background: linear-gradient(135deg, rgba(124,200,255,0.18), rgba(80,99,255,0.18));
  box-shadow: 0 0 16px rgba(124,200,255,0.3);
}

/* Canvas + overlay */
.canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 480px;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 100%, rgba(80,99,255,0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 110%, rgba(124,200,255,0.20) 0%, transparent 50%),
    linear-gradient(180deg, #000 0%, #02040a 60%, #050810 100%);
  overflow: hidden;
}
#gameCanvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.multiplier-overlay {
  position: absolute;
  top: 28px; left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  z-index: 2;
  width: 100%;
  padding: 0 20px;
}
.mp-status {
  font-family: var(--mono); font-size: 11px; letter-spacing: 4px;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.mp-value {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(56px, 9vw, 130px);
  letter-spacing: 4px;
  line-height: 1;
  background: linear-gradient(180deg, #fff 0%, #7CC8FF 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(124,200,255,0.3);
  transition: color .15s;
}
.mp-value .x {
  font-size: 0.55em;
  margin-left: 4px;
  opacity: 0.7;
}
.mp-bar {
  width: min(420px, 80%);
  height: 3px;
  margin: 14px auto 8px;
  background: rgba(255,255,255,0.06);
  position: relative; overflow: hidden;
}
.mp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #7CC8FF 0%, #5063FF 100%);
  width: 0%;
  transition: width .1s linear;
}
.mp-meta {
  font-family: var(--mono); font-size: 10px; letter-spacing: 2px;
  color: var(--muted-2);
}

/* States */
.state-flying .mp-value {
  background: linear-gradient(180deg, #fff 0%, #7CC8FF 100%);
  -webkit-background-clip: text; background-clip: text;
}
.state-crashed .mp-value {
  background: linear-gradient(180deg, #ff8a8a 0%, #ff3030 100%);
  -webkit-background-clip: text; background-clip: text;
  text-shadow: 0 0 60px rgba(255,80,80,0.45);
  animation: crashShake .35s ease;
}
.state-crashed .mp-status {
  color: #ff5050;
  letter-spacing: 6px;
}
@keyframes crashShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 4px); }
  40% { transform: translate(6px, -3px); }
  60% { transform: translate(-4px, -2px); }
  80% { transform: translate(4px, 3px); }
}
.state-cashed-self .mp-value {
  background: linear-gradient(180deg, #fff 0%, #4ade80 100%);
  -webkit-background-clip: text; background-clip: text;
  text-shadow: 0 0 60px rgba(74,222,128,0.45);
}

/* Cashout pop */
.cashout-pop {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 24px 36px;
  background: rgba(0,0,0,0.85);
  border: 2px solid #4ade80;
  box-shadow: 0 0 40px rgba(74,222,128,0.4);
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s, transform .25s cubic-bezier(.2,1.6,.5,1);
  z-index: 3;
}
.cashout-pop.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.cp-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 4px;
  color: #4ade80;
}
.cp-value {
  font-family: var(--display); font-weight: 900;
  font-size: 42px; letter-spacing: 3px;
  color: #fff;
}
.cp-amount {
  font-family: var(--mono); font-size: 13px; letter-spacing: 1px;
  color: #4ade80;
}

/* ===== Bet panel ===== */
.bet-panel {
  padding: 18px;
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--line);
}
.bp-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.bp-input label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 2.5px;
  color: var(--muted-2);
  display: block; margin-bottom: 8px;
}
.bp-input-row {
  display: flex; gap: 6px;
}
.bp-input input {
  flex: 1;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--line);
  color: #fff;
  font-family: var(--display); font-size: 18px; letter-spacing: 1.5px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .2s;
  min-width: 0;
}
.bp-input input:focus { border-color: var(--blue); }
.bp-chip {
  padding: 0 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 1px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  transition: all .2s;
  cursor: pointer;
}
.bp-chip:hover {
  color: #fff; border-color: var(--blue);
  background: rgba(124,200,255,0.05);
}

/* Big action button */
.action-btn {
  width: 100%;
  padding: 18px 24px;
  font-family: var(--display); font-weight: 800;
  font-size: 15px; letter-spacing: 4px;
  border: 1px solid;
  cursor: pointer;
  transition: all .2s;
  position: relative; overflow: hidden;
}
.action-btn[data-state="bet"] {
  background: #fff; color: #000; border-color: #fff;
}
.action-btn[data-state="bet"]:hover {
  background: #7CC8FF; border-color: #7CC8FF;
}
.action-btn[data-state="placed"] {
  background: rgba(255,196,71,0.1); color: #FFC447; border-color: #FFC447;
  cursor: not-allowed;
}
.action-btn[data-state="cashout"] {
  background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%);
  color: #000; border-color: #4ade80;
  box-shadow: 0 0 30px rgba(74,222,128,0.4);
  animation: cashoutPulse 0.8s ease-in-out infinite;
}
@keyframes cashoutPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(74,222,128,0.4); }
  50% { box-shadow: 0 0 50px rgba(74,222,128,0.7); }
}
.action-btn[data-state="cashout"]:hover {
  filter: brightness(1.1);
}
.action-btn[data-state="cashed"] {
  background: rgba(74,222,128,0.1); color: #4ade80; border-color: #4ade80;
  cursor: not-allowed;
}
.action-btn[data-state="busted"] {
  background: rgba(255,80,80,0.08); color: #ff5050; border-color: rgba(255,80,80,0.5);
  cursor: not-allowed;
}
.action-btn[data-state="disabled"] {
  background: rgba(255,255,255,0.04); color: var(--muted-2); border-color: var(--line);
  cursor: not-allowed;
}
.bp-foot {
  margin-top: 12px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px;
  color: var(--muted-2);
  text-align: center;
}

/* ===== Right column: fair + log ===== */
.fair-card {
  display: flex; flex-direction: column; gap: 12px;
}
.fair-row {
  display: flex; flex-direction: column; gap: 4px;
}
.fair-row span {
  font-family: var(--mono); font-size: 9px; letter-spacing: 2px;
  color: var(--muted-2);
}
.fair-row b {
  font-family: var(--display); font-size: 14px; letter-spacing: 1px;
  color: #fff;
}
.fair-row code {
  font-family: var(--mono); font-size: 10px;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--line);
  padding: 8px 10px;
  color: var(--blue);
  word-break: break-all;
  line-height: 1.5;
}
.verify-btn {
  padding: 12px 16px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 2px;
  color: var(--blue);
  border: 1px solid var(--blue);
  background: rgba(124,200,255,0.06);
  cursor: pointer;
  transition: all .2s;
  margin-top: 4px;
}
.verify-btn:hover {
  background: var(--blue); color: #000;
}

.round-log {
  display: flex; flex-direction: column; gap: 4px;
}
.log-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px; align-items: center;
  padding: 7px 10px;
  background: rgba(255,255,255,0.02);
  font-family: var(--mono); font-size: 10px;
}
.log-row .lr-id {
  color: var(--muted-2);
}
.log-row .lr-mult {
  font-family: var(--display); font-weight: 700;
  letter-spacing: 0.5px;
  text-align: right;
}
.log-row .lr-mult.low { color: #ff5050; }
.log-row .lr-mult.mid { color: #FFC447; }
.log-row .lr-mult.high { color: #4ade80; }
.log-row .lr-mult.epic { color: var(--blue); }
.log-row .lr-time {
  color: var(--muted-2);
  font-size: 9px;
}

/* ===== Footer banner ===== */
.game-footer {
  max-width: 1480px; margin: 18px auto 0;
  padding: 14px 22px;
  border: 1px solid rgba(255,196,71,0.2);
  background: rgba(255,196,71,0.04);
  font-family: var(--mono); font-size: 11px; letter-spacing: 1px;
  color: rgba(255,196,71,0.9);
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
}
.game-footer a {
  color: #FFC447;
  font-weight: 700;
  border-bottom: 1px solid #FFC447;
  padding-bottom: 1px;
}
.game-footer a:hover { color: #fff; border-color: #fff; }

/* ===== Responsive ===== */
@media (max-width: 1180px) {
  .game-wrap {
    grid-template-columns: 1fr;
  }
  .g-side {
    height: auto;
    position: static;
    max-height: 360px;
  }
  .player-list { max-height: 240px; }
  .canvas-wrap { min-height: 380px; }
}
@media (max-width: 720px) {
  .game-main { padding: 80px 12px 12px; }
  .nav-game { padding: 12px 16px; }
  .nav-links { display: none; }
  .balance-pill { padding: 6px 10px; font-size: 10px; }
  .balance-pill b { font-size: 12px; }
  .bp-row { grid-template-columns: 1fr; }
  .canvas-wrap { min-height: 320px; }
  .mp-value { font-size: 56px; }
  .mp-status { font-size: 10px; letter-spacing: 3px; }
  .game-footer { flex-direction: column; align-items: flex-start; text-align: left; }
}
