:root {
  color-scheme: light;
  --paper: #f7f1e7;
  --paper-2: #fffaf0;
  --ink: #19130f;
  --muted: #6e6258;
  --red: #bf1834;
  --blue: #133d7c;
  --navy: #071125;
  --green: #1b815f;
  --gold: #d4af37;
  --gold-2: #fff0a3;
  --line: rgba(212, 175, 55, 0.42);
  --shadow: rgba(7, 17, 37, 0.34);
  --gold-border: linear-gradient(135deg, #612807, #f7c948 18%, #fff6bd 38%, #b56f12 58%, #ffe898 76%, #6f320a);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 12px;
  color: var(--ink);
  background: #f1eee7;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.game-shell {
  width: min(100%, 1400px);
  min-height: calc(100vh - 24px);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
  border: 3px solid var(--gold);
  background: linear-gradient(135deg, #1a0b2e 0%, #0a0512 50%, #000000 100%);
}

.top-nav {
  min-height: 54px;
  display: flex;
  align-items: end;
  gap: 34px;
  padding: 12px 24px 8px;
  border-bottom: 1px solid var(--line);
  color: rgba(255, 240, 163, 0.78);
  font-weight: 900;
  text-transform: uppercase;
}

.top-nav a {
  color: var(--gold-2);
  text-decoration: none;
}

.top-nav span {
  font-size: 0.76rem;
}

.language-switcher {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 2px;
}

.language-flag {
  width: 22px;
  height: 16px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(25, 19, 15, 0.24);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.flag-en {
  background:
    linear-gradient(90deg, #1f4e9d 0 42%, transparent 42%),
    repeating-linear-gradient(180deg, #c92235 0 2px, #fff 2px 4px);
}

.flag-es {
  background: linear-gradient(180deg, #c92332 0 25%, #f3c43b 25% 75%, #c92332 75%);
}

.flag-fr {
  background: linear-gradient(90deg, #173f8f 0 33%, #fff 33% 66%, #c92332 66%);
}

.flag-de {
  background: linear-gradient(180deg, #111 0 33%, #d21f2f 33% 66%, #f1c232 66%);
}

.flag-cn {
  background:
    radial-gradient(circle at 30% 30%, #ffd94d 0 2px, transparent 2px),
    #c92332;
}

.text-button {
  border: 0;
  color: inherit;
  background: transparent;
  font-weight: 900;
  text-transform: uppercase;
}

.cabinet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 190px;
  grid-template-areas: "left middle board";
  gap: 12px;
  align-items: start;
  justify-content: center;
  padding: 22px 24px 12px;
}

.left-machine {
  grid-area: left;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  align-self: start;
}

.brand-panel,
.reel-panel,
.side-panel {
  border: 3px solid transparent;
  border-image: var(--gold-border) 1;
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(229, 182, 66, 0.18);
}

.brand-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: 176px auto auto auto;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.06), transparent 40%),
    var(--navy);
}

.logo-loop {
  width: 100%;
  height: 100%;
  min-height: 176px;
  display: block;
  object-fit: contain;
  background: #02040b;
}

.meter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--paper);
}

.meter {
  min-width: 0;
  padding: 0 12px;
  color: var(--ink);
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  line-height: 1;
}

.meter span,
.bet-control span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.meter strong {
  display: block;
  margin-top: 1px;
  color: var(--blue);
  font-size: 1.28rem;
  line-height: 1;
}

.state-banner,
.feature-meter {
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 8px;
  color: #fff;
  text-align: center;
  font-weight: 1000;
  text-transform: uppercase;
}

.state-banner {
  background: #182a58;
}

.state-banner.is-win {
  color: var(--gold-2);
}

.state-banner.is-loss {
  color: #ffd4d4;
}

.state-banner.is-feature {
  color: #fff;
  background: var(--green);
}

.feature-meter {
  min-height: 32px;
  color: var(--gold-2);
  background: #08152b;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1;
  white-space: nowrap;
}

.feature-meter img {
  width: 28px;
  height: 22px;
  flex: 0 0 auto;
  object-fit: cover;
  object-position: top center;
  border: 1px solid rgba(255, 240, 163, 0.65);
}

.reel-panel {
  position: relative;
  border-top: 0;
  background: var(--paper-2);
  overflow: hidden;
}

.reels {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  aspect-ratio: 2.08 / 1;
}

.symbol,
.side-symbol {
  min-width: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.symbol,
.side-symbol {
  position: relative;
  background: #fffaf0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.symbol img,
.side-symbol img,
.symbol video,
.side-symbol video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.symbol.is-video,
.side-symbol.is-video {
  background: #000;
}

.symbol[data-symbol="flag"].is-video video,
.side-symbol[data-symbol="flag"].is-video video {
  height: 125%;
  object-position: center center;
}

.reel-feature-video {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background: #000;
}

.reel-feature-video video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.symbol[data-symbol="wild"] img {
  object-position: top center;
}

.symbol.is-win,
.side-symbol.is-win {
  z-index: 2;
  outline: 4px solid var(--gold);
  box-shadow: inset 0 0 0 4px rgba(255, 240, 163, 0.82), 0 0 22px rgba(229, 182, 66, 0.8);
}

.symbol.is-spinning,
.side-symbol.is-spinning {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 24%, transparent 76%, rgba(0, 0, 0, 0.26)),
    #05030a;
}

.symbol.is-spinning img,
.side-symbol.is-spinning img {
  animation: reelSpinBlur 0.22s ease-in-out infinite alternate;
  filter: blur(5px) saturate(1.18) brightness(0.98);
  opacity: 0.78;
  transform: scaleY(1.08);
  transform-origin: center;
}

@keyframes reelSpinBlur {
  0% {
    filter: blur(3px) saturate(1.05) brightness(0.92);
    opacity: 0.7;
  }

  100% {
    filter: blur(7px) saturate(1.25) brightness(1.12);
    opacity: 0.84;
  }
}

.side-panel {
  grid-area: middle;
  position: relative;
  display: grid;
  grid-template-rows: auto;
  width: 100%;
  align-self: start;
  aspect-ratio: 0.96 / 1;
  background: var(--paper-2);
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.side-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  width: 100%;
  aspect-ratio: 0.96 / 1;
}

.payline-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.payline-path {
  fill: none;
  stroke: var(--line-color);
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 3px var(--line-color));
}

.payline-dot {
  fill: var(--line-color);
  stroke: rgba(0, 0, 0, 0.55);
  stroke-width: 0.45;
  filter: drop-shadow(0 0 2px var(--line-color));
}

.leaderboard {
  grid-area: board;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr auto;
  gap: 12px;
  padding: 10px;
  border-left: 1px solid var(--line);
  color: rgba(255, 244, 207, 0.72);
}

.leaderboard-title {
  color: var(--gold-2);
  font-weight: 1000;
  text-transform: uppercase;
}

.leaderboard ol {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard li,
.you-score,
.players {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8rem;
}

.leaderboard strong,
.you-score strong {
  color: var(--blue);
}

.share-panel {
  align-self: end;
  display: grid;
  gap: 7px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.share-panel > span {
  color: var(--gold-2);
  font-size: 0.74rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.share-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.share-button {
  min-height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--navy);
  border: 1px solid rgba(25, 19, 15, 0.28);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 1000;
  border-radius: 4px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.share-button:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.28);
}

.share-button svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0;
}

.share-x {
  background: #111;
}

.share-whatsapp {
  background: #1f9d55;
}

.share-facebook {
  background: #1f4e9d;
  font-size: 1rem;
}

.share-telegram {
  background: #2680bb;
}

.share-reddit {
  background: #d84a28;
}

.share-email {
  background: #6b625a;
}

.controls {
  display: grid;
  grid-template-columns: 34px minmax(112px, 132px) 34px 100px 62px 62px 76px;
  grid-template-areas: "minus bet plus spin auto refill paytable";
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 16px 0 2px;
}

#decreaseBet {
  grid-area: minus;
}

.bet-control {
  grid-area: bet;
}

#increaseBet {
  grid-area: plus;
}

#spinButton {
  grid-area: spin;
}

#autoSpin {
  grid-area: auto;
}

#refillCredits {
  grid-area: refill;
}

#paytableButton {
  grid-area: paytable;
}

.small-round,
.spin-button,
.secondary-button {
  min-height: 46px;
  border: 0;
  font-weight: 850;
  text-transform: uppercase;
}

.small-round {
  width: 34px;
  min-height: 34px;
  justify-self: center;
  border-radius: 50%;
  color: #12081e;
  background: linear-gradient(180deg, #ffe773, #d4af37);
  border: 1px solid rgba(255, 240, 163, 0.74);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.28);
  font-size: 1.2rem;
  font-weight: 1000;
  line-height: 1;
}

.bet-control {
  min-height: 48px;
  display: grid;
  align-content: center;
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.bet-control input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--blue);
  background: transparent;
  font-size: 1.25rem;
  font-weight: 1000;
  text-align: center;
}

.spin-button {
  width: 100px;
  min-height: 100px;
  border-radius: 50%;
  color: #12081e;
  border: 3px solid rgba(255, 240, 163, 0.9);
  background: radial-gradient(circle at 42% 32%, #fff4a6 0 18%, #ffe05b 19% 54%, #d4af37 55% 100%);
  box-shadow: 0 6px 0 #6f5510, 0 0 30px rgba(212, 175, 55, 0.64);
  font-size: 1.25rem;
  font-weight: 1000;
}

.spin-button:active {
  transform: translateY(5px);
  box-shadow: 0 3px 0 #6a4a09;
}

.secondary-button {
  color: rgba(255, 244, 207, 0.9);
  min-height: 38px;
  background: linear-gradient(180deg, rgba(31, 19, 53, 0.96), rgba(10, 5, 18, 0.96));
  border: 1px solid rgba(212, 175, 55, 0.58);
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.12);
  font-size: 0.84rem;
  font-weight: 800;
}

.secondary-button[aria-pressed="true"] {
  color: #12081e;
  background: linear-gradient(180deg, #ffe773, #d4af37);
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.footer-line {
  display: grid;
  justify-content: center;
  gap: 6px;
  align-content: end;
  min-height: 88px;
  padding: 16px;
  border-top: 1px solid var(--line);
  color: rgba(255, 244, 207, 0.72);
  text-align: center;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.charity-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--gold-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.charity-link img {
  width: 74px;
  height: auto;
  display: block;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7, 17, 37, 0.82);
}

.modal[hidden],
.reel-feature-video[hidden] {
  display: none;
}

.modal-panel {
  width: min(100%, 980px);
  padding: 18px;
  color: #fff;
  background: #08152b;
  border: 3px solid transparent;
  border-image: var(--gold-border) 1;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.modal-panel h2 {
  margin: 0 0 16px;
  color: var(--gold-2);
  font-size: clamp(1.8rem, 5vw, 4rem);
  line-height: 0.95;
  text-align: center;
  text-transform: uppercase;
}

.modal-close {
  justify-self: end;
  min-height: 36px;
  padding: 0 14px;
  color: #fff;
  background: var(--navy);
  border: 1px solid var(--line);
  font-weight: 1000;
  text-transform: uppercase;
}

.paytable-modal {
  display: grid;
  gap: 12px;
}

.paytable-copy {
  display: grid;
  gap: 6px;
  color: #f7f1e7;
  font-weight: 800;
}

.paytable-copy p {
  margin: 0;
}

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

.paytable-item {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px;
  color: #f7f1e7;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.78rem;
  font-weight: 900;
}

.paytable-item img {
  width: 46px;
  height: 34px;
  object-fit: cover;
  border: 1px solid rgba(212, 175, 55, 0.42);
}

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

.feature-card {
  min-width: 0;
  display: grid;
  gap: 9px;
  padding: 8px;
  border: 2px solid transparent;
  border-image: var(--gold-border) 1;
  color: #fff;
  background: #101f3d;
  text-align: left;
}

.feature-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
}

.feature-card strong {
  color: var(--gold-2);
  font-size: 1rem;
  text-transform: uppercase;
}

.feature-card span {
  color: #d8e3ff;
  font-size: 0.82rem;
}

@media (max-width: 980px) {
  .cabinet {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    grid-template-areas:
      "left middle"
      "board board";
  }

  .leaderboard {
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
  }

  .leaderboard ol {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

}

@media (max-width: 780px) {
  body {
    padding: 0;
  }

  .game-shell {
    min-height: 100vh;
    border-left: 0;
    border-right: 0;
  }

  .top-nav {
    gap: 18px;
    overflow-x: auto;
  }

  .language-switcher {
    margin-left: 0;
  }

  .cabinet {
    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "middle"
      "board";
  }

  .cabinet {
    padding: 12px;
  }

  .controls {
    grid-template-columns: 48px minmax(140px, 1fr) 48px;
    grid-template-areas:
      "minus bet plus"
      "spin spin spin"
      "auto refill paytable";
    justify-content: stretch;
  }

  .spin-button,
  .secondary-button {
    grid-column: auto;
  }

  .spin-button {
    width: 112px;
    min-height: 112px;
    grid-column: 1 / -1;
    justify-self: center;
  }

  .secondary-button {
    width: 100%;
  }

  .feature-options {
    grid-template-columns: 1fr;
  }

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

  .leaderboard,
  .leaderboard ol {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .reels {
    aspect-ratio: 2.08 / 1;
  }

  .side-grid {
    aspect-ratio: 0.96 / 1;
  }
}
