/* Game Zone — grid of game cards, each one opens a game that runs in an
   embedded frame right on the page. Every game is its own little app with
   its own styles/scripts, so we keep it sealed inside an <iframe> — that
   way none of the 10 games can accidentally break each other's look. */

.gz-toolbar {
  max-width: 1100px;
  margin: 0 auto 1rem;
  padding: 0 1.5rem;
  text-align: center;
}

.gz-toolbar p {
  font-family: "Rubik", sans-serif;
  font-size: 0.85rem;
  opacity: 0.75;
  margin: 0;
}

.gz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.gz-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  text-align: center;
}

.gz-card .gz-icon {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 0 10px var(--game-color, var(--neon-cyan)));
}

.gz-card h2 {
  font-size: 0.85rem;
  margin: 0;
  color: var(--game-color, var(--neon-cyan));
}

.gz-card p {
  font-family: "Rubik", sans-serif;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.4;
}

.gz-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.gz-badge {
  font-family: "Rubik", sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  white-space: nowrap;
}

.gz-play-btn {
  font-family: "Rubik", sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: none;
  background: var(--game-color, var(--neon-cyan));
  color: #0a0a12;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.gz-play-btn:hover {
  transform: scale(1.05);
}

.gz-play-btn:active {
  transform: scale(0.97);
}

/* ---------- The full-screen-ish game player overlay ---------- */

.gz-player {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 12, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.gz-player.open {
  display: flex;
}

.gz-player-inner {
  width: 100%;
  max-width: 900px;
  height: 100%;
  max-height: 700px;
  display: flex;
  flex-direction: column;
  background: #05050a;
  border: 2px solid var(--game-color, var(--neon-cyan));
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 0 40px var(--game-color, var(--neon-cyan));
}

.gz-player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: #0a0a12;
  border-bottom: 1px solid var(--border);
}

.gz-player-title {
  font-family: "Press Start 2P", sans-serif;
  font-size: 0.75rem;
  color: var(--game-color, var(--neon-cyan));
}

.gz-player-close {
  font-family: "Rubik", sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.gz-player-close:hover {
  border-color: var(--neon-magenta);
  color: var(--neon-magenta);
}

.gz-player iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
}

.gz-credits {
  max-width: 900px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
  font-family: "Rubik", sans-serif;
}

.gz-credits summary {
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.7;
}

.gz-credits ul {
  font-size: 0.75rem;
  opacity: 0.65;
  line-height: 1.7;
  padding-left: 1.2rem;
}

.gz-credits a {
  color: var(--neon-cyan);
}

/* ---------- Leaderboard (shared with fidget page, duplicated here) ---------- */

.toy-leaderboard {
  width: 100%;
  margin-top: 0.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.toy-best {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 0;
  text-align: center;
}

.toy-best .best-value {
  color: var(--neon-yellow);
  font-weight: 700;
}

.score-form {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.score-name-input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.75rem;
  font-family: inherit;
}

.score-name-input:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.15);
}

.score-form button {
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  border: none;
  background: var(--neon-yellow);
  color: #2b1a00;
  font-weight: 700;
  font-size: 0.7rem;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.1s ease, opacity 0.1s ease;
}

.score-form button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.score-form button:disabled {
  opacity: 0.4;
  cursor: default;
}

.score-feedback {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin: -0.15rem 0 0;
  min-height: 0.9em;
  text-align: center;
}

.leaderboard-details {
  width: 100%;
}

.leaderboard-details summary {
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text);
  text-align: center;
  padding: 0.35rem 0;
  list-style: none;
}

.leaderboard-details summary::-webkit-details-marker {
  display: none;
}

.leaderboard-details summary::after {
  content: " ▾";
  color: var(--text-dim);
}

.leaderboard-details[open] summary::after {
  content: " ▴";
}

.leaderboard-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 220px;
  overflow-y: auto;
}

.leaderboard-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 0.72rem;
}

.leaderboard-rank {
  flex: 0 0 auto;
  width: 1.6em;
  text-align: center;
}

.leaderboard-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.leaderboard-score {
  flex: 0 0 auto;
  color: var(--neon-cyan);
  font-weight: 700;
}

.leaderboard-list li.leaderboard-empty {
  color: var(--text-dim);
  font-style: italic;
  justify-content: center;
}

@media (max-width: 700px) {
  .gz-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    padding: 0 1rem 3rem;
    gap: 1.25rem;
  }

  .gz-player-inner {
    max-height: none;
    border-radius: 0;
  }

  .gz-player {
    padding: 0;
  }
}
