:root {
  /* Default theme colors (fallback when no venue) */
  --default-primary: #00cc88;
  --default-secondary: #0099cc;
  --default-accent: #cccc00;

  /* Venue customizable colors (overridden by JS when venue loads) */
  --venue-primary: var(--default-primary);
  --venue-secondary: var(--default-secondary);
  --venue-accent: var(--default-accent);

  /* System colors (not customizable) */
  --background-dark: #000000;
  --background-light: #111111;
  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;
  --error-color: #cc0000;
  --success-color: #00cc00;

  /* Semantic aliases (use venue colors) */
  --border-color: var(--venue-primary);
  --warning-color: var(--venue-accent);
  --shadow: 2px 2px 0 rgba(0, 204, 136, 0.4);
}

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

body {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  background: var(--background-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  position: fixed;
  width: 100%;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

#app {
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.header {
  background: var(--background-dark);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--border-color);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.2rem;
  font-weight: normal;
  color: var(--venue-secondary);
  text-shadow: 2px 2px 0 #000;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--error-color);
  animation: pulse 2s infinite;
}

.status-indicator.connected {
  background: var(--success-color);
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  width: 100%;
}

.screen {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.welcome-section {
  text-align: center;
  margin-bottom: 3rem;
}

.welcome-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--venue-primary);
  text-shadow: 3px 3px 0 #000;
}

.welcome-section p {
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.join-section, .lobby-header, .game-header {
  background: var(--background-light);
  border-radius: 0;
  padding: 2rem;
  margin-bottom: 2rem;
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow);
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.input-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 0;
  background: var(--background-dark);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: 'Press Start 2P', monospace;
  transition: none;
}

.input-group input:focus {
  outline: none;
  border-color: var(--venue-primary);
  box-shadow: var(--shadow);
}

.input-group input::placeholder {
  color: var(--text-secondary);
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: 0;
  font-size: 0.7rem;
  font-family: 'Press Start 2P', monospace;
  font-weight: normal;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: none;
  min-width: 120px;
}

.btn-primary {
  background: var(--venue-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--venue-accent);
  color: var(--text-primary);
}

.btn-secondary {
  background: var(--venue-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--venue-accent);
  color: var(--text-primary);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--venue-primary);
  color: var(--venue-primary);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  min-width: auto;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.quick-join {
  text-align: center;
}

.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.players-section {
  margin-bottom: 2rem;
}

.players-section h3, .games-section h3 {
  margin-bottom: 1rem;
  margin-top: 2.5rem;
  color: var(--venue-primary);
  border-bottom: 2px solid var(--venue-primary);
  padding-bottom: 0.5rem;
}

.games-section h3:first-of-type {
  margin-top: 1rem;
}

.players-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.player-card {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  text-align: center;
}

.player-card .player-name {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.player-card .player-status {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.game-card {
  background: var(--background-dark);
  border: 2px solid var(--border-color);
  border-radius: 0;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: none;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.game-card:hover {
  border-color: var(--venue-primary);
  box-shadow: var(--shadow);
}

.game-card:before {
  display: none;
}

.game-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.game-card.disabled:hover {
  transform: none;
  border-color: var(--border-color);
  box-shadow: none;
}

.game-card.disabled:before {
  display: none;
}

/* Mode cards - same styling as game cards */
.mode-card {
  background: var(--background-dark);
  border: 2px solid var(--border-color);
  border-radius: 0;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: none;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.mode-card:hover {
  border-color: var(--venue-primary);
  box-shadow: var(--shadow);
}

.mode-card:before {
  display: none;
}

.mode-card h4 {
  margin-bottom: 0.8rem;
  color: var(--venue-primary);
  font-size: 0.9rem;
  font-weight: normal;
}

.mode-card p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.4;
  flex-grow: 1;
}

.game-icon {
  font-size: 3.5rem;
  margin-bottom: 1.2rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.game-card h4 {
  margin-bottom: 0.8rem;
  color: var(--venue-primary);
  font-size: 0.9rem;
  font-weight: normal;
}

.game-card p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.4;
  flex-grow: 1;
}

.game-features {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.feature {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.queue-status {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.4rem;
  background: rgba(255, 107, 53, 0.1);
  border-radius: 20px;
  border: 1px solid rgba(255, 107, 53, 0.3);
}

.queue-count {
  color: var(--venue-primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.in-queue {
  color: var(--success-color);
  font-weight: 600;
  font-size: 0.75rem;
}

.game-card.in-queue {
  border-color: var(--success-color);
  background: rgba(76, 175, 80, 0.05);
}

.players-needed {
  background: var(--venue-primary);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 25px;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.estimated-time {
  color: var(--venue-accent);
  font-size: 0.8rem;
  font-weight: 500;
}

/* Challenge Section */
.challenge-section {
  margin-top: 3rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 2rem;
  border: 1px solid var(--border-color);
}

.challenge-section h3 {
  margin-bottom: 1.5rem;
  color: var(--venue-accent);
  border-bottom: 2px solid var(--venue-accent);
  padding-bottom: 0.5rem;
}

.challenge-controls {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
}

.challenge-controls select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.challenge-controls select:focus {
  outline: none;
  border-color: var(--venue-accent);
  box-shadow: 0 0 0 3px rgba(26, 101, 158, 0.2);
}

/* Challenge Game Cards */
.challenge-game-card {
  background: var(--background-dark);
  border: 2px solid var(--border-color);
  border-radius: 0;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: none;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.challenge-game-card:hover {
  border-color: var(--venue-primary);
  box-shadow: var(--shadow);
}

.challenge-game-card h4 {
  margin-bottom: 0.8rem;
  color: var(--venue-primary);
  font-size: 0.9rem;
  font-weight: normal;
}

.challenge-game-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Challenge Options Screen */
.challenge-options-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.challenge-summary {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--border-color);
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.summary-item .label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.summary-item .value {
  color: var(--venue-primary);
  font-size: 1.2rem;
  font-weight: 600;
}

.options-section {
  margin-bottom: 2rem;
}

.option-group {
  margin-bottom: 2rem;
}

.option-group h3 {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.option-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.option-btn {
  flex: 1;
  min-width: 120px;
  padding: 1rem 1.5rem;
  background: var(--background-dark);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Press Start 2P', monospace;
  text-transform: uppercase;
}

.option-btn:hover {
  border-color: var(--venue-primary);
  background: var(--venue-accent);
  color: var(--text-primary);
  box-shadow: var(--shadow);
}

.option-btn.active {
  border-color: var(--venue-primary);
  background: var(--venue-primary);
  color: var(--text-primary);
}

/* Challenge Notification Popup */
.challenge-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3000;
  background: var(--background-dark);
  border: 3px solid var(--venue-primary);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  max-width: 500px;
  width: 90%;
  animation: slideInBounce 0.5s ease-out;
}

@keyframes slideInBounce {
  0% {
    transform: translate(-50%, -60%);
    opacity: 0;
  }
  60% {
    transform: translate(-50%, -48%);
  }
  100% {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
}

.challenge-notification::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), transparent);
  pointer-events: none;
}

.notification-header {
  background: var(--venue-primary);
  padding: 1.5rem;
  text-align: center;
}

.notification-header h4 {
  margin: 0;
  color: white;
  font-size: 1.3rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.notification-content {
  padding: 2rem;
  text-align: center;
}

.notification-content p {
  margin: 0.5rem 0;
  font-size: 1.1rem;
  line-height: 1.6;
}

.notification-content strong {
  color: var(--venue-primary);
}

.notification-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  justify-content: center;
}

.accept-btn,
.decline-btn {
  flex: 1;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border: 2px solid;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.accept-btn {
  background: var(--success-color);
  border-color: var(--success-color);
  color: white;
}

.accept-btn:hover {
  background: #5cb85c;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.decline-btn {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-color);
}

.decline-btn:hover {
  border-color: #e74c3c;
  color: #e74c3c;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal.active {
  display: flex;
  justify-content: center;
  align-items: center;
  animation: modalFadeIn 0.3s ease-out;
}

.modal-content {
  background: var(--background-light);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  margin: 0;
  color: var(--venue-primary);
  font-size: 1.3rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--error-color);
}

.modal-body {
  padding: 2rem;
}

.invitation-details p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  line-height: 1.5;
  text-align: center;
}

.invitation-timer {
  text-align: center;
  font-size: 1rem;
  color: var(--warning-color);
  font-weight: 600;
}

.modal-footer {
  display: flex;
  gap: 1rem;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-color);
  justify-content: center;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== IMMERSIVE GAME CONTAINER - MAXIMUM SCREEN USAGE ===== */

/* Hide immersive container by default */
.immersive-game-container {
  display: none;
}

/* Only show immersive container when gameScreen is active */
#gameScreen.active .immersive-game-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--background-dark);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.immersive-game-container canvas {
  max-width: 100vw;
  max-height: 100vh;
  background: var(--background-dark);
  border: none;
  display: block;
}

/* Minimal HUD Overlay - Non-intrusive */
.game-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1001;
}

.hud-top-left {
  position: absolute;
  top: 1rem;
  left: 1rem;
  pointer-events: auto;
  z-index: 1001;
}

.hud-top-right {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  pointer-events: auto;
  z-index: 1001;
}

.hud-bottom {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  z-index: 1001;
}

/* HUD Elements Styling */
.game-title {
  font-size: 1rem;
  color: var(--venue-primary);
  margin: 0 0 0.25rem 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.hud-score {
  font-size: 0.9rem;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.7);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  backdrop-filter: blur(5px);
}

.hud-status {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.7);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  text-align: center;
  backdrop-filter: blur(5px);
}

/* HUD Buttons - Minimal and Elegant */
.hud-btn {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Better mobile touch target */
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  /* Ensure it's always clickable */
  position: relative;
  z-index: 1002;
}

.hud-btn:hover {
  background: rgba(0, 204, 136, 0.2);
  border-color: var(--venue-primary);
  transform: scale(1.05);
}

.hud-btn.quit-btn {
  background: rgba(204, 0, 0, 0.8);
  border-color: var(--error-color);
}

.hud-btn.quit-btn:hover {
  background: rgba(204, 0, 0, 1);
}

/* Portrait/Landscape Optimizations */
@media screen and (orientation: portrait) {
  .hud-top-left, .hud-top-right {
    top: 0.5rem;
  }

  .hud-bottom {
    bottom: 0.5rem;
  }

  .hud-btn {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
}

@media screen and (orientation: landscape) and (max-height: 500px) {
  .hud-top-left, .hud-top-right {
    top: 0.25rem;
  }

  .hud-bottom {
    bottom: 0.25rem;
  }

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

  .hud-score, .hud-status {
    font-size: 0.7rem;
    padding: 0.125rem 0.375rem;
  }

  .hud-btn {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
}

/* Legacy game-container for backward compatibility */
.game-container {
  background: rgba(0, 0, 0, 0.8);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.game-container canvas {
  max-width: 100%;
  max-height: 70vh;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: #000;
}

.game-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.score-display, .status-display {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  border: 1px solid var(--border-color);
}

.notification-container {
  position: fixed;
  top: 80px;
  right: 1rem;
  z-index: 1000;
  max-width: 300px;
}

.notification {
  background: var(--background-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease-out;
}

.notification.success {
  border-color: var(--success-color);
  background: rgba(76, 175, 80, 0.1);
}

.notification.error {
  border-color: var(--error-color);
  background: rgba(244, 67, 54, 0.1);
}

.notification.warning {
  border-color: var(--warning-color);
  background: rgba(255, 152, 0, 0.1);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .header-content {
    padding: 0 0.5rem;
  }

  .logo {
    font-size: 1.2rem;
  }

  .main-content {
    padding: 0.5rem;
  }

  .welcome-section {
    margin-bottom: 1.5rem;
  }

  .welcome-section h2 {
    font-size: 1.8rem;
  }

  .welcome-section p {
    font-size: 1rem;
  }

  .join-section, .lobby-header, .game-header {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .lobby-header {
    flex-direction: column;
    text-align: center;
  }

  .game-header {
    padding: 0.75rem;
  }

  .game-controls {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
  }

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

  .game-container {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    min-height: auto;
  }

  .game-container canvas {
    max-height: 75vh;
  }

  .game-info {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .notification-container {
    top: 60px;
    right: 0.5rem;
    left: 0.5rem;
    max-width: none;
  }

  .input-group {
    margin-bottom: 1rem;
  }

  .btn {
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
  }
}

/* Venue Selection Styles */
.venues-section {
  margin-bottom: 2rem;
}

.venues-section h3 {
  margin-bottom: 2rem;
  color: var(--venue-primary);
  text-align: center;
  font-size: 1.5rem;
  border-bottom: 2px solid var(--venue-primary);
  padding-bottom: 0.5rem;
}

.venues-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.venue-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.venue-card:hover {
  border-color: var(--venue-primary);
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(255, 107, 53, 0.3);
}

.venue-card:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.1), transparent);
  transition: left 0.5s;
}

.venue-card:hover:before {
  left: 100%;
}

.venue-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.venue-card h4 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-size: 1.3rem;
}

.venue-card p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.venue-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.venue-stats span {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
}

.active-tables {
  color: var(--venue-primary);
}

.online-count {
  color: var(--venue-accent);
}

/* Venue Header */
.venue-header {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 3rem;
  text-align: center;
}

.venue-header h2 {
  margin: 0;
  color: var(--venue-secondary);
}

.venue-branding {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.venue-logo {
  max-height: 40px;
  max-width: 100px;
  object-fit: contain;
}

.venue-info {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
}

.venue-info span {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
}

/* Input Error Styling */
.input-error {
  color: var(--error-color);
  font-size: 0.8rem;
  margin-top: 0.5rem;
  min-height: 1rem;
}

.input-group input.error {
  border-color: var(--error-color);
  box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.2);
}

/* Active Tables Section */
.active-tables-section {
  margin-top: 2rem;
}

.active-tables-section h3 {
  margin-bottom: 1rem;
  color: var(--venue-primary);
  border-bottom: 2px solid var(--venue-primary);
  padding-bottom: 0.5rem;
}

.active-tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.active-table-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.active-table-card:hover {
  border-color: var(--venue-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(26, 101, 158, 0.3);
}

.active-table-card.occupied {
  border-color: var(--warning-color);
  background: rgba(255, 152, 0, 0.1);
}

.active-table-card.full {
  border-color: var(--error-color);
  background: rgba(244, 67, 54, 0.1);
  cursor: not-allowed;
}

.table-number {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--venue-primary);
  margin-bottom: 0.5rem;
}

.table-players {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.table-status {
  font-size: 0.7rem;
  margin-top: 0.5rem;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  background: var(--success-color);
  color: white;
}

.table-status.playing {
  background: var(--warning-color);
}

.table-status.full {
  background: var(--error-color);
}

@media (max-width: 768px) {
  .venue-header {
    flex-direction: column;
    text-align: center;
  }

  .venue-info {
    justify-content: center;
  }

  .venues-grid {
    grid-template-columns: 1fr;
  }

  .venue-card {
    padding: 1.5rem;
  }

  .venue-icon {
    font-size: 3rem;
  }

  .active-tables-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

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

  .game-card {
    min-height: 250px;
    padding: 1.5rem;
  }

  .game-icon {
    font-size: 3rem;
  }

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

  .modal-content {
    width: 95%;
    margin: 1rem;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem;
  }

  .modal-footer {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: 0 0.25rem;
  }

  .logo {
    font-size: 1rem;
  }

  .connection-status {
    font-size: 0.75rem;
  }

  .main-content {
    padding: 0.25rem;
  }

  .welcome-section h2 {
    font-size: 1.5rem;
  }

  .welcome-section p {
    font-size: 0.9rem;
  }

  .game-container {
    padding: 0.25rem;
    margin-bottom: 0.25rem;
  }

  .game-container canvas {
    border-radius: 4px;
    border-width: 1px;
  }

  .game-header {
    padding: 0.5rem;
  }

  .game-header h2 {
    font-size: 1rem;
  }

  .btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
  }

  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .lobby-header .btn {
    width: auto;
    margin-bottom: 0;
  }

  .venue-header .btn {
    width: auto;
    margin-bottom: 0;
  }

  .venue-card {
    padding: 1rem;
  }

  .venues-grid {
    gap: 0.75rem;
  }

  .game-card {
    min-height: 220px;
    padding: 1.25rem;
  }

  .input-group input {
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
  }

  .game-info {
    font-size: 0.9rem;
  }
}

/* ===== GAME CATEGORIES - RETRO ARCADE STYLE ===== */
.game-categories {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-radius: 12px;
  border: 2px solid #00ff88;
  box-shadow:
    0 0 20px rgba(0, 255, 136, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.game-categories::-webkit-scrollbar {
  display: none;
}

.category-btn {
  padding: 0.75rem 1.25rem;
  border: 2px solid #00ff88;
  background: linear-gradient(135deg, #0f3460, #16213e);
  color: #00ff88;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.category-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.2), transparent);
  transition: left 0.6s;
}

.category-btn:hover::before {
  left: 100%;
}

.category-btn:hover {
  background: linear-gradient(135deg, #1a4480, #00ff88);
  color: #0f3460;
  text-shadow: 0 0 15px rgba(15, 52, 96, 0.8);
  box-shadow:
    0 6px 25px rgba(0, 255, 136, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.category-btn.active {
  background: linear-gradient(135deg, #00ff88, #00d470);
  color: #0f3460;
  text-shadow: 0 0 10px rgba(15, 52, 96, 0.8);
  box-shadow:
    0 0 30px rgba(0, 255, 136, 0.6),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2);
  animation: glow 2s ease-in-out infinite alternate;
}

.category-btn:active {
  transform: translateY(0);
  box-shadow:
    0 2px 10px rgba(0, 255, 136, 0.3),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes glow {
  from {
    box-shadow:
      0 0 30px rgba(0, 255, 136, 0.6),
      inset 0 -2px 4px rgba(0, 0, 0, 0.2);
  }
  to {
    box-shadow:
      0 0 40px rgba(0, 255, 136, 0.8),
      0 0 60px rgba(0, 255, 136, 0.4),
      inset 0 -2px 4px rgba(0, 0, 0, 0.2);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive category navigation */
@media (max-width: 768px) {
  .game-categories {
    padding: 0.75rem;
    gap: 0.375rem;
  }

  .category-btn {
    padding: 0.5rem 1rem;
    font-size: 0.6rem;
  }
}

/* ===== FULLSCREEN BUTTON STYLING ===== */

/* Fullscreen button styling */
#fullscreenBtn {
  background: transparent;
  border: 2px solid var(--venue-primary);
  color: var(--venue-primary);
  font-size: 0.75rem;
  transition: all 0.3s ease;
}

#fullscreenBtn:hover {
  background: var(--venue-accent);
  color: var(--text-primary);
  border-color: var(--venue-accent);
  transform: translateY(-1px);
}


/* Competition Features Section */
.feature-access-section {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  margin-top: 3rem;
  box-shadow: var(--shadow);
}

.feature-access-section h3 {
  margin-bottom: 1.5rem;
  color: var(--venue-accent);
  text-align: center;
  font-size: 1.2rem;
  border-bottom: 2px solid var(--venue-accent);
  padding-bottom: 0.5rem;
}

.feature-buttons {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.feature-buttons .btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  min-width: 200px;
  justify-content: center;
}

.btn-icon {
  font-size: 1.2rem;
}

@media (max-width: 768px) {
  .feature-access-section {
    padding: 1.5rem;
    margin-top: 2rem;
  }

  .feature-buttons {
    flex-direction: column;
    align-items: center;
  }

  .feature-buttons .btn {
    width: 100%;
    max-width: 300px;
  }
}

/* Game Scoreboards Section */
.game-scoreboards-section {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  margin-top: 3rem;
  box-shadow: var(--shadow);
}

.game-scoreboards-section h3 {
  margin-bottom: 1.5rem;
  color: var(--venue-primary);
  text-align: center;
  font-size: 1.2rem;
  border-bottom: 2px solid var(--venue-primary);
  padding-bottom: 0.5rem;
}

.scoreboards-section-title {
  margin: 2rem 0 1rem 0;
  color: var(--venue-accent);
  text-align: left;
  font-size: 1rem;
  border-bottom: 1px solid var(--venue-accent);
  padding-bottom: 0.3rem;
}

.scoreboards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.scoreboard-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  transition: all 0.3s ease;
}

.scoreboard-card:hover {
  border-color: var(--venue-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 204, 136, 0.3);
}

.scoreboard-card .game-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.scoreboard-card h4 {
  margin-bottom: 0.8rem;
  color: var(--venue-primary);
  font-size: 0.8rem;
}

.top-score {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.top-score .score {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--venue-accent);
}

.top-score .player {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .game-scoreboards-section {
    padding: 1.5rem;
    margin-top: 2rem;
  }

  .scoreboards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .scoreboard-card {
    padding: 0.75rem;
  }

  .scoreboard-card .game-icon {
    font-size: 1.5rem;
  }

  .scoreboard-card h4 {
    font-size: 0.7rem;
  }
}
/* ===== Access Denied Error Screen ===== */
.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
  padding: 2rem;
}

.error-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.error-container h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.error-message {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  color: var(--text-color);
}

.error-details {
  text-align: left;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 1.5rem;
  width: 100%;
}

.error-details p {
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.error-details ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.error-details li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.error-details li:before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
}

@media (max-width: 768px) {
  .error-container {
    padding: 1rem;
  }

  .error-icon {
    font-size: 4rem;
  }

  .error-container h2 {
    font-size: 1.5rem;
  }

  .error-message {
    font-size: 1rem;
  }
}
