/* =========================
   ROOT: POSITION & SIZE CONTROLS
   Меняешь только переменные
========================= */

:root {
  --scene-width: 1920px;
  --scene-height: 1080px;

  /* Intro */
  --intro-title-top: 32%;
  --intro-title-left: 50%;
  --intro-title-font-size: 100px;
  --intro-play-top: 55%;
  --intro-play-left: 50%;
  --intro-play-width: 180px;

  /* Sound toggle */
  --sound-toggle-top: 24px;
  --sound-toggle-right: 32px;
  --sound-toggle-size: 54px;

  /* MAIN screen */
  --main-title-top: 80px;
  --main-title-left: 50%;
  --main-title-font-size: 80px;

  --main-logo-top: 50%;
  --main-logo-left: 50%;
  --main-logo-width: 380px;

  --bottom-nav-bottom: 26px;
  --bottom-nav-right: 40px;
  --bottom-nav-gap: 26px;
  --bottom-nav-font-size: 40px;

  --play-game-bottom: 26px;
  --play-game-left: 40px;
  --play-game-font-size: 26px;

  /* ABOUT screen */
  --about-title-top: 50px;
  --about-title-left: 50%;
  --about-title-font-size: 80px;

  --about-tablet-top: 180px;
  --about-tablet-left: 50%;
  --about-tablet-width: 680px;

  --about-text-padding-x: 40px;
  --about-text-padding-y: 48px;

  /* CHART block */
  --chart-block-top: 250px;
  --chart-block-left: 5%;
  --chart-block-width: 720px;
  --chart-title-font-size: 50px;
  --chart-frame-height: 380px;

  /* GAME block */
  --game-block-top: 170px;
  --game-block-right: 5%;
  --game-block-width: 640px;
  --game-title-font-size: 50px;

  --slot-frame-height: 380px;

  /* Balance */
  --game-balance-top-offset: 20px;

  /* Colors */
  --bg-intro-image: url("bg_sog_intro.png");
  --bg-main-image: url("bg_sog_main.png");
  --bg-about-image: url("bg_sog_about.png");
  --bg-chart-game-image: url("bg_sog_chart_game.png");

  --color-red: #ff2b2b;
  --color-dark: #050505;
  --color-gray: #757575;
  --color-light: #f5f5f5;
}

/* =========================
   BASE
========================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #000;
  color: #fff;
}

.page-wrapper {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

/* =========================
   SCREENS
========================= */

.screen {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
}

.screen-intro {
  background-image: var(--bg-intro-image);
}

.screen-main {
  background-image: var(--bg-main-image);
}

.screen-about {
  background-image: var(--bg-about-image);
}

.screen-chart-game {
  background-image: var(--bg-chart-game-image);
}

/* =========================
   INTRO
========================= */

.intro-title {
  position: absolute;
  top: var(--intro-title-top);
  left: var(--intro-title-left);
  transform: translate(-50%, -50%);
  font-family: "Irish Grover", system-ui, cursive;
  font-size: var(--intro-title-font-size);
  color: var(--color-red);
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.06em;
  animation: intro-pulse 2.2s ease-in-out infinite;
}

.intro-play-btn {
  position: absolute;
  top: var(--intro-play-top);
  left: var(--intro-play-left);
  transform: translate(-50%, -50%);
  width: var(--intro-play-width);
  height: auto;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  animation: play-bounce 1.8s ease-in-out infinite;
}

.intro-play-btn img {
  width: 100%;
  height: auto;
  display: block;
}

@keyframes intro-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    text-shadow: 0 0 12px rgba(0, 0, 0, 0.9);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.06);
    text-shadow: 0 0 18px rgba(255, 43, 43, 0.9);
  }
}

@keyframes play-bounce {
  0%,
  100% {
    transform: translate(-50%, -50%) translateY(0);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-10px);
  }
}

/* =========================
   SOUND TOGGLE
========================= */

.sound-toggle {
  position: fixed;
  top: var(--sound-toggle-top);
  right: var(--sound-toggle-right);
  width: var(--sound-toggle-size);
  height: var(--sound-toggle-size);
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease,
    opacity 0.2s ease;
}

.sound-toggle img {
  width: 70%;
  height: auto;
  display: block;
}

.sound-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

.sound-toggle.muted {
  filter: grayscale(1) brightness(0.7);
  box-shadow: none;
}

.sound-toggle.hidden {
  opacity: 0;
  pointer-events: none;
}

/* =========================
   MAIN
========================= */

.main-title {
  position: absolute;
  top: var(--main-title-top);
  left: var(--main-title-left);
  transform: translateX(-50%);
  margin: 0;
  font-family: "Irish Grover", system-ui, cursive;
  font-size: var(--main-title-font-size);
  color: var(--color-red);
  letter-spacing: 0.08em;
  text-shadow: 0 0 10px rgba(0, 0, 0, 1);
  animation: title-flicker 2.8s infinite;
}

.main-logo-wrapper {
  position: absolute;
  top: var(--main-logo-top);
  left: var(--main-logo-left);
  transform: translate(-50%, -50%);
  width: var(--main-logo-width);
  max-width: 70vw;
  filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.9));
  animation: chip-spin 6s linear infinite;
}

.main-logo-image {
  width: 100%;
  height: auto;
  display: block;
}

@keyframes title-flicker {
  0%,
  18%,
  22%,
  100% {
    opacity: 1;
  }
  19%,
  21% {
    opacity: 0.2;
  }
}

@keyframes chip-spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Bottom nav */

.bottom-nav {
  position: absolute;
  right: var(--bottom-nav-right);
  bottom: var(--bottom-nav-bottom);
  display: flex;
  gap: var(--bottom-nav-gap);
}

.nav-link {
  border: none;
  background: none;
  padding: 0;
  font-family: "Irish Grover", system-ui, cursive;
  font-size: var(--bottom-nav-font-size);
  color: var(--color-red);
  cursor: pointer;
  text-shadow: 0 0 8px rgba(0, 0, 0, 1);
  transition: transform 0.15s ease, text-shadow 0.15s ease;
}

.nav-link:hover {
  transform: translateY(-2px);
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.8);
}

/* Play game btn */

.play-game-btn {
  position: absolute;
  left: var(--play-game-left);
  bottom: var(--play-game-bottom);
  border: none;
  background: none;
  padding: 0;
  font-family: "Irish Grover", system-ui, cursive;
  font-size: var(--play-game-font-size);
  color: var(--color-red);
  cursor: pointer;
  text-shadow: 0 0 8px rgba(0, 0, 0, 1);
  transition: transform 0.15s ease, text-shadow 0.15s ease;
}

.play-game-btn:hover {
  transform: translateY(-2px);
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.8);
}

/* =========================
   ABOUT
========================= */

.about-title {
  position: absolute;
  top: var(--about-title-top);
  left: var(--about-title-left);
  transform: translateX(-50%);
  margin: 0;
  font-family: "Irish Grover", system-ui, cursive;
  font-size: var(--about-title-font-size);
  letter-spacing: 0.12em;
  color: var(--color-red);
  text-shadow: 0 0 10px rgba(0, 0, 0, 1);
}

.about-tablet {
  position: absolute;
  top: var(--about-tablet-top);
  left: var(--about-tablet-left);
  transform: translateX(-50%);
  width: var(--about-tablet-width);
  max-width: 90vw;
}

.about-tablet-frame {
  width: 100%;
  height: auto;
  display: block;
}

.about-text-wrapper {
  position: absolute;
  inset: var(--about-text-padding-y) var(--about-text-padding-x);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;

  color: #000000; /* черный цвет текста */
  font-family: "Irish Grover", system-ui, cursive; /* наш шрифт */
  font-size: 18px;
  font-weight: 400;

  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1.2s ease 0.3s, transform 1.2s ease 0.3s;
}

.about-text-wrapper.visible {
  opacity: 1;
  transform: translateY(0);
}

.about-text-wrapper p {
  margin: 10px 0;
}

/* Flying fruits */

.fruits-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.fruit {
  position: absolute;
  width: 120px;
  height: auto;
  animation: fruit-fall linear infinite;
  opacity: 0;
}

@keyframes fruit-fall {
  0% {
    transform: translate3d(0, -20%, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translate3d(0, 120vh, 0) rotate(360deg);
    opacity: 0;
  }
}

/* разные траектории */
.fruit-1 { left: 10%; animation-duration: 14s; animation-delay: 0s; }
.fruit-2 { left: 25%; animation-duration: 17s; animation-delay: 2s; }
.fruit-3 { left: 40%; animation-duration: 16s; animation-delay: 4s; }
.fruit-4 { left: 55%; animation-duration: 15s; animation-delay: 1s; }
.fruit-5 { left: 70%; animation-duration: 18s; animation-delay: 3s; }
.fruit-6 { left: 82%; animation-duration: 19s; animation-delay: 5s; }
.fruit-7 { left: 92%; animation-duration: 16s; animation-delay: 6s; }

/* =========================
   CHART + GAME
========================= */

.screen-chart-game {
  display: block;
}

/* CHART block */

.chart-block {
  position: absolute;
  top: var(--chart-block-top);
  left: var(--chart-block-left);
  width: var(--chart-block-width);
  max-width: 90vw;
}

.chart-title {
  margin: 0 0 12px;
  font-family: "Irish Grover", system-ui, cursive;
  font-size: var(--chart-title-font-size);
  color: var(--color-red);
  letter-spacing: 0.12em;
  text-shadow: 0 0 10px rgba(0, 0, 0, 1);
}

.chart-frame {
  width: 100%;
  height: var(--chart-frame-height);
  border-radius: 20px;
  overflow: hidden;
  background: radial-gradient(circle at top, #333 0%, #050505 55%, #000 100%);
  box-shadow:
    0 0 0 2px #444,
    0 0 0 4px #111,
    0 0 28px rgba(0, 0, 0, 0.8);
  position: relative;
}

.chart-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 0, 0, 0.3),
    transparent,
    rgba(255, 255, 255, 0.4)
  );
  mix-blend-mode: overlay;
  opacity: 0.15;
  pointer-events: none;
}

.chart-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* GAME block */

.game-block {
  position: absolute;
  top: var(--game-block-top);
  right: var(--game-block-right);
  width: var(--game-block-width);
  max-width: 90vw;
}

.game-title {
  margin: 0 0 12px;
  font-family: "Irish Grover", system-ui, cursive;
  font-size: var(--game-title-font-size);
  color: var(--color-red);
  letter-spacing: 0.12em;
  text-shadow: 0 0 10px rgba(0, 0, 0, 1);
}

.game-disclaimer {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f0f0f0;
  opacity: 0.7;
  margin-bottom: 10px;
}

/* Balance */

.game-balance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.9);
  margin-bottom: var(--game-balance-top-offset);
}

.token-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.balance-label {
  font-size: 14px;
  text-transform: uppercase;
  opacity: 0.8;
}

#tokenBalance {
  font-weight: 700;
  font-size: 18px;
  color: #ffffff;
}

.balance-unit {
  font-size: 12px;
  opacity: 0.8;
}

/* SLOT FRAME */

.slot-frame {
  position: relative;
  width: 100%;
  height: var(--slot-frame-height);
  margin-top: 18px;
  border-radius: 22px;
  padding: 18px 18px 20px;
  background:
    radial-gradient(circle at top, #ff2b2b 0, #3b0000 35%, #050505 100%);
  box-shadow:
    0 0 0 2px #a3a3a3,
    0 0 0 4px #000,
    0 0 30px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

.slot-frame::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 20px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.18),
    rgba(0, 0, 0, 0.9),
    rgba(255, 0, 0, 0.3)
  );
  opacity: 0.85;
  z-index: 0;
}

.slot-header {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 14px;
  font-family: "Irish Grover", system-ui, cursive;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow:
    0 0 8px rgba(0, 0, 0, 1),
    0 0 12px rgba(255, 255, 255, 0.6);
}

.slot-reels {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 12px;
}

.slot-reel {
  width: 110px;
  height: 140px;
  border-radius: 14px;
  background: radial-gradient(circle at top, #ffffff 0%, #d0d0d0 35%, #555 100%);
  box-shadow:
    0 0 0 2px #111,
    inset 0 0 10px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.slot-reel img {
  width: 80%;
  height: auto;
  display: block;
}

/* Spinning animation */

.slot-reel.spinning {
  animation: reel-spin 0.5s linear infinite;
}

@keyframes reel-spin {
  0% {
    transform: translateY(-10%);
  }
  50% {
    transform: translateY(10%);
  }
  100% {
    transform: translateY(-10%);
  }
}

/* Controls */

.slot-controls {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.spin-button {
  padding: 10px 40px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  background: radial-gradient(circle at top, #ff4b4b 0%, #8b0000 80%);
  color: #ffffff;
  font-family: "Irish Grover", system-ui, cursive;
  font-size: 24px;
  letter-spacing: 0.16em;
  cursor: pointer;
  text-shadow: 0 0 8px rgba(0, 0, 0, 1);
  box-shadow:
    0 5px 0 #2b0000,
    0 0 14px rgba(0, 0, 0, 0.9);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.spin-button:hover {
  transform: translateY(-2px);
  box-shadow:
    0 7px 0 #2b0000,
    0 0 18px rgba(255, 255, 255, 0.4);
}

.spin-button:active {
  transform: translateY(1px);
  box-shadow:
    0 2px 0 #2b0000,
    0 0 10px rgba(0, 0, 0, 0.8);
}

/* Slot message */

.slot-message {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #ffffff;
}

/* =========================
   TOAST
========================= */

.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(20px);
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.9);
  color: #ffffff;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1024px) {
  :root {
    --intro-title-font-size: 52px;
    --intro-play-width: 100px;
    --main-title-font-size: 46px;
    --main-logo-width: 260px;
    --bottom-nav-font-size: 20px;
    --play-game-font-size: 20px;

    --about-tablet-width: 520px;
    --about-title-font-size: 42px;

    --chart-block-left: 50%;
    --chart-block-top: 120px;
    --chart-block-width: 80vw;
    --chart-frame-height: 300px;

    --game-block-top: 460px;
    --game-block-right: 50%;
    --game-block-width: 80vw;
    --slot-frame-height: 380px;
  }

  .chart-block {
    transform: translateX(-50%);
  }

  .game-block {
    transform: translateX(50%);
  }
}

@media (max-width: 768px) {
  :root {
    --intro-title-font-size: 40px;
    --intro-play-width: 86px;

    --main-title-top: 70px;
    --main-title-font-size: 34px;
    --main-logo-top: 55%;
    --main-logo-width: 230px;

    --bottom-nav-font-size: 14px;
    --bottom-nav-gap: 14px;
    --play-game-font-size: 14px;

    --about-title-top: 40px;
    --about-title-font-size: 32px;
    --about-tablet-top: 140px;
    --about-tablet-width: 90vw;

    --chart-block-top: 110px;
    --chart-frame-height: 230px;

    --game-block-top: 440px;
    --slot-frame-height: 360px;
  }

  .slot-reel {
    width: 90px;
    height: 120px;
  }
}

@media (max-width: 480px) {
  :root {
    --sound-toggle-size: 44px;

    --main-title-font-size: 30px;
    --bottom-nav-font-size: 12px;
    --play-game-font-size: 12px;

    --chart-title-font-size: 32px;
    --game-title-font-size: 32px;
  }

  .game-disclaimer {
    font-size: 10px;
  }

  .spin-button {
    font-size: 20px;
    padding: 8px 26px;
  }
}
