:root {
  --bg: #101216;
  --panel: #1d2129;
  --panel-strong: #272c36;
  --panel-soft: rgba(255, 255, 255, 0.055);
  --gold: #f2c14e;
  --gold-dark: #c88d21;
  --green: #30c77a;
  --red: #ff5c6c;
  --blue: #6ec6ff;
  --text: #f8fafc;
  --muted: #aeb7c5;
  --line: rgba(255, 255, 255, 0.13);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(48, 199, 122, 0.18), transparent 30rem),
    radial-gradient(circle at 80% 85%, rgba(242, 193, 78, 0.18), transparent 30rem),
    linear-gradient(135deg, #0d0f13, var(--bg));
}

button {
  font: inherit;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at center, rgba(242, 193, 78, 0.16), transparent 28rem),
    rgba(8, 10, 14, 0.96);
}

.splash-screen.hidden {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.splash-card {
  width: min(100%, 520px);
  padding: clamp(24px, 6vw, 44px);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  background: linear-gradient(145deg, rgba(39, 44, 54, 0.98), rgba(15, 17, 22, 0.98));
  box-shadow: var(--shadow);
}

.splash-card p,
.splash-card span {
  margin: 0;
  color: var(--gold);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.splash-card h2 {
  margin: 16px 0 10px;
  max-width: 100%;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 1;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.splash-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.splash-card button {
  min-width: 180px;
  min-height: 54px;
  margin-top: 26px;
  border: 0;
  border-radius: 8px;
  color: #17120a;
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  cursor: pointer;
  font-weight: 900;
}

.game-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.slot-machine {
  position: relative;
  width: min(100%, 980px);
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(39, 44, 54, 0.97), rgba(22, 25, 31, 0.99));
  box-shadow: var(--shadow);
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.studio-mark,
.version-label,
.tagline,
.interaction-note {
  margin: 0;
}

.studio-mark {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.version-label,
.tagline,
.interaction-note {
  color: var(--muted);
}

.version-label {
  margin-top: 6px;
  font-size: 0.86rem;
}

.game-header {
  text-align: center;
  margin-bottom: 22px;
}

h1 {
  margin: 0;
  max-width: 100%;
  font-size: clamp(1.9rem, 5.2vw, 3.75rem);
  line-height: 1.04;
  letter-spacing: 0;
  text-align: center;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

h1 span {
  display: inline-block;
}

.tagline {
  margin-top: 10px;
  font-size: clamp(0.9rem, 2.3vw, 1rem);
}

.stats-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.game-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: -6px 0 18px;
}

.game-stats div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.game-stats span,
.game-footer p {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.game-stats span,
.game-stats strong {
  display: block;
}

.game-stats strong {
  margin-top: 5px;
  color: var(--text);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.stat {
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 8px;
  color: var(--gold);
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-variant-numeric: tabular-nums;
}

.stat strong.counting {
  animation: countGlow 0.34s ease-in-out;
}

.reels {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(8px, 2vw, 16px);
  padding: clamp(10px, 2.5vw, 18px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent),
    #0c0f14;
}

.reel {
  position: relative;
  aspect-ratio: 1 / 1.12;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(242, 193, 78, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), transparent 42%),
    var(--panel);
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.reel::before,
.reel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  height: 22%;
  pointer-events: none;
}

.reel::before {
  top: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.36), transparent);
}

.reel::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.36), transparent);
}

.reel img {
  position: relative;
  z-index: 0;
  width: 78%;
  height: 78%;
  object-fit: contain;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.35));
  transform: translateZ(0);
}

.reel.spinning {
  border-color: rgba(110, 198, 255, 0.7);
  box-shadow: inset 0 0 24px rgba(110, 198, 255, 0.1);
}

.reel.spinning img {
  animation: reelSpin 0.18s linear infinite;
}

.reel.stopping img {
  animation: reelStop 0.22s ease-out;
}

.reel.win {
  border-color: var(--green);
  box-shadow: 0 0 28px rgba(48, 199, 122, 0.48), inset 0 0 18px rgba(48, 199, 122, 0.12);
  animation: reelWin 0.9s ease-in-out 2, winFlash 0.45s ease-in-out 4;
}

@keyframes reelSpin {
  0% {
    transform: translateY(-62%) scale(0.82);
    opacity: 0.35;
  }
  45% {
    transform: translateY(0) scale(1.08);
    opacity: 1;
  }
  100% {
    transform: translateY(62%) scale(0.82);
    opacity: 0.35;
  }
}

@keyframes reelStop {
  0% {
    transform: translateY(-24%) scale(0.94);
  }
  70% {
    transform: translateY(6%) scale(1.05);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes reelWin {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes winFlash {
  50% {
    filter: brightness(1.3);
  }
}

@keyframes countGlow {
  0%, 100% {
    color: var(--gold);
    text-shadow: none;
  }
  50% {
    color: #fff3b8;
    text-shadow: 0 0 14px rgba(242, 193, 78, 0.9);
  }
}

.message {
  min-height: 40px;
  margin: 18px 0;
  text-align: center;
  color: var(--muted);
  font-size: clamp(1rem, 3vw, 1.45rem);
  font-weight: 900;
}

.message.win,
.message.big-win,
.message.jackpot {
  color: var(--green);
  animation: messagePop 0.54s ease-out;
}

.message.big-win {
  color: var(--gold);
}

.message.jackpot {
  color: #fff3b8;
  text-shadow: 0 0 20px rgba(242, 193, 78, 0.9);
}

.message.lose {
  color: var(--red);
}

@keyframes messagePop {
  0% {
    transform: scale(0.88);
    opacity: 0;
  }
  70% {
    transform: scale(1.08);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

.controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.bet-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(58px, 1fr));
  gap: 10px;
}

.bet-button,
.spin-button,
.icon-button,
.toggle-button,
.reset-button,
.close-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.bet-button {
  min-height: 50px;
  color: var(--text);
  background: var(--panel-strong);
}

.bet-button:hover,
.bet-button.active {
  color: #17120a;
  background: var(--gold);
}

.spin-button {
  min-width: min(42vw, 200px);
  min-height: 74px;
  color: #17120a;
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  box-shadow: 0 12px 28px rgba(242, 193, 78, 0.26);
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.spin-button.spinning {
  animation: spinButtonPulse 0.72s ease-in-out infinite;
}

@keyframes spinButtonPulse {
  50% {
    box-shadow: 0 0 26px rgba(242, 193, 78, 0.5);
  }
}

.icon-button,
.toggle-button,
.close-button {
  color: var(--text);
  background: var(--panel-strong);
}

.icon-button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
}

.toggle-button {
  min-width: 72px;
  min-height: 42px;
  color: #17120a;
  background: var(--green);
}

.toggle-button.off {
  color: var(--text);
  background: #4a5260;
}

.reset-button {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  color: #fff;
  background: #a73543;
}

.close-button {
  width: 38px;
  height: 38px;
  font-size: 1.4rem;
}

.spin-button:hover:not(:disabled),
.bet-button:hover:not(:disabled),
.icon-button:hover,
.toggle-button:hover,
.reset-button:hover,
.close-button:hover {
  transform: translateY(-2px);
}

.spin-button:active:not(:disabled),
.bet-button:active:not(:disabled),
.icon-button:active,
.toggle-button:active,
.reset-button:active,
.close-button:active {
  transform: translateY(1px);
}

.spin-button:disabled,
.bet-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.interaction-note {
  min-height: 18px;
  margin-top: 14px;
  text-align: center;
  font-size: 0.84rem;
}

.game-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.game-footer p {
  margin: 0;
}

.now-playing {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.now-playing span,
.now-playing em {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.now-playing strong {
  min-width: 0;
  color: var(--gold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.62);
}

.settings-panel[hidden] {
  display: none;
}

.settings-card {
  width: min(100%, 440px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1b2028;
  box-shadow: var(--shadow);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.settings-header h2 {
  margin: 0;
  font-size: 1.6rem;
}

.setting-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.setting-row strong,
.setting-row span {
  display: block;
}

.setting-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.volume-control {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.volume-control span {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--text);
}

.volume-control em {
  color: var(--gold);
  font-style: normal;
  font-weight: 900;
}

.volume-control input {
  width: 100%;
  accent-color: var(--gold);
}

.how-to-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text);
}

.how-to-list li {
  margin: 0 0 10px;
  line-height: 1.35;
}

.version-info {
  display: grid;
  gap: 5px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

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

.version-info span {
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 720px) {
  .game-shell {
    padding: 14px;
  }

  h1 {
    font-size: clamp(2rem, 11vw, 3.25rem);
    line-height: 1.02;
  }

  .top-bar {
    align-items: stretch;
  }

  .stats-panel,
  .game-stats,
  .controls {
    grid-template-columns: 1fr;
  }

  .spin-button {
    width: 100%;
  }

  .reels {
    gap: 7px;
  }
}

@media (max-width: 480px) {
  .slot-machine {
    padding: 14px;
  }

  h1 {
    margin-inline: auto;
    overflow-wrap: normal;
  }

  h1 span {
    display: block;
  }

  .top-bar {
    flex-direction: column;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .icon-button {
    width: 100%;
  }

  .stats-panel {
    gap: 8px;
  }

  .stat {
    min-height: 64px;
    padding: 12px;
  }

  .bet-buttons {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  .bet-button {
    min-height: 46px;
  }

  .setting-row {
    grid-template-columns: 1fr;
  }

  .now-playing {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .now-playing strong {
    white-space: normal;
  }
}
