:root {
  --forest-900: #0f1a12;
  --forest-800: #142015;
  --bog-900: #1a120b;
  --bark: rgba(40, 30, 20, 0.7);
  --bark-deep: rgba(24, 18, 12, 0.86);
  --gold: #ffd700;
  --gold-soft: #ffe98a;
  --gold-deep: #b8860b;
  --beige: #f5deb3;
  --moss: #7a8f5a;
  --moss-deep: #4d5c3a;
  --autumn: #c9772f;
  --text: #f3ead6;
  --muted: #b8ab90;
  --danger: #e08a7a;
  --font-display: "Cinzel", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-panel: 0 24px 60px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(245, 222, 179, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  background:
    radial-gradient(1100px 760px at 10% -12%, rgba(255, 215, 0, 0.1), transparent 60%),
    radial-gradient(900px 700px at 92% 2%, rgba(245, 222, 179, 0.07), transparent 58%),
    linear-gradient(165deg, var(--forest-900) 0%, var(--forest-800) 42%, var(--bog-900) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    repeating-linear-gradient(102deg, rgba(245, 222, 179, 0.035) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(7deg, rgba(0, 0, 0, 0.16) 0 2px, transparent 2px 12px),
    radial-gradient(circle at 18% 28%, rgba(122, 143, 90, 0.16), transparent 44%),
    radial-gradient(circle at 82% 74%, rgba(90, 60, 30, 0.22), transparent 50%);
  opacity: 0.8;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

::selection {
  background: rgba(255, 215, 0, 0.32);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--gold);
  color: #2a1a0a;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Forest atmosphere */

.canopy {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}

.glow--a {
  width: 520px;
  height: 420px;
  left: -90px;
  top: -130px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.5), rgba(255, 215, 0, 0) 70%);
}

.glow--b {
  width: 620px;
  height: 500px;
  right: -160px;
  top: 16%;
  background: radial-gradient(circle, rgba(245, 222, 179, 0.3), transparent 70%);
}

.glow--c {
  width: 480px;
  height: 380px;
  left: 28%;
  bottom: -180px;
  background: radial-gradient(circle, rgba(122, 143, 90, 0.34), transparent 70%);
}

.leaf-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.leaf {
  position: absolute;
  top: -12vh;
  width: 16px;
  height: 11px;
  border-radius: 0 70% 0 70%;
  background: linear-gradient(135deg, rgba(201, 119, 47, 0.65), rgba(255, 215, 0, 0.28));
  opacity: 0.32;
  animation: leafFall linear infinite;
}

.leaf--1 { left: 6%; animation-duration: 18s; animation-delay: -2s; }
.leaf--2 { left: 18%; animation-duration: 24s; animation-delay: -9s; width: 12px; height: 8px; }
.leaf--3 { left: 31%; animation-duration: 20s; animation-delay: -14s; }
.leaf--4 { left: 44%; animation-duration: 27s; animation-delay: -5s; width: 20px; height: 13px; }
.leaf--5 { left: 57%; animation-duration: 22s; animation-delay: -17s; }
.leaf--6 { left: 69%; animation-duration: 29s; animation-delay: -8s; width: 13px; height: 9px; }
.leaf--7 { left: 81%; animation-duration: 19s; animation-delay: -12s; }
.leaf--8 { left: 92%; animation-duration: 25s; animation-delay: -3s; width: 18px; height: 12px; }

@keyframes leafFall {
  0% {
    transform: translate3d(0, -12vh, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(46px, 55vh, 0) rotate(220deg);
  }
  100% {
    transform: translate3d(-14px, 116vh, 0) rotate(430deg);
  }
}

/* Splash */

.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
  background: radial-gradient(circle at 50% 40%, #162215, #080c08 72%);
  pointer-events: none;
  animation: splashAuto 2.4s ease forwards;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash.is-hidden {
  animation: none;
  opacity: 0;
  visibility: hidden;
}

.splash__text {
  margin: 0;
  color: var(--beige);
  font-size: 0.86rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.splash-acorn {
  position: relative;
  width: 56px;
  height: 64px;
  animation: acornSpin 1.6s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.splash-acorn::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 15px;
  bottom: 0;
  border-radius: 50% 50% 46% 46% / 55% 55% 45% 45%;
  background: radial-gradient(circle at 35% 30%, #fff2a8, #ffd700 45%, #b8860b 76%, #6b3f1a);
  box-shadow: 0 0 32px rgba(255, 215, 0, 0.55);
}

.splash-acorn::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 4px;
  height: 20px;
  border-radius: 50% 50% 35% 35%;
  background: linear-gradient(180deg, #8b5a1a, #4a2c12);
  box-shadow: inset 0 2px 0 rgba(245, 222, 179, 0.32);
}

@keyframes acornSpin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.08); }
  100% { transform: rotate(360deg) scale(1); }
}

@keyframes splashAuto {
  0%, 62% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; }
}

/* Layout */

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
  padding: 14px 0 40px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 215, 0, 0.45);
  border-radius: 18px;
  background:
    repeating-linear-gradient(92deg, rgba(0, 0, 0, 0.12) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, rgba(64, 45, 28, 0.94), rgba(35, 24, 15, 0.9));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(245, 222, 179, 0.18);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3b0, #ffd700 46%, #8b5a1a);
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.brand__text {
  display: grid;
  gap: 1px;
}

.brand__text strong {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand__text small {
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.tabbar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline: auto;
  padding: 5px;
  border: 1px solid rgba(255, 215, 0, 0.16);
  border-radius: 14px;
  background: rgba(20, 14, 8, 0.42);
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 9px 13px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
}

.tab svg {
  flex-shrink: 0;
}

.tab::before {
  content: "";
  position: absolute;
  inset: -8px 8px 12px;
  z-index: -1;
  border-radius: 999px;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 215, 0, 0.55), transparent 70%);
  filter: blur(8px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.tab:hover {
  color: var(--beige);
  background: rgba(255, 215, 0, 0.06);
}

.tab.is-active {
  color: var(--gold);
  background: rgba(255, 215, 0, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.28);
}

.tab.is-active::before {
  opacity: 1;
}

.topbar__balance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 8px 13px;
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 999px;
  background: rgba(10, 15, 10, 0.45);
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Shared surfaces */

.panel {
  border: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(40, 30, 20, 0.74), rgba(24, 18, 12, 0.86));
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(10px);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--gold {
  border: 1px solid rgba(255, 215, 0, 0.5);
  background: rgba(255, 215, 0, 0.13);
  color: var(--gold);
}

.badge--moss {
  border: 1px solid rgba(122, 143, 90, 0.55);
  background: rgba(122, 143, 90, 0.14);
  color: #c3d3a2;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.eyebrow__leaf {
  width: 14px;
  height: 9px;
  border-radius: 0 70% 0 70%;
  background: linear-gradient(135deg, var(--autumn), var(--gold));
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.35);
}

.section {
  padding: 46px 0 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head .eyebrow {
  margin-bottom: 8px;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  font-weight: 600;
  line-height: 1.12;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 0;
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 215, 0, 0.35);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.text-link:hover {
  color: var(--gold-soft);
  border-color: var(--gold-soft);
}

/* Buttons */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid rgba(255, 215, 0, 0.7);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe98a, #ffd700 46%, #b8860b);
  color: #2a1a0a;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px #ffd700, 0 12px 28px rgba(0, 0, 0, 0.4);
  filter: brightness(1.04);
}

.btn:active {
  transform: scale(0.98);
}

.btn--acorn {
  padding-top: 15px;
}

.btn--acorn::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 16%;
  right: 16%;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #7a4a1c, #3f2410);
  box-shadow: inset 0 1px 0 rgba(245, 222, 179, 0.35);
}

.btn--ghost {
  background: rgba(40, 30, 20, 0.6);
  color: var(--beige);
  border-color: rgba(245, 222, 179, 0.34);
  box-shadow: none;
}

.btn--ghost:hover {
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.35);
  color: var(--gold-soft);
}

.btn--sm {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 0.8rem;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 32px;
  align-items: start;
  padding: 48px 0 8px;
}

.hero__copy {
  padding-top: 10px;
}

.hero__title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5.6vw, 4.5rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: 0.01em;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.hero__title-accent {
  color: transparent;
  background: linear-gradient(100deg, #fff3b0 0%, #ffd700 42%, #c9772f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 24px rgba(255, 215, 0, 0.25));
}

.hero__lead {
  max-width: 48ch;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.68;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 26px;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.stat-chip {
  min-width: 104px;
  padding: 10px 14px;
  border: 1px solid rgba(245, 222, 179, 0.18);
  border-radius: var(--radius-md);
  background: rgba(40, 30, 20, 0.5);
}

.stat-chip dt {
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stat-chip dd {
  margin: 3px 0 0;
  font-family: var(--font-display);
  font-size: 1.16rem;
  color: var(--gold);
}

.hero__note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 46ch;
  margin-top: 24px;
  padding: 12px 14px;
  border-left: 2px solid rgba(255, 215, 0, 0.5);
  border-radius: 0 12px 12px 0;
  background: rgba(20, 28, 18, 0.4);
  color: var(--muted);
  font-size: 0.84rem;
}

.hero__note p {
  margin: 0;
}

.hero__note-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

/* Plinko board */

.board-panel {
  padding: 18px;
  overflow: hidden;
}

.board-panel::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -70px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.16), transparent 70%);
  pointer-events: none;
}

.board-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.board-panel__kicker {
  margin: 0 0 2px;
  color: var(--moss);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.board-panel__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
}

.plinko-board {
  position: relative;
  height: 470px;
  border: 1px solid rgba(245, 222, 179, 0.16);
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 215, 0, 0.14), transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(122, 143, 90, 0.2), transparent 62%),
    linear-gradient(180deg, #0b120c, #161009);
  box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.62);
  touch-action: manipulation;
}

.plinko-board__beam {
  position: absolute;
  top: 0;
  left: 50%;
  width: 62%;
  height: 76%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.24), rgba(255, 215, 0, 0) 72%);
  clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%);
  filter: blur(10px);
  opacity: 0.55;
  pointer-events: none;
}

.plinko-pegs,
.plinko-balls {
  position: absolute;
  inset: 0;
}

.plinko-pegs {
  z-index: 1;
}

.plinko-balls {
  z-index: 3;
  pointer-events: none;
}

.peg {
  position: absolute;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
}

.peg::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50% 50% 42% 42% / 70% 70% 30% 30%;
  background: radial-gradient(circle at 35% 25%, #f5deb3, #c9772f 46%, #6b3f1a);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45), 0 0 10px rgba(255, 215, 0, 0.16);
}

.peg::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 6px;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 0 0 4px 4px;
  background: linear-gradient(#f5deb3, #8b5a1a);
}

.peg--gold::before {
  background: radial-gradient(circle at 35% 25%, #fff3b0, #ffd700 46%, #8b5a1a);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
}

.peg--branch {
  width: 28px;
  height: 8px;
  border-radius: 999px;
  transform: translate(-50%, -50%) rotate(-18deg);
  background: linear-gradient(90deg, #4a2c12, #8b5a1a 45%, #4a2c12);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.peg--branch::before,
.peg--branch::after {
  display: none;
}

.acorn-ball {
  position: absolute;
  top: 0;
  left: 0;
  width: 22px;
  height: 24px;
  z-index: 4;
  will-change: transform;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.45));
}

.acorn-ball::before {
  content: "";
  position: absolute;
  inset: 4px 0 0;
  border-radius: 50% 50% 46% 46% / 55% 55% 45% 45%;
  background: radial-gradient(circle at 35% 30%, #fff2a8, #ffd700 42%, #b8860b 72%, #6b3f1a);
}

.acorn-ball::after {
  content: "";
  position: absolute;
  top: 0;
  left: 2px;
  right: 2px;
  height: 10px;
  border-radius: 50% 50% 30% 30%;
  background: linear-gradient(180deg, #8b5a1a, #4a2c12);
  box-shadow: inset 0 1px 0 rgba(245, 222, 179, 0.3);
}

.plinko-slots {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 4px;
}

.slot {
  display: grid;
  place-items: center;
  height: 38px;
  border: 1px solid rgba(255, 215, 0, 0.55);
  border-radius: 8px;
  background: linear-gradient(180deg, #f5deb3, #c9a96a);
  color: #2a1a0a;
  font-size: 0.7rem;
  font-weight: 700;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.slot--high {
  background: linear-gradient(180deg, #fff3b0, #ffd700);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2), 0 0 14px rgba(255, 215, 0, 0.32);
}

.slot--low {
  background: linear-gradient(180deg, #9aa878, #5f6b45);
  border-color: rgba(122, 143, 90, 0.7);
  color: #f3ead6;
}

.slot.is-hit {
  animation: slotHit 0.6s ease;
}

@keyframes slotHit {
  0%, 100% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-4px) scale(1.08); box-shadow: 0 0 24px rgba(255, 215, 0, 0.75); }
}

.board-result {
  min-height: 1.3em;
  margin: 12px 0 0;
  color: var(--beige);
  font-size: 0.88rem;
}

.board-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-top: 12px;
}

.bet-control {
  flex: 1 1 170px;
}

.bet-control label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.bet-control__row {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(245, 222, 179, 0.22);
  border-radius: 12px;
  background: rgba(10, 15, 10, 0.58);
}

.bet-step {
  width: 42px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.bet-step:hover {
  background: rgba(255, 215, 0, 0.08);
}

#betAmount {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 10px 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  -moz-appearance: textfield;
}

#betAmount::-webkit-outer-spin-button,
#betAmount::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.bet-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bet-presets button {
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid rgba(245, 222, 179, 0.2);
  border-radius: 999px;
  background: rgba(40, 30, 20, 0.55);
  color: var(--beige);
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.bet-presets button:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(255, 215, 0, 0.08);
}

.btn--drop {
  flex: 1 1 100%;
  min-height: 50px;
}

/* Game cards */

.game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.game-card {
  position: relative;
  display: flex;
  min-height: 268px;
  border: 1px solid rgba(255, 215, 0, 0.38);
  border-radius: var(--radius-lg);
  overflow: hidden;
  isolation: isolate;
  background: #10160f;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.game-card:hover {
  border-color: rgba(255, 215, 0, 0.72);
  transform: translateY(-3px);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.4), 0 0 26px rgba(255, 215, 0, 0.12);
}

.game-card__media {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(201, 119, 47, 0.45), transparent 60%),
    radial-gradient(circle at 72% 82%, rgba(122, 143, 90, 0.45), transparent 62%),
    linear-gradient(160deg, #1b2a18, #1a120b);
}

.game-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.82) saturate(1.06);
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.game-card:hover .game-card__media img {
  transform: scale(1.06);
}

.game-card__media.is-fallback img {
  opacity: 0;
}

.game-card__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  padding: 16px;
  background: linear-gradient(180deg, transparent 18%, rgba(10, 15, 10, 0.9) 82%);
}

.game-card__body .badge {
  align-self: flex-start;
  margin-bottom: 8px;
}

.game-card__body h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 600;
}

.game-card__body p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.game-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 999px;
  background: rgba(255, 215, 0, 0.08);
  color: var(--gold);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  transition: gap 0.2s ease, color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.game-card__link:hover {
  gap: 10px;
  color: var(--gold-soft);
  border-color: rgba(255, 215, 0, 0.6);
  background: rgba(255, 215, 0, 0.14);
}

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 46px;
  padding: 26px 28px;
  background:
    radial-gradient(circle at 8% 20%, rgba(255, 215, 0, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(40, 30, 20, 0.76), rgba(24, 18, 12, 0.88));
}

.cta-band .eyebrow {
  margin-bottom: 8px;
}

.cta-band__text {
  margin: 8px 0 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Profile */

.profile-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 28px;
  margin-top: 34px;
  padding: 28px;
  background:
    radial-gradient(circle at 12% 30%, rgba(201, 119, 47, 0.16), transparent 40%),
    linear-gradient(180deg, rgba(40, 30, 20, 0.76), rgba(24, 18, 12, 0.88));
}

.avatar-wreath {
  position: relative;
  display: grid;
  place-items: center;
  width: 136px;
  height: 136px;
  border-radius: 50%;
  background: conic-gradient(from 20deg, #8b5a1a, #ffd700, #f5deb3, #b8860b, #ffd700, #8b5a1a);
  box-shadow: 0 0 32px rgba(255, 215, 0, 0.35), inset 0 0 0 2px rgba(58, 36, 16, 0.6);
}

.avatar-wreath::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #1c2a1a, #0b120c 72%);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.7);
}

.avatar-wreath::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 215, 0, 0.35);
  animation: wreathSpin 28s linear infinite;
}

@keyframes wreathSpin {
  to { transform: rotate(360deg); }
}

.avatar-core {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 98px;
  height: 98px;
  border: 1px solid rgba(255, 215, 0, 0.42);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, rgba(255, 215, 0, 0.18), rgba(20, 30, 18, 0.92));
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.45);
}

.profile-name {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 600;
  line-height: 1.05;
}

.profile-handle {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.avatar-core img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px;
}

.stat {
  flex: 1 1 160px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat__value {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--gold);
  word-break: break-all;
}

.stat__value small {
  font-size: 0.9rem;
}

.stat__label {
  margin: 0;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.treasure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.chest {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(40, 30, 20, 0.74), rgba(24, 18, 12, 0.86));
  box-shadow: var(--shadow-panel);
}

.chest__art {
  position: relative;
  width: 86px;
  height: 70px;
  flex-shrink: 0;
}

.chest__lid {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 6px;
  height: 28px;
  border: 1px solid rgba(58, 36, 16, 0.85);
  border-radius: 14px 14px 4px 4px;
  background: linear-gradient(180deg, #ffe98a, #d4a017 58%, #8b5a1a);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), 0 6px 14px rgba(0, 0, 0, 0.35);
}

.chest__body {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 4px;
  height: 36px;
  border: 1px solid rgba(58, 36, 16, 0.9);
  border-radius: 4px 4px 10px 10px;
  background: linear-gradient(180deg, #8b5a1a, #4a2c12);
  box-shadow: inset 0 1px 0 rgba(245, 222, 179, 0.25);
}

.chest__lock {
  position: absolute;
  left: 50%;
  top: 26px;
  width: 16px;
  height: 20px;
  transform: translateX(-50%);
  border: 1px solid #3a2410;
  border-radius: 4px;
  background: linear-gradient(180deg, #ffd700, #8b5a1a);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.chest__lock::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -8px;
  width: 10px;
  height: 10px;
  transform: translateX(-50%);
  border: 2px solid #ffd700;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}

.chest--ton .chest__lid {
  background: linear-gradient(180deg, #d9f0ff, #7fb7c9 58%, #2f5d54);
}

.chest--ton .chest__body {
  background: linear-gradient(180deg, #2f5d54, #16302b);
}

.chest--ton .chest__lock {
  background: linear-gradient(180deg, #bff3e2, #2f8f7a);
  box-shadow: 0 0 12px rgba(127, 220, 190, 0.4);
}

.chest--ton .chest__lock::before {
  border-color: #bff3e2;
}

.chest__info {
  min-width: 0;
}

.chest__label {
  margin: 0;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.chest__value {
  margin: 2px 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--gold);
  line-height: 1.1;
}

.chest__value small {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--beige);
}

.chest__hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.history {
  padding: 4px 18px;
  overflow: hidden;
}

.history table {
  width: 100%;
  border-collapse: collapse;
}

.history th,
.history td {
  padding: 13px 10px;
  border-bottom: 1px solid rgba(245, 222, 179, 0.1);
  text-align: left;
  font-size: 0.86rem;
}

.history thead th {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.history tbody th {
  color: var(--beige);
  font-weight: 600;
}

.history tbody tr:last-child th,
.history tbody tr:last-child td {
  border-bottom: 0;
}

.history .is-win {
  color: #a9d68b;
  font-weight: 600;
}

.history .is-loss {
  color: var(--danger);
  font-weight: 600;
}

/* Footer */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 46px;
  padding: 24px 0 8px;
  border-top: 1px solid rgba(245, 222, 179, 0.12);
  color: var(--muted);
  font-size: 0.78rem;
}

.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--beige);
  font-weight: 500;
}

.footer__note {
  margin: 0;
  max-width: 48ch;
  text-align: right;
}

/* Feedback */

.win-glow {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 44%, rgba(255, 215, 0, 0.55), rgba(255, 215, 0, 0.12) 36%, transparent 66%);
}

.win-glow.is-active {
  animation: winPulse 1.05s ease-out;
}

@keyframes winPulse {
  0% { opacity: 0; }
  22% { opacity: 0.92; }
  100% { opacity: 0; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 70;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: var(--radius-md);
  background: rgba(20, 28, 18, 0.96);
  color: var(--beige);
  font-size: 0.9rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.14);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast strong {
  color: var(--gold);
}

.toast--loss {
  border-color: rgba(224, 138, 122, 0.5);
}

.toast--loss strong {
  color: var(--danger);
}

/* Responsive */

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 26px;
    padding-top: 32px;
  }

  .hero__copy {
    padding-top: 0;
  }

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

  .treasure-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 84px;
  }

  .app-shell {
    width: calc(100% - 24px);
    padding-bottom: 116px;
  }

  .topbar {
    top: 8px;
    gap: 10px;
    padding: 9px 12px;
    backdrop-filter: none;
  }

  .brand__text small {
    display: none;
  }

  .brand__text strong {
    font-size: 0.9rem;
  }

  .brand__mark {
    width: 36px;
    height: 36px;
  }

  .tabbar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 50;
    margin: 0;
    padding: 7px;
    border-color: rgba(255, 215, 0, 0.4);
    background:
      repeating-linear-gradient(92deg, rgba(0, 0, 0, 0.12) 0 2px, transparent 2px 9px),
      linear-gradient(180deg, rgba(64, 45, 28, 0.96), rgba(35, 24, 15, 0.94));
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(245, 222, 179, 0.18);
    backdrop-filter: blur(12px);
  }

  .tab {
    flex: 1;
    flex-direction: column;
    gap: 3px;
    padding: 7px 4px;
    font-size: 0.66rem;
  }

  .tab::before {
    inset: 2px 4px 4px;
  }

  .topbar__balance {
    margin-left: auto;
    padding: 7px 10px;
    font-size: 0.78rem;
  }

  .hero {
    padding-top: 24px;
  }

  .hero__title {
    font-size: clamp(2.2rem, 10vw, 3.2rem);
  }

  .hero__lead {
    font-size: 0.98rem;
  }

  .plinko-board {
    height: 410px;
  }

  .board-panel {
    padding: 14px;
  }

  .section {
    padding-top: 36px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .game-card {
    min-height: 236px;
  }

  .cta-band {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 22px;
  }

  .profile-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 18px;
    margin-top: 24px;
    padding: 22px;
  }

  .profile-actions {
    justify-content: center;
  }

  .chest {
    grid-template-columns: auto 1fr;
  }

  .chest .btn {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .history {
    padding: 4px 14px;
  }

  .history table,
  .history thead,
  .history tbody,
  .history tr,
  .history th,
  .history td {
    display: block;
  }

  .history thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .history tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 14px;
    padding: 13px 0;
    border-bottom: 1px solid rgba(245, 222, 179, 0.1);
  }

  .history tbody tr:last-child {
    border-bottom: 0;
  }

  .history tbody th {
    grid-column: 1 / -1;
    padding: 0;
    border: 0;
    font-size: 0.98rem;
  }

  .history tbody td {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 0;
    border: 0;
    font-size: 0.8rem;
  }

  .history tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
  }

  .history tbody td:last-child {
    grid-column: 1 / -1;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 36px;
  }

  .footer__note {
    text-align: left;
  }

  .toast {
    bottom: 94px;
  }
}

@media (max-width: 520px) {
  .acorn-ball {
    width: 18px;
    height: 20px;
  }

  .game-grid {
    grid-template-columns: 1fr;
  }

  .game-card {
    min-height: 220px;
  }

  .bet-presets button {
    flex: 1;
  }

  .stat-chip {
    flex: 1 1 30%;
    min-width: 0;
    padding: 9px 10px;
  }

  .stat-chip dd {
    font-size: 1rem;
  }

  .chest__value {
    font-size: 1.45rem;
  }
}

/* Balance duo (hero) */

.balance-duo {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.balance-stars,
.balance-ton {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.balance-stars {
  border: 1px solid rgba(255, 215, 0, 0.35);
  background: rgba(20, 14, 8, 0.55);
  color: var(--gold);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 215, 0, 0.16);
}

.balance-ton {
  border: 1px solid rgba(127, 183, 201, 0.45);
  background: rgba(10, 20, 18, 0.55);
  color: #a9dbe8;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(127, 183, 201, 0.2);
}

.balance-stars svg,
.balance-ton svg {
  flex-shrink: 0;
}

/* Currency toggle (bet controls) */

.currency-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.currency-control__label {
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.currency-toggle {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(245, 222, 179, 0.22);
  border-radius: 999px;
  background: rgba(10, 15, 10, 0.58);
}

.currency-btn {
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.currency-btn:hover {
  color: var(--beige);
}

.currency-btn.active {
  border-color: rgba(255, 215, 0, 0.45);
  background: rgba(255, 215, 0, 0.14);
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.25), 0 6px 18px rgba(255, 215, 0, 0.14);
}

@media (max-width: 520px) {
  .balance-duo {
    gap: 8px;
  }

  .balance-stars,
  .balance-ton {
    padding: 8px 12px;
    font-size: 0.84rem;
  }

  .currency-btn {
    min-height: 44px;
    padding: 8px 12px;
  }
}

/* Admin panel */

.admin-panel {
  padding: 20px;
  margin-bottom: 18px;
}

.admin-panel__title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gold);
}

.admin-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 8px;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-field--grow {
  flex: 1 1 200px;
}

.admin-field label {
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.admin-field input,
.admin-field select {
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid rgba(245, 222, 179, 0.22);
  border-radius: 10px;
  background: rgba(10, 15, 10, 0.58);
  color: var(--text);
  font-size: 0.9rem;
}

.admin-field input:focus,
.admin-field select:focus {
  border-color: var(--gold);
  outline: none;
}

.admin-status {
  min-height: 1.2em;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.admin-status.is-error {
  color: var(--danger);
}

.admin-status.is-ok {
  color: var(--gold);
}

@media (max-width: 520px) {
  .admin-panel {
    padding: 14px;
  }

  .admin-form {
    align-items: stretch;
  }

  .admin-field,
  .admin-field--grow {
    flex: 1 1 100%;
  }
}

@supports not (backdrop-filter: blur(10px)) {
  .topbar,
  .panel,
  .tabbar {
    background-color: rgba(30, 22, 14, 0.96);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .leaf-field,
  .splash,
  .win-glow {
    display: none;
  }

  .avatar-wreath::after {
    animation: none;
  }
}
