html,
body {
  height: 100%;
}

body {
  min-height: 100dvh;
  min-width: 0;
  display: flex;
  overflow-x: hidden;
  overflow-y: auto;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

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

.glass {
  border: 1px solid var(--line);
  background: var(--glass-bg);
  box-shadow: var(--shadow), var(--inner-glow);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  isolation: isolate;
}

.liquidGlass-wrapper {
  position: relative;
  display: flex;
  overflow: hidden;
  isolation: isolate;
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.liquidGlass-effect,
.liquidGlass-tint,
.liquidGlass-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.liquidGlass-effect {
  z-index: 0;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  overflow: hidden;
  transform: translateZ(0);
}

.liquidGlass-tint {
  z-index: 1;
  background: var(--glass-bg);
}

.liquidGlass-shine {
  z-index: 2;
  overflow: hidden;
  box-shadow: var(--inner-glow);
}

.liquidGlass-text {
  position: relative;
  z-index: 3;
  width: 100%;
  color: inherit;
}

.glass.liquidGlass-wrapper {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
}

@supports not (backdrop-filter: blur(1px)) {
  .liquidGlass-effect {
    filter: none;
  }

  .glass .liquidGlass-tint {
    background: color-mix(in srgb, var(--page-bg) 82%, var(--glass-bg)) !important;
  }
}

.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4vh, 12px);
  width: 100%;
  max-width: min(var(--content), 100%);
  min-width: 0;
  margin: 0 auto;
  min-height: calc(100dvh - 20px);
  min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  min-height: 56px;
  padding: 0;
  border-radius: 22px;
}

.topbar > .liquidGlass-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 8px 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--glass-highlight);
  border-radius: 13px;
  background:
    radial-gradient(circle at 30% 22%, rgb(255 255 255 / 85%), transparent 18%),
    linear-gradient(105deg, var(--accent-from), var(--accent-mid) 52%, var(--accent-to));
  box-shadow: 0 14px 34px var(--glass-accent-shadow), var(--inner-glow);
}

.brand strong {
  display: block;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 1.4vw, 10px);
  flex-shrink: 0;
}

.stat-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 52px;
  min-width: 0;
  padding: 0;
  border-radius: 18px;
  text-align: center;
}

.stat-panel > .liquidGlass-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 52px;
  padding: 6px 8px;
}

.stat-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-value {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 2.6vw, 1.35rem);
  font-weight: 650;
  line-height: 1.2;
}

.stat-value.yellow {
  color: #ca8a04;
}

:root[data-theme="dark"] .stat-value.yellow {
  color: #facc15;
}

.stat-value.is-flash {
  color: var(--text) !important;
  text-shadow: 0 0 18px color-mix(in srgb, var(--text) 45%, transparent);
}

.euro-gray {
  color: var(--muted);
  font-size: 0.72em;
  font-weight: 500;
}

.main-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: clamp(8px, 1.4vh, 12px);
  min-height: 0;
  min-width: 0;
  width: 100%;
}

.game-section {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  container-type: size;
}

.game-board-shell {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 5 / 3;
  height: auto;
  border-radius: var(--radius);
}

@supports (width: 1cqh) {
  .game-board-shell {
    width: min(100%, calc(100cqh * 5 / 3));
    height: auto;
    max-height: 100%;
  }
}

.game-board-shell .liquidGlass-effect {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.game-board-shell .liquidGlass-tint {
  background: color-mix(in srgb, var(--glass-bg) 42%, transparent);
}

.game-board-shell > .liquidGlass-text {
  display: flex;
  width: 100%;
  height: 100%;
}

#game-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: clamp(0.22rem, 1.2cqi, 0.85rem);
  padding: clamp(0.4rem, 1.5cqi, 1.1rem);
  width: 100%;
  height: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  background: none;
  border: none;
  box-shadow: none;
  container-type: inline-size;
}

.controls-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-radius: var(--radius);
  position: relative;
  flex-shrink: 0;
}

.controls-section > .liquidGlass-text {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4vh, 12px);
  padding: clamp(10px, 1.6vh, 14px);
  position: relative;
  flex: 1;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass-bg);
  color: var(--text);
  text-decoration: none;
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, calc(0.55 * var(--glass-reflex-light))),
    inset 0 -1px 2px rgba(0, 0, 0, calc(0.12 * var(--glass-reflex-dark))),
    0 4px 18px var(--glass-shadow);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  transition: background-color 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.45, 0.64, 1), border-color 0.35s ease;
}

.button:hover:not(:disabled) {
  border-color: var(--glass-accent-border);
  background: var(--glass-bg-hover);
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.button.primary {
  background: linear-gradient(105deg, var(--accent-from), var(--accent-mid) 50%, var(--accent-to));
  color: #0b1220;
  border-color: var(--glass-accent-border);
  font-weight: 700;
  box-shadow: 0 8px 26px var(--glass-accent-shadow), var(--inner-glow);
}

.icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
  flex: 0 0 auto;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  display: block;
}

.icon-button.is-off {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
}

.icon-button.is-on {
  color: var(--ok);
}

.theme-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin: 0;
  padding: 0.3rem;
  border: none;
  border-radius: 9999px;
  background: var(--switcher-track);
  backdrop-filter: blur(22px) saturate(var(--glass-saturation));
  -webkit-backdrop-filter: blur(22px) saturate(var(--glass-saturation));
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, calc(0.55 * var(--glass-reflex-light))),
    inset 0 -1px 2px rgba(0, 0, 0, calc(0.12 * var(--glass-reflex-dark))),
    0 4px 18px var(--glass-shadow);
}

.theme-switcher::after {
  content: "";
  position: absolute;
  top: 0.3rem;
  left: 0.3rem;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background: var(--switcher-thumb);
  backdrop-filter: blur(14px) saturate(var(--glass-saturation));
  -webkit-backdrop-filter: blur(14px) saturate(var(--glass-saturation));
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, calc(0.65 * var(--glass-reflex-light))),
    inset 0 -1px 2px rgba(0, 0, 0, calc(0.1 * var(--glass-reflex-dark))),
    0 2px 10px rgba(0, 0, 0, calc(0.12 * var(--glass-reflex-dark)));
  transition: transform 0.5s cubic-bezier(0.34, 1.45, 0.64, 1);
  pointer-events: none;
  z-index: 0;
}

.theme-switcher:has(.theme-switcher__input[data-option="2"]:checked)::after {
  transform: translateX(2.35rem);
}

.theme-switcher__option {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  cursor: pointer;
  border-radius: 50%;
}

.theme-switcher__input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.theme-switcher__icon {
  width: 16px;
  height: 16px;
  color: var(--switcher-icon);
  transition: color 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.45, 0.64, 1);
}

.theme-switcher:has(.theme-switcher__input[data-option="1"]:checked) .theme-switcher__option:first-of-type .theme-switcher__icon,
.theme-switcher:has(.theme-switcher__input[data-option="2"]:checked) .theme-switcher__option:last-of-type .theme-switcher__icon {
  color: var(--switcher-icon-active);
  transform: scale(1.08);
}

.bet-control-panel {
  width: 100%;
}

.bet-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#bet-amount-display {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.6vw, 1.25rem);
  color: var(--accent-mid);
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  margin: 6px 0 0;
}

input[type="range"]:focus {
  outline: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: color-mix(in srgb, var(--text) 16%, transparent);
  border-radius: 999px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 20px;
  width: 20px;
  margin-top: -7px;
  border-radius: 50%;
  background: linear-gradient(105deg, var(--accent-from), var(--accent-to));
  border: 1px solid var(--glass-highlight);
  box-shadow: 0 4px 14px var(--glass-accent-shadow), var(--inner-glow);
  cursor: pointer;
}

input[type="range"]::-moz-range-track {
  height: 6px;
  background: color-mix(in srgb, var(--text) 16%, transparent);
  border-radius: 999px;
  border: none;
}

input[type="range"]::-moz-range-thumb {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: linear-gradient(105deg, var(--accent-from), var(--accent-to));
  border: 1px solid var(--glass-highlight);
}

#message-container {
  min-height: 76px;
  padding: 0;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#message-container > .liquidGlass-text {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 76px;
  padding: 10px 12px;
}

#message {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--text);
  line-height: 1.15;
}

.spin-status {
  color: var(--accent-mid);
  animation: blink 0.35s infinite;
}

.spin-result {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.msg-multi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.35rem, 5.2vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(
    110deg,
    #ff4d6d 0%,
    #ffb020 18%,
    #ffffff 38%,
    #0affc2 52%,
    #3b9eff 70%,
    #e879f9 88%,
    #ff4d6d 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 1px 0 #fff)
    drop-shadow(0 0 8px rgba(255, 255, 255, 0.7))
    drop-shadow(0 2px 10px rgba(255, 255, 255, 0.35));
  animation: holo-shimmer 3.2s linear infinite;
}

.msg-win {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0;
  border-radius: 16px;
  font-size: clamp(1.55rem, 5.6vw, 2.55rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #b8ffd0;
  overflow: hidden;
}

.msg-win > .liquidGlass-text {
  display: inline-flex;
  align-items: center;
  padding: 0.28em 0.72em 0.3em;
  color: #7dffa8;
  text-shadow: 0 0 14px rgba(80, 255, 150, 0.45);
}

.msg-win .liquidGlass-tint {
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.28), transparent 42%),
    color-mix(in srgb, #22c55e 32%, var(--glass-bg));
}

.msg-win .liquidGlass-shine {
  box-shadow:
    inset 2px 2px 1px 0 rgba(255, 255, 255, calc(0.62 * var(--glass-reflex-light))),
    inset -1px -1px 1px 1px rgba(74, 222, 128, 0.28);
}

.msg-win .euro-gray {
  margin-left: 0.18em;
  color: color-mix(in srgb, #7dffa8 55%, var(--muted));
}

.msg-win.lose,
.spin-result.is-lose .msg-win {
  color: #f5f5f7;
  font-weight: 650;
}

.spin-result.is-lose .msg-win .liquidGlass-tint {
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.42), transparent 46%),
    color-mix(in srgb, #ffffff 22%, var(--glass-bg));
}

.spin-result.is-lose .msg-win > .liquidGlass-text {
  color: #f5f5f7;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.35);
}

.spin-result.is-lose .msg-win .euro-gray {
  color: color-mix(in srgb, #f5f5f7 70%, var(--muted));
}

.spin-result.is-lose .msg-multi {
  animation: none;
  background: linear-gradient(180deg, #ffffff 0%, #e8e8ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 1px 0 #fff)
    drop-shadow(0 0 8px rgba(255, 255, 255, 0.55));
}

:root[data-theme="light"] .spin-result.is-lose .msg-win > .liquidGlass-text,
:root[data-theme="light"] .spin-result.is-lose .msg-win .euro-gray {
  color: var(--text);
  text-shadow: none;
}

:root[data-theme="light"] .spin-result.is-lose .msg-multi {
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  color: var(--text);
  filter: none;
}

#spin-button {
  width: 100%;
  min-height: 56px;
  border-radius: 18px;
  font-size: clamp(1.05rem, 3.2vw, 1.45rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.action-buttons {
  display: flex;
  gap: 8px;
  width: 100%;
}

.action-buttons .button {
  flex: 1;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.small-toggles {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.slot-cell {
  --chip: #8b9bb0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border-radius: clamp(10px, 2.4cqi, 16px);
  position: relative;
  overflow: hidden;
  color: var(--chip);
  box-shadow:
    0 6px 18px color-mix(in srgb, var(--chip) 20%, var(--glass-shadow)),
    0 0 18px color-mix(in srgb, var(--chip) 14%, transparent);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s ease;
}

.slot-cell .liquidGlass-effect {
  backdrop-filter: blur(18px) saturate(var(--glass-saturation));
  -webkit-backdrop-filter: blur(18px) saturate(var(--glass-saturation));
}

.slot-cell .liquidGlass-tint {
  background:
    radial-gradient(circle at 30% 22%, color-mix(in srgb, #fff 28%, transparent), transparent 42%),
    color-mix(in srgb, var(--chip) 26%, var(--glass-bg));
}

.slot-cell .liquidGlass-shine {
  box-shadow:
    inset 2px 2px 1px 0 color-mix(in srgb, #fff calc(55% * var(--glass-reflex-light)), var(--chip)),
    inset -1px -1px 1px 1px color-mix(in srgb, var(--chip) 42%, transparent);
}

.slot-cell > .liquidGlass-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: clamp(2px, 1.2cqi, 8px);
}

.slot-cell-symbol {
  font-size: clamp(1.05rem, 12cqi, 3.4rem);
  line-height: 1;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--chip) 70%, transparent));
}

.stars-container {
  position: absolute;
  top: 4px;
  left: 4px;
  display: flex;
  gap: 2px;
  z-index: 5;
}

.star {
  font-size: clamp(0.55rem, 4cqi, 1rem);
  text-shadow: 0 0 2px #000;
  color: currentColor;
}

.chip-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
  max-width: 100%;
}

.chip-info-text {
  font-size: clamp(0.45rem, 5cqi, 1.4rem);
  color: color-mix(in srgb, var(--chip) 75%, #fff);
  margin-top: 1px;
  font-weight: 700;
  text-shadow: 0 0 6px color-mix(in srgb, var(--chip) 45%, transparent);
}

.chip-trebol-text {
  font-size: clamp(0.75rem, 10cqi, 2.2rem);
  color: #dfffdf;
  text-shadow: 0 0 5px rgba(50, 205, 50, 0.8);
  font-weight: 700;
}

.chip-chicle-text {
  font-size: clamp(0.85rem, 11cqi, 2.2rem);
  color: #ff0000;
  text-shadow: 0 0 5px rgba(255, 0, 0, 0.8);
  font-weight: 800;
  line-height: 0.9;
}

.slot-cell.spinning {
  animation: reel-blur 0.07s linear infinite;
}

.slot-cell.reel-stop {
  animation: reel-land 0.18s ease-out;
}

.R-normal { --chip: #6b7c8d; }
.R-comun { --chip: #0affc2; }
.R-raro { --chip: #00a8ff; }
.R-epico { --chip: #ff00de; }
.R-legendario { --chip: #ffaa00; z-index: 2; }
.R-trebol { --chip: #32cd32; z-index: 8; }
.R-unica { --chip: #ff3b3b; z-index: 5; animation: pulse-red 0.2s infinite alternate; }
.R-mitica { --chip: #f5f5f7; z-index: 10; animation: divine-shake 3s infinite ease-in-out; }
.R-chicle { --chip: #ff2d6a; z-index: 10; }
.R-cosmic { --chip: #ffffff; z-index: 20; }

.R-legendario .liquidGlass-tint {
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, #fff 40%, transparent), transparent 38%),
    color-mix(in srgb, var(--chip) 38%, var(--glass-bg));
}

.R-chicle .liquidGlass-tint {
  background:
    linear-gradient(135deg,
      color-mix(in srgb, #ff0000 42%, var(--glass-bg)),
      color-mix(in srgb, #ff69b4 38%, var(--glass-bg)) 45%,
      color-mix(in srgb, #fff 28%, var(--glass-bg)) 70%,
      color-mix(in srgb, #ff2d6a 40%, var(--glass-bg)));
}

.R-mitica .liquidGlass-tint {
  background:
    linear-gradient(225deg,
      color-mix(in srgb, #000 35%, var(--glass-bg)) 0%,
      color-mix(in srgb, #fff 55%, var(--glass-bg)) 25%,
      color-mix(in srgb, #000 30%, var(--glass-bg)) 50%,
      color-mix(in srgb, #fff 50%, var(--glass-bg)) 75%,
      color-mix(in srgb, #000 35%, var(--glass-bg)) 100%);
}

.R-trebol .liquidGlass-tint {
  background:
    linear-gradient(135deg,
      color-mix(in srgb, #0a290a 28%, var(--glass-bg)),
      color-mix(in srgb, #32cd32 22%, var(--glass-bg)) 40%,
      color-mix(in srgb, #4a3d00 18%, var(--glass-bg)));
}

.R-cosmic .liquidGlass-tint {
  background: color-mix(in srgb, #fff 8%, transparent);
}

.R-unica .liquidGlass-tint {
  background:
    radial-gradient(circle at center, color-mix(in srgb, #ff0000 48%, transparent), color-mix(in srgb, #300 40%, var(--glass-bg)));
}

:root[data-theme="dark"] .slot-cell .liquidGlass-tint {
  background:
    radial-gradient(circle at 30% 22%, color-mix(in srgb, #fff 16%, transparent), transparent 42%),
    color-mix(in srgb, var(--chip) 32%, rgba(8, 10, 14, 0.28));
}

:root[data-theme="dark"] .R-legendario .liquidGlass-tint {
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, #fff 28%, transparent), transparent 38%),
    color-mix(in srgb, var(--chip) 42%, rgba(8, 10, 14, 0.22));
}

:root[data-theme="dark"] .R-chicle .liquidGlass-tint {
  background:
    linear-gradient(135deg,
      color-mix(in srgb, #ff0000 46%, rgba(8, 10, 14, 0.2)),
      color-mix(in srgb, #ff69b4 40%, rgba(8, 10, 14, 0.2)) 45%,
      color-mix(in srgb, #fff 22%, rgba(8, 10, 14, 0.2)) 70%,
      color-mix(in srgb, #ff2d6a 42%, rgba(8, 10, 14, 0.2)));
}

:root[data-theme="dark"] .R-mitica .liquidGlass-tint {
  background:
    linear-gradient(225deg,
      rgba(0, 0, 0, 0.45) 0%,
      rgba(255, 255, 255, 0.42) 25%,
      rgba(0, 0, 0, 0.4) 50%,
      rgba(255, 255, 255, 0.38) 75%,
      rgba(0, 0, 0, 0.45) 100%);
}

:root[data-theme="dark"] .R-cosmic .liquidGlass-tint {
  background: rgba(255, 255, 255, 0.06);
}

@keyframes pulse-red {
  from { box-shadow: 0 0 30px rgba(255, 0, 0, 0.5); }
  to { box-shadow: 0 0 60px rgba(255, 0, 0, 0.9); transform: scale(1.02); }
}

@keyframes divine-shake {
  0%, 100% { transform: translateY(0) scale(1.05); }
  50% { transform: translateY(-2px) scale(1.08); filter: brightness(1.2); }
}

@keyframes cosmic-spin { 100% { transform: rotate(360deg); } }
@keyframes holo-shimmer { 0% { background-position: 200% center; } 100% { background-position: -200% center; } }
@keyframes holo-aggressive-anim {
  0% { background-position: 150% 0; opacity: 0.5; }
  50% { opacity: 1; }
  100% { background-position: -150% 0; opacity: 0.5; }
}
@keyframes sparkle-anim {
  0% { opacity: 0.3; transform: scale(0.8) rotate(0deg); }
  100% { transform: scale(1.2) rotate(45deg); }
}
@keyframes blink { 50% { opacity: 0.35; } }
@keyframes blink-gold { from { filter: brightness(1); } to { filter: brightness(1.45); } }
@keyframes jackpot-pop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes reel-blur {
  0% { filter: blur(0) brightness(1.15); transform: translateY(-10%); }
  50% { filter: blur(2px) brightness(1.35); transform: translateY(10%); }
  100% { filter: blur(0) brightness(1.15); transform: translateY(-10%); }
}
@keyframes reel-land {
  0% { transform: translateY(-14%) scale(1.04); }
  65% { transform: translateY(5%) scale(0.98); }
  100% { transform: translateY(0) scale(1); }
}

.winning-cell {
  animation: vibrate-glow 0.4s infinite;
  z-index: 50;
  box-shadow: 0 0 14px currentColor, 0 0 28px color-mix(in srgb, currentColor 45%, transparent) !important;
}

.winning-cell .liquidGlass-shine {
  box-shadow:
    inset 0 0 10px currentColor,
    inset 2px 2px 1px 0 color-mix(in srgb, #fff 50%, currentColor),
    inset -1px -1px 1px 1px currentColor !important;
}

@keyframes vibrate-glow {
  0% { transform: scale(1.025) translate(0, 0); filter: brightness(1.3) contrast(1.1); }
  25% { transform: scale(1.025) translate(-1px, 1px); }
  50% { transform: scale(1.025) translate(1px, -1px); filter: brightness(1.5) contrast(1.2); }
  75% { transform: scale(1.025) translate(-1px, -1px); }
  100% { transform: scale(1.025) translate(0, 0); filter: brightness(1.3) contrast(1.1); }
}

.slot-cell.R-trebol.winning-cell {
  color: #32cd32 !important;
  box-shadow: 0 0 16px #32cd32, 0 0 28px rgba(50, 205, 50, 0.35) !important;
}

.multiplier-cell {
  animation: pulse-red-glow 1s infinite alternate;
  z-index: 40;
  box-shadow: 0 0 12px #ff0033, 0 0 22px #ff0000 !important;
}

@keyframes pulse-red-glow {
  from { transform: scale(1); filter: brightness(1.1); box-shadow: 0 0 5px #ff0033; }
  to { transform: scale(1.025); filter: brightness(1.4); box-shadow: 0 0 12px #ff0033, 0 0 20px #ff0000; }
}

.R-cosmic::before {
  content: "";
  position: absolute;
  inset: -50%;
  z-index: 0;
  background: conic-gradient(from 0deg, #ff0000, #ff8800, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
  animation: cosmic-spin 2s linear infinite;
  filter: blur(10px);
  opacity: 0.72;
}

.R-cosmic::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, transparent 20%, transparent 80%, rgba(255, 255, 255, 0.9) 100%);
  mix-blend-mode: overlay;
  animation: holo-aggressive-anim 0.4s infinite linear;
  pointer-events: none;
}

.R-cosmic span {
  position: relative;
  z-index: 2;
  text-shadow: 0 0 10px black, 0 0 20px white;
}

.holo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.4) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: holo-shimmer 3s infinite linear;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.holo-aggressive::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, 0.9) 50%, transparent 60%);
  background-size: 200% 100%;
  animation: holo-aggressive-anim 0.4s infinite linear;
  pointer-events: none;
  mix-blend-mode: color-dodge;
}

.sparkles::before {
  content: "✦";
  position: absolute;
  top: 10%;
  right: 10%;
  color: white;
  font-size: 14px;
  text-shadow: 0 0 5px #fff;
  animation: sparkle-anim 0.6s infinite alternate;
  pointer-events: none;
  z-index: 10;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 80;
  background: color-mix(in srgb, var(--page-bg) 42%, transparent);
  backdrop-filter: blur(18px) saturate(var(--glass-saturation));
  -webkit-backdrop-filter: blur(18px) saturate(var(--glass-saturation));
}

.modal-overlay.active {
  display: flex;
}

.modal-content,
.jackpot-content {
  position: relative;
  width: min(500px, calc(100% - 24px));
  max-height: min(90vh, calc(100dvh - 24px));
  overflow: hidden;
  padding: 0;
  border-radius: var(--radius);
  color: var(--text);
}

.modal-content > .liquidGlass-text,
.jackpot-content > .liquidGlass-text {
  max-height: min(90vh, calc(100dvh - 24px));
  overflow-y: auto;
  padding: 1.4rem 1.2rem 1.3rem;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
}

.modal-title {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-align: center;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}

.info-table th {
  text-align: left;
  padding: 0.5rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.info-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}

.modal-note {
  margin-top: 1.2rem;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
}

.modal-note h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}

.modal-note p {
  margin: 0 0 0.45rem;
  font-size: 0.85em;
  color: var(--muted);
}

.chip-cosmic-label {
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent-from), var(--accent-mid), var(--accent-to));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.jackpot-content {
  text-align: center;
  border-color: color-mix(in srgb, var(--warn) 55%, var(--line));
}

.jackpot-title {
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ca8a04;
  margin-bottom: 0.6rem;
  animation: blink-gold 0.5s infinite alternate;
}

:root[data-theme="dark"] .jackpot-title {
  color: #ffd700;
}

.jackpot-amount {
  font-family: var(--font-mono);
  font-size: clamp(1.3rem, 4vw, 2rem);
  margin-bottom: 1.2rem;
}

#jackpot-btn,
.jackpot-btn {
  min-width: 160px;
}

@media (max-width: 420px) {
  .brand small { display: none; }
  .brand strong { font-size: 14px; }
  .brand-mark { width: 28px; height: 28px; border-radius: 10px; }
  .icon-button { width: 36px; height: 36px; }
  .theme-switcher { padding: 0.22rem; }
  .theme-switcher__option,
  .theme-switcher::after {
    width: 1.95rem;
    height: 1.95rem;
  }
  .theme-switcher:has(.theme-switcher__input[data-option="2"]:checked)::after {
    transform: translateX(1.95rem);
  }
  .stat-label { font-size: 10px; letter-spacing: 0.04em; }
  .stat-value { font-size: clamp(0.8rem, 4.2vw, 1.05rem); }
  .stat-panel > .liquidGlass-text { padding: 6px 4px; }
  .action-buttons .button { font-size: 12px; padding: 8px 10px; }
}

@media (max-width: 767px) and (orientation: portrait) {
  .game-section {
    min-height: min(58vw, 46dvh);
  }
}

@media (min-width: 768px) {
  .app-shell { gap: 12px; }
  .topbar > .liquidGlass-text { padding: 10px 14px; min-height: 64px; }
  .stat-panel > .liquidGlass-text { padding: 8px 12px; min-height: 56px; }
  #message-container,
  #message-container > .liquidGlass-text { min-height: 80px; }
}

@media (min-width: 1024px) {
  body {
    overflow: hidden;
    height: 100dvh;
    align-items: stretch;
  }

  .app-shell {
    height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px);
    min-height: 0;
  }

  .main-content {
    flex-direction: row;
    align-items: stretch;
    overflow: hidden;
  }

  .game-section {
    flex: 1 1 0;
    min-height: 0;
  }

  .controls-section {
    flex: 0 0 min(380px, 34%);
    max-width: 380px;
    justify-content: center;
  }

  .controls-section > .liquidGlass-text {
    justify-content: center;
    min-height: 100%;
  }

  #message-container,
  #message-container > .liquidGlass-text { min-height: 110px; }
  #spin-button { min-height: 64px; font-size: 1.35rem; }
  .small-toggles { position: absolute; bottom: 14px; right: 14px; }
}

@media (max-height: 740px) and (orientation: landscape) {
  body {
    overflow: hidden;
    height: 100dvh;
  }

  .app-shell {
    height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px);
    min-height: 0;
    gap: 8px;
  }

  .topbar { min-height: 48px; }
  .topbar > .liquidGlass-text { min-height: 48px; padding: 6px 10px; }
  .brand small { display: none; }
  .stats-row { display: none; }

  .main-content {
    flex-direction: row;
    overflow: hidden;
    gap: 8px;
  }

  .game-section {
    flex: 1 1 0;
    min-height: 0;
  }

  .controls-section {
    flex: 0 0 min(300px, 36%);
    max-width: 320px;
  }

  .controls-section > .liquidGlass-text {
    gap: 6px;
    padding: 8px 10px;
    justify-content: center;
  }

  #message-container,
  #message-container > .liquidGlass-text { min-height: 44px; padding: 6px; }
  #spin-button { min-height: 42px; font-size: 1rem; }
  .small-toggles { position: static; justify-content: flex-end; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .action-buttons { display: none; }
  .bet-label span:first-child { display: none; }
  #message-container,
  #message-container > .liquidGlass-text { min-height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .slot-cell.spinning,
  .winning-cell,
  .multiplier-cell,
  .R-mitica,
  .R-unica,
  .R-cosmic::before,
  .R-cosmic::after,
  .holo::after,
  .holo-aggressive::after,
  .sparkles::before {
    animation: none !important;
  }
}
