/* Game Selector Styles */
/* Inherits variables from style.css */

/* Override base style.css overflow:hidden on html,body for scrollable page */
html, body {
  height: auto;
  min-height: 100vh;
  overflow-y: auto !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  box-sizing: border-box;
}

.selector-container {
  max-width: 1000px;
  width: 100%;
  text-align: center;
  margin: auto 0;
}

.selector-header h1 {
  font-size: 2.5rem;
  margin-bottom: 8px;
  color: var(--text);
}

.selector-header .tagline {
  color: var(--muted);
  font-size: 1.1rem;
  margin-bottom: 40px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.game-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.game-card h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.game-desc {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 16px;
}

.game-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.feature {
  padding: 4px 10px;
  background: var(--bg);
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}

.play-btn {
  padding: 12px 32px;
  background: var(--accent);
  color: #000;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s;
}

.game-card:hover .play-btn {
  background: #6fd4ff;
}

/* Card accent colors */
.snake-card:hover {
  border-color: #66bb6a;
}
.snake-card:hover .play-btn {
  background: #66bb6a;
}

.tanks-card:hover {
  border-color: #ffd700;
}
.tanks-card:hover .play-btn {
  background: #ffd700;
}

.selector-footer {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1100px) {
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .game-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .selector-container {
    padding-bottom: 40px;
  }
}

@media (max-width: 600px) {
  .selector-header h1 {
    font-size: 1.8rem;
  }
  .game-icon {
    font-size: 3rem;
  }
  .game-card {
    padding: 24px 16px;
  }
}

/* ─── Username section ────────────────────────────────────────── */
.username-section {
  margin-bottom: 32px;
}

.username-section input {
  padding: 12px 16px;
  font-size: 1.1rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  width: 280px;
  max-width: 90%;
  text-align: center;
}

.username-section input:focus {
  outline: none;
  border-color: var(--accent);
}

.username-section input::placeholder {
  color: var(--muted);
}

/* ─── Bomberman card accent ───────────────────────────────────── */
.bomberman-card:hover {
  border-color: #ff6b35;
}

.bomberman-card:hover .play-btn:not(.coming-soon) {
  background: #ff6b35;
}

.coming-soon {
  pointer-events: none;
  opacity: 0.6;
  background: var(--muted) !important;
  color: #fff !important;
}

.bomberman-card {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Hedgewars card accent ──────────────────────────────────── */
.hedgewars-card {
  border-color: #27ae60;
}

.hedgewars-card:hover {
  border-color: #2ecc71;
  box-shadow: 0 0 20px rgba(46, 204, 113, 0.3);
}

.hedgewars-card:hover .play-btn {
  background: #2ecc71;
}

/* Grey out desktop-only cards on mobile (touch devices) */
@media (hover: none) and (pointer: coarse) {
  .desktop-only-card {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
  }
  .desktop-only-card::after {
    content: 'Desktop Only';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10;
  }
}

/* ─── Theme toggle ────────────────────────────────────────────── */
.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1.3rem;
  padding: 6px 10px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

/* ─── Privacy link ────────────────────────────────────────────── */
.privacy-link {
  color: var(--muted);
  text-decoration: underline;
  transition: color 0.2s;
}

.privacy-link:hover {
  color: var(--accent);
}
