/* Vibe Games — game shell + three game UIs. */

.game-page-head {
  padding: var(--space-7) 0 var(--space-5);
}
.game-page-head .badge-row {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.game-shell-container {
  container-type: inline-size;
}

.game-shell {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
  padding-bottom: var(--space-9);
}

.game-stage {
  padding: var(--space-6) var(--space-5) var(--space-7);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  min-height: 340px;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.game-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, oklch(82% 0.16 168 / 0.1), transparent 60%);
  pointer-events: none;
}

.game-panel {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.panel-row span:first-child { color: var(--ink-dim); font-size: 0.88rem; }
.panel-row strong { font-family: var(--font-mono); font-size: 1.05rem; }

.stake-control {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.stake-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-line);
  background: oklch(100% 0 0 / 0.04);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  touch-action: manipulation;
}
.stake-btn:active { transform: scale(0.94); }
.stake-value {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
}

.play-btn {
  width: 100%;
  min-height: 56px;
  font-size: 1.05rem;
}
.play-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.get-tokens-btn {
  width: 100%;
}

.result-banner {
  min-height: 28px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--mint);
}
.result-banner[data-state="lose"] { color: var(--ink-faint); }

.history-strip {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-1);
}
.history-chip {
  flex-shrink: 0;
  min-width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid var(--surface-line);
  background: oklch(100% 0 0 / 0.03);
}
.history-chip.is-win { color: var(--mint); border-color: var(--mint-dim); }

@container (min-width: 760px) {
  .game-shell { grid-template-columns: 1.5fr 1fr; align-items: start; }
}
@media (min-width: 1024px) {
  .game-shell { grid-template-columns: 1.5fr 1fr; align-items: start; }
}

/* ── Slots ───────────────────────────────────────────── */
.slots-machine {
  display: flex;
  gap: var(--space-2);
  width: 100%;
  max-width: 460px;
}
.slot-reel {
  flex: 1;
  /* Ровно 3 клетки высотой — иначе нижний ряд выплатной линии обрезается */
  aspect-ratio: 1 / 3;
  min-width: 0;
  background: var(--bg-deep);
  border: 1px solid var(--surface-line);
  border-radius: var(--r-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: inset 0 12px 20px -10px oklch(8% 0.02 265 / 0.8), inset 0 -12px 20px -10px oklch(8% 0.02 265 / 0.8);
}
.slot-reel-track {
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  transition: transform 900ms cubic-bezier(0.2, 0.8, 0.3, 1);
}
.slot-cell {
  width: 100%;
  aspect-ratio: 1;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  padding: 10%;
}
.slot-cell img { width: 100%; height: 100%; object-fit: contain; }
.slot-reel.is-spinning .slot-reel-track {
  transition: none;
}

.payout-table {
  margin-top: var(--space-2);
}
.payout-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--surface-line);
}
.payout-row img { width: 28px; height: 28px; }
.payout-row span:last-child { margin-left: auto; font-family: var(--font-mono); color: var(--mint); }

/* ── Wheel ───────────────────────────────────────────── */
.wheel-wrap {
  position: relative;
  width: min(88vw, 420px);
  aspect-ratio: 1;
}
.wheel-pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  translate: -50% 0;
  width: 0; height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 22px solid var(--coral);
  z-index: 5;
  filter: drop-shadow(0 4px 6px oklch(8% 0.02 265 / 0.5));
}
.wheel-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  border: 6px solid var(--surface-up);
  box-shadow: var(--shadow-pop);
  transition: transform 3200ms cubic-bezier(0.15, 0.65, 0.1, 1);
}
.wheel-sector-label {
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(0.65rem, 2.4vw, 0.9rem);
  color: oklch(15% 0.02 265);
  white-space: nowrap;
}
.wheel-hub {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22%;
  height: 22%;
  border-radius: 50%;
  background: var(--surface);
  border: 4px solid var(--surface-line);
  display: grid;
  place-items: center;
}
.wheel-hub img { width: 60%; }

@media (max-width: 400px) {
  .wheel-sector-label { display: none; }
}

.wheel-mode-toggle {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-1);
  border-radius: var(--r-pill);
  background: oklch(100% 0 0 / 0.04);
  border: 1px solid var(--surface-line);
}
.wheel-mode-toggle button {
  flex: 1;
  min-height: 44px;
  border: none;
  background: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-pill);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-dim);
  cursor: pointer;
  touch-action: manipulation;
}
.wheel-mode-toggle button[aria-pressed="true"] {
  background: var(--mint);
  color: var(--mint-ink);
}

/* ── Dice ────────────────────────────────────────────── */
.dice-face {
  width: 120px;
  height: 120px;
}
.dice-readout {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  max-width: 420px;
}
.dice-slider-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.dice-slider-row input[type="range"] {
  width: 100%;
  height: 44px;
  -webkit-appearance: none;
  background: transparent;
  touch-action: manipulation;
}
.dice-slider-row input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--coral) 0%, var(--coral) var(--fill, 50%), var(--mint) var(--fill, 50%), var(--mint) 100%);
}
.dice-slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  border: 4px solid var(--mint);
  margin-top: -12px;
  cursor: pointer;
}
.dice-slider-row input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--coral) 0%, var(--coral) var(--fill, 50%), var(--mint) var(--fill, 50%), var(--mint) 100%);
}
.dice-slider-row input[type="range"]::-moz-range-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  border: 4px solid var(--mint);
  cursor: pointer;
}
.dice-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}
.dice-stats .stat-tile { padding: var(--space-4); }

@media (min-width: 640px) {
  .dice-stats { grid-template-columns: repeat(3, 1fr); }
}

/* ── Sticky mobile controls dock ─────────────────────── */
.mobile-dock {
  display: none;
}
@media (max-width: 1023px) {
  .game-panel.is-primary {
    position: sticky;
    bottom: 0;
    z-index: 60;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom));
    box-shadow: 0 -20px 40px -20px oklch(8% 0.02 265 / 0.6);
  }
}

/* Fairness / how-it-works probability tables reuse .table-scroll from site.css */

@media (orientation: landscape) and (max-height: 500px) {
  .game-page-head { padding: var(--space-4) 0 var(--space-3); }
  .game-stage { min-height: 0; padding: var(--space-4); gap: var(--space-3); }
  .wheel-wrap { width: min(52vh, 320px); }
  .dice-face { width: 72px; height: 72px; }
  .slots-machine { max-width: 340px; }
}

