/* ============================================================
   SatoshiGuesser – Slot Machine Styles (финальная версия)
   ============================================================ */

.machine {
  width: 100%;
  max-width: 740px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.machine-frame {
  position: relative;
  background: linear-gradient(145deg, #1b1a2a, #0f0e1a);
  border: 2px solid #3b2c1a;
  box-shadow:
    0 0 0 4px #0f0e1a,
    0 0 0 6px var(--accent, #f7931a),
    0 20px 60px rgba(0, 0, 0, 0.8),
    inset 0 0 80px rgba(247, 147, 26, 0.08);
  border-radius: 1.8rem;
  padding: 2rem 1.5rem 2.2rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* ============================================================
   КЛАССИЧЕСКИЙ РЕЖИМ
   ============================================================ */
.reels {
  display: flex;
  gap: 0.8rem;
  background: #0a0c14;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--border, #2b3150);
  width: 100%;
  justify-content: center;
  box-shadow: inset 0 4px 20px rgba(0,0,0,0.7);
  perspective: 800px;
}

.reel {
  position: relative;
  width: 6rem;
  height: 6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, #f5f5f0, #cfcfc5);
  border-radius: 1.2rem;
  box-shadow:
    inset 0 -6px 12px rgba(0,0,0,0.2),
    inset 0 6px 12px rgba(255,255,255,0.7),
    0 8px 24px rgba(0,0,0,0.5);
  transition: all 0.25s ease;
  overflow: hidden;
  transform-style: preserve-3d;
  transform: rotateY(0deg) scale(1);
  backface-visibility: hidden;

  /* Скрываем весь внутренний текст */
  font-size: 0 !important;
  color: transparent !important;
}
.reel * {
  font-size: 0 !important;
  color: transparent !important;
}

/* ---- Биткоин-монета (псевдоэлемент) ---- */
.reel::before {
  content: "₿";
  position: absolute;
  font-size: 3.8rem;
  font-weight: 700;
  color: var(--ink, #eef0f8);
  text-shadow: 0 0 10px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  line-height: 1;
  backface-visibility: hidden;
  font-family: "Segoe UI", "Arial Unicode MS", sans-serif;
  z-index: 2;
}

/* ---- Стеклянный блик ---- */
.reel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 60%);
  pointer-events: none;
  border-radius: inherit;
  backface-visibility: hidden;
  z-index: 1;
}

/* ---- SPINNING ---- */
.reel.spinning {
  background: radial-gradient(circle at 30% 30%, #fffbe6, #f0e6c0);
  animation: reel3dSpin 0.6s cubic-bezier(0.2, 0.8, 0.3, 1) infinite;
  filter: blur(1.5px);
}
.reel.spinning::before {
  color: #d4b87a;
  text-shadow: 0 0 20px #f7931a66;
}
.reel.spinning::after {
  background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, transparent 60%);
}

@keyframes reel3dSpin {
  0%   { transform: rotateY(0deg) scale(1); }
  100% { transform: rotateY(360deg) scale(1); }
}

/* ---- WIN ---- */
.reel.win {
  background: radial-gradient(circle at 30% 30%, #b8f5d6, #4fd18a);
  box-shadow: 0 0 50px var(--win-glow, #6fe0a4), inset 0 0 30px var(--win-glow, #6fe0a4);
  animation: winGlow 0.8s ease-in-out infinite alternate;
  transform: rotateY(0deg) scale(1);
  filter: blur(0);
}
.reel.win::before {
  color: #0a2d1a;
  text-shadow: 0 0 30px var(--win-glow, #6fe0a4);
}
.reel.win::after {
  background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, transparent 60%);
}

@keyframes winGlow {
  0%   { box-shadow: 0 0 30px var(--win-glow, #6fe0a4), inset 0 0 20px var(--win-glow, #6fe0a4); }
  100% { box-shadow: 0 0 80px var(--win-glow, #6fe0a4), inset 0 0 60px var(--win-glow, #6fe0a4); }
}

/* ---- LOSE – монета + крестик ---- */
.reel.lose {
  background: radial-gradient(circle at 30% 30%, #f7caca, #e08585);
  box-shadow: 0 0 50px var(--lose-glow, #ff6b81), inset 0 0 30px var(--lose-glow, #ff6b81);
  animation: loseGlow 0.6s ease-in-out infinite alternate;
  transform: rotateY(0deg) scale(1);
  filter: blur(0);
}
.reel.lose::before {
  color: #3d0e0e;
  text-shadow: 0 0 30px var(--lose-glow, #ff6b81);
}
.reel.lose::after {
  content: "✗";
  position: absolute;
  font-size: 4.5rem;
  font-weight: 900;
  color: #3d0e0e;
  text-shadow: 0 0 20px var(--lose-glow, #ff6b81);
  line-height: 1;
  background: none;
  inset: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  font-family: "Segoe UI", "Arial Unicode MS", sans-serif;
  z-index: 3;
}

@keyframes loseGlow {
  0%   { box-shadow: 0 0 20px var(--lose-glow, #ff6b81), inset 0 0 15px var(--lose-glow, #ff6b81); }
  100% { box-shadow: 0 0 70px var(--lose-glow, #ff6b81), inset 0 0 50px var(--lose-glow, #ff6b81); }
}

/* ---- Адаптив ---- */
@media (max-width: 600px) {
  .reel {
    width: 4.2rem;
    height: 4.2rem;
  }
  .reel::before {
    font-size: 2.6rem;
  }
  .reel.lose::after {
    font-size: 3rem;
  }
}

/* ============================================================
   РЕАЛИСТИЧНЫЙ РЕЖИМ (64 hex-ячейки)
   ============================================================ */
.reels-realistic {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 4px;
  background: #0a0c14;
  padding: 0.8rem;
  border-radius: 1rem;
  border: 1px solid var(--border, #2b3150);
  width: 100%;
  box-shadow: inset 0 4px 20px rgba(0,0,0,0.6);
}

.hex-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1f253a;
  color: var(--ink, #eef0f8);
  border-radius: 4px;
  font-family: var(--mono, monospace);
  font-size: 1.1rem;
  font-weight: 700;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

/* Скрываем внутренний текст в ячейках */
.hex-cell * {
  font-size: 0 !important;
  color: transparent !important;
}

.hex-cell.win {
  background: var(--win, #2bd47d);
  color: #0a1f12;
  box-shadow: 0 0 30px var(--win-glow, #6fe0a4);
  transform: scale(1.05);
}

.hex-cell.lose {
  background: var(--lose, #ff4757);
  color: #2a0d0d;
  box-shadow: 0 0 30px var(--lose-glow, #ff6b81);
  transform: scale(0.95);
}
.hex-cell.lose::after {
  content: "✗";
  position: absolute;
  font-size: 1.6rem;
  font-weight: 900;
  color: #2a0d0d;
  opacity: 0.9;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  text-shadow: 0 0 10px var(--lose-glow, #ff6b81);
  font-family: "Segoe UI", "Arial Unicode MS", sans-serif;
}

@media (max-width: 600px) {
  .reels-realistic {
    grid-template-columns: repeat(8, 1fr);
    gap: 3px;
  }
  .hex-cell {
    font-size: 0.85rem;
  }
  .hex-cell.lose::after {
    font-size: 1.2rem;
  }
}

/* ============================================================
   КНОПКА SPIN
   ============================================================ */
.lever {
  position: relative;
  background: linear-gradient(145deg, var(--accent, #f7931a), #c6740c);
  color: #1a1004;
  font-family: var(--sans, sans-serif);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  padding: 0.9rem 2.8rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow:
    0 0 0 2px rgba(247, 147, 26, 0.3),
    0 8px 0 #8f4f0a,
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    0 8px 40px var(--shadow, rgba(247, 147, 26, 0.3));
  transition: all 0.1s ease;
  text-transform: uppercase;
}
.lever::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 80%);
  pointer-events: none;
}

.lever:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 0 0 2px rgba(247, 147, 26, 0.5), 0 10px 0 #8f4f0a, 0 12px 60px var(--shadow, rgba(247, 147, 26, 0.3));
}
.lever:active:not(:disabled) {
  transform: translateY(6px);
  box-shadow: 0 0 0 2px rgba(247, 147, 26, 0.3), 0 2px 0 #8f4f0a, 0 6px 30px var(--shadow, rgba(247, 147, 26, 0.3));
}
.lever:disabled {
  opacity: 0.5;
  transform: translateY(4px);
  box-shadow: 0 0 0 1px rgba(247, 147, 26, 0.1), 0 4px 0 #6a3a08;
  cursor: not-allowed;
}

.lever:not(:disabled) {
  animation: leverPulse 2.5s ease-in-out infinite;
}
@keyframes leverPulse {
  0%   { box-shadow: 0 0 0 2px rgba(247,147,26,0.3), 0 8px 0 #8f4f0a, 0 8px 40px var(--shadow, rgba(247,147,26,0.3)); }
  50%  { box-shadow: 0 0 0 6px rgba(247,147,26,0.1), 0 8px 0 #8f4f0a, 0 12px 60px var(--shadow, rgba(247,147,26,0.3)); }
  100% { box-shadow: 0 0 0 2px rgba(247,147,26,0.3), 0 8px 0 #8f4f0a, 0 8px 40px var(--shadow, rgba(247,147,26,0.3)); }
}