/* ===== CSS Variables ===== */
:root {
  --jeopardy-blue: #060CE9;
  --jeopardy-blue-dark: #04098B;
  --jeopardy-blue-light: #1E24FF;
  --jeopardy-gold: #D4A843;
  --jeopardy-gold-light: #E8C66A;
  --pictionary-green: #2E7D32;
  --pictionary-green-light: #4CAF50;
  --pictionary-green-dark: #1B5E20;
  --nametune-maroon: #8B2252;
  --nametune-maroon-light: #C2185B;
  --nametune-maroon-dark: #5D1538;
  --white: #FFFFFF;
  --black: #000000;
  --gray: #666666;
  --gray-light: #CCCCCC;
  --gray-dark: #333333;

  --font-logo: 'Michroma', sans-serif;
  --font-sans: 'Open Sans', sans-serif;

  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-heavy: 0 8px 16px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 12px 24px rgba(0, 0, 0, 0.5);
}

/* ===== Reset & Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  color: var(--white);
}

/* ===== Screen Management ===== */
.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: block;
}

/* ===== Login Screen ===== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-title {
  font-family: var(--font-logo);
  font-size: 3.5rem;
  background: linear-gradient(135deg, var(--jeopardy-gold) 0%, var(--jeopardy-gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 2rem;
  letter-spacing: 2px;
}

.login-container {
  background: rgba(0, 0, 0, 0.3);
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  max-width: 350px;
  width: 100%;
}

.login-container h2 {
  font-family: var(--font-logo);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--white);
}

.login-inputs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.login-inputs input {
  padding: 0.75rem 1rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 1rem;
}

.login-inputs input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.login-inputs input:focus {
  outline: none;
  border-color: var(--jeopardy-gold);
}

.login-error {
  color: #ff6b6b;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.login-error.hidden {
  display: none;
}

.btn {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--jeopardy-gold) 0%, var(--jeopardy-gold-light) 100%);
  color: var(--black);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 168, 67, 0.4);
}

/* ===== Container ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */
.header {
  text-align: center;
  margin-bottom: 3rem;
}

.title {
  font-family: var(--font-logo);
  font-size: 3.5rem;
  background: linear-gradient(135deg, var(--jeopardy-gold) 0%, var(--jeopardy-gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
}

.subtitle {
  font-size: 1.25rem;
  color: var(--gray-light);
  font-weight: 400;
}

/* ===== Games Grid ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  flex: 1;
  align-content: start;
}

/* ===== Game Card ===== */
.game-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 2rem;
  text-decoration: none;
  color: var(--white);
  transition: all 0.3s ease;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.card-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--white);
  cursor: pointer;
  width: 100%;
}

.game-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

/* Zeopardy Card */
.zeopardy-card {
  border-color: var(--jeopardy-blue);
  background: linear-gradient(135deg, rgba(6, 12, 233, 0.2) 0%, rgba(4, 9, 139, 0.3) 100%);
}

.zeopardy-card:hover {
  border-color: var(--jeopardy-gold);
  background: linear-gradient(135deg, rgba(6, 12, 233, 0.3) 0%, rgba(4, 9, 139, 0.4) 100%);
}

.zeopardy-card .game-icon {
  color: var(--jeopardy-gold);
}

/* Pictionary Card */
.pictionary-card {
  border-color: var(--pictionary-green);
  background: linear-gradient(135deg, rgba(46, 125, 50, 0.2) 0%, rgba(27, 94, 32, 0.3) 100%);
}

.pictionary-card:hover {
  border-color: var(--pictionary-green-light);
  background: linear-gradient(135deg, rgba(46, 125, 50, 0.3) 0%, rgba(27, 94, 32, 0.4) 100%);
}

.pictionary-card .game-icon {
  color: var(--pictionary-green-light);
}

/* Name That Tune Card */
.nametune-card {
  border-color: var(--nametune-maroon);
  background: linear-gradient(135deg, rgba(139, 34, 82, 0.2) 0%, rgba(93, 21, 56, 0.3) 100%);
}

.nametune-card:hover {
  border-color: var(--nametune-maroon-light);
  background: linear-gradient(135deg, rgba(139, 34, 82, 0.3) 0%, rgba(93, 21, 56, 0.4) 100%);
}

.nametune-card .game-icon {
  color: var(--nametune-maroon-light);
}

.nametune-card.has-room {
  border-color: var(--nametune-maroon-light);
}

/* UNO Card */
.uno-card {
  border-color: #8B5CF6;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(124, 58, 237, 0.3) 100%);
}

.uno-card:hover {
  border-color: #A78BFA;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(124, 58, 237, 0.4) 100%);
}

.uno-card .game-icon {
  color: #A78BFA;
}

.uno-card.has-room {
  border-color: #A78BFA;
}

/* Blackjack Card */
.blackjack-card {
  border-color: #dc2626;
  background: linear-gradient(135deg, rgba(26, 71, 42, 0.4) 0%, rgba(20, 56, 33, 0.5) 100%);
}

.blackjack-card:hover {
  border-color: #fbbf24;
  background: linear-gradient(135deg, rgba(26, 71, 42, 0.5) 0%, rgba(20, 56, 33, 0.6) 100%);
}

.blackjack-card .game-icon {
  color: #fbbf24;
}

.blackjack-card.has-room {
  border-color: #fbbf24;
}

/* Coming Soon Card */
.coming-soon-card {
  border-color: var(--gray);
  background: rgba(255, 255, 255, 0.02);
  cursor: default;
  opacity: 0.6;
}

.coming-soon-card:hover {
  transform: none;
  box-shadow: none;
}

.coming-soon-card .game-icon {
  color: var(--gray);
}

/* ===== Game Icon ===== */
.game-icon {
  width: 100px;
  height: 100px;
  margin-bottom: 1.5rem;
}

.icon-svg {
  width: 100%;
  height: 100%;
}

/* ===== Game Title ===== */
.game-title {
  font-family: var(--font-logo);
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  letter-spacing: 1px;
}

/* ===== Game Description ===== */
.game-description {
  font-size: 1rem;
  color: var(--gray-light);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
}

/* ===== Game Players ===== */
.game-players {
  font-size: 0.875rem;
  color: var(--gray);
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
}

/* ===== Room Badge ===== */
.room-badge {
  position: absolute;
  top: -12px;
  right: -12px;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
  animation: pulse-badge 2s infinite;
  z-index: 10;
}

.room-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(40, 167, 69, 0.6);
}

.room-badge-text {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.room-badge-code {
  font-family: var(--font-logo);
  font-size: 1rem;
  letter-spacing: 2px;
}

.room-badge.hidden {
  display: none;
}

.room-badge-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0.5rem;
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 140px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 20;
}

.room-badge-menu.hidden {
  display: none;
}

.room-badge-menu .menu-btn {
  background: transparent;
  color: var(--white);
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s ease;
}

.room-badge-menu .menu-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

@keyframes pulse-badge {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.7);
  }
}

/* Card with active room */
.game-card.has-room {
  animation: glow 2s infinite;
}

.zeopardy-card.has-room {
  border-color: var(--jeopardy-gold);
}

.pictionary-card.has-room {
  border-color: var(--pictionary-green-light);
}

@keyframes glow {
  0%, 100% {
    box-shadow: var(--shadow);
  }
  50% {
    box-shadow: var(--shadow-hover);
  }
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-text {
  color: var(--gray);
  font-size: 0.9rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .container {
    padding: 1.5rem;
  }

  .title {
    font-size: 2.5rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .games-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .game-card {
    padding: 1.5rem;
  }

  .game-icon {
    width: 80px;
    height: 80px;
  }

  .game-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 2rem;
  }

  .game-icon {
    width: 60px;
    height: 60px;
  }
}
