/* ══════════════════════════════════════════════
   KOTMALE DAIRIES – SPIN & WIN  |  style.css
   Colors: #313a95 (blue) · #272f80 (dark-blue) · #fffffb (cream)
   ══════════════════════════════════════════════ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --blue: #313a95;
  --dark-blue: #272f80;
  --cream: #fffffb;
  --gold: #f5c518;
  --gold2: #e6a800;
  --red: #e63946;
  --green: #2dc653;
  --radius: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, .45);
}

html,
body {
  height: 100%;
  overflow-x: hidden;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, var(--dark-blue) 0%, var(--blue) 60%, #1a2060 100%);
  color: var(--cream);
}

/* ── PARTICLE CANVAS ── */
#particleCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ══ HEADER ══ */
.game-header {
  position: relative;
  z-index: 10;
  background: rgba(39, 47, 128, .85);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid rgba(245, 197, 24, .35);
  padding: 10px 30px;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .5));
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.header-stats {
  display: flex;
  gap: 10px;
}

.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 251, .08);
  border: 1px solid rgba(255, 255, 251, .18);
  border-radius: 10px;
  padding: 4px 14px;
  min-width: 64px;
}

.win-rate-pill {
  border-color: rgba(245, 197, 24, .4);
  background: rgba(245, 197, 24, .1);
}

.stat-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  opacity: .7;
  font-weight: 600;
}

.stat-value {
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
}

.admin-hint {
  font-size: 11px;
  opacity: .5;
}

.admin-hint kbd {
  background: rgba(255, 255, 255, .15);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  border: 1px solid rgba(255, 255, 255, .3);
}

/* ══ MAIN ══ */
.game-main {
  position: relative;
  z-index: 5;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

/* Title */
.game-title-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.game-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 900;
  letter-spacing: 4px;
  text-shadow: 0 0 30px rgba(245, 197, 24, .6), 0 4px 16px rgba(0, 0, 0, .6);
}

.title-spin {
  color: var(--cream);
}

.title-amp {
  color: var(--gold);
  margin: 0 8px;
}

.title-win {
  color: var(--gold);
  animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {

  0%,
  100% {
    text-shadow: 0 0 20px rgba(245, 197, 24, .4);
  }

  50% {
    text-shadow: 0 0 40px rgba(245, 197, 24, 1), 0 0 80px rgba(245, 197, 24, .5);
  }
}

/* Timer */
.timer-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 251, .06);
  border: 2px solid rgba(245, 197, 24, .3);
  border-radius: var(--radius);
  padding: 10px 20px;
  min-width: 120px;
}

.timer-label {
  font-size: 10px;
  letter-spacing: 2px;
  opacity: .6;
  font-weight: 600;
}

.timer-display {
  font-family: 'Orbitron', monospace;
  font-size: 38px;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
  transition: color .3s;
}

.timer-display.urgent {
  color: var(--red);
  animation: urgentPulse .5s ease-in-out infinite;
}

@keyframes urgentPulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .5
  }
}

.timer-bar-wrap {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, .15);
  border-radius: 3px;
  overflow: hidden;
}

.timer-bar {
  height: 100%;
  width: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width .9s linear, background .5s;
}

.timer-bar.urgent {
  background: var(--red);
}

/* Win req banner */
.win-req-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 197, 24, .12);
  border: 1px solid rgba(245, 197, 24, .35);
  border-radius: 50px;
  padding: 6px 22px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .5px;
}

.req-label {
  opacity: .85;
}

.req-count {
  font-family: 'Orbitron', monospace;
  font-size: 22px;
  font-weight: 900;
  color: var(--gold);
  margin: 0 2px;
}

/* ══ SLOT MACHINE ══ */
.slot-machine {
  width: 100%;
}

.machine-frame {
  background: linear-gradient(180deg, rgba(39, 47, 128, .9) 0%, rgba(25, 31, 90, .95) 100%);
  border: 3px solid var(--gold);
  border-radius: 24px;
  box-shadow: var(--shadow), 0 0 60px rgba(245, 197, 24, .2), inset 0 0 30px rgba(0, 0, 0, .4);
  overflow: hidden;
  position: relative;
}

.machine-top-bar,
.machine-bottom-bar {
  height: 18px;
  background: linear-gradient(90deg, var(--gold2), var(--gold), var(--gold2));
}

.machine-bottom-bar {
  margin-top: 0;
}

.reels-container {
  display: flex;
  gap: 0;
  padding: 0 12px;
  background: rgba(0, 0, 0, .3);
  position: relative;
}

/* center-line overlay removed — player sees the product directly */

/* ── Single Reel Column ── */
.reel-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 6px;
  position: relative;
  overflow: hidden;
}

.reel-col+.reel-col {
  border-left: 1px solid rgba(245, 197, 24, .2);
}

.reel-window {
  width: 180px;
  height: 260px;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  border: 2px solid rgba(255, 255, 255, .1);
  position: relative;
}

.reel-window::before,
.reel-window::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  z-index: 10;
  height: 40px;
  pointer-events: none;
}

.reel-window::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(25, 31, 90, .9), transparent);
}

.reel-window::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(25, 31, 90, .9), transparent);
}

.reel-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: transform;
  transition: none;
}

.reel-item {
  width: 180px;
  height: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
}

.reel-item img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.5));
  transition: transform .2s;
}

.logo-main {
  height: 140px;
  max-height: 140px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,.55)) drop-shadow(0 0 30px rgba(245,197,24,.25));
  transition: transform .3s;
}

.reel-item .product-name {
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  color: rgba(255, 255, 251, .8);
  letter-spacing: .5px;
  line-height: 1.2;
}

/* Highlighted winning item */
.reel-item.winner {
  animation: winnerGlow .6s ease-in-out infinite alternate;
}

@keyframes winnerGlow {
  from {
    background: rgba(245, 197, 24, .1);
    box-shadow: inset 0 0 20px rgba(245, 197, 24, .3);
  }

  to {
    background: rgba(245, 197, 24, .25);
    box-shadow: inset 0 0 40px rgba(245, 197, 24, .6);
  }
}

/* Reel label */
.reel-label {
  font-size: 10px;
  letter-spacing: 2px;
  opacity: .5;
  margin-top: 6px;
  font-weight: 600;
}

/* ══ STOP BUTTONS ══ */
.stop-buttons-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-stop {
  width: 180px;
  padding: 12px 0;
  background: linear-gradient(135deg, #e63946, #b71c1c);
  border: 2px solid rgba(255, 255, 255, .25);
  border-radius: 10px;
  color: #fff;
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(230, 57, 70, .5);
  transition: all .15s;
}

.btn-stop:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(230, 57, 70, .7);
}

.btn-stop:active:not(:disabled) {
  transform: translateY(0);
}

.btn-stop:disabled {
  opacity: .35;
  cursor: not-allowed;
  transform: none;
}

.btn-stop.stopped {
  background: linear-gradient(135deg, #555, #333);
  box-shadow: none;
  opacity: .6;
}

/* ══ SPIN BUTTON ══ */
.main-action-row {
  display: flex;
  justify-content: center;
}

.btn-spin {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 60px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  border: 3px solid rgba(255, 255, 255, .3);
  border-radius: 60px;
  cursor: pointer;
  font-family: 'Orbitron', monospace;
  font-size: 22px;
  font-weight: 900;
  color: #1a1a00;
  letter-spacing: 3px;
  box-shadow: 0 6px 30px rgba(245, 197, 24, .55), 0 2px 0 rgba(255, 255, 255, .3) inset;
  transition: all .2s;
  position: relative;
  overflow: hidden;
}

.btn-spin::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, .2), transparent);
  border-radius: inherit;
}

.btn-spin:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 40px rgba(245, 197, 24, .8), 0 2px 0 rgba(255, 255, 255, .3) inset;
}

.btn-spin:active:not(:disabled) {
  transform: scale(.97);
}

.btn-spin:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

.btn-spin-icon {
  font-size: 26px;
  animation: spinIcon 3s linear infinite;
}

@keyframes spinIcon {
  to {
    transform: rotate(360deg);
  }
}

/* ══ RESULT BANNER ══ */
.result-banner {
  width: 100%;
  text-align: center;
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 12px;
  letter-spacing: 1px;
}

.result-banner.win {
  background: rgba(45, 198, 83, .2);
  border: 2px solid var(--green);
  color: var(--green);
}

.result-banner.lose {
  background: rgba(230, 57, 70, .15);
  border: 2px solid var(--red);
  color: var(--red);
}

/* ══ OVERLAYS ══ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(6px);
  animation: fadeIn .3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

.overlay-card {
  position: relative;
  text-align: center;
  background: linear-gradient(145deg, rgba(49, 58, 149, .95), rgba(39, 47, 128, .98));
  border-radius: 28px;
  padding: 48px 60px;
  box-shadow: var(--shadow), 0 0 80px rgba(245, 197, 24, .3);
  animation: popIn .4s cubic-bezier(.175, .885, .32, 1.275);
  max-width: 480px;
  width: 90%;
}

.win-card {
  border: 3px solid var(--gold);
}

.lose-card {
  border: 3px solid rgba(255, 255, 255, .2);
}

@keyframes popIn {
  from {
    transform: scale(.6);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.overlay-emoji {
  font-size: 72px;
  margin-bottom: 12px;
  animation: bounceIn .6s ease;
}

@keyframes bounceIn {
  0% {
    transform: scale(0) rotate(-20deg);
  }

  60% {
    transform: scale(1.2) rotate(5deg);
  }

  100% {
    transform: scale(1) rotate(0);
  }
}

.overlay-title {
  font-family: 'Orbitron', monospace;
  font-size: 36px;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 10px;
  text-shadow: 0 0 20px rgba(245, 197, 24, .6);
}

.overlay-sub {
  font-size: 16px;
  opacity: .85;
  margin-bottom: 28px;
  line-height: 1.5;
}

.overlay-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 28px;
}

.btn-overlay {
  padding: 14px 48px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  font-weight: 700;
  color: #1a1a00;
  letter-spacing: 2px;
  box-shadow: 0 4px 20px rgba(245, 197, 24, .5);
  transition: all .2s;
}

.btn-overlay:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 30px rgba(245, 197, 24, .7);
}

/* Confetti pieces */
.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(350px) rotate(720deg);
    opacity: 0;
  }
}

/* ══ ADMIN PANEL ══ */
.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .8);
  backdrop-filter: blur(8px);
  animation: fadeIn .3s ease;
}

.admin-panel {
  background: linear-gradient(145deg, #1a2060, #222c8a);
  border: 2px solid rgba(245, 197, 24, .4);
  border-radius: 24px;
  width: 90%;
  max-width: 780px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow-y: auto;
  animation: popIn .35s cubic-bezier(.175, .885, .32, 1.275);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid rgba(245, 197, 24, .25);
}

.admin-title {
  font-family: 'Orbitron', monospace;
  font-size: 20px;
  color: var(--gold);
}

.admin-close {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
  color: var(--cream);
  font-size: 18px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: background .2s;
}

.admin-close:hover {
  background: rgba(230, 57, 70, .4);
}

.admin-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 24px 28px;
}

@media (max-width: 600px) {
  .admin-body {
    grid-template-columns: 1fr;
  }
}

.admin-section-title {
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 1px;
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(245, 197, 24, .2);
}

.admin-field {
  margin-bottom: 18px;
}

.admin-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .8px;
  opacity: .75;
  margin-bottom: 7px;
}

.admin-hint-text {
  font-size: 10px;
  opacity: .5;
  margin-top: 4px;
  display: block;
}

.admin-select-wrap select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
  color: var(--cream);
  font-size: 14px;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23f5c518' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.admin-select-wrap select:focus {
  border-color: var(--gold);
}

.admin-select-wrap select option {
  background: #1a2060;
  color: var(--cream);
}

/* Toggle */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, .15);
  border-radius: 26px;
  transition: .3s;
  border: 1px solid rgba(255, 255, 255, .2);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: .3s;
}

input:checked+.toggle-slider {
  background: var(--green);
  border-color: var(--green);
}

input:checked+.toggle-slider::before {
  transform: translateX(23px);
}

.toggle-label {
  font-size: 13px;
  font-weight: 600;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.stats-card {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.stats-card.highlight {
  border-color: rgba(245, 197, 24, .4);
  background: rgba(245, 197, 24, .08);
}

.stats-num {
  font-family: 'Orbitron', monospace;
  font-size: 24px;
  font-weight: 700;
  color: var(--gold);
}

.stats-desc {
  font-size: 11px;
  opacity: .6;
  margin-top: 3px;
}

.btn-reset {
  width: 100%;
  padding: 10px;
  background: rgba(230, 57, 70, .2);
  border: 1px solid rgba(230, 57, 70, .4);
  border-radius: 8px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: .5px;
}

.btn-reset:hover {
  background: rgba(230, 57, 70, .35);
}

.admin-footer {
  padding: 16px 28px;
  border-top: 1px solid rgba(245, 197, 24, .2);
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-save {
  padding: 12px 32px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #1a1a00;
  letter-spacing: 1px;
  transition: all .2s;
}

.btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245, 197, 24, .5);
}

.save-msg {
  font-size: 13px;
  color: var(--green);
  font-weight: 600;
  opacity: 0;
  transition: opacity .3s;
}

.save-msg.show {
  opacity: 1;
}

/* ── Spinning animation class ── */
.reel-spinning .reel-strip {
  animation: none;
}

/* ── Reel stopped flash ── */
@keyframes stopFlash {

  0%,
  100% {
    box-shadow: none;
  }

  50% {
    box-shadow: 0 0 20px 4px rgba(245, 197, 24, .8);
  }
}

.reel-stop-flash {
  animation: stopFlash .35s ease;
}