@import url('/static/shared/base.css');

:root {
  --water-deep:  #050d1a;
  --water-elev:  #11192a;
  --water-card:  #16213b;
  --moon-yellow: #fbbf24;
  --moon-bright: #ffd76a;
  --hot-pink:    #ff2091;
  --win-green:   #84ff7e;
  --lose-pink:   #ff8aa7;
  --gem-cyan:    #5fc5d4;
  --trap-red:    #ff3a3a;
}

body {
  background:
    radial-gradient(ellipse at 30% 15%, rgba(132, 255, 196, 0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 85%, rgba(125, 108, 243, 0.14) 0%, transparent 55%),
    var(--water-deep) !important;
  color: #e8eaf3 !important;
}

.stage {
  display: flex !important; flex-direction: column !important; gap: 1rem !important;
  max-width: 1180px !important; width: 100%; margin: 0 auto;
  padding: 1rem 1.2rem 2rem; box-sizing: border-box;
}
.stage, .hero, .hero p, .panel, .muted { color: #e8eaf3; }
.muted { color: #a8aebf !important; }
.brand, .brand-game { color: var(--moon-bright) !important; }
.balance { color: var(--moon-bright) !important; }
#player-label { color: #cdd0d8 !important; }
.hero h1 { color: #fff !important; }
.hero p  { color: #cdd0d8 !important; }
.hero em, .hero strong { color: var(--moon-bright); font-style: normal; font-weight: 600; }

.topbar { background: rgba(8, 10, 16, 0.88) !important; border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important; backdrop-filter: blur(10px); }
.new-pill { display: inline-block; margin-left: 0.5rem; padding: 2px 8px; border-radius: 10px; background: linear-gradient(135deg, #FF2091 0%, #0184FD 100%); color: #fff; font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; vertical-align: middle; }

.hero { text-align: center; padding: 1.1rem 1rem 0.4rem; }
.hero-eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.28em; color: var(--moon-yellow); margin-bottom: 0.5rem; }
.hero h1 { font-family: 'Cormorant Garamond', serif; font-size: clamp(1.5rem, 4vw, 2.4rem); margin: 0 0 0.5rem; line-height: 1.15; }
.hero p { max-width: 640px; margin: 0 auto 1.2rem; font-size: 0.95rem; line-height: 1.55; padding: 0 0.5rem; }
.hero-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.8rem; max-width: 1000px; margin: 1.4rem auto 0; text-align: left; }
.hp-card { background: var(--water-card); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 10px; padding: 1rem 1.1rem; transition: transform 0.25s, border-color 0.25s; }
.hp-card:hover { transform: translateY(-2px); border-color: rgba(251, 191, 36, 0.4); }
.hp-step { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--moon-yellow); background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.3); border-radius: 100px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.hp-title { font-family: 'Cormorant Garamond', serif; font-size: 1.18rem; font-weight: 600; color: var(--moon-bright); margin-top: 0.5rem; margin-bottom: 0.3rem; }
.hp-body { font-size: 13px; color: #b8bfd0; line-height: 1.55; }
.hp-body em { color: var(--moon-bright); font-style: normal; font-weight: 600; }

button.cta { background: linear-gradient(135deg, #FF2091 0%, #0184FD 100%) !important; color: #fff !important; border: none !important; padding: 0.9rem 2rem !important; font-size: 1rem !important; font-weight: 700 !important; letter-spacing: 0.08em !important; text-transform: uppercase !important; border-radius: 6px !important; cursor: pointer !important; box-shadow: 0 6px 22px rgba(255, 32, 145, 0.35); min-height: 48px; }
button.cta:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
button.cta:disabled { opacity: 0.5; cursor: not-allowed; }

.phase-indicator { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.6rem 1rem; background: var(--water-elev); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 100px; margin: 0 auto; font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: #6f7689; flex-wrap: wrap; }
.phase-step { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.7rem; border-radius: 100px; transition: all 0.25s; }
.phase-step .phase-num { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 255, 255, 0.06); font-size: 10px; color: #8a92a8; }
.phase-step.active { background: rgba(251, 191, 36, 0.10); color: var(--moon-bright); box-shadow: 0 0 14px rgba(251, 191, 36, 0.35); }
.phase-step.active .phase-num { background: var(--moon-yellow); color: #0a0d14; font-weight: 700; }
.phase-step.done { color: #5fa68f; }
.phase-step.done .phase-num { background: rgba(95, 166, 143, 0.3); color: #5fa68f; }
.phase-arrow { color: #4a526a; }

/* Solo flow: collapse the hero so the game-panel sits under the header. */
.hero { display: none !important; }
.phase-indicator { display: none !important; }
.stage { gap: 0.6rem !important; padding-top: 0.6rem !important; }

.game-panel { background: var(--water-elev); border: 2px solid rgba(132, 255, 196, 0.3); border-radius: 14px; padding: 0.7rem 0.8rem 0.9rem; }

.hud { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; margin-bottom: 0.9rem; }
.hud-cell { background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 8px; padding: 0.55rem 0.7rem; text-align: center; }
.hud-label { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase; color: #8a92a8; margin-bottom: 0.15rem; }
.hud-value { font-family: 'JetBrains Mono', monospace; font-size: 18px; font-weight: 700; color: var(--moon-bright); font-variant-numeric: tabular-nums; }

/* Stash uses a CSS grid of tiles instead of an SVG canvas. */
.canvas-wrap {
  width: 100%; max-width: 380px; margin: 0 auto 0.6rem;
  padding: 0.7rem;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(132, 255, 196, 0.18);
  border: 2px solid rgba(255, 255, 255, 0.10);
  background: linear-gradient(135deg, #0a121e 0%, #11192a 100%);
}
.stash-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  width: 100%;
  aspect-ratio: 1 / 1;
}
.stash-tile {
  background: linear-gradient(160deg, #2a3a5a 0%, #1a2840 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  cursor: pointer;
  transition: transform 0.12s, background 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.stash-tile:not(.is-revealed):hover { transform: scale(1.05); background: linear-gradient(160deg, #34466a 0%, #223254 100%); box-shadow: 0 0 14px rgba(132, 255, 196, 0.3); }
.stash-tile:not(.is-revealed):active { transform: scale(0.96); }
.stash-tile.is-cash {
  background: linear-gradient(135deg, var(--gem-cyan) 0%, #2a8b9a 100%);
  border-color: var(--gem-cyan);
  cursor: default;
  box-shadow: 0 0 18px rgba(95, 197, 212, 0.5);
}
.stash-tile.is-trap {
  background: linear-gradient(135deg, var(--trap-red) 0%, #8c1a1a 100%);
  border-color: var(--trap-red);
  cursor: default;
  box-shadow: 0 0 22px rgba(255, 58, 58, 0.6);
  animation: trap-shake 0.4s;
}
.stash-tile.is-trap-other {
  /* Other traps revealed after a bust, dimmed */
  background: rgba(255, 58, 58, 0.18);
  border-color: rgba(255, 58, 58, 0.4);
  cursor: default;
}
.stash-tile.is-disabled {
  pointer-events: none;
  opacity: 0.55;
}
@keyframes trap-shake {
  0%, 100% { transform: scale(1); }
  20%      { transform: scale(1.1) rotate(-3deg); }
  40%      { transform: scale(1.05) rotate(3deg); }
  60%      { transform: scale(1.08) rotate(-2deg); }
}

.next-multi-row {
  display: flex; align-items: center; justify-content: center;
  gap: 0.6rem;
  margin-top: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.next-label { color: #8a92a8; }
.next-value { color: var(--win-green); font-weight: 700; }

/* Stake + traps rows. */
.stake-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; margin-bottom: 0.5rem; }
.stake-pill { min-width: 0; padding: 0.5rem 0.4rem; border: 1px solid rgba(255, 255, 255, 0.15); background: rgba(255, 255, 255, 0.04); border-radius: 10px; color: #cdd0d8; font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: all 0.15s; }
.stake-pill:hover:not(.is-locked) { border-color: var(--moon-yellow); color: #fff; background: rgba(251, 191, 36, 0.08); }
.stake-pill.is-selected { background: rgba(251, 191, 36, 0.16); border-color: var(--moon-bright); color: #fff; box-shadow: 0 0 14px rgba(251, 191, 36, 0.35); }
.stake-pill.is-locked { opacity: 0.5; cursor: not-allowed; }

.traps-row {
  display: grid;
  grid-template-columns: auto repeat(4, 1fr);
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.traps-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.14em; color: #8a92a8; text-transform: uppercase; }
.traps-pill {
  min-width: 0;
  padding: 0.45rem 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  color: #cdd0d8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.traps-pill:hover:not(.is-locked) { border-color: var(--trap-red); color: #fff; background: rgba(255, 58, 58, 0.12); }
.traps-pill.is-selected { background: rgba(255, 58, 58, 0.22); border-color: var(--trap-red); color: #fff; box-shadow: 0 0 14px rgba(255, 58, 58, 0.4); }
.traps-pill.is-locked { opacity: 0.5; cursor: not-allowed; }

.action-btn { width: 100%; padding: 1rem 1.2rem; border-radius: 12px; border: none; cursor: pointer; font-family: 'Cormorant Garamond', serif; letter-spacing: 0.06em; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; min-height: 76px; transition: transform 0.1s, filter 0.15s, box-shadow 0.2s; -webkit-tap-highlight-color: transparent; }
.action-btn:active:not(:disabled) { transform: scale(0.98); filter: brightness(1.1); }
.action-btn:disabled { cursor: not-allowed; }
.action-btn.act-drop { background: linear-gradient(135deg, #FF2091 0%, #0184FD 100%); color: #fff; box-shadow: 0 8px 26px rgba(255, 32, 145, 0.4); }
.action-btn.act-cashout { background: linear-gradient(135deg, #5fa68f 0%, #2a7d5f 100%); color: #fff; box-shadow: 0 8px 26px rgba(95, 166, 143, 0.5); }
.action-btn.act-done { background: linear-gradient(135deg, #5fa68f 0%, #2a7d5f 100%); color: #fff; }
.action-btn.act-idle { background: rgba(255, 255, 255, 0.05); color: #8a92a8; border: 1px dashed rgba(255, 255, 255, 0.15); }
.action-btn .act-top { font-size: 1.5rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.action-btn .act-bot { font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; letter-spacing: 0.06em; opacity: 0.92; }

.game-status { margin-top: 0.6rem; text-align: center; font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.1em; color: var(--moon-bright); min-height: 1.2em; }

.reveal-panel { background: var(--water-elev); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 10px; padding: 1.4rem 1.3rem; text-align: center; }
.reveal-banner { font-family: 'JetBrains Mono', monospace; font-size: clamp(1rem, 2.6vw, 1.3rem); letter-spacing: 0.18em; text-transform: uppercase; color: #cdd0d8; margin-bottom: 0.5rem; }
.reveal-banner.win  { color: var(--win-green); }
.reveal-banner.lose { color: var(--lose-pink); }
.reveal-payout { font-family: 'Cormorant Garamond', serif; font-size: clamp(2.4rem, 6vw, 3.2rem); font-weight: 700; margin: 0.2rem 0; }
.reveal-sub { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.1em; }
.reveal-panel .secondary { margin-top: 0.8rem; background: transparent; border: 1px solid var(--moon-yellow); color: var(--moon-bright); padding: 0.6rem 1.2rem; border-radius: 6px; font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; letter-spacing: 0.15em; text-transform: uppercase; cursor: pointer; }
.reveal-panel .secondary:hover { background: rgba(251, 191, 36, 0.08); }

.pool-panel { background: var(--water-elev); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 10px; padding: 1rem 1.2rem; }
.pool-panel h3 { color: var(--moon-bright) !important; margin: 0 0 0.5rem; font-family: 'Cormorant Garamond', serif; font-size: 1.05rem; }
.pool-panel .amount { color: #cdd0d8; font-size: 0.85rem; }
.pool-panel p.muted { color: #b0b6c8 !important; }

/* Mobile */
@media (max-width: 900px) {
  .stage { padding: 0.9rem 0.8rem 1.6rem; gap: 0.85rem; max-width: 100% !important; }
  .canvas-wrap { max-width: 460px; padding: 1rem; }
  .stash-tile { font-size: 24px; }
  .hud-value { font-size: 16px; }
}

@media (max-width: 640px) {
  .stage { padding: 0.6rem 0.5rem 1.4rem; gap: 0.7rem; }
  .hero { padding: 0.6rem 0.4rem 0.2rem; }
  .hero h1 { font-size: 1.35rem; }
  .hero p { font-size: 0.9rem; padding: 0 0.3rem; }
  .hero-preview { grid-template-columns: 1fr; gap: 0.55rem; margin-top: 1rem; }
  .hp-card { padding: 0.75rem 0.85rem; }
  .hp-title { font-size: 1.08rem; }
  .hp-body { font-size: 12px; }
  button.cta { padding: 0.9rem 1.4rem !important; width: 100%; max-width: 340px; font-size: 0.95rem !important; }

  .game-panel { padding: 0.7rem 0.6rem 0.85rem; border-radius: 12px; }
  .hud { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; margin-bottom: 0.7rem; }
  .hud-cell { padding: 0.45rem 0.4rem; }
  .hud-label { font-size: 8px; letter-spacing: 0.18em; }
  .hud-value { font-size: 14px; }
  .canvas-wrap { padding: 0.7rem; max-width: 100%; }
  .stash-grid { gap: 5px; }
  .stash-tile { font-size: 20px; border-radius: 7px; }

  .stake-row { gap: 0.35rem; }
  .stake-pill { min-width: 0; flex: 1 1 22%; padding: 0.55rem 0.3rem; font-size: 0.82rem; border-radius: 8px; }
  .traps-pill { min-width: 40px; padding: 0.5rem 0.55rem; font-size: 0.85rem; }
  .traps-label { font-size: 9px; }

  .action-btn { padding: 0.85rem 0.9rem; min-height: 68px; }
  .action-btn .act-top { font-size: 1.1rem; letter-spacing: 0.08em; }
  .action-btn .act-bot { font-size: 0.78rem; }

  .topbar { padding: 0.5rem 0.8rem; }
  .brand-game { font-size: 0.92rem; }
  .balance { font-size: 0.95rem; }
}

@media (max-width: 380px) {
  .stash-tile { font-size: 18px; }
  .stake-pill { padding: 0.5rem 0.25rem; font-size: 0.78rem; }
  .hud-value { font-size: 13px; }
  .action-btn .act-top { font-size: 1rem; }
}
