/* ================================================
   FRUITY — Fruit Machine CSS
   ================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  font-family: 'Press Start 2P', monospace;
  background: #0d0005;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
}

/* ---- CSS Variables ---- */
:root {
  --gold:        #d4af37;
  --gold-light:  #f5d060;
  --gold-dark:   #8b6914;
  --cabinet-bg1: #3a0808;
  --cabinet-bg2: #1a0303;
  --cabinet-bg3: #2e0606;
  --reel-bg:     #0c0202;
  --led-bg:      #080808;
  --led-green:   #00ff44;
  --led-red:     #ff2020;
  --led-amber:   #ffaa00;
  --payline:     rgba(255, 200, 0, 0.85);
  --hold-color:  #ff9500;
  --nudge-color: #1a7fd4;
  --spin-color:  #1a7a1a;
  --gamble-color:#8b0000;
  --coin-color:  #555;
  --chrome1:     #c8c8c8;
  --chrome2:     #606060;
  --chrome3:     #e8e8e8;
}

/* ---- Page Background ---- */
.page-bg {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px 8px 32px;
  background:
    radial-gradient(ellipse at 50% 0%, #3d001a 0%, #0d0005 60%),
    #0d0005;
}

/* ================================================
   CABINET
   ================================================ */
.cabinet {
  width: 100%;
  max-width: 500px;
  position: relative;
  background: linear-gradient(175deg, var(--cabinet-bg1) 0%, var(--cabinet-bg2) 50%, var(--cabinet-bg3) 100%);
  border-radius: 18px 18px 12px 12px;
  border: 3px solid var(--gold-dark);
  box-shadow:
    0 0 0 1px #5a3800,
    0 0 40px rgba(212,175,55,0.25),
    0 10px 60px rgba(0,0,0,0.8),
    inset 0 1px 0 rgba(255,220,80,0.15);
  overflow: hidden;
}

/* ---- Decorative Lights Bar ---- */
.lights-bar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 4px 10px;
  background: linear-gradient(90deg, #120000, #1e0000, #120000);
  border-bottom: 2px solid var(--gold-dark);
}
.lights-bar.bottom-lights {
  border-bottom: none;
  border-top: 2px solid var(--gold-dark);
}

.light {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.4);
  animation: lightFlicker 2s infinite;
}

.light.red    { background: #cc2200; box-shadow: 0 0 6px #ff4400; }
.light.amber  { background: #cc7700; box-shadow: 0 0 6px #ffaa00; animation-delay: 0.5s; }
.light.green  { background: #006600; box-shadow: 0 0 6px #00cc00; animation-delay: 1.0s; }
.light.blue   { background: #002299; box-shadow: 0 0 6px #0044ff; animation-delay: 1.5s; }

@keyframes lightFlicker {
  0%,100% { opacity: 1; }
  45%      { opacity: 1; }
  50%      { opacity: 0.3; }
  55%      { opacity: 1; }
  80%      { opacity: 1; }
  85%      { opacity: 0.5; }
  90%      { opacity: 1; }
}

/* ================================================
   HEADER
   ================================================ */
.cabinet-header {
  position: relative;
  padding: 10px 14px 8px;
  background: linear-gradient(180deg, #2a0505 0%, #1a0303 100%);
  border-bottom: 3px solid var(--gold-dark);
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.header-glow {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
  animation: headerGlow 3s ease-in-out infinite;
}

@keyframes headerGlow {
  0%,100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

.title-section {
  flex: 1;
}

.game-title {
  font-size: clamp(20px, 5vw, 32px);
  font-family: 'Press Start 2P', monospace;
  letter-spacing: 4px;
  line-height: 1;
  display: flex;
  gap: 2px;
  flex-wrap: nowrap;
}

.title-letter {
  display: inline-block;
  color: var(--gold-light);
  text-shadow:
    0 0 10px var(--gold),
    0 0 20px rgba(212,175,55,0.5),
    2px 2px 0 var(--gold-dark);
  animation: titlePulse 4s ease-in-out infinite;
}

.title-letter:nth-child(1) { animation-delay: 0.0s; }
.title-letter:nth-child(2) { animation-delay: 0.1s; }
.title-letter:nth-child(3) { animation-delay: 0.2s; }
.title-letter:nth-child(4) { animation-delay: 0.3s; }
.title-letter:nth-child(5) { animation-delay: 0.4s; }
.title-letter:nth-child(6) { animation-delay: 0.5s; }

@keyframes titlePulse {
  0%,100% { text-shadow: 0 0 10px var(--gold), 0 0 20px rgba(212,175,55,0.5), 2px 2px 0 var(--gold-dark); }
  50%      { text-shadow: 0 0 20px var(--gold), 0 0 40px rgba(212,175,55,0.8), 2px 2px 0 var(--gold-dark); }
}

.tagline {
  font-size: 5px;
  color: var(--gold);
  opacity: 0.7;
  margin-top: 6px;
  letter-spacing: 1px;
  white-space: nowrap;
}

.win-panel {
  text-align: center;
  flex-shrink: 0;
}

/* ================================================
   LED DISPLAYS
   ================================================ */
.led-display {
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  font-size: clamp(14px, 4vw, 20px);
  background: var(--led-bg);
  color: var(--led-red);
  text-shadow: 0 0 8px var(--led-red), 0 0 16px rgba(255,32,32,0.4);
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #333;
  min-width: 80px;
  text-align: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
  letter-spacing: 1px;
}

.win-display {
  font-size: clamp(12px, 3.5vw, 18px);
  color: var(--led-amber);
  text-shadow: 0 0 8px var(--led-amber), 0 0 16px rgba(255,170,0,0.4);
  min-width: 90px;
}

.win-display.flashing {
  animation: winFlash 0.3s step-end infinite;
}

@keyframes winFlash {
  0%,100% { color: var(--led-amber); text-shadow: 0 0 8px var(--led-amber), 0 0 16px rgba(255,170,0,0.4); }
  50%      { color: #fff; text-shadow: 0 0 12px #fff, 0 0 24px rgba(255,255,255,0.6); }
}

.nudge-led {
  color: var(--led-green);
  text-shadow: 0 0 8px var(--led-green), 0 0 16px rgba(0,255,68,0.4);
}

.panel-label {
  font-size: 6px;
  color: var(--gold);
  opacity: 0.8;
  text-align: center;
  margin-bottom: 4px;
  letter-spacing: 2px;
}

.display-group {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ================================================
   REEL AREA
   ================================================ */
.reel-area {
  padding: 8px 10px;
  background: linear-gradient(180deg, #180303 0%, #100202 100%);
  border-bottom: 2px solid var(--gold-dark);
}

.reel-panel {
  position: relative;
  background: #0a0101;
  border-radius: 8px;
  border: 2px solid #4a2a00;
  box-shadow:
    inset 0 4px 20px rgba(0,0,0,0.9),
    0 0 20px rgba(0,0,0,0.5),
    0 0 1px var(--gold-dark);
  padding: 8px;
}

.payline-marker {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-light);
  font-size: 10px;
  font-family: 'Press Start 2P', monospace;
  text-shadow: 0 0 8px var(--gold);
  z-index: 10;
  pointer-events: none;
}
.payline-marker.left  { left: -2px; }
.payline-marker.right { right: -2px; }

.reel-strip {
  display: flex;
  align-items: stretch;
  gap: 0;
  justify-content: center;
  max-width: 280px;
  margin: 0 auto;
}

.reel-divider {
  width: 5px;
  background: linear-gradient(180deg, #3a1a00, #1a0800, #3a1a00);
  border-left: 1px solid #5a3000;
  border-right: 1px solid #5a3000;
  flex-shrink: 0;
}

.reel-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 88px;
  position: relative;
}

.reel-chrome {
  height: 8px;
  background: linear-gradient(90deg, var(--chrome2), var(--chrome3), var(--chrome1), var(--chrome3), var(--chrome2));
  border: 1px solid #888;
  position: relative;
  z-index: 2;
}
.reel-chrome.top-chrome {
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.reel-chrome.bottom-chrome {
  border-top: none;
  border-radius: 0 0 3px 3px;
  box-shadow: 0 -1px 4px rgba(0,0,0,0.5);
}

.reel-canvas-wrap {
  position: relative;
  overflow: hidden;
  /* aspect-ratio matches canvas internal size 128×384 (1 wide : 3 tall) */
  aspect-ratio: 128 / 384;
  width: 100%;
  border-left: 1px solid #555;
  border-right: 1px solid #555;
  background: #080202;
}

.reel-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
}

/* Payline overlay on each reel */
.reel-canvas-wrap::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 33.33%;
  height: 33.33%;
  border-top: 2px solid var(--payline);
  border-bottom: 2px solid var(--payline);
  pointer-events: none;
  box-shadow:
    0 0 8px rgba(255,200,0,0.4),
    inset 0 0 8px rgba(255,200,0,0.05);
}

/* Win highlight on reel window */
.reel-window.win-highlight .reel-canvas-wrap::after {
  border-color: #fff;
  box-shadow: 0 0 16px rgba(255,255,255,0.8), inset 0 0 20px rgba(255,255,255,0.1);
  animation: reelWinPulse 0.4s ease-in-out infinite;
}

@keyframes reelWinPulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* ================================================
   REEL CONTROLS
   ================================================ */
.reel-controls {
  display: flex;
  justify-content: space-around;
  padding: 6px 10px;
  background: linear-gradient(180deg, #120202 0%, #1a0303 100%);
  border-bottom: 2px solid #2a1400;
  gap: 5px;
}

.reel-ctrl-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
  max-width: 140px;
}

/* ================================================
   BUTTONS — Base
   ================================================ */
.btn {
  font-family: 'Press Start 2P', monospace;
  cursor: pointer;
  border: none;
  outline: none;
  border-radius: 6px;
  transition: all 0.08s ease;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.btn:active:not(:disabled) {
  transform: translateY(2px);
}

.btn:disabled {
  opacity: 0.3;
  cursor: default;
  filter: grayscale(0.5);
}

/* Inner highlight sheen */
.btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 40%;
  background: rgba(255,255,255,0.12);
  border-radius: 4px 4px 0 0;
  pointer-events: none;
}

/* ---- Nudge Buttons ---- */
.nudge-btn {
  width: 100%;
  padding: 4px 4px;
  font-size: 6px;
  line-height: 1.4;
  color: #fff;
  background: linear-gradient(180deg, #2060c0, #0a3a8a, #08306e);
  border: 2px solid #0a3a8a;
  box-shadow:
    0 3px 0 #051d45,
    0 4px 8px rgba(0,0,0,0.5),
    inset 0 0 6px rgba(50,120,255,0.2);
  text-shadow: 0 0 6px rgba(100,160,255,0.8);
  text-align: center;
}

.nudge-btn:not(:disabled):hover {
  background: linear-gradient(180deg, #3070d0, #1a4a9a, #0a3a7e);
  box-shadow: 0 3px 0 #051d45, 0 4px 8px rgba(0,0,0,0.5), 0 0 12px rgba(50,120,255,0.5);
}

.nudge-btn:not(:disabled):active {
  box-shadow: 0 0 0 #051d45, 0 1px 4px rgba(0,0,0,0.5);
}

.nudge-btn span {
  display: block;
  font-size: 6px;
  opacity: 0.9;
}

/* ---- Hold Buttons ---- */
.hold-btn {
  width: 100%;
  padding: 6px 4px;
  font-size: 7px;
  color: #1a0a00;
  background: linear-gradient(180deg, #ffc040, #d48000, #a86000);
  border: 2px solid #c07000;
  box-shadow:
    0 3px 0 #7a4000,
    0 4px 8px rgba(0,0,0,0.5),
    inset 0 0 6px rgba(255,200,80,0.3);
  text-shadow: 1px 1px 0 rgba(255,255,255,0.3);
}

.hold-btn:not(:disabled):hover {
  background: linear-gradient(180deg, #ffd060, #e49010, #b87010);
}

.hold-btn:not(:disabled):active {
  box-shadow: 0 0 0 #7a4000, 0 1px 4px rgba(0,0,0,0.5);
}

.hold-btn.held {
  background: linear-gradient(180deg, #ffee80, #ffc020, #d48000) !important;
  border-color: #ffd040 !important;
  box-shadow:
    0 3px 0 #7a4000,
    0 4px 8px rgba(0,0,0,0.5),
    0 0 16px rgba(255,200,0,0.6) !important;
  color: #1a0a00 !important;
  animation: holdPulse 1s ease-in-out infinite;
}

@keyframes holdPulse {
  0%,100% { box-shadow: 0 3px 0 #7a4000, 0 4px 8px rgba(0,0,0,0.5), 0 0 16px rgba(255,200,0,0.6); }
  50%      { box-shadow: 0 3px 0 #7a4000, 0 4px 8px rgba(0,0,0,0.5), 0 0 28px rgba(255,200,0,0.9); }
}

/* ================================================
   BOTTOM PANEL
   ================================================ */
.bottom-panel {
  padding: 8px 12px 10px;
  background: linear-gradient(180deg, #1a0303 0%, #120202 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-section {
  display: flex;
  justify-content: space-around;
  gap: 12px;
}

.action-section {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: stretch;
}

.paytable-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}

.keyboard-hint {
  font-size: 6px;
  color: rgba(255,255,255,0.3);
  font-family: 'Press Start 2P', monospace;
}

/* ---- Coin Button ---- */
.coin-btn {
  flex: 1;
  padding: 7px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #ddd;
  background: linear-gradient(180deg, #666, #3a3a3a, #252525);
  border: 2px solid #505050;
  box-shadow: 0 3px 0 #111, 0 4px 8px rgba(0,0,0,0.5);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}

.coin-btn:not(:disabled):hover {
  background: linear-gradient(180deg, #777, #4a4a4a, #333);
}

.coin-btn:not(:disabled):active {
  box-shadow: 0 0 0 #111;
}

.coin-icon { font-size: 16px; line-height: 1; }
.coin-label { font-size: 6px; }
.coin-value { font-size: 7px; color: var(--gold); }

/* ---- Spin Button ---- */
.spin-btn {
  flex: 1.4;
  padding: 7px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #fff;
  background: linear-gradient(180deg, #3da03d, #1a6a1a, #0e4e0e);
  border: 2px solid #2a6a2a;
  box-shadow:
    0 4px 0 #0a3a0a,
    0 6px 12px rgba(0,0,0,0.6),
    inset 0 0 10px rgba(80,200,80,0.15),
    0 0 20px rgba(40,160,40,0.15);
  text-shadow: 0 0 8px rgba(100,255,100,0.5);
}

.spin-btn:not(:disabled):hover {
  background: linear-gradient(180deg, #4db04d, #2a7a2a, #1a5e1a);
  box-shadow: 0 4px 0 #0a3a0a, 0 6px 12px rgba(0,0,0,0.6), 0 0 30px rgba(40,200,40,0.4);
}

.spin-btn:not(:disabled):active {
  box-shadow: 0 0 0 #0a3a0a, 0 2px 6px rgba(0,0,0,0.6);
}

.spin-label { font-size: 14px; letter-spacing: 2px; }
.spin-sub   { font-size: 6px; opacity: 0.7; }

.spin-btn:not(:disabled) {
  animation: spinBtnGlow 2.5s ease-in-out infinite;
}

@keyframes spinBtnGlow {
  0%,100% { box-shadow: 0 4px 0 #0a3a0a, 0 6px 12px rgba(0,0,0,0.6), 0 0 20px rgba(40,160,40,0.15); }
  50%      { box-shadow: 0 4px 0 #0a3a0a, 0 6px 12px rgba(0,0,0,0.6), 0 0 35px rgba(40,200,40,0.5); }
}

/* ---- Gamble Button ---- */
.gamble-btn {
  flex: 1;
  padding: 7px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #ffc0c0;
  background: linear-gradient(180deg, #a01010, #6a0808, #4a0404);
  border: 2px solid #7a0808;
  box-shadow: 0 3px 0 #2a0000, 0 4px 8px rgba(0,0,0,0.5);
  text-shadow: 0 0 8px rgba(255,100,100,0.5);
}

.gamble-btn:not(:disabled):hover {
  background: linear-gradient(180deg, #c02020, #8a1010, #6a0606);
}

.gamble-btn:not(:disabled):active {
  box-shadow: 0 0 0 #2a0000;
}

.gamble-btn:not(:disabled) {
  animation: gambleBtnGlow 1.5s ease-in-out infinite;
}

@keyframes gambleBtnGlow {
  0%,100% { box-shadow: 0 3px 0 #2a0000, 0 4px 8px rgba(0,0,0,0.5), 0 0 10px rgba(180,0,0,0.2); }
  50%      { box-shadow: 0 3px 0 #2a0000, 0 4px 8px rgba(0,0,0,0.5), 0 0 25px rgba(220,0,0,0.6); }
}

.gamble-icon  { font-size: 14px; line-height: 1; }
.gamble-label { font-size: 6px; }

/* ---- Info / Pay Table Button ---- */
.info-btn {
  font-size: 7px;
  padding: 6px 10px;
  color: var(--gold);
  background: linear-gradient(180deg, #2a1800, #1a0e00);
  border: 1px solid var(--gold-dark);
  box-shadow: 0 2px 0 #0a0500;
  letter-spacing: 1px;
}

.info-btn:hover {
  background: linear-gradient(180deg, #3a2200, #2a1400);
  border-color: var(--gold);
}

/* ================================================
   WIN FLASH OVERLAY
   ================================================ */
.win-flash-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: rgba(255, 220, 0, 0);
  transition: none;
}

.win-flash-overlay.flash {
  animation: screenFlash 0.5s ease-out forwards;
}

@keyframes screenFlash {
  0%   { background: rgba(255, 220, 0, 0.45); }
  100% { background: rgba(255, 220, 0, 0); }
}

/* ================================================
   MESSAGE TOAST
   ================================================ */
.message-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: linear-gradient(180deg, #3a1a00, #1a0a00);
  border: 2px solid var(--gold);
  color: var(--gold-light);
  padding: 10px 20px;
  border-radius: 6px;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.8), 0 0 20px rgba(212,175,55,0.3);
  z-index: 200;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  white-space: nowrap;
  pointer-events: none;
  text-align: center;
}

.message-toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ================================================
   OVERLAY BACKDROP
   ================================================ */
.overlay-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.overlay-backdrop.hidden {
  display: none;
}

/* ================================================
   GAMBLE MODAL
   ================================================ */
.gamble-modal {
  background: linear-gradient(160deg, #2a0606 0%, #150303 100%);
  border: 3px solid var(--gold-dark);
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 0 60px rgba(200,0,0,0.3), 0 0 0 1px #5a3800;
  text-align: center;
}

.modal-title {
  font-size: 18px;
  color: var(--gold-light);
  text-shadow: 0 0 12px var(--gold), 0 0 24px rgba(212,175,55,0.5);
  margin-bottom: 16px;
  letter-spacing: 4px;
}

.gamble-info {
  display: flex;
  justify-content: space-around;
  margin-bottom: 16px;
}

.card-section {
  margin-bottom: 16px;
}

.card-instruction {
  font-size: 8px;
  color: #ccc;
  margin-bottom: 10px;
}

.card-container {
  display: flex;
  justify-content: center;
  perspective: 600px;
}

.playing-card {
  width: 90px;
  height: 130px;
  position: relative;
}

.card-face {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  border: 2px solid #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.card-back {
  background: linear-gradient(135deg, #1a0040, #060020);
  opacity: 1;
  transform: scale(1);
}

.card-back-pattern {
  color: #4a3080;
  font-size: 52px;
  line-height: 1;
}

.playing-card.flipped .card-back {
  opacity: 0;
  transform: scale(0.85);
}

.card-front {
  background: #fff;
  opacity: 0;
  transform: scale(0.85);
}

.playing-card.flipped .card-front {
  opacity: 1;
  transform: scale(1);
}

.card-front #card-value {
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  font-weight: 900;
  color: #cc0000;
  text-shadow: 0 0 8px rgba(200,0,0,0.3);
}

.card-front.black-card #card-value {
  color: #111;
  text-shadow: none;
}

.gamble-result-msg {
  font-size: 9px;
  height: 20px;
  line-height: 20px;
  margin-top: 8px;
  font-family: 'Press Start 2P', monospace;
  transition: opacity 0.3s;
}

.gamble-result-msg.win  { color: #00ff44; text-shadow: 0 0 8px #00ff44; }
.gamble-result-msg.lose { color: #ff2020; text-shadow: 0 0 8px #ff2020; }

.gamble-action-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.higher-btn, .lower-btn {
  flex: 1;
  padding: 10px 6px;
  font-size: 8px;
  color: #fff;
}

.higher-btn {
  background: linear-gradient(180deg, #2060c0, #0a3a8a, #08306e);
  border: 2px solid #0a3a8a;
  box-shadow: 0 3px 0 #051d45;
}

.higher-btn:not(:disabled):hover { background: linear-gradient(180deg, #3070d0, #1a4a9a, #0a3a7e); }
.higher-btn:not(:disabled):active { box-shadow: 0 0 0 #051d45; }

.lower-btn {
  background: linear-gradient(180deg, #a01010, #6a0808, #4a0404);
  border: 2px solid #7a0808;
  box-shadow: 0 3px 0 #2a0000;
}

.lower-btn:not(:disabled):hover { background: linear-gradient(180deg, #c02020, #8a1010, #6a0606); }
.lower-btn:not(:disabled):active { box-shadow: 0 0 0 #2a0000; }

.collect-btn {
  flex: 1;
  padding: 10px 6px;
  font-size: 7px;
  color: var(--gold-light);
  background: linear-gradient(180deg, #3a2200, #1a1000, #0e0a00);
  border: 2px solid var(--gold-dark);
  box-shadow: 0 3px 0 #0a0500;
}

.collect-btn:not(:disabled):hover { background: linear-gradient(180deg, #4a2e00, #2a1600, #1a1000); }
.collect-btn:not(:disabled):active { box-shadow: 0 0 0 #0a0500; }

/* ================================================
   PAY TABLE MODAL
   ================================================ */
.paytable-modal {
  background: linear-gradient(160deg, #1a0a02 0%, #0c0602 100%);
  border: 3px solid var(--gold-dark);
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 98vh;
  overflow-y: auto;
  box-shadow: 0 0 60px rgba(212,175,55,0.2), 0 0 0 1px #5a3800;
}

.paytable-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.paytable-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.4);
  border: 1px solid #2a1800;
  border-radius: 4px;
  padding: 6px 10px;
  gap: 8px;
}

.pt-symbols {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.pt-sym-img {
  width: 28px;
  height: 28px;
  image-rendering: auto;
}

.pt-name {
  font-size: 6px;
  color: #ccc;
  flex: 1;
  text-align: center;
}

.pt-payout {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 900;
  color: var(--led-amber);
  text-shadow: 0 0 6px var(--led-amber);
  min-width: 55px;
  text-align: right;
}

.pt-jackpot .pt-payout {
  color: var(--gold-light);
  text-shadow: 0 0 10px var(--gold-light), 0 0 20px var(--gold);
  font-size: 13px;
  animation: jackpotGlow 1.5s ease-in-out infinite;
}

@keyframes jackpotGlow {
  0%,100% { text-shadow: 0 0 10px var(--gold-light), 0 0 20px var(--gold); }
  50%      { text-shadow: 0 0 20px #fff, 0 0 40px var(--gold-light); }
}

.paytable-notes {
  font-size: 6px;
  color: #aaa;
  line-height: 2;
  border-top: 1px solid #2a1800;
  padding-top: 10px;
  margin-bottom: 14px;
}

.paytable-highscore {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--gold-dark);
  border-radius: 4px;
  padding: 6px 12px;
  margin-bottom: 12px;
  background: rgba(255,160,0,0.06);
}

.paytable-highscore .panel-label {
  font-size: 6px;
  margin-bottom: 0;
}

.paytable-highscore .led-display {
  font-size: 13px;
  color: #ffdd44;
  text-shadow: 0 0 10px #ffaa00;
}

.close-btn {
  display: block;
  width: 100%;
  padding: 10px;
  font-size: 9px;
  color: var(--gold-light);
  background: linear-gradient(180deg, #3a2200, #1a1000);
  border: 2px solid var(--gold-dark);
  box-shadow: 0 3px 0 #0a0500;
}

.close-btn:hover { background: linear-gradient(180deg, #4a2e00, #2a1600); }
.close-btn:active { box-shadow: 0 0 0 #0a0500; }

/* ================================================
   NUDGE AWARDED ANIMATION
   ================================================ */
@keyframes nudgeAwarded {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.15); }
  60%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.nudge-led.awarded {
  animation: nudgeAwarded 0.4s ease-out, nudgeLedPulse 0.8s 0.4s ease-in-out 3;
}

@keyframes nudgeLedPulse {
  0%,100% { color: var(--led-green); text-shadow: 0 0 8px var(--led-green); }
  50%      { color: #fff; text-shadow: 0 0 16px #00ff44, 0 0 32px #00ff44; }
}

/* ================================================
   JACKPOT SPECIAL
   ================================================ */
.cabinet.jackpot-flash {
  animation: jackpotCabinetFlash 0.25s step-end 12;
}

@keyframes jackpotCabinetFlash {
  0%,100% { border-color: var(--gold-dark); box-shadow: 0 0 0 1px #5a3800, 0 0 40px rgba(212,175,55,0.25); }
  50%      { border-color: #fff; box-shadow: 0 0 0 2px #fff, 0 0 80px rgba(255,255,255,0.5); }
}

/* ================================================
   RESPONSIVE — very small screens
   ================================================ */
@media (max-width: 360px) {
  .game-title { font-size: 18px; letter-spacing: 2px; }
  .tagline    { font-size: 4px; }
  .spin-label { font-size: 12px; }
  .nudge-btn  { font-size: 6px; padding: 5px 3px; }
  .hold-btn   { font-size: 7px; padding: 6px 3px; }
}

/* scrollbar inside paytable modal */
.paytable-modal::-webkit-scrollbar { width: 4px; }
.paytable-modal::-webkit-scrollbar-track { background: #0a0600; }
.paytable-modal::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 2px; }

/* ---- About Button ---- */
.about-btn {
  margin-left: 6px;
}

/* ================================================
   NUDGE LIGHT SHOW
   ================================================ */

/* Chase sequence on lights when nudge is active */
.lights-bar.nudge-chase .light {
  animation: nudgeLightChase 0.6s infinite !important;
}
.lights-bar.nudge-chase .light:nth-child(1)  { animation-delay: 0.00s !important; }
.lights-bar.nudge-chase .light:nth-child(2)  { animation-delay: 0.05s !important; }
.lights-bar.nudge-chase .light:nth-child(3)  { animation-delay: 0.10s !important; }
.lights-bar.nudge-chase .light:nth-child(4)  { animation-delay: 0.15s !important; }
.lights-bar.nudge-chase .light:nth-child(5)  { animation-delay: 0.20s !important; }
.lights-bar.nudge-chase .light:nth-child(6)  { animation-delay: 0.25s !important; }
.lights-bar.nudge-chase .light:nth-child(7)  { animation-delay: 0.30s !important; }
.lights-bar.nudge-chase .light:nth-child(8)  { animation-delay: 0.35s !important; }
.lights-bar.nudge-chase .light:nth-child(9)  { animation-delay: 0.40s !important; }
.lights-bar.nudge-chase .light:nth-child(10) { animation-delay: 0.45s !important; }
.lights-bar.nudge-chase .light:nth-child(11) { animation-delay: 0.50s !important; }
.lights-bar.nudge-chase .light:nth-child(12) { animation-delay: 0.55s !important; }

@keyframes nudgeLightChase {
  0%,100% { opacity: 0.1; transform: scale(0.8); }
  20%      { opacity: 1;   transform: scale(1.3); filter: brightness(2); }
  40%      { opacity: 0.9; transform: scale(1.1); }
  60%      { opacity: 0.3; transform: scale(0.9); }
}

/* FRUITY title strobe when nudge active */
.game-title.nudge-strobe .title-letter {
  animation: nudgeTitleStrobe 0.18s step-end infinite !important;
}
.game-title.nudge-strobe .title-letter:nth-child(1) { animation-delay: 0.00s !important; }
.game-title.nudge-strobe .title-letter:nth-child(2) { animation-delay: 0.03s !important; }
.game-title.nudge-strobe .title-letter:nth-child(3) { animation-delay: 0.06s !important; }
.game-title.nudge-strobe .title-letter:nth-child(4) { animation-delay: 0.09s !important; }
.game-title.nudge-strobe .title-letter:nth-child(5) { animation-delay: 0.12s !important; }
.game-title.nudge-strobe .title-letter:nth-child(6) { animation-delay: 0.15s !important; }

@keyframes nudgeTitleStrobe {
  0%,100% { color: var(--gold-light); text-shadow: 0 0 10px var(--gold), 0 0 20px rgba(212,175,55,0.5), 2px 2px 0 var(--gold-dark); }
  50%      { color: #fff; text-shadow: 0 0 20px #fff, 0 0 40px #fff, 0 0 60px var(--gold-light); }
}

/* Nudge buttons flash when nudge phase active */
.nudge-btn.nudge-flash:not(:disabled) {
  animation: nudgeBtnFlash 0.4s step-end infinite !important;
}

@keyframes nudgeBtnFlash {
  0%,100% {
    background: linear-gradient(180deg, #2060c0, #0a3a8a, #08306e);
    box-shadow: 0 3px 0 #051d45, 0 4px 8px rgba(0,0,0,0.5), inset 0 0 6px rgba(50,120,255,0.2);
  }
  50% {
    background: linear-gradient(180deg, #80c0ff, #4090e0, #2060c0);
    box-shadow: 0 3px 0 #051d45, 0 4px 8px rgba(0,0,0,0.5), 0 0 20px rgba(80,160,255,0.9);
  }
}

/* ================================================
   CREDITS MODAL
   ================================================ */
.credits-modal {
  background: linear-gradient(160deg, #0a0a2a 0%, #050514 100%);
  border: 3px solid var(--gold-dark);
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 0 60px rgba(100,80,255,0.3), 0 0 0 1px #5a3800;
  text-align: center;
}

.credits-fruit-stage {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: linear-gradient(180deg, #05051a 0%, #0a0a30 100%);
  border-radius: 8px;
  border: 1px solid #2a2060;
  margin-bottom: 18px;
}

#fireworks-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
}

.credits-text {
  margin-bottom: 20px;
}

.credits-dev {
  font-size: 9px;
  color: var(--gold-light);
  text-shadow: 0 0 10px var(--gold);
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.credits-version {
  font-size: 7px;
  color: #aaa;
  letter-spacing: 2px;
}
