/* Base + topbar + buttons + landing.
   Loaded by every page. Anything game-specific lives in css/<game>.css. */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: #0a6e3a;
  background-image: radial-gradient(ellipse at center, #138a4a 0%, #0a6e3a 60%, #054a26 100%);
  color: white;
  min-height: 100vh;
}

/* === Topbar === */

.topbar {
  padding: 12px 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  flex-wrap: wrap;
}

.topbar .hint {
  font-size: 13px;
  opacity: 0.8;
}

.topbar .back {
  color: white;
  text-decoration: none;
  font-size: 14px;
  opacity: 0.85;
  padding: 6px 10px;
  border-radius: 4px;
}
.topbar .back:hover { background: rgba(0, 0, 0, 0.25); }

/* === Buttons === */

button {
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  border-radius: 4px;
  background: #f0f0f0;
  color: #222;
  font-weight: 600;
}
button:hover { background: #ffffff; }
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button:disabled:hover { background: #f0f0f0; }

.link-btn {
  background: transparent;
  color: white;
  padding: 2px 8px;
  font-size: 14px;
  border-radius: 4px;
  font-weight: 400;
}
.link-btn:hover { background: rgba(0, 0, 0, 0.25); }

/* Difficulty selector — used by minesweeper, sudoku, reversi, tictactoe, gomoku */
.difficulty-buttons {
  display: flex;
  gap: 4px;
}
.difficulty-buttons button {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
}
.difficulty-buttons button.active {
  background: #ffd54f;
  color: #222;
}

/* === Landing page === */

.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
}
.landing h1 {
  font-size: 56px;
  margin: 0 0 6px;
  letter-spacing: 1px;
}
.landing .subtitle {
  margin: 0 0 36px;
  opacity: 0.85;
  font-size: 16px;
}

.game-tiles {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}
.game-tile {
  display: block;
  width: 240px;
  padding: 28px 28px 24px;
  background: rgba(0, 0, 0, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  color: white;
  text-decoration: none;
  text-align: left;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.game-tile:hover {
  background: rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 213, 79, 0.7);
  transform: translateY(-3px);
}
.game-tile h2 { margin: 0 0 8px; font-size: 22px; }
.game-tile p  { margin: 0; opacity: 0.8; font-size: 14px; line-height: 1.4; }
.game-tile .tile-stats {
  margin-top: 12px;
  font-size: 12px;
  opacity: 0.85;
  letter-spacing: 0.2px;
  font-weight: 600;
  color: #ffd54f;
  font-variant-numeric: tabular-nums;
}

/* === Responsive === */

@media (max-width: 820px) {
  .topbar { padding: 10px 12px; gap: 10px; }
  .topbar .hint { display: none; }
  .landing h1 { font-size: 42px; }
}
@media (max-width: 580px) {
  .topbar { font-size: 13px; padding: 8px 10px; gap: 8px; }
  button { padding: 6px 10px; font-size: 13px; }
  .landing h1 { font-size: 36px; }
  .game-tile { width: 100%; max-width: 320px; padding: 22px; }
}
