:root {
  color-scheme: dark;
  --bg: #030303;
  --surface: rgba(10, 10, 11, 0.86);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f5f5f0;
  --muted: #a6a6a0;
  --dim: #6d6d68;
  --signal: #e9ff70;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(115deg, rgba(233, 255, 112, 0.08), transparent 28rem),
    linear-gradient(245deg, rgba(255, 255, 255, 0.06), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}

.casino-page {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) 0 64px;
}

.hero {
  display: grid;
  justify-items: center;
  padding: 32px 0 34px;
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 42px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 760;
}

.brand-mark {
  width: 17px;
  height: 17px;
  border: 2px solid var(--text);
  border-radius: 50%;
  box-shadow: inset 6px 0 0 var(--signal);
}

h1,
h2 {
  margin: 0;
  font-weight: 820;
  line-height: 0.86;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(58px, 12vw, 136px);
}

h2 {
  font-size: clamp(42px, 8vw, 88px);
}

.lede {
  max-width: 720px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 26px);
  line-height: 1.22;
}

.disclaimer,
.wallet,
.game-menu,
.game-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 70%),
    var(--surface);
}

.disclaimer {
  margin-bottom: 14px;
  padding: 16px 18px;
  color: var(--muted);
  line-height: 1.45;
}

.disclaimer strong {
  color: var(--signal);
}

.wallet {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 16px;
}

.wallet div,
.bet-row label {
  display: grid;
  gap: 6px;
}

.wallet span,
.bet-row span,
.cards-table > div > span {
  color: var(--signal);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.wallet strong {
  font-size: clamp(24px, 4vw, 46px);
  line-height: 0.95;
}

.game-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.game-menu {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.game-tab {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 760;
  text-align: left;
  padding: 0 12px;
}

.game-tab.active {
  border-color: rgba(233, 255, 112, 0.55);
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.game-panel {
  min-height: 560px;
  padding: clamp(18px, 4vw, 34px);
  animation: panelIn 360ms ease both;
}

.bet-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 14px;
  align-items: end;
  margin-bottom: 28px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
}

#message {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

#message.message-pop {
  animation: messagePop 360ms ease both;
}

.game-view {
  display: none;
  gap: 22px;
}

.game-view.active {
  display: grid;
  animation: gameIn 280ms ease both;
}

.button {
  display: inline-flex;
  min-height: 42px;
  width: fit-content;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0 20px;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 760;
}

.button-light {
  border: 1px solid #eff2d6;
  background: #f5f7e9;
  color: #11120e;
}

.button-dark {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cards-table {
  display: grid;
  gap: 16px;
}

.cards,
.poker-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 86px;
}

.card {
  position: relative;
  display: grid;
  width: 82px;
  height: 112px;
  place-items: center;
  border: 2px solid rgba(17, 18, 14, 0.18);
  border-radius: 14px;
  background: #f5f5f0;
  color: #050505;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
  font-size: 28px;
  font-weight: 900;
  animation: cardDeal 320ms ease both;
}

.cards .card,
.poker-hand .card {
  color: #050505;
}

.card.red {
  color: #b80000;
}

.hidden-card {
  background:
    linear-gradient(135deg, rgba(233, 255, 112, 0.88), rgba(245, 245, 240, 0.92)),
    #e9ff70;
  color: #050505;
  font-size: 34px;
}

.hidden-card::after {
  position: absolute;
  inset: 10px;
  border: 2px solid rgba(5, 5, 5, 0.18);
  border-radius: 10px;
  content: "";
}

.plinko-stage {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(233, 255, 112, 0.12), transparent 24rem),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
}

.plinko-board {
  position: absolute;
  inset: 0;
}

.peg {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #f5f5f0;
  box-shadow: 0 0 18px rgba(245, 245, 240, 0.35);
  transform: translate(-50%, -50%);
  transition:
    background 120ms ease,
    box-shadow 120ms ease,
    transform 120ms ease;
}

.peg.hit {
  background: var(--signal);
  box-shadow: 0 0 24px rgba(233, 255, 112, 0.82);
  transform: translate(-50%, -50%) scale(1.45);
}

.plinko-slot {
  position: absolute;
  bottom: 16px;
  display: grid;
  width: 9.5%;
  min-height: 58px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 22px;
  font-weight: 820;
  transform: translateX(-50%);
}

.plinko-ball {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 6%;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--signal);
  box-shadow: 0 0 28px rgba(233, 255, 112, 0.65);
  opacity: 0;
  transform: translate(-50%, -50%);
  transition:
    left 135ms cubic-bezier(0.2, 0.9, 0.32, 1.18),
    top 135ms cubic-bezier(0.2, 0.9, 0.32, 1.18),
    transform 135ms ease,
    opacity 160ms ease;
}

.plinko-ball.active {
  opacity: 1;
}

.plinko-ball.settled {
  animation: plinkoSettle 260ms ease both;
}

.rocket-screen {
  position: relative;
  display: grid;
  min-height: 260px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
}

#rocket-multiplier {
  font-size: clamp(54px, 10vw, 120px);
  font-weight: 820;
}

.rocket {
  position: absolute;
  bottom: 26px;
  right: 34px;
  width: 28px;
  height: 64px;
  border-radius: 999px 999px 8px 8px;
  background: var(--signal);
  transition: transform 120ms linear;
}

.slots-reels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.slots-reels span {
  display: grid;
  min-height: 140px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: clamp(42px, 8vw, 88px);
  font-weight: 900;
  text-shadow: 0 0 24px rgba(233, 255, 112, 0.16);
}

.slots-reels span.spinning {
  animation: reelSpin 130ms linear infinite;
}

.slots-reels span.landed {
  animation: reelLand 420ms ease both;
}

.single-action {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

@media (max-width: 800px) {
  .wallet,
  .game-layout,
  .bet-row {
    grid-template-columns: 1fr;
  }

  .game-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plinko-stage {
    min-height: 380px;
  }

}

@media (max-width: 520px) {
  .casino-page {
    width: min(100% - 28px, 1180px);
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes gameIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes messagePop {
  0% {
    opacity: 0.5;
    transform: translateY(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardDeal {
  from {
    opacity: 0;
    transform: translateY(-10px) rotate(-3deg);
  }
}

@keyframes reelSpin {
  0% {
    filter: blur(1px);
    transform: translateY(-8px);
  }
  100% {
    filter: blur(1px);
    transform: translateY(8px);
  }
}

@keyframes reelLand {
  0% {
    transform: scale(0.94);
  }
  60% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes plinkoSettle {
  0% {
    scale: 1;
  }
  50% {
    scale: 1.25;
  }
  100% {
    scale: 1;
  }
}
