/* --- Design System & CSS Variables --- */
:root {
  /* Fonts */
  --font-primary: "Outfit", sans-serif;
  --font-display: "Orbitron", sans-serif;
  --font-serif: "Playfair Display", serif;

  /* Common Speeds */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.slot-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  scale: 1.45;
}

.side-logo {
  position: relative;
  width: 200px;
  height: 372px;
  margin: 2rem 2rem 0rem 2rem;
  background: url("img/side-bar.png") no-repeat center;
  background-zize: 100% 100%;
  box-shadow:
    0 0 18px #00d4ff,
    0 0 40px rgba(0, 212, 255, 0.4),
    inset 0 0 20px rgba(0, 100, 200, 0.3);
  background-size: cover; /* Fills the container, may crop */
  z-index: 1;
  border-radius: 47% 47% / 39% 39%;
  animation: ovalPulse 3s ease-in-out infinite;
}

.side-logo .star-container {
  position: relative;
}
.side-logo .star-1 {
  bottom: 14%;
  left: 39%;
  rotate: 60deg;
  scale: 1.3;
}

.side-logo .star-2 {
  top: 4%;
  right: 40%;
  rotate: 63deg;
  scale: 0.8;
}

@keyframes ovalPulse {
  0%,
  100% {
    box-shadow:
      0 0 28px rgba(80, 170, 255, 0.5),
      0 0 70px rgba(60, 140, 255, 0.18),
      inset 0 0 32px rgba(10, 60, 190, 0.4);
  }

  50% {
    box-shadow:
      0 0 50px rgba(100, 210, 255, 0.8),
      0 0 100px rgba(80, 175, 255, 0.3),
      inset 0 0 44px rgba(20, 90, 210, 0.55);
  }
}

.bg-cover {
  position: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
}

.bg-cover .bg-background {
  height: 1400px;
}

.waves {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 0;
  pointer-events: none;
  background: url("img/background.png") no-repeat center;
  background-size: cover;
}
.wave-bar {
  width: 3px;
  background: linear-gradient(
    to top,
    transparent,
    rgba(0, 160, 255, 0.5),
    transparent
  );
  border-radius: 4px;
  animation: wavePulse 0.8s ease-in-out infinite alternate;
}
@keyframes wavePulse {
  from {
    transform: scaleY(0.2);
    opacity: 0.5;
  }
  to {
    transform: scaleY(1);
    opacity: 0.9;
  }
}

.star-container {
  display: flex;
  position: absolute;
  justify-content: center;
  align-items: center;
  height: 200px;
  /*background-color: #0b0f19;*/
}

.star-container.bg-1 {
  top: 35%;
  left: 5%;
  scale: 1.55;
  transform: rotate(5deg);
}
.star-container.bg-2 {
  top: 50%;
  left: 12%;
  scale: 0.3;
  transform: rotate(15deg);
}
.star-container.bg-3 {
  top: 18%;
  left: 18%;
  scale: 0.5;
  transform: rotate(20deg);
}
.star-container.bg-4 {
  top: 65%;
  left: 20%;
  scale: 1;
  transform: rotate(25deg);
}
.star-container.bg-5 {
  top: 40%;
  left: 25%;
  scale: 3;
  transform: rotate(30deg);
}
.star-container.bg-6 {
  top: 52%;
  right: 25%;
  scale: 1.8;
  transform: rotate(72deg);
}
.star-container.bg-7 {
  top: 38%;
  right: 22%;
  scale: 0.8;
  transform: rotate(75deg);
}
.star-container.bg-8 {
  top: 60%;
  right: 18%;
  scale: 0.4;
  transform: rotate(79deg);
}
.star-container.bg-9 {
  top: 27%;
  right: 12%;
  scale: 2;
  transform: rotate(82deg);
}
.star-container.bg-10 {
  top: 56%;
  right: 2%;
  scale: 1;
  transform: rotate(85deg);
}

/* ตัวตนหลักของแสง 8 แฉก */
.sparkle-8-point {
  position: relative;
  width: 3px;
  height: 100px;
  background: radial-gradient(circle, #ffffff 10%, rgba(255, 255, 255, 0) 80%);
  border-radius: 50%;
  filter: drop-shadow(0 0 10px #0080ff); /* เพิ่มแสงเรืองรองรอบๆ */
  animation: ovalPulse 3s ease-in-out infinite;
}

/* สร้างแฉกที่เหลือด้วย Pseudo-elements */
.sparkle-8-point::before,
.sparkle-8-point::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: inherit;
  border-radius: inherit;
}

/* แฉกเฉียงคู่ที่ 1 (45 องศา) */
.sparkle-8-point::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: inherit;
  border-radius: inherit;
  transform: rotate(45deg);
  scale: 0.7; /* ปรับให้แฉกเฉียงสั้นลงเล็กน้อยเพื่อความสมจริง */
}

/* แฉกเฉียงคู่ที่ 2 (135 องศา) - สร้างครอบทับอีกชั้น */
.sparkle-8-point-overlay {
  transform: rotate(90deg);
  left: -3px;
}

/* Cyberpunk Neon Theme (Default) */
.theme-cyberpunk {
  --bg-app: #090812;
  --bg-gradient: radial-gradient(circle at 50% 50%, #150f30 0%, #090812 100%);
  --panel-bg: rgba(136, 130, 183, 0.7);
  --panel-border: rgba(0, 242, 254, 0.15);
  --panel-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);

  --text-primary: #f0edf6;
  --text-secondary: #8c82ab;
  --text-muted: #534b72;

  --color-accent: #00f2fe; /* Cyber cyan */
  --color-accent-secondary: #ff007f; /* Cyber pink */
  --color-success: #39ff14; /* Neon green */

  /* Cabinet Colors */
  --cabinet-border: #ff007f;
  --cabinet-bg: #1c1538;
  --cabinet-screen-bg: #0a0618;
  --cabinet-marquee-bg: #0f0720;
  --cabinet-shadow: 0 20px 50px rgba(255, 0, 127, 0.15);
  --cabinet-neon-glow:
    0 0 20px rgba(0, 242, 254, 0.3), inset 0 0 15px rgba(255, 0, 127, 0.3);

  --lever-ball: #ff007f;
  --lever-rod: #e2e8f0;
  --lever-mount: #2a2250;

  --item-bg: rgba(255, 255, 255, 0.03);
  --item-border: rgba(0, 242, 254, 0.1);
  --item-selected-bg: linear-gradient(
    90deg,
    rgba(0, 242, 254, 0.15) 0%,
    rgba(255, 0, 127, 0.15) 100%
  );
  --item-selected-glow: 0 0 15px rgba(0, 242, 254, 0.4);

  --font-marquee: var(--font-display);
  --input-bg: rgba(0, 0, 0, 0.3);
}

/* Retro Casino Gold Theme */
.theme-casino {
  --bg-app: #120202;
  --bg-gradient: radial-gradient(circle at 50% 50%, #2e0505 0%, #120202 100%);
  --panel-bg: rgba(26, 12, 12, 0.8);
  --panel-border: rgba(212, 175, 55, 0.2);
  --panel-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.6);

  --text-primary: #fffbeb;
  --text-secondary: #dfcca0;
  --text-muted: #7d6548;

  --color-accent: #d4af37; /* Gold */
  --color-accent-secondary: #dc2626; /* Ruby Red */
  --color-success: #10b981; /* Emerald Green */

  /* Cabinet Colors */
  --cabinet-border: #d4af37;
  --cabinet-bg: #400505;
  --cabinet-screen-bg: #1f0202;
  --cabinet-marquee-bg: #2b0303;
  --cabinet-shadow: 0 20px 50px rgba(212, 175, 55, 0.15);
  --cabinet-neon-glow:
    0 0 20px rgba(212, 175, 55, 0.4), inset 0 0 20px rgba(0, 0, 0, 0.8);

  --lever-ball: #dc2626;
  --lever-rod: #d4af37;
  --lever-mount: #6b0c0c;

  --item-bg: rgba(212, 175, 55, 0.02);
  --item-border: rgba(212, 175, 55, 0.08);
  --item-selected-bg: linear-gradient(
    90deg,
    rgba(212, 175, 55, 0.2) 0%,
    rgba(220, 38, 38, 0.15) 100%
  );
  --item-selected-glow: 0 0 15px rgba(212, 175, 55, 0.5);

  --font-marquee: var(--font-serif);
  --input-bg: rgba(0, 0, 0, 0.3);
}

/* Classic Blue, White and Black Theme */
.theme-classic-blue {
  --bg-app: #ffffff;
  --bg-gradient: radial-gradient(circle at 50% 50%, #f1f5f9 0%, #ffffff 100%);
  --panel-bg: rgba(255, 255, 255, 0.75);
  --panel-border: rgba(0, 112, 243, 0.15);
  --panel-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.06);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --color-accent: #0070f3; /* Electric Blue */
  --color-accent-secondary: #0f172a; /* Crisp Black */
  --color-success: #38bdf8; /* Light Blue */

  /* Cabinet Colors */
  --cabinet-border: #0f172a;
  --cabinet-bg: #ffffff; /* WHITE CABINET BODY */
  --cabinet-screen-bg: #ffffff; /* WHITE SCREEN BACKGROUND */
  --cabinet-marquee-bg: #ffffff; /* WHITE MARQUEE BACKGROUND */
  --cabinet-shadow: 0 20px 50px rgba(0, 112, 243, 0.12);
  --cabinet-neon-glow:
    0 0 25px rgba(0, 112, 243, 0.15), inset 0 0 20px rgba(0, 0, 0, 0.02);

  --lever-ball: #0070f3;
  --lever-rod: #0f172a;
  --lever-mount: #e2e8f0;

  --item-bg: #ffffff;
  --item-border: rgba(0, 112, 243, 0.06);
  --item-selected-bg: var(--color-accent);
  --item-selected-glow: 0 4px 12px rgba(0, 112, 243, 0.35);

  --font-marquee: var(--font-display);
  --input-bg: rgba(15, 23, 42, 0.05);

  /* Reel Layout overrides */
  --reel-bg: #f8fafc;
  --reel-border: rgba(0, 112, 243, 0.1);
  --reel-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

/* --- Global Reset & Setup --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  background: #000540;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Background Glowing Orbs */
.bg-effects {
  position: absolute;
  background:
    radial-gradient(
      ellipse 55% 80% at 20% 50%,
      rgba(0, 60, 200, 0.55) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 55% 80% at 80% 50%,
      rgba(0, 60, 200, 0.55) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 60% 70% at 50% 50%,
      #001080 0%,
      #000850 50%,
      #000435 100%
    );
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  mix-blend-mode: screen;
  animation: orbFloat 20s infinite alternate;
}

.theme-classic-blue .glow-orb {
  opacity: 0.08;
  mix-blend-mode: multiply;
}

.orb-1 {
  width: 50vw;
  height: 50vw;
  background: var(--color-accent);
  top: -10vw;
  right: -10vw;
}

.orb-2 {
  width: 45vw;
  height: 45vw;
  background: var(--color-accent-secondary);
  bottom: -10vw;
  left: -10vw;
  animation-delay: -5s;
}

@keyframes orbFloat {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(10%, 10%) scale(1.2);
  }
}

/* --- Layout --- */
.app-container {
  /*width: 100%;*/
  max-width: 1400px;
  height: 90vh;
  display: flex;
  gap: 2rem;
  padding: 1rem;
  /*z-index: 1;*/
  position: relative;
}

@media (max-width: 1024px) {
  .app-container {
    flex-direction: column;
    height: auto;
    padding: 1.5rem;
  }
}

/* --- Glass Panels --- */
.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-glow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
}

/* --- Sidebar Controls --- */
.sidebar {
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
  gap: 1.5rem;
  overflow-y: auto;
}

@media (max-width: 1024px) {
  .sidebar {
    width: 100%;
    max-height: 500px;
  }
}

.logo-area {
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 1rem;
}

.logo-area h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.sub-logo {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-accent);
  display: block;
  margin-bottom: 0.25rem;
}

/* Control Sections */
.control-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.control-section h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.count-badge {
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.75rem;
  border: 1px solid var(--panel-border);
  color: var(--color-accent);
}

/* Textarea styling */
textarea {
  width: 100%;
  height: 150px;
  background: var(--input-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  resize: none;
  outline: none;
  transition: var(--transition-fast);
}

textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

/* Buttons */
.button-row {
  display: flex;
  gap: 0.5rem;
}

.btn {
  font-family: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--panel-border);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-accent);
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.85rem;
  flex: 1;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1.1rem;
  border-radius: 12px;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--color-accent) 0%,
    var(--color-accent-secondary) 100%
  );
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.4);
}

/* Presets Dropdown */
.dropdown {
  position: relative;
  flex: 1;
  display: flex;
}

.dropdown #btn-presets {
  width: 100%;
}

.dropdown-content {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 100%;
  background: var(--bg-app);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: var(--panel-glow);
  z-index: 10;
  overflow: hidden;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-content a {
  color: var(--text-secondary);
  padding: 10px 12px;
  text-decoration: none;
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

.dropdown-content a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-accent);
}

/* Setting Items */
.setting-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.setting-item label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

select {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
}

select:focus {
  border-color: var(--color-accent);
}

.range-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  background: var(--input-bg);
  height: 6px;
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  box-shadow: 0 0 10px var(--color-accent);
  transition: var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--text-primary);
  min-width: 45px;
  text-align: center;
}

/* Checkbox */
.setting-item-row {
  display: flex;
  align-items: center;
}

.checkbox-container {
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  user-select: none;
  color: var(--text-secondary);
  gap: 10px;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: relative;
  height: 18px;
  width: 18px;
  background-color: var(--input-bg);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  transition: var(--transition-fast);
}

.checkbox-container:hover input ~ .checkmark {
  border-color: var(--color-accent);
}

.checkbox-container input:checked ~ .checkmark {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

.checkbox-container .checkmark:after {
  left: 6px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Theme Selector */
.theme-selector {
  display: flex;
  gap: 0.5rem;
  background: var(--input-bg);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
}

.theme-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.theme-btn.active {
  background: var(--color-accent);
  color: #000;
  box-shadow: 0 0 10px var(--color-accent);
}

.theme-casino .theme-btn.active,
.theme-classic-blue .theme-btn.active {
  color: #fff;
}

/* Winning History List */
.history-section {
  border-top: 1px solid var(--panel-border);
  padding-top: 1rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-link:hover {
  color: var(--color-accent-secondary);
}

.history-list {
  overflow-y: auto;
  max-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-right: 4px;
}

.history-list::-webkit-scrollbar {
  width: 4px;
}

.history-list::-webkit-scrollbar-thumb {
  background: var(--panel-border);
  border-radius: 99px;
}

.empty-history {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 20px 0;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.history-name {
  font-weight: 600;
  color: var(--text-primary);
}

.history-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Main Content Area --- */
.main-content {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Slot Machine Cabinet Wrapper */
.slot-machine-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
}

@media (max-width: 640px) {
  .slot-machine-wrapper {
    padding-right: 0;
    padding-bottom: 80px;
    flex-direction: column;
  }
}

/* Slot Cabinet Casing */
.slot-cabinet {
  width: 500px;
  position: relative;
  margin-top: 4.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  z-index: 20;
  overflow: hidden;
  transition: var(--transition-slow);
}

@media (max-width: 768px) {
  .slot-cabinet {
    width: 100%;
    max-width: 500px;
  }
}

/* Cabinet Header (Marquee) */
.cabinet-marquee {
  display: none;
  padding: 1rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    rgba(35, 132, 244, 0.4) 0%,
    rgba(30, 105, 157, 0.4) 100%
  );
  border: 0.2rem solid rgba(150, 220, 255, 0.75);
  border-radius: 30px;
  box-shadow:
    0 0 12px #00d4ff,
    0 0 40px rgba(100, 212, 255, 0.4),
    inset 0 0 20px rgba(0, 100, 200, 0.3);
  height: 72px;
  width: 340px;
  top: 40px;
  z-index: 25;
}

/* Blinking Marquee Bulbs */
.marquee-lights {
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.marquee-lights span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffea00;
  box-shadow: 0 0 5px #ffea00;
}

/* Custom pulsing marquee text */
.marquee-title {
  font-family: var(--font-marquee);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: #fff;
  margin: 0;
  text-shadow:
    0 0 10px var(--color-accent),
    0 0 20px var(--color-accent-secondary);
  animation: marqueePulse 1.5s infinite alternate;
}

.theme-casino .marquee-title {
  font-size: 2.5rem;
  letter-spacing: 2px;
  text-shadow:
    0 0 8px var(--color-accent),
    0 4px 5px rgba(0, 0, 0, 0.6);
  color: var(--color-accent);
}

@keyframes marqueePulse {
  0% {
    transform: scale(0.98);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.02);
    opacity: 1;
  }
}

.marquee-decor {
  font-size: 0.8rem;
  color: var(--color-accent-secondary);
  letter-spacing: 6px;
  margin-top: 0.25rem;
}

/* Slot Screen (Reel Frame) */
.slot-screen-outer {
  padding: 12px;
  border-radius: 20px;
  background: transparent;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.03);
}

.slot-screen-inner {
  height: 250px;
  background: transparent;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 112, 243, 0.15);
}

/* Payline Indicators (The markers) */
.payline-left,
.payline-right {
  position: absolute;
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  z-index: 5;
  top: 50%;
  transform: translateY(-50%);
}

.payline-left {
  left: 8px;
  border-left: 16px solid white;
  filter: drop-shadow(0 0 5px white);
}

.payline-right {
  right: 8px;
  border-right: 16px solid white;
  filter: drop-shadow(0 0 5px white);
}

.payline-wire {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(255, 0, 127, 0) 0%,
    rgba(255, 255, 255, 0.4) 15%,
    rgba(255, 255, 255, 0.4) 85%,
    rgba(255, 0, 127, 0) 100%
  );
  z-index: 4;
  pointer-events: none;
}

.theme-casino .payline-left {
  border-left-color: white;
  filter: drop-shadow(0 0 5px white);
}
.theme-casino .payline-right {
  border-right-color: white;
  filter: drop-shadow(0 0 5px white);
}
.theme-casino .payline-wire {
  background: linear-gradient(
    90deg,
    rgba(212, 175, 55, 0) 0%,
    rgba(212, 175, 55, 0.4) 15%,
    rgba(212, 175, 55, 0.4) 85%,
    rgba(212, 175, 55, 0) 100%
  );
}

/* Reels Container */
.reels-container {
  width: 100%;
  height: 100%;
  display: flex;
  gap: 12px;
  padding: 0 24px;
  position: relative;
  z-index: 3;
}

.reel-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.placeholder-text {
  color: var(--text-muted);
  font-size: 1.1rem;
  text-align: center;
  font-weight: 500;
}

/* A single reel tape */
.reel-column {
  flex: 1;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border-left: 1px solid var(--reel-border, rgba(255, 255, 255, 0.05));
  border-right: 1px solid var(--reel-border, rgba(255, 255, 255, 0.05));
  box-shadow: var(--reel-shadow, inset 0 0 20px rgba(0, 0, 0, 0.8));
  /*background: linear-gradient(90deg,rgba(0, 0, 0, 0) 0%, rgba(0, 100, 255, 0.1) 25%, rgba(0, 100, 255, 0.3) 50%, rgba(0, 100, 255, 0.1) 75%, rgba(0, 0, 0, 0) 100%);
*/
}

.reel-tape {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  will-change: transform;
  transform: translateY(0);
}

/* A slot item on the reel */
.reel-item {
  height: 70px; /* Matches JS offset calculation */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 10px;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--item-border);
  background: transparent;
  transition:
    color 0.15s ease,
    text-shadow 0.15s ease;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reel-item.active {
  color: var(--text-primary);
  box-shadow: var(--item-selected-glow);
  text-shadow: 0 0 8px var(--color-accent);
}

/* Blurred effect during spin */
.reel-tape.blurring {
  filter: blur(3px);
}

/* Bottom Console */
.cabinet-console {
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--panel-border);
  border-radius: 15px;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.console-decor-lights {
  position: absolute;
  left: 20px;
  display: flex;
  gap: 8px;
}

.light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.light-blue {
  background: #00f2fe;
  box-shadow: 0 0 8px #00f2fe;
}
.light-pink {
  background: #ff007f;
  box-shadow: 0 0 8px #ff007f;
}
.light-green {
  background: #39ff14;
  box-shadow: 0 0 8px #39ff14;
}

.blinking-fast {
  animation: blink 0.4s infinite alternate;
}
.blinking-slow {
  animation: blink 1s infinite alternate;
}

@keyframes blink {
  0% {
    opacity: 0.3;
  }
  100% {
    opacity: 1;
  }
}

/* SPIN BUTTON */
.spin-btn {
  width: 145px;
  height: 50px;
  border-radius: 30px;
  color: #fff;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 2px;
  position: relative;
  top: -6px;
  left: 5px;
  outline: none;
  display: flex;
  justify-content: center;
  align-items: center;
  transition:
    transform 0.05s ease,
    box-shadow 0.05s ease;
  z-index: 25;
  background: linear-gradient(
    180deg,
    rgba(35, 132, 244, 1) 0%,
    rgba(30, 105, 157, 1) 100%
  );
  border: 0.2rem solid rgba(180, 220, 255, 0.75);
  box-shadow:
    0 0 12px #00d4ff,
    0 0 40px rgba(100, 212, 255, 0.4),
    inset 0 0 20px rgba(0, 100, 200, 0.3);
}

.theme-casino .spin-btn {
  background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
  box-shadow:
    0 6px 0 #7f1d1d,
    0 10px 20px rgba(220, 38, 38, 0.4);
}

.theme-classic-blue .spin-btn {
  background: linear-gradient(
    180deg,
    rgba(35, 132, 244, 1) 0%,
    rgba(30, 105, 157, 1) 100%
  );
  border: 0.2rem solid rgba(180, 220, 255, 0.75);
  box-shadow:
    0 0 12px #00d4ff,
    0 0 40px rgba(100, 212, 255, 0.4),
    inset 0 0 20px rgba(0, 100, 200, 0.3);
}

.spin-btn:hover {
  filter: brightness(1.1);
}

.spin-btn:active {
  transform: translateY(4px);
  box-shadow:
    0 2px 0 #002e62,
    0 4px 10px rgba(0, 112, 243, 0.3);
}

.theme-casino .spin-btn:active {
  box-shadow:
    0 2px 0 #7f1d1d,
    0 4px 10px rgba(220, 38, 38, 0.3);
}

.theme-classic-blue .spin-btn:active {
  box-shadow:
    0 2px 0 #002e62,
    0 4px 10px rgba(0, 112, 243, 0.3);
}

.spin-btn:disabled {
  opacity: 1;
  cursor: not-allowed;
  transform: none;
  background: linear-gradient(180deg, #7c7c7c 0%, #4f4f4f 100%);
}

.spin-btn-glow {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 34px;
  border: 2px solid var(--color-accent);
  opacity: 0;
  pointer-events: none;
  animation: buttonPulse 2s infinite;
}

@keyframes buttonPulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.08);
    opacity: 0;
  }
}

/* --- Lever Assembly --- */
.lever-assembly {
  position: absolute;
  right: 18px;
  top: calc(50% - 70px);
  width: 60px;
  height: 140px;
  display: flex;
  justify-content: center;
  /*z-index: 1;*/
}

@media (max-width: 640px) {
  .lever-assembly {
    right: auto;
    bottom: 10px;
    top: auto;
    width: 140px;
    height: 60px;
    flex-direction: row;
    justify-content: center;
    align-items: center;
  }
}

.lever-mount {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--lever-mount);
  border: 3px solid var(--cabinet-border);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  position: absolute;
  bottom: 0;
  /*z-index: 2;*/
}

.lever-rod-wrapper {
  height: 100px;
  width: 20px;
  position: absolute;
  bottom: 16px;
  transform-origin: bottom center;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lever-rod {
  width: 8px;
  height: 85px;
  background: linear-gradient(
    90deg,
    #b0b0b0 0%,
    var(--lever-rod) 50%,
    #707070 100%
  );
  border-radius: 4px;
}

.lever-ball {
  width: 28px;
  height: 28px;
  background: var(--lever-ball);
  border-radius: 50%;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.4),
    inset 0 -4px 8px rgba(0, 0, 0, 0.4),
    inset 0 4px 8px rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.lever-ball:hover {
  transform: scale(1.1);
}

/* Lever Pull State Animation */
.lever-rod-wrapper.pulled {
  transform: rotateX(75deg) translateY(20px);
  transition: transform 0.15s ease-in;
}

/* --- Winner Modal --- */
.win-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.win-modal.active {
  pointer-events: auto;
  opacity: 1;
}

.win-modal-backdrop {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(6, 4, 14, 0.85);
  backdrop-filter: blur(12px);
}

.win-modal-content {
  background: radial-gradient(
    circle at 50% 50%,
    rgba(28, 21, 56, 0.95) 0%,
    rgba(10, 8, 22, 0.98) 100%
  );
  border: 3px solid var(--color-accent);
  box-shadow:
    0 0 50px rgba(0, 242, 254, 0.3),
    inset 0 0 30px rgba(255, 0, 127, 0.2);
  width: 90%;
  max-width: 550px;
  border-radius: 30px;
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  z-index: 2;
  transform: scale(0.7);
  transition: transform var(--transition-bounce);
}

.theme-casino .win-modal-content {
  background: radial-gradient(
    circle at 50% 50%,
    rgba(46, 5, 5, 0.98) 0%,
    rgba(18, 2, 2, 0.98) 100%
  );
  border: 3px solid var(--color-accent);
  box-shadow:
    0 0 50px rgba(212, 175, 55, 0.3),
    inset 0 0 30px rgba(0, 0, 0, 0.8);
}

.theme-classic-blue .win-modal-content {
  background: radial-gradient(
    circle at 50% 50%,
    rgba(10, 15, 30, 0.98) 0%,
    rgba(0, 0, 0, 0.98) 100%
  );
  border: 3px solid var(--color-accent-secondary);
  box-shadow:
    0 0 50px rgba(0, 112, 243, 0.3),
    inset 0 0 30px rgba(255, 255, 255, 0.1);
}

.win-modal.active .win-modal-content {
  transform: scale(1);
}

#confetti-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 27px;
  pointer-events: none;
  z-index: 0;
}

.win-banner {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--color-accent-secondary);
  text-shadow: 0 0 10px var(--color-accent-secondary);
  margin-bottom: 1rem;
  animation: pulseGlow 1s infinite alternate;
}

.theme-casino .win-banner {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 2.5rem;
  color: var(--color-accent);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.theme-classic-blue .win-banner {
  font-family: var(--font-display);
  font-size: 2.2rem;
  letter-spacing: 4px;
  color: var(--color-accent-secondary);
  text-shadow:
    0 0 10px var(--color-accent),
    0 0 20px var(--color-accent);
}

@keyframes pulseGlow {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.05);
    opacity: 1;
  }
}

.winner-display-container {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 2rem 1rem;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.winner-label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.winner-name {
  font-size: 3rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 0 20px var(--color-accent);
  word-break: break-word;
}

.theme-casino .winner-name {
  font-family: var(--font-primary);
  color: #ffffff;
  text-shadow:
    0 0 15px var(--color-accent),
    0 0 30px var(--color-accent-secondary);
}

.modal-buttons {
  position: relative;
  z-index: 1;
}

.modal-buttons button {
  width: 100%;
}

/* --- Classic Blue Theme Layout Overrides --- */

/* Marquee overrides */
.theme-classic-blue .cabinet-marquee {
  box-shadow:
    0 0 12px #00d4ff,
    0 0 40px rgba(100, 212, 255, 0.4),
    inset 0 0 20px rgba(0, 100, 200, 0.3);
}

.theme-classic-blue .marquee-title {
  color: white;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.theme-classic-blue .marquee-decor {
  color: #0f172a;
}

.theme-classic-blue .marquee-lights span {
  background: #0070f3;
  box-shadow: 0 0 6px #0070f3;
}

/* Screen outer frame */
.theme-classic-blue .slot-screen-outer {
  background: transparent;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.06);
}

.theme-classic-blue .slot-screen-inner {
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 112, 243, 0.15);
}

/* Paylines */
.theme-classic-blue .payline-left {
  border-left-color: white;
  filter: drop-shadow(0 0 4px white);
}

.theme-classic-blue .payline-right {
  border-right-color: white;
  filter: drop-shadow(0 0 4px white);
}

.theme-classic-blue .payline-wire {
  background: linear-gradient(
    90deg,
    rgba(0, 112, 243, 0) 0%,
    rgba(255, 255, 255, 0.3) 15%,
    rgba(255, 255, 255, 0.3) 85%,
    rgba(0, 112, 243, 0) 100%
  );
}

/* Active reel item override */
.theme-classic-blue .reel-item.active {
  color: #ffffff;
  text-shadow: none;
}

/* Console overrides */
.theme-classic-blue .cabinet-console {
  background: #ffffff;
  border-color: rgba(0, 112, 243, 0.15);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.03);
}

/* Console decorative lights */
.theme-classic-blue .console-decor-lights .light-blue {
  background: #0070f3;
  box-shadow: 0 0 8px #0070f3;
}
.theme-classic-blue .console-decor-lights .light-pink {
  background: #0f172a;
  box-shadow: none;
  border: 1px solid rgba(0, 0, 0, 0.15);
}
.theme-classic-blue .console-decor-lights .light-green {
  background: #e2e8f0;
  box-shadow: none;
  border: 1px solid rgba(0, 0, 0, 0.1);
}
