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

:root {
  --bg:         #0d0508;
  --bg2:        #1a0a0e;
  --gold:       #ffd700;
  --gold2:      #ffb300;
  --red:        #c0392b;
  --red2:       #e74c3c;
  --green:      #27ae60;
  --green2:     #2ecc71;
  --chrome:     #b8b8b8;
  --dark-chrome: #2a2a2a;
  --reel-bg:    #0a0a0a;
  --reel-item:  #1a1a2e;
  --neon-pink:  #ff006e;
  --neon-blue:  #00c8ff;
  --text:       #f0e6d3;
  --text-muted: #8a7a6a;
  --panel-bg:   rgba(20, 8, 12, 0.85);
  --card-bg:    rgba(30, 15, 20, 0.9);
  --border:     rgba(255, 215, 0, 0.25);
  --machine-h: #8b0000;
  --machine-body: #5c0a0a;
  --machine-trim: #ffd700;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Roboto', sans-serif;
  overflow-x: hidden;
}

/* Animated star background */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,215,0,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 70%, rgba(255,215,0,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 20%, rgba(255,100,100,0.2) 0%, transparent 100%),
    radial-gradient(600px circle at 50% 50%, rgba(139,0,0,0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Navbar ─────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 2rem;
  background: rgba(10,2,4,0.95);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 2px 20px rgba(255,215,0,0.2);
  backdrop-filter: blur(10px);
}
.nav-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  color: var(--gold);
  text-shadow: 0 0 10px var(--gold), 0 0 20px var(--gold2);
  letter-spacing: 3px;
}
.nav-links { display: flex; gap: 0.4rem; align-items: center; }
.nav-link {
  padding: 0.4rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 4px;
  transition: all 0.2s;
}
.nav-link:hover, .nav-link.active {
  color: var(--gold);
  background: rgba(255,215,0,0.1);
}
.nav-logout { color: var(--red2) !important; }
.nav-logout:hover { background: rgba(231,76,60,0.15) !important; }

/* ─── Casino Wrapper ─────────────────────────────────────── */
.casino-wrapper {
  position: relative; z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem 1rem;
  min-height: calc(100vh - 60px);
}

/* ─── Side Panels ─────────────────────────────────────────── */
.side-panel {
  display: flex; flex-direction: column; gap: 1rem;
  width: 220px; min-width: 200px;
  padding-top: 1rem;
}
.panel-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  backdrop-filter: blur(8px);
}
.panel-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
}

/* Mode toggle */
.mode-toggle { display: flex; flex-direction: column; gap: 0.5rem; }
.mode-btn {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 0.7rem 0.8rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  text-align: left;
}
.mode-btn .mode-icon { font-size: 1.2rem; margin-bottom: 0.2rem; }
.mode-btn .mode-name {
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: var(--text);
}
.mode-btn .mode-desc { font-size: 0.7rem; color: var(--text-muted); }
.mode-btn.active {
  background: rgba(255,215,0,0.12);
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(255,215,0,0.2), inset 0 0 10px rgba(255,215,0,0.05);
}
.mode-btn.active .mode-name { color: var(--gold); }

/* Pool display */
.pool-display {
  display: flex; align-items: baseline; gap: 0.3rem;
  font-family: 'Bebas Neue', sans-serif;
}
#pool-count { font-size: 2.5rem; color: var(--gold); line-height: 1; }
.pool-slash { font-size: 1.5rem; color: var(--text-muted); }
#active-count { font-size: 1.5rem; color: var(--text-muted); }

.pool-reset-btn {
  margin-top: 0.6rem;
  width: 100%;
  padding: 0.4rem 0.6rem;
  background: rgba(255,215,0,0.08);
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: 6px;
  color: var(--gold);
  font-family: 'Oswald', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
}
.pool-reset-btn:hover  { background: rgba(255,215,0,0.18); border-color: var(--gold); }
.pool-reset-btn:active { transform: scale(0.97); }
.pool-reset-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.pool-bar-wrap {
  height: 6px; background: rgba(255,255,255,0.1);
  border-radius: 3px; overflow: hidden; margin-top: 0.5rem;
}
.pool-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold2), var(--gold));
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Result card */
.result-card { text-align: center; }
.result-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  color: var(--gold);
  text-shadow: 0 0 10px var(--gold);
  word-break: break-word;
  line-height: 1.1;
}
.result-mode {
  font-size: 0.75rem; color: var(--text-muted);
  margin-top: 0.3rem;
  font-family: 'Oswald', sans-serif;
}

/* History list */
.history-list { display: flex; flex-direction: column; gap: 0.3rem; max-height: 400px; overflow-y: auto; }
.history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  font-size: 0.8rem;
  animation: slideIn 0.3s ease;
}
.history-item .hi-name { font-weight: 500; }
.history-item .hi-mode {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
}
.hi-mode.keep { background: rgba(39,174,96,0.3); color: var(--green2); }
.hi-mode.remove { background: rgba(192,57,43,0.3); color: var(--red2); }
.history-empty { color: var(--text-muted); font-size: 0.8rem; text-align: center; padding: 1rem 0; }

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

/* ─── Machine Container ───────────────────────────────────── */
.machine-container {
  position: relative;
  display: flex; flex-direction: column;
  width: 520px;
  flex-shrink: 0;
}

/* Top neon sign */
.machine-top {
  background: linear-gradient(180deg, #200010 0%, var(--machine-h) 100%);
  border: 3px solid var(--machine-trim);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 0 30px rgba(255,215,0,0.3), inset 0 2px 10px rgba(255,255,255,0.05);
}

.neon-sign {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem;
  letter-spacing: 6px;
  color: var(--gold);
  text-shadow:
    0 0 5px var(--gold),
    0 0 15px var(--gold),
    0 0 30px var(--gold2),
    0 0 60px rgba(255,215,0,0.4);
  animation: neonFlicker 4s ease-in-out infinite;
}

@keyframes neonFlicker {
  0%, 90%, 100% { opacity: 1; }
  91%, 93%, 95%, 97% { opacity: 0.85; }
  92%, 94%, 96% { opacity: 1; }
}

.lights-row {
  display: flex; justify-content: space-around;
  margin-top: 0.6rem;
}
.bulb {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold), 0 0 12px var(--gold2);
  animation: bulbBlink 0.8s ease-in-out infinite alternate;
}
@keyframes bulbBlink {
  from { opacity: 1; box-shadow: 0 0 6px var(--gold), 0 0 12px var(--gold2); }
  to   { opacity: 0.2; box-shadow: none; }
}

/* Machine body */
.machine-body {
  display: flex;
  background: linear-gradient(180deg, var(--machine-h) 0%, var(--machine-body) 100%);
  border-left: 3px solid var(--machine-trim);
  border-right: 3px solid var(--machine-trim);
  padding: 1.5rem 1.5rem 1.5rem 1.5rem;
  gap: 1rem;
  align-items: center;
  box-shadow:
    inset 0 0 30px rgba(0,0,0,0.5),
    inset 0 5px 20px rgba(255,215,0,0.05);
}

/* Reels frame */
.reels-frame {
  flex: 1;
  display: flex;
  align-items: center;
  background: #0a0005;
  border: 3px solid #333;
  border-radius: 12px;
  padding: 0.8rem;
  box-shadow:
    inset 0 0 20px rgba(0,0,0,0.9),
    inset 0 2px 5px rgba(255,215,0,0.1),
    0 0 20px rgba(0,0,0,0.5);
  gap: 0;
  position: relative;
}

.reel-divider {
  width: 3px;
  height: 200px;
  background: linear-gradient(180deg, transparent, #444, transparent);
  flex-shrink: 0;
}

/* Individual reel window */
.reel-window {
  flex: 1;
  height: 240px;
  overflow: hidden;
  position: relative;
  background: var(--reel-bg);
  border-radius: 6px;
}
.reel-window::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0.8) 0%,
    transparent 25%,
    transparent 75%,
    rgba(0,0,0,0.8) 100%
  );
  pointer-events: none;
  z-index: 2;
}

.center-reel {
  border: 2px solid rgba(255,215,0,0.3);
}

.winner-bar {
  position: absolute; left: 0; right: 0; height: 2px;
  background: var(--gold);
  z-index: 3;
  box-shadow: 0 0 8px var(--gold);
}
.winner-bar.top  { top: 79px; }
.winner-bar.bottom { top: 159px; }

.reel-shine {
  position: absolute; top: 0; left: 0; right: 0; height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.03) 0%,
    rgba(255,255,255,0.06) 50%,
    rgba(255,255,255,0.01) 100%
  );
  pointer-events: none;
  z-index: 4;
}

/* Reel strip & items */
.reel-strip {
  position: absolute;
  top: 0; left: 0; right: 0;
  will-change: transform;
  transition: none;
}

.reel-item {
  height: 80px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 2px;
  color: #ccc;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  user-select: none;
  text-align: center;
  padding: 0 0.5rem;
  line-height: 1.1;
  word-break: break-word;
}
.reel-item.center { color: var(--gold); font-size: 1.5rem; }

/* Lever */
.lever-wrap {
  width: 60px;
  display: flex; flex-direction: column; align-items: center;
  height: 220px;
  position: relative;
  flex-shrink: 0;
}
.lever-track {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  width: 8px; height: 100%;
  background: linear-gradient(180deg, #222, #111, #222);
  border-radius: 4px;
  border: 1px solid #444;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}
.lever {
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer;
  transition: top 0.2s ease;
  z-index: 1;
  transform-origin: center top;
}
.lever:hover .lever-ball {
  box-shadow: 0 0 15px var(--red2), 0 0 30px var(--red);
}
.lever-arm {
  width: 6px; height: 80px;
  background: linear-gradient(180deg, #888, #ccc, #888);
  border-radius: 3px;
  box-shadow: 2px 0 4px rgba(0,0,0,0.4);
}
.lever-ball {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff6b6b, var(--red2), var(--red));
  box-shadow: 0 0 10px var(--red2), 0 4px 8px rgba(0,0,0,0.5);
  border: 2px solid rgba(255,255,255,0.2);
  transition: box-shadow 0.2s, transform 0.1s;
}
.lever-ball:active { transform: scale(0.95); }
.lever.pulled { top: 120px !important; }

/* Machine bottom */
.machine-bottom {
  background: linear-gradient(180deg, var(--machine-body) 0%, #300000 100%);
  border: 3px solid var(--machine-trim);
  border-top: none;
  border-radius: 0 0 20px 20px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.spin-btn {
  padding: 0.8rem 2.5rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 4px;
  color: #1a0000;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold2) 50%, #c8960a 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow:
    0 4px 0 #8a6000,
    0 0 20px rgba(255,215,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.4);
  transition: all 0.1s;
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
  transform: translateY(0);
}
.spin-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffe040 0%, var(--gold) 50%, #d4a017 100%);
  box-shadow: 0 4px 0 #8a6000, 0 0 30px rgba(255,215,0,0.6), inset 0 1px 0 rgba(255,255,255,0.4);
}
.spin-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #8a6000, 0 0 20px rgba(255,215,0,0.3);
}
.spin-btn:disabled {
  opacity: 0.5; cursor: not-allowed;
}

.sound-toggle {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 2px solid rgba(255,215,0,0.3);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sound-toggle:hover { background: rgba(255,215,0,0.15); border-color: var(--gold); }
.sound-toggle.muted { opacity: 0.5; border-color: rgba(255,255,255,0.15); }

.credits-display {
  display: flex; flex-direction: column; align-items: center;
  background: #0a0505; border: 2px solid #333;
  border-radius: 6px; padding: 0.4rem 0.8rem;
}
.credits-label {
  font-size: 0.6rem; letter-spacing: 2px;
  color: var(--text-muted); font-family: 'Oswald', sans-serif;
}
.credits-value {
  font-family: 'Bebas Neue', sans-serif; font-size: 1.8rem;
  color: var(--green2);
  text-shadow: 0 0 8px var(--green2);
}

/* ─── Win Overlay ─────────────────────────────────────────── */
.win-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.win-overlay.active { display: flex; }

.win-content {
  position: relative;
  background: radial-gradient(ellipse at center, #2d0a0a 0%, #1a0005 60%, #0d0002 100%);
  border: 3px solid var(--gold);
  border-radius: 20px;
  padding: 2.5rem 3rem;
  text-align: center;
  box-shadow: 0 0 60px rgba(255,215,0,0.4), 0 0 100px rgba(255,215,0,0.1);
  max-width: 400px; width: 90%;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.empty-content { border-color: var(--red2); box-shadow: 0 0 40px rgba(231,76,60,0.3); }

@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.win-sparks { position: absolute; inset: -10px; pointer-events: none; overflow: hidden; }
.spark {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  animation: sparkFly 1s ease-out forwards;
}
@keyframes sparkFly {
  from { transform: translate(0,0) scale(1); opacity: 1; }
  to   { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

.win-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem; letter-spacing: 4px;
  color: var(--gold);
  text-shadow: 0 0 10px var(--gold);
  margin-bottom: 0.5rem;
}
.win-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3rem; line-height: 1;
  color: #fff;
  text-shadow: 0 0 20px var(--gold), 0 0 40px rgba(255,215,0,0.5);
  margin-bottom: 1.5rem;
  animation: nameGlow 1s ease-in-out infinite alternate;
}
@keyframes nameGlow {
  from { text-shadow: 0 0 20px var(--gold), 0 0 40px rgba(255,215,0,0.4); }
  to   { text-shadow: 0 0 30px var(--gold), 0 0 60px rgba(255,215,0,0.7), 0 0 80px var(--gold2); }
}
.win-close {
  padding: 0.6rem 2rem;
  font-family: 'Bebas Neue', sans-serif; font-size: 1.2rem; letter-spacing: 2px;
  background: linear-gradient(180deg, var(--gold), var(--gold2));
  color: #1a0000; border: none; border-radius: 6px; cursor: pointer;
  box-shadow: 0 3px 0 #8a6000;
  transition: all 0.1s;
}
.win-close:hover { filter: brightness(1.1); }

/* ─── Stats Page ──────────────────────────────────────────── */
.stats-wrapper {
  position: relative; z-index: 1;
  max-width: 1000px; margin: 0 auto; padding: 2rem 1rem;
}
.stats-header { margin-bottom: 2rem; }
.stats-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.5rem; letter-spacing: 4px;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(255,215,0,0.3);
  margin-bottom: 1rem;
}
.stats-summary {
  display: flex; gap: 1rem; flex-wrap: wrap;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  text-align: center;
  min-width: 120px;
}
.stat-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem; color: var(--gold);
  line-height: 1;
}
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3rem; font-family: 'Oswald', sans-serif; }

.stats-empty { text-align: center; color: var(--text-muted); padding: 4rem 0; font-size: 1.1rem; }

.stats-section { margin-bottom: 2.5rem; }
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem; letter-spacing: 3px;
  color: var(--gold);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem; margin-bottom: 1rem;
}

/* Ranking grid */
.ranking-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.ranking-row {
  display: flex; align-items: center; gap: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  transition: background 0.2s;
}
.ranking-row:hover { background: rgba(255,215,0,0.05); }
.ranking-row.inactive { opacity: 0.5; }

.rank-position { font-family: 'Bebas Neue', sans-serif; font-size: 1.3rem; width: 35px; text-align: center; flex-shrink: 0; }
.rank-name { font-family: 'Oswald', sans-serif; font-size: 1rem; width: 130px; flex-shrink: 0; }
.rank-bar-wrap { flex: 1; height: 8px; background: rgba(255,255,255,0.08); border-radius: 4px; overflow: hidden; }
.rank-bar { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.rank-stats { display: flex; gap: 0.5rem; align-items: center; width: 90px; flex-shrink: 0; justify-content: flex-end; }
.rank-count { font-family: 'Oswald', sans-serif; font-size: 0.9rem; }
.rank-pct { font-size: 0.8rem; color: var(--gold); font-weight: bold; }
.rank-modes { display: flex; gap: 0.3rem; flex-shrink: 0; }
.badge-inactive { font-size: 0.65rem; background: rgba(255,255,255,0.1); padding: 0.1rem 0.4rem; border-radius: 10px; margin-left: 0.4rem; }

.badge-mode {
  font-size: 0.7rem; padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-family: 'Oswald', sans-serif;
}
.badge-mode.keep   { background: rgba(39,174,96,0.2);  color: var(--green2); border: 1px solid rgba(39,174,96,0.3); }
.badge-mode.remove { background: rgba(192,57,43,0.2); color: var(--red2);   border: 1px solid rgba(192,57,43,0.3); }

/* Chart */
.chart-container {
  display: flex; gap: 2rem; align-items: flex-start;
  flex-wrap: wrap;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
}
#pieChart { border-radius: 50%; }
.chart-legend { display: flex; flex-direction: column; gap: 0.4rem; flex: 1; min-width: 160px; }
.legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.legend-name { flex: 1; }
.legend-val { color: var(--text-muted); font-size: 0.8rem; }

/* History table */
.history-table-wrap { overflow-x: auto; }
.history-table {
  width: 100%; border-collapse: collapse;
  background: var(--card-bg); border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border);
}
.history-table th {
  background: rgba(255,215,0,0.08);
  font-family: 'Oswald', sans-serif; font-size: 0.8rem; letter-spacing: 1px;
  text-transform: uppercase; color: var(--gold);
  padding: 0.7rem 1rem; text-align: left;
  border-bottom: 1px solid var(--border);
}
.history-table td { padding: 0.55rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 0.9rem; }
.history-table tr:last-child td { border-bottom: none; }
.history-table tr:hover td { background: rgba(255,215,0,0.03); }
.td-num { color: var(--text-muted); width: 40px; }
.td-name { font-family: 'Oswald', sans-serif; }
.td-date { color: var(--text-muted); font-size: 0.8rem; }

/* ─── Admin Pages ─────────────────────────────────────────── */
.admin-login-wrap {
  position: relative; z-index: 1;
  min-height: calc(100vh - 60px);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%; max-width: 380px;
  text-align: center;
  box-shadow: 0 0 40px rgba(255,215,0,0.1);
}
.login-logo { font-size: 3rem; margin-bottom: 0.5rem; }
.login-title {
  font-family: 'Bebas Neue', sans-serif; font-size: 1.8rem; letter-spacing: 3px;
  color: var(--gold); margin-bottom: 1.5rem;
}
.login-form { display: flex; flex-direction: column; gap: 1rem; text-align: left; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.8rem; color: var(--text-muted); font-family: 'Oswald', sans-serif; letter-spacing: 1px; text-transform: uppercase; }
.form-group input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  color: var(--text); font-size: 1rem;
  outline: none; transition: border 0.2s;
}
.form-group input:focus { border-color: var(--gold); }
.flash { padding: 0.6rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem; }
.flash-error { background: rgba(231,76,60,0.2); border: 1px solid var(--red2); color: var(--red2); }
.back-link { display: block; margin-top: 1rem; color: var(--text-muted); font-size: 0.85rem; text-decoration: none; }
.back-link:hover { color: var(--gold); }

/* Admin dashboard */
.admin-wrapper {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto; padding: 2rem 1rem;
}
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.5rem; }
.admin-title { font-family: 'Bebas Neue', sans-serif; font-size: 2rem; letter-spacing: 3px; color: var(--gold); }
.admin-meta { font-size: 0.85rem; color: var(--text-muted); }

.admin-stats-row { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.admin-stat {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 1rem 1.5rem; text-align: center; flex: 1; min-width: 100px;
}
.as-value { font-family: 'Bebas Neue', sans-serif; font-size: 2.2rem; color: var(--gold); line-height: 1; }
.as-label { font-size: 0.7rem; color: var(--text-muted); font-family: 'Oswald', sans-serif; letter-spacing: 1px; margin-top: 0.2rem; }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.admin-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.2rem;
}
.cheat-card { border-color: rgba(255,165,0,0.4); box-shadow: 0 0 20px rgba(255,165,0,0.1); }
.danger-card { border-color: rgba(231,76,60,0.3); }
.card-title {
  font-family: 'Bebas Neue', sans-serif; font-size: 1.1rem; letter-spacing: 2px;
  color: var(--gold); margin-bottom: 0.8rem;
  border-bottom: 1px solid var(--border); padding-bottom: 0.4rem;
}
.card-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.6rem; line-height: 1.4; }

.forced-badge {
  display: flex; align-items: center; gap: 0.5rem;
  background: rgba(255,165,0,0.1); border: 1px solid rgba(255,165,0,0.3);
  border-radius: 6px; padding: 0.5rem 0.8rem; margin-bottom: 0.8rem;
  font-size: 0.9rem;
}
.forced-badge.hidden { display: none; }
.forced-badge strong { color: var(--gold); }

.force-form { display: flex; gap: 0.5rem; }
.admin-select {
  flex: 1; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px; padding: 0.5rem 0.8rem; color: var(--text); font-size: 0.9rem; outline: none;
}
.admin-select option { background: #1a0a0e; }

.add-form { display: flex; gap: 0.5rem; }
.admin-input {
  flex: 1; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px; padding: 0.5rem 0.8rem; color: var(--text); font-size: 0.9rem; outline: none;
}
.admin-input:focus { border-color: var(--gold); }

.people-card { grid-column: 1 / -1; }
.people-grid { display: flex; flex-direction: column; gap: 0.4rem; }
.person-row {
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
  padding: 0.6rem 0.8rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px; transition: background 0.2s;
}
.person-row:hover { background: rgba(255,255,255,0.06); }
.person-inactive { opacity: 0.5; }
.person-info { display: flex; align-items: baseline; gap: 0.5rem; flex: 1; min-width: 120px; }
.person-name { font-family: 'Oswald', sans-serif; font-size: 1rem; }
.person-draws { font-size: 0.75rem; color: var(--text-muted); }
.person-badges { display: flex; gap: 0.3rem; }
.badge-status {
  font-size: 0.65rem; padding: 0.15rem 0.5rem; border-radius: 10px;
  font-family: 'Oswald', sans-serif; letter-spacing: 0.5px;
}
.badge-status.active   { background: rgba(39,174,96,0.2);  color: var(--green2); }
.badge-status.inactive { background: rgba(192,57,43,0.2); color: var(--red2); }
.badge-status.pool     { background: rgba(255,215,0,0.15); color: var(--gold); }
.badge-status.no-pool  { background: rgba(255,255,255,0.08); color: var(--text-muted); }

.person-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn-primary {
  padding: 0.5rem 1.2rem;
  background: linear-gradient(180deg, var(--gold), var(--gold2));
  color: #1a0000; border: none; border-radius: 6px; cursor: pointer;
  font-family: 'Oswald', sans-serif; font-size: 0.9rem; font-weight: 600; letter-spacing: 1px;
  box-shadow: 0 2px 0 #8a6000;
  transition: all 0.1s;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 1px 0 #8a6000; }

.btn-warning {
  padding: 0.5rem 1.2rem;
  background: rgba(255,165,0,0.2); color: orange;
  border: 1px solid rgba(255,165,0,0.4);
  border-radius: 6px; cursor: pointer;
  font-family: 'Oswald', sans-serif; font-size: 0.9rem; letter-spacing: 1px;
  transition: all 0.2s;
}
.btn-warning:hover { background: rgba(255,165,0,0.3); }

.btn-danger {
  padding: 0.5rem 1.2rem;
  background: rgba(231,76,60,0.2); color: var(--red2);
  border: 1px solid rgba(231,76,60,0.4);
  border-radius: 6px; cursor: pointer;
  font-family: 'Oswald', sans-serif; font-size: 0.9rem; letter-spacing: 1px;
  transition: all 0.2s;
}
.btn-danger:hover { background: rgba(231,76,60,0.35); }

.btn-success {
  padding: 0.4rem 0.8rem;
  background: rgba(39,174,96,0.2); color: var(--green2);
  border: 1px solid rgba(39,174,96,0.4);
  border-radius: 6px; cursor: pointer;
  font-family: 'Oswald', sans-serif; font-size: 0.8rem; letter-spacing: 0.5px;
  transition: all 0.2s;
}
.btn-success:hover { background: rgba(39,174,96,0.35); }

.btn-sm {
  padding: 0.25rem 0.6rem;
  font-family: 'Oswald', sans-serif; font-size: 0.75rem;
  border-radius: 4px; cursor: pointer; border: 1px solid;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-sm.btn-toggle-active { background: rgba(231,76,60,0.15); color: var(--red2); border-color: rgba(231,76,60,0.3); }
.btn-sm.btn-toggle-active:hover { background: rgba(231,76,60,0.3); }
.btn-sm.btn-success { background: rgba(39,174,96,0.15); color: var(--green2); border-color: rgba(39,174,96,0.3); }
.btn-sm.btn-success:hover { background: rgba(39,174,96,0.3); }
.btn-sm.btn-danger { background: rgba(231,76,60,0.1); color: var(--red2); border-color: rgba(231,76,60,0.2); }
.btn-sm.btn-danger:hover { background: rgba(231,76,60,0.25); }
.btn-sm.btn-warning { background: rgba(255,165,0,0.1); color: orange; border-color: rgba(255,165,0,0.2); }
.btn-sm.btn-warning:hover { background: rgba(255,165,0,0.2); }
.btn-sm.btn-toggle-pool { background: rgba(255,215,0,0.08); color: var(--text-muted); border-color: rgba(255,215,0,0.15); }
.btn-sm.btn-toggle-pool:hover:not(:disabled) { background: rgba(255,215,0,0.15); color: var(--gold); }
.btn-sm:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Landing Page ───────────────────────────────────────── */
.landing-wrap {
  position: relative; z-index: 1;
  min-height: calc(100vh - 60px);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
}
.landing-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3rem 2.5rem;
  width: 100%; max-width: 420px;
  text-align: center;
  box-shadow: 0 0 60px rgba(255,215,0,0.1);
}
.landing-logo { font-size: 4rem; margin-bottom: 0.5rem; }
.landing-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3rem; letter-spacing: 6px;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(255,215,0,0.4);
  margin-bottom: 0.5rem;
}
.landing-sub {
  font-size: 0.9rem; color: var(--text-muted);
  margin-bottom: 1.5rem; line-height: 1.4;
}
.landing-error {
  background: rgba(231,76,60,0.15);
  border: 1px solid rgba(231,76,60,0.4);
  color: var(--red2);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.code-form {
  display: flex; flex-direction: column; gap: 0.8rem;
  margin-bottom: 1.5rem;
}
.code-input {
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,215,0,0.3);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  color: var(--gold);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: 8px;
  text-align: center;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.code-input:focus { border-color: var(--gold); box-shadow: 0 0 15px rgba(255,215,0,0.2); }
.code-input::placeholder { color: rgba(255,215,0,0.2); }
.btn-join { width: 100%; padding: 0.7rem; font-size: 1.1rem; letter-spacing: 3px; }
.landing-admin-link {
  font-size: 0.8rem; color: var(--text-muted);
  text-decoration: none;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 1px;
  transition: color 0.2s;
}
.landing-admin-link:hover { color: var(--gold); }

/* ─── Room display (room.html left panel) ────────────────── */
.room-name-display {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem; letter-spacing: 2px;
  color: var(--text);
  line-height: 1.2;
  word-break: break-word;
}
.room-code-display {
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem; letter-spacing: 4px;
  color: var(--gold);
  margin-top: 0.3rem;
  opacity: 0.7;
}

/* Stats room pill */
.room-code-pill {
  display: inline-block;
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem; letter-spacing: 3px;
  color: var(--gold);
  background: rgba(255,215,0,0.1);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 20px;
  padding: 0.25rem 0.8rem;
  margin-bottom: 1rem;
}

/* ─── Admin Room Cards ────────────────────────────────────── */
.admin-section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem; letter-spacing: 3px;
  color: var(--gold);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

#rooms-grid {
  display: flex; flex-direction: column; gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.room-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  transition: background 0.2s;
}
.room-card:hover { background: rgba(255,215,0,0.03); }
.room-inactive { opacity: 0.6; }

.room-card-head {
  display: flex; align-items: center; gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}
.room-code-badge {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem; letter-spacing: 3px;
  color: var(--gold);
  background: rgba(255,215,0,0.12);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 6px;
  padding: 0.15rem 0.6rem;
  flex-shrink: 0;
}
.room-card-name {
  font-family: 'Oswald', sans-serif;
  font-size: 1.05rem;
  color: var(--text);
  flex: 1;
}
.room-card-meta {
  font-size: 0.75rem; color: var(--text-muted);
  width: 100%;
}

.room-pool-row {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}
.room-pool-label {
  font-size: 0.78rem; color: var(--text-muted);
  font-family: 'Oswald', sans-serif;
  flex-shrink: 0;
}
.room-pool-count {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem; color: var(--gold);
}

.room-force-row {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

.room-actions {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .casino-wrapper { flex-direction: column; align-items: center; padding: 1rem; }
  .side-panel { width: 100%; max-width: 520px; flex-direction: row; flex-wrap: wrap; }
  .panel-card { flex: 1; min-width: 150px; }
  .machine-container { width: 100%; max-width: 520px; }
}
@media (max-width: 600px) {
  .machine-container { width: 100%; }
  .reels-frame { padding: 0.5rem; }
  .reel-item { font-size: 1rem; }
  .neon-sign { font-size: 1.5rem; }
  .spin-btn { padding: 0.7rem 1.5rem; font-size: 1.2rem; }
}
