/* Minigame Lobby - C68Club dark purple neon gaming theme */
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(180deg, #120028 0%, #1a0540 30%, #0d001a 100%);
  font-family: 'Segoe UI', -apple-system, sans-serif;
  color: #fff;
  padding-bottom: 64px;
  overflow-x: hidden;
}

/* ── TOP BAR ── */
.top-bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: rgba(10, 0, 30, 0.95);
  border-bottom: 1.5px solid rgba(200, 160, 80, 0.5);
  backdrop-filter: blur(6px);
}
.logo {
  text-decoration: none; font-size: 16px; font-weight: 800;
  letter-spacing: 1px; flex-shrink: 0;
  background: linear-gradient(90deg, #ffd700, #ffb800, #ff8c00);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.user-info { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: center; min-width: 0; }
.username { font-size: 13px; font-weight: 600; color: #e0aaff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100px; }
.coin { font-size: 13px; color: #ffd700; font-weight: 600; white-space: nowrap; }
.top-actions { display: flex; gap: 4px; flex-shrink: 0; }
.top-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid rgba(180, 130, 255, 0.5);
  background: rgba(255,255,255,0.07); color: #fff; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.top-btn:hover { background: rgba(180,130,255,0.25); }

/* ── MARQUEE TICKER ── */
.marquee-bar {
  overflow: hidden;
  background: rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(200, 160, 80, 0.3);
  padding: 4px 0;
}
.marquee-track { white-space: nowrap; }
.marquee-text {
  display: inline-block;
  animation: marquee 22s linear infinite;
  font-size: 11px; font-weight: 600; color: #ffd700; letter-spacing: 0.3px;
}
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── LOBBY MAIN ── */
.lobby-main {
  display: flex;
  min-height: calc(100vh - 120px);
  min-height: calc(100dvh - 120px);
}

/* ── SIDEBARS ── */
.sidebar {
  width: 72px; flex-shrink: 0;
  background: linear-gradient(180deg, rgba(60,10,120,0.85) 0%, rgba(20,0,60,0.9) 100%);
  border: 1px solid rgba(180,130,255,0.25);
  display: flex; flex-direction: column; align-items: center; padding: 10px 4px;
}
.sidebar-left  { border-right: none; }
.sidebar-right { border-left: none; }
.sidebar-banner { text-align: center; width: 100%; }
.sidebar-title {
  font-size: 9px; font-weight: 800; line-height: 1.4;
  letter-spacing: 0.5px; color: #e0c4ff; text-transform: uppercase; margin-bottom: 4px;
}
.sidebar-sub {
  font-size: 8px; font-weight: 700; color: #ffd700; letter-spacing: 1px;
  text-transform: uppercase; background: rgba(255,215,0,0.12);
  border: 1px solid rgba(255,215,0,0.35); border-radius: 4px; padding: 2px 4px; display: inline-block;
}
.jackpot-nums { margin-top: 8px; width: 100%; }
.jp-row {
  font-family: 'Courier New', monospace; font-size: 9px; font-weight: 700;
  color: #ffd700; text-align: center; padding: 2px; margin-bottom: 3px;
  background: rgba(255,215,0,0.08); border: 1px solid rgba(255,215,0,0.2);
  border-radius: 4px; letter-spacing: 0.3px;
}

/* ── GAME AREA ── */
.game-area { flex: 1; overflow-y: auto; min-width: 0; }

/* ── GAME GRID ── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
}
.game-card[data-size="wide"] { grid-column: span 2; }
.game-card[data-size="tall"] { grid-row: span 2; }

/* ── GAME CARD (compact) ── */
.game-card {
  position: relative;
  background: rgba(30, 10, 60, 0.8);
  border: 1.5px solid rgba(180, 130, 255, 0.25);
  border-radius: 12px;
  overflow: hidden; cursor: pointer;
  aspect-ratio: 4 / 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 10px 4px 8px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.game-card[data-size="wide"] { aspect-ratio: 8 / 3; }
.game-card[data-size="tall"] { aspect-ratio: auto; min-height: 0; }

/* Active game: prominent glow + border */
.game-card.active {
  border-color: rgba(255,215,0,0.5);
  animation: activeGlow 2.5s ease-in-out infinite;
}
.game-card.active:hover { transform: scale(1.04); border-color: rgba(255,215,0,0.8); }

/* Inactive: looks normal, maintenance only on click */
.game-card.inactive { opacity: 1; cursor: pointer; }
.game-card.inactive:hover { transform: scale(1.03); border-color: rgba(180,130,255,0.5); }

@keyframes activeGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(255,215,0,0.25), inset 0 0 6px rgba(255,215,0,0.08); }
  50%       { box-shadow: 0 0 18px rgba(255,215,0,0.5), 0 0 35px rgba(180,130,255,0.15), inset 0 0 10px rgba(255,215,0,0.12); }
}

.game-icon {
  width: 70%; max-width: 90px; object-fit: contain; border-radius: 10px;
}
.game-name {
  margin-top: 6px; font-size: 13px; font-weight: 800; text-align: center;
  font-variant: small-caps; line-height: 1.2; letter-spacing: 0.5px;
  background: linear-gradient(90deg, #ffd700, #ffb800);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ── LIVE BADGE (active games) ── */
.live-badge {
  position: absolute; top: 6px; left: 6px;
  display: flex; align-items: center; gap: 3px;
  background: rgba(220, 38, 38, 0.9);
  color: #fff; font-size: 8px; font-weight: 900; letter-spacing: 0.5px;
  padding: 2px 6px; border-radius: 6px;
  box-shadow: 0 0 8px rgba(220,38,38,0.5);
}
.live-dot {
  width: 5px; height: 5px; border-radius: 50%; background: #fff;
  animation: liveBlink 1s ease-in-out infinite;
}
@keyframes liveBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── ONLINE COUNT (active games) ── */
.online-count {
  position: absolute; bottom: 4px; right: 6px;
  font-size: 8px; font-weight: 600; color: #4ade80;
  background: rgba(0,0,0,0.5); padding: 1px 5px; border-radius: 4px;
}

/* ── MAINTENANCE OVERLAY (light, readable) ── */
.maintenance-overlay {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding-bottom: 6px; gap: 1px;
  border-radius: 12px; transition: background 0.2s;
}
.game-card.inactive:hover .maintenance-overlay { background: rgba(0, 0, 0, 0.15); }
.maintenance-overlay .wrench { font-size: 12px; }
.maintenance-overlay .maintenance-text {
  font-size: 7px; font-weight: 700; color: #fbbf24; letter-spacing: 0.5px;
  background: rgba(0,0,0,0.5); padding: 1px 6px; border-radius: 4px;
}

/* ── MAINTENANCE MODAL ── */
.maint-modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.maint-modal.show { opacity: 1; pointer-events: all; }

.maint-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
}
.maint-content {
  position: relative; z-index: 1;
  background: linear-gradient(145deg, #1a0540, #2a0860);
  border: 1.5px solid rgba(180,130,255,0.4);
  border-radius: 16px; padding: 28px 24px 20px;
  text-align: center; max-width: 320px; width: 90%;
  box-shadow: 0 0 40px rgba(120,40,220,0.4);
  transform: scale(0.9); transition: transform 0.3s;
}
.maint-modal.show .maint-content { transform: scale(1); }

.maint-icon { font-size: 40px; margin-bottom: 8px; animation: wrenchSpin 2s ease-in-out infinite; }
@keyframes wrenchSpin {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(20deg); }
  75% { transform: rotate(-20deg); }
}
.maint-title {
  font-size: 18px; font-weight: 800; margin: 0 0 8px;
  background: linear-gradient(90deg, #ffd700, #ffb800);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.maint-msg { font-size: 13px; color: #c9a0ff; line-height: 1.5; margin: 0 0 12px; }
.maint-eta {
  font-size: 11px; color: #999; margin-bottom: 16px;
  background: rgba(255,255,255,0.04); padding: 6px 12px; border-radius: 8px;
}
.maint-eta strong { color: #ffd700; }
.maint-close {
  padding: 8px 28px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #6a3de8, #8b5cf6);
  color: #fff; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: transform 0.1s; box-shadow: 0 2px 12px rgba(106,61,232,0.4);
}
.maint-close:active { transform: scale(0.95); }

/* ── BOTTOM BAR ── */
.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; height: 56px;
  display: flex; align-items: center; justify-content: space-around; padding: 4px 2px;
  background: rgba(10,0,30,0.96); border-top: 1.5px solid rgba(200,160,80,0.5);
  backdrop-filter: blur(6px);
}
.bb-item {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  text-decoration: none; color: #ccc; font-size: 9px; font-weight: 600;
  letter-spacing: 0.2px; text-transform: uppercase; flex: 1; text-align: center;
  min-width: 0;
}
.bb-icon { font-size: 16px; line-height: 1; }
.bb-item:hover { color: #e0aaff; }
.bb-main { flex: 1.3; position: relative; top: -8px; }
.bb-main-text {
  display: inline-block;
  background: linear-gradient(135deg, #ffd700, #ff8c00, #ffd700);
  background-size: 200% auto; animation: goldShimmer 2s linear infinite;
  color: #1a0033; font-size: 10px; font-weight: 900; letter-spacing: 0.5px;
  padding: 6px 10px; border-radius: 20px; white-space: nowrap;
  box-shadow: 0 0 12px rgba(255,180,0,0.5), 0 3px 8px rgba(0,0,0,0.4);
}
@keyframes goldShimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 68px; left: 50%; z-index: 100;
  transform: translateX(-50%) translateY(20px);
  background: rgba(40,10,70,0.95); border: 1px solid rgba(180,130,255,0.6);
  color: #e0aaff; padding: 8px 18px; border-radius: 20px;
  font-size: 13px; font-weight: 500; white-space: nowrap;
  box-shadow: 0 0 15px rgba(180,130,255,0.4);
  opacity: 0; transition: opacity 0.3s, transform 0.3s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── RESPONSIVE ── */

/* Hide sidebars below 640px */
@media (max-width: 640px) {
  .sidebar { display: none; }
}

/* Small phones */
@media (max-width: 400px) {
  .top-bar { padding: 6px 8px; gap: 6px; }
  .logo { font-size: 14px; }
  .username { max-width: 70px; font-size: 12px; }
  .coin { font-size: 12px; }
  .top-actions { gap: 3px; }
  .top-btn { width: 26px; height: 26px; font-size: 11px; }
  .game-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 6px; }
  .game-card { aspect-ratio: 3 / 2; }
  .game-icon { max-width: 64px; }
  .game-name { font-size: 11px; }
  .bb-item { font-size: 8px; }
  .bb-main-text { font-size: 9px; padding: 5px 8px; }
  .bottom-bar { height: 50px; }
  body { padding-bottom: 50px; }
}
