/**
 * Expertly Games — Shared Game Styles (High-Fidelity Edition)
 * Used by all industry games alongside each game's own styles.
 * Premium dark theme with hotel-luxe accents: deep navy, warm gold, emerald, soft white.
 */

/* WHY: Inter provides clean tabular numerics, tight letter-spacing control, and
   a premium feel at all weights — critical for score displays and stat cards. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES — Hotel-Luxe Palette
   ============================================================ */

:root {
  /* Primary palette */
  --eg-navy: #080814;
  --eg-navy-mid: #0d0d22;
  --eg-navy-light: #14142e;
  --eg-surface: #1a1a3a;
  --eg-border: #2a2a5a;
  --eg-border-glow: rgba(124, 58, 237, 0.25);

  /* Accent colors */
  --eg-gold: #f5c542;
  --eg-gold-dim: #d4a017;
  --eg-emerald: #34d399;
  --eg-emerald-dim: #059669;
  --eg-purple: #a855f7;
  --eg-purple-deep: #7c3aed;
  --eg-rose: #f43f5e;
  --eg-cyan: #22d3ee;
  --eg-blue: #60a5fa;

  /* Transitions */
  --eg-ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --eg-ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================
   BASE RESET & DEFAULTS
   ============================================================ */

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

body {
  background: var(--eg-navy);
  color: #e0e0e0;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Animated ambient background — subtle floating aurora */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 800px 600px at 20% 20%, rgba(124, 58, 237, 0.07) 0%, transparent 70%),
    radial-gradient(ellipse 600px 500px at 80% 80%, rgba(34, 211, 238, 0.05) 0%, transparent 70%),
    radial-gradient(ellipse 500px 400px at 50% 50%, rgba(245, 197, 66, 0.03) 0%, transparent 70%);
  animation: eg-aurora 20s ease-in-out infinite alternate;
}

@keyframes eg-aurora {
  0% { opacity: 0.6; transform: scale(1) translate(0, 0); }
  50% { opacity: 1; transform: scale(1.05) translate(1%, -1%); }
  100% { opacity: 0.6; transform: scale(1) translate(-1%, 1%); }
}

/* Subtle scanline texture — premium depth */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255,255,255,0.003) 2px,
      rgba(255,255,255,0.003) 4px
    );
}

/* ============================================================
   GAME CONTAINER
   ============================================================ */

.eg-game-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* ============================================================
   TOP BAR — Timer, score, controls (glassmorphism)
   ============================================================ */

.eg-top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(20, 20, 52, 0.95), rgba(12, 12, 36, 0.95));
  border: 1px solid rgba(100, 100, 200, 0.12);
  border-radius: 16px;
  margin-bottom: 12px;
  backdrop-filter: blur(16px);
  flex-shrink: 0;
  box-shadow:
    0 4px 24px rgba(0,0,0,0.4),
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 -1px 0 rgba(0,0,0,0.2) inset;
  position: relative;
  z-index: 1;
}

/* Subtle top-edge highlight for glass effect */
.eg-top-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  border-radius: 1px;
}

.eg-game-title {
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  color: #fff;
  letter-spacing: -0.3px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.eg-timer-bar {
  flex: 1;
  height: 8px;
  background: rgba(26, 26, 62, 0.8);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
  position: relative;
}

.eg-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ade80, #22c55e, #4ade80);
  background-size: 200% 100%;
  border-radius: 6px;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.4), 0 0 2px rgba(74, 222, 128, 0.8) inset;
  animation: eg-timer-shimmer 3s ease-in-out infinite;
}

@keyframes eg-timer-shimmer {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

.eg-timer-fill.eg-timer-warning {
  background: linear-gradient(90deg, #fbbf24, #f59e0b, #fbbf24);
  background-size: 200% 100%;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.5), 0 0 2px rgba(251, 191, 36, 0.8) inset;
}

.eg-timer-fill.eg-timer-danger {
  background: linear-gradient(90deg, #ef4444, #dc2626, #ef4444);
  background-size: 200% 100%;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.6), 0 0 2px rgba(239, 68, 68, 0.8) inset;
  animation: eg-pulse 0.5s ease infinite, eg-timer-shimmer 2s ease-in-out infinite;
}

@keyframes eg-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.eg-score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.eg-score-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #666;
  font-weight: 600;
}

.eg-score-value {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 16px rgba(255,255,255,0.15);
  transition: transform 0.2s var(--eg-ease-out-back), color 0.3s;
}

/* ============================================================
   BUTTONS — Premium glass effect with animated shine
   ============================================================ */

.eg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.25s var(--eg-ease-smooth);
  text-decoration: none;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
  font-family: inherit;
  letter-spacing: 0.2px;
}

/* Animated shine sweep on all buttons */
.eg-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.08) 50%, transparent 60%);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
  pointer-events: none;
}
.eg-btn:hover::after {
  left: 125%;
}

.eg-btn-primary {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  box-shadow:
    0 2px 8px rgba(124, 58, 237, 0.3),
    inset 0 1px 0 rgba(255,255,255,0.1);
}
.eg-btn-primary:hover {
  background: linear-gradient(135deg, #6d28d9, #9333ea);
  transform: translateY(-2px);
  box-shadow:
    0 8px 24px rgba(124, 58, 237, 0.5),
    0 0 40px rgba(124, 58, 237, 0.15),
    inset 0 1px 0 rgba(255,255,255,0.15);
}
.eg-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.eg-btn-secondary {
  background: rgba(255,255,255,0.06);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
}
.eg-btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.eg-btn-ghost {
  background: transparent;
  color: #888;
}
.eg-btn-ghost:hover { color: #fff; }

.eg-btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.eg-btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.eg-btn-lg {
  padding: 16px 40px;
  font-size: 18px;
  border-radius: 16px;
  letter-spacing: 0.5px;
}

/* ============================================================
   FLOATING TEXT ANIMATION — with trail and scale effect
   ============================================================ */

.eg-float-text {
  position: absolute;
  font-size: 20px;
  font-weight: 900;
  pointer-events: none;
  animation: eg-float-up 1s ease-out forwards;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 20px currentColor;
  z-index: 100;
  letter-spacing: -0.5px;
}

@keyframes eg-float-up {
  0% { opacity: 1; transform: translateY(0) scale(0.8); filter: blur(0); }
  30% { opacity: 1; transform: translateY(-10px) scale(1.15); filter: blur(0); }
  100% { opacity: 0; transform: translateY(-50px) scale(0.9); filter: blur(2px); }
}

/* ============================================================
   VILLAIN BANNER — Dramatic entrance with glow
   ============================================================ */

.eg-villain-banner {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  background: linear-gradient(135deg, rgba(60, 20, 20, 0.97), rgba(30, 8, 8, 0.97));
  border: 2px solid rgba(239, 68, 68, 0.6);
  border-radius: 20px;
  z-index: 1000;
  animation: eg-villain-enter 0.5s var(--eg-ease-out-back);
  box-shadow:
    0 8px 40px rgba(239, 68, 68, 0.35),
    0 0 60px rgba(239, 68, 68, 0.1),
    inset 0 1px 0 rgba(255,255,255,0.05);
  max-width: 90vw;
  backdrop-filter: blur(16px);
}

.eg-villain-banner-exit {
  animation: eg-villain-exit 0.5s ease-in forwards;
}

@keyframes eg-villain-enter {
  0% { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(0.85); }
  60% { transform: translateX(-50%) translateY(3px) scale(1.02); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes eg-villain-exit {
  0% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(0.9); }
}

.eg-villain-icon {
  font-size: 40px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
  animation: eg-villain-icon-pulse 1s ease-in-out infinite;
}

.eg-villain-icon img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

/* WHY: Illustrated villain art replaces the emoji icon for a richer visual impact */
.eg-villain-art {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(239, 68, 68, 0.5);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
  animation: eg-villain-icon-pulse 1s ease-in-out infinite;
}

@keyframes eg-villain-icon-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.eg-villain-name {
  font-size: 17px;
  font-weight: 900;
  color: #f87171;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-shadow: 0 0 20px rgba(248, 113, 113, 0.5);
}

.eg-villain-desc {
  font-size: 13px;
  color: #fca5a5;
  margin-top: 2px;
  font-style: italic;
}

/* ============================================================
   RESULT CARD — Shareable infographic quality
   ============================================================ */

.eg-result-card {
  max-width: 500px;
  margin: 40px auto;
  padding: 36px;
  border-radius: 28px;
  border: 1px solid rgba(100, 100, 200, 0.15);
  box-shadow:
    0 20px 80px rgba(0,0,0,0.6),
    0 0 40px rgba(124, 58, 237, 0.05),
    inset 0 1px 0 rgba(255,255,255,0.05);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Animated gradient border glow */
.eg-result-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(34, 211, 238, 0.1), rgba(245, 197, 66, 0.1));
  z-index: -1;
  animation: eg-result-glow 4s ease-in-out infinite alternate;
}

@keyframes eg-result-glow {
  0% { opacity: 0.3; }
  100% { opacity: 0.7; }
}

/* Floating sparkle particles behind the card */
.eg-result-card::after {
  content: '';
  position: absolute;
  top: -20%;
  left: -20%;
  width: 140%;
  height: 140%;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(245, 197, 66, 0.3) 0%, transparent 100%),
    radial-gradient(2px 2px at 80% 40%, rgba(168, 85, 247, 0.25) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 40% 70%, rgba(34, 211, 238, 0.2) 0%, transparent 100%),
    radial-gradient(2px 2px at 60% 20%, rgba(74, 222, 128, 0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 80%, rgba(245, 197, 66, 0.3) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 10% 90%, rgba(168, 85, 247, 0.2) 0%, transparent 100%);
  animation: eg-sparkle-drift 8s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: -1;
}

@keyframes eg-sparkle-drift {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(3%, -3%) rotate(2deg); }
}

.eg-result-header {
  margin-bottom: 24px;
}

.eg-result-game {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #666;
  margin-bottom: 6px;
  font-weight: 700;
}

.eg-result-player {
  font-size: 14px;
  color: #a0a0a0;
  font-weight: 500;
}

.eg-result-headline {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 24px;
  letter-spacing: -0.3px;
}

.eg-result-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.eg-result-stat {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  color: #ccc;
  font-weight: 600;
  backdrop-filter: blur(4px);
  transition: all 0.3s;
}

.eg-result-stat:hover {
  background: rgba(255,255,255,0.08);
  transform: translateY(-1px);
}

.eg-result-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 20px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 14px;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.1);
}

.eg-result-title-icon {
  font-size: 22px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

.eg-result-title-text {
  font-size: 14px;
  font-weight: 800;
  color: #c084fc;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.eg-result-flavor {
  font-size: 14px;
  color: #888;
  font-style: italic;
  margin-bottom: 28px;
  line-height: 1.5;
}

.eg-result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.eg-share-feedback {
  font-size: 12px;
  color: #4ade80;
  margin-bottom: 16px;
  font-weight: 600;
}

.eg-result-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.eg-back-link {
  color: #888;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s, transform 0.2s;
}
.eg-back-link:hover { color: #fff; transform: translateX(-2px); }

.eg-result-branding {
  font-size: 10px;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
}

/* ============================================================
   CTA — Premium card with gradient border
   ============================================================ */

.eg-cta {
  margin-top: 24px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(168, 85, 247, 0.04));
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

.eg-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.3), transparent);
}

.eg-cta-text {
  font-size: 14px;
  color: #ccc;
  line-height: 1.6;
  margin-bottom: 16px;
  font-weight: 500;
}

.eg-cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  text-decoration: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.25s;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
  position: relative;
  overflow: hidden;
}
.eg-cta-button::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}
.eg-cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.5);
}
.eg-cta-button:hover::after {
  left: 125%;
}

/* ============================================================
   TOAST NOTIFICATIONS — Glass effect
   ============================================================ */

.eg-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s var(--eg-ease-smooth);
  pointer-events: none;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.eg-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.eg-toast-info { background: rgba(30, 58, 95, 0.9); color: #93c5fd; border: 1px solid rgba(37, 99, 235, 0.5); }
.eg-toast-success { background: rgba(20, 83, 45, 0.9); color: #6ee7b7; border: 1px solid rgba(22, 163, 74, 0.5); }
.eg-toast-warning { background: rgba(66, 32, 6, 0.9); color: #fde68a; border: 1px solid rgba(217, 119, 6, 0.5); }
.eg-toast-error { background: rgba(69, 10, 10, 0.9); color: #fca5a5; border: 1px solid rgba(220, 38, 38, 0.5); }

/* ============================================================
   MUTE TOGGLE
   ============================================================ */

.eg-mute-toggle {
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  transition: color 0.2s, transform 0.2s;
  border-radius: 8px;
}
.eg-mute-toggle:hover { color: #fff; transform: scale(1.1); }

/* ============================================================
   NAME PROMPT OVERLAY — Premium modal
   ============================================================ */

.eg-name-prompt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 15, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(12px);
  animation: eg-fade-in 0.3s ease;
}

@keyframes eg-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.eg-name-prompt {
  background: linear-gradient(135deg, #14142e, #1a1a3e);
  border: 1px solid rgba(100, 100, 200, 0.15);
  border-radius: 24px;
  padding: 36px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(124, 58, 237, 0.05);
  animation: eg-modal-enter 0.4s var(--eg-ease-out-back);
}

@keyframes eg-modal-enter {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.eg-name-prompt h3 {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.eg-name-prompt p {
  font-size: 13px;
  color: #888;
  margin-bottom: 20px;
}

.eg-name-input,
.eg-city-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(10, 10, 26, 0.8);
  border: 1px solid rgba(100, 100, 200, 0.15);
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.eg-name-input:focus,
.eg-city-input:focus {
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.1);
}

.eg-name-submit {
  width: 100%;
  margin-bottom: 8px;
}

.eg-name-skip {
  width: 100%;
}

/* ============================================================
   SPLASH / INTRO SCREEN — Dramatic entrance
   ============================================================ */

.eg-splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  padding: 32px;
  position: relative;
  z-index: 1;
}

.eg-splash-icon {
  font-size: 88px;
  margin-bottom: 24px;
  animation: eg-bounce 2.5s ease-in-out infinite;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.5));
}

@keyframes eg-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-12px) scale(1.02); }
}

.eg-splash-title {
  font-size: 52px;
  font-weight: 900;
  background: linear-gradient(135deg, #f5c542, #a855f7, #22d3ee);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 10px;
  animation: eg-gradient-shift 4s ease-in-out infinite;
}

@keyframes eg-gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.eg-splash-subtitle {
  font-size: 18px;
  color: #888;
  margin-bottom: 36px;
  max-width: 480px;
  line-height: 1.5;
  font-weight: 400;
}

.eg-splash-tagline {
  font-size: 13px;
  color: #444;
  margin-top: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
}

.eg-splash-meta {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  font-size: 12px;
  color: #555;
  font-weight: 500;
}

.eg-splash-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   GAME AREA — The main play area
   ============================================================ */

.eg-game-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(100, 100, 200, 0.1);
  background: linear-gradient(180deg, #0c0c22, #080818);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.02);
}

/* ============================================================
   TASK CARDS (used in chaos games) — Glass cards
   ============================================================ */

.eg-task-card {
  position: absolute;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(100, 100, 200, 0.12);
  background: linear-gradient(135deg, rgba(20, 20, 42, 0.95), rgba(14, 14, 32, 0.95));
  cursor: pointer;
  transition: transform 0.2s var(--eg-ease-smooth), box-shadow 0.2s, border-color 0.2s;
  min-width: 160px;
  max-width: 220px;
  user-select: none;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.eg-task-card:hover {
  transform: scale(1.04);
  border-color: rgba(100, 100, 200, 0.25);
  box-shadow: 0 8px 24px rgba(100, 100, 255, 0.15);
}

.eg-task-card:active {
  transform: scale(0.97);
}

.eg-task-type {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 4px;
}

.eg-task-text {
  font-size: 13px;
  color: #ccc;
  line-height: 1.35;
  font-weight: 500;
}

.eg-task-urgent { border-color: rgba(239, 68, 68, 0.5); }
.eg-task-urgent .eg-task-type { color: #f87171; }

.eg-task-normal .eg-task-type { color: #93c5fd; }
.eg-task-warning .eg-task-type { color: #fde68a; }
.eg-task-villain { border-color: rgba(239, 68, 68, 0.5); background: rgba(30, 10, 10, 0.95); }

/* ============================================================
   UPGRADE PANEL (used in builder games) — Premium grid
   ============================================================ */

.eg-upgrades-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(20, 20, 48, 0.9), rgba(14, 14, 36, 0.9));
  border: 1px solid rgba(100, 100, 200, 0.1);
  border-radius: 16px;
  margin-top: 12px;
  backdrop-filter: blur(8px);
}

.eg-upgrade-card {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(100, 100, 200, 0.1);
  background: rgba(20, 20, 42, 0.8);
  cursor: pointer;
  transition: all 0.25s var(--eg-ease-smooth);
}

.eg-upgrade-card:hover:not(.eg-upgrade-locked):not(.eg-upgrade-owned) {
  border-color: rgba(124, 58, 237, 0.4);
  background: rgba(124, 58, 237, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.15);
}

.eg-upgrade-card.eg-upgrade-locked {
  opacity: 0.35;
  cursor: default;
}

.eg-upgrade-card.eg-upgrade-owned {
  border-color: rgba(5, 150, 105, 0.4);
  background: rgba(5, 150, 105, 0.08);
  box-shadow: 0 0 12px rgba(5, 150, 105, 0.08);
}

.eg-upgrade-name {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 3px;
  letter-spacing: -0.2px;
}

.eg-upgrade-desc {
  font-size: 11px;
  color: #888;
  line-height: 1.35;
  margin-bottom: 8px;
}

.eg-upgrade-cost {
  font-size: 12px;
  font-weight: 800;
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.2);
}

.eg-upgrade-owned-label {
  font-size: 11px;
  color: #34d399;
  font-weight: 700;
}

/* ============================================================
   PROGRESS METRICS (used in builder games)
   ============================================================ */

.eg-metrics-bar {
  display: flex;
  gap: 16px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(20, 20, 48, 0.9), rgba(14, 14, 36, 0.9));
  border: 1px solid rgba(100, 100, 200, 0.1);
  border-radius: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.eg-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
}

.eg-metric-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #666;
  font-weight: 600;
}

.eg-metric-value {
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s, transform 0.2s;
}

.eg-metric-value.eg-metric-good { color: #34d399; text-shadow: 0 0 12px rgba(52, 211, 153, 0.3); }
.eg-metric-value.eg-metric-warn { color: #fbbf24; text-shadow: 0 0 12px rgba(251, 191, 36, 0.3); }
.eg-metric-value.eg-metric-bad { color: #f87171; text-shadow: 0 0 12px rgba(248, 113, 113, 0.3); }

/* ============================================================
   ROOM GRID (used in hospitality games) — Rich tile states
   ============================================================ */

.eg-room-grid {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.eg-room {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 2px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s var(--eg-ease-smooth);
  position: relative;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
}

.eg-room::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.25s;
  background: radial-gradient(circle at center, rgba(255,255,255,0.08), transparent 70%);
  pointer-events: none;
}

.eg-room:hover { transform: scale(1.07); z-index: 2; }
.eg-room:hover::before { opacity: 1; }
.eg-room:active { transform: scale(0.93); }

.eg-room-vacant {
  background: linear-gradient(135deg, #0a2a0a, #0d3310);
  border-color: rgba(22, 163, 74, 0.6);
  color: #4ade80;
  box-shadow: 0 0 12px rgba(22, 163, 74, 0.1), inset 0 0 16px rgba(22, 163, 74, 0.05);
}
.eg-room-occupied {
  background: linear-gradient(135deg, #1a1a4e, #1e2050);
  border-color: rgba(59, 130, 246, 0.5);
  color: #93c5fd;
  box-shadow: inset 0 -8px 20px rgba(59, 130, 246, 0.06);
}
.eg-room-dirty {
  background: linear-gradient(135deg, #2a1a0a, #302010);
  border-color: rgba(217, 119, 6, 0.6);
  color: #fbbf24;
  animation: eg-dirty-pulse 2s ease-in-out infinite;
}
@keyframes eg-dirty-pulse {
  0%, 100% { box-shadow: inset 0 0 10px rgba(217, 119, 6, 0.1); }
  50% { box-shadow: inset 0 0 24px rgba(217, 119, 6, 0.2), 0 0 8px rgba(217, 119, 6, 0.1); }
}
.eg-room-cleaning {
  background: linear-gradient(135deg, #0d2a3a, #102d40);
  border-color: rgba(8, 145, 178, 0.6);
  color: #22d3ee;
  box-shadow: inset 0 0 16px rgba(8, 145, 178, 0.08);
}
.eg-room-maintenance {
  background: linear-gradient(135deg, #2a0a0a, #350e0e);
  border-color: rgba(220, 38, 38, 0.6);
  color: #fca5a5;
  animation: eg-maint-pulse 1.2s ease infinite;
}
@keyframes eg-maint-pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(220, 38, 38, 0.1); }
  50% { box-shadow: 0 0 20px rgba(220, 38, 38, 0.25), inset 0 0 16px rgba(220, 38, 38, 0.1); }
}
.eg-room-vip {
  background: linear-gradient(135deg, #2a1a3e, #321d4a);
  border-color: rgba(168, 85, 247, 0.5);
  color: #c084fc;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.12), inset 0 0 16px rgba(168, 85, 247, 0.05);
}

.eg-room-icon {
  font-size: 22px;
  margin-bottom: 2px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: transform 0.3s;
}

.eg-room:hover .eg-room-icon { transform: scale(1.1); }

.eg-room-number {
  font-size: 9px;
  color: rgba(255,255,255,0.25);
  position: absolute;
  top: 3px;
  left: 6px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   PARTICLE CELEBRATION — Used on successful actions
   ============================================================ */

@keyframes eg-particle-burst {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx, 30px), var(--ty, -30px)) scale(0); }
}

.eg-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  animation: eg-particle-burst 0.7s ease-out forwards;
  z-index: 100;
}

/* ============================================================
   SCREEN SHAKE — Used during villain attacks and urgency
   ============================================================ */

@keyframes eg-screen-shake {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-4px, -2px); }
  20% { transform: translate(4px, 2px); }
  30% { transform: translate(-3px, 3px); }
  40% { transform: translate(3px, -3px); }
  50% { transform: translate(-2px, 2px); }
  60% { transform: translate(2px, -1px); }
  70% { transform: translate(-1px, 1px); }
}

.eg-shake {
  animation: eg-screen-shake 0.5s ease;
}

/* ============================================================
   SCORE POP — Used when score increases
   ============================================================ */

@keyframes eg-score-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.eg-score-pop {
  animation: eg-score-pop 0.35s var(--eg-ease-out-back);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 600px) {
  .eg-splash-title { font-size: 36px; }
  .eg-splash-subtitle { font-size: 15px; }
  .eg-splash-icon { font-size: 64px; }
  .eg-result-card { margin: 20px 10px; padding: 24px 18px; border-radius: 22px; }
  .eg-result-headline { font-size: 19px; }
  .eg-top-bar { padding: 8px 12px; gap: 8px; border-radius: 14px; }
  .eg-game-title { font-size: 14px; }
  .eg-upgrades-panel { grid-template-columns: 1fr 1fr; }
  .eg-villain-banner { padding: 10px 18px; border-radius: 16px; }
  .eg-villain-icon { font-size: 32px; }
  .eg-villain-art { width: 44px; height: 44px; border-radius: 10px; }
  .eg-btn-lg { padding: 14px 28px; font-size: 16px; }
}

@media (max-width: 400px) {
  .eg-upgrades-panel { grid-template-columns: 1fr; }
  .eg-result-actions { flex-direction: column; }
  .eg-result-actions .eg-btn { width: 100%; }
  .eg-splash-title { font-size: 30px; }
}
