/* Same palette and card layout as the Drag Ball game (Tailwind zinc + emerald). */
:root {
  --zinc-200: #e4e4e7;
  --zinc-400: #a1a1aa;
  --zinc-700: #3f3f46;
  --zinc-800: #27272a;
  --zinc-900: #18181b;
  --zinc-950: #09090b;
  --emerald-300: #6ee7b7;
  --emerald-400: #34d399;
  --emerald-600: #059669;
  --emerald-700: #047857;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--zinc-950);
  color: #fff;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}
body { height: 100%; }
.wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
}
.game-card {
  width: 100%;
  max-width: 320px; /* Drag Ball card = play-area width */
  background: var(--zinc-900);
  border-radius: 1.5rem;
  padding-bottom: 0.75rem;
}
.game-head {
  position: relative;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--zinc-800);
  text-align: center;
}
/* DS logo left of the title, like the icons left of the game names; centred as a group. */
.title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
}
.head-logo {
  flex: none;
  width: 5.25rem;
  height: auto;
}
.game-title {
  margin: 0;
  text-align: left;
  font-size: 1.2rem;
  line-height: 1.5rem;
  font-weight: 800;
}
.game-sub {
  margin: 0.25rem 0 0;
  color: var(--zinc-400);
  font-size: 0.875rem;
  font-weight: 800;
}
.stats {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  background: var(--zinc-950);
}
.stat-label {
  font-size: 10px;
  color: var(--zinc-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.stat-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.25rem;
  color: var(--emerald-400);
}
.play-area {
  position: relative;
  width: 100%;
  margin: 0.5rem 0;
  padding: 1.25rem 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  border: 2px solid var(--zinc-700);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--zinc-950) url('./assets/play_area.svg') center / cover no-repeat;
}
.play-area::before,
.play-area::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.play-area::before { background: rgba(0, 0, 0, 0.6); }
.play-area::after {
  opacity: 0.05;
  background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
  background-size: 10px 10px;
}
.game-btn {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 0.875rem;
  border-radius: 0.75rem;
  background: var(--emerald-700); /* white text 5.48:1 (small description text needs AA) */
  border: 2px solid var(--emerald-600);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}
.game-btn:active { background: #065f46; transform: scale(0.98); }
.game-btn:focus-visible { outline: 3px solid var(--emerald-300); outline-offset: 3px; }
.icon { flex: none; width: 3rem; height: 3rem; }
.icon.bubbles { position: relative; }
.icon.bubbles i {
  position: absolute;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.95) 0 9%, rgba(255, 255, 255, 0) 24%),
    radial-gradient(circle, rgba(191, 233, 255, 0.15) 55%, rgba(191, 233, 255, 0.95) 90%, rgba(191, 233, 255, 0) 100%);
}
.icon.bubbles i:first-child { width: 2.25rem; height: 2.25rem; left: 0; top: 0.1rem; }
.icon.bubbles i:last-child { width: 1.4rem; height: 1.4rem; right: 0; bottom: 0.1rem; }
.txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.name { font-size: 1.25rem; font-weight: 800; text-transform: uppercase; line-height: 1.6rem; }
.desc { font-size: 0.85rem; line-height: 1.15rem; color: #fff; opacity: 0.95; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { font-size: 2rem; font-weight: 300; line-height: 1; }
.brand {
  margin: 0.5rem 0 0;
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--zinc-400);
}

.total-row {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: center;
}
.added {
  position: absolute;
  left: 100%;
  margin-left: 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fde047;
  white-space: nowrap;
  animation: added 2.6s ease-out forwards;
}
@keyframes added {
  0% { opacity: 0; transform: translateY(6px); }
  12% { opacity: 1; transform: translateY(0); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-6px); }
}
.brand a { color: var(--zinc-400); text-decoration: underline; }
.brand a:focus-visible { outline: 3px solid var(--emerald-300); outline-offset: 2px; }

/* ---------- Sport dropdown (applies to both games; saved in localStorage) ---------- */
.sport-picker { position: relative; z-index: 3; display: flex; align-items: center; gap: 0.6rem; }
.sport-cap { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--zinc-200); }
.sport-btn {
  flex: 1; display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.75rem; border-radius: 0.75rem;
  background: rgba(24, 24, 27, 0.92); color: #fff;
  border: 2px solid var(--emerald-600);
  font: inherit; font-size: 1rem; font-weight: 800; text-transform: uppercase; text-align: left; cursor: pointer;
}
.sport-btn:focus-visible { outline: 3px solid var(--emerald-300); outline-offset: 2px; }
.sport-btn[aria-expanded="true"] { border-color: var(--emerald-400); }
.sport-icon { width: 1.75rem; height: 1.75rem; flex: none; }
.sport-name { flex: 1; }
.caret {
  width: 0.55rem; height: 0.55rem; margin: 0 0.2rem 0.25rem 0;
  border-right: 2.5px solid var(--emerald-400); border-bottom: 2.5px solid var(--emerald-400);
  transform: rotate(45deg); transition: transform 0.15s;
}
.sport-btn[aria-expanded="true"] .caret { transform: translateY(0.3rem) rotate(-135deg); }
.sport-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 0.35rem);
  margin: 0; padding: 0.3rem; list-style: none;
  background: var(--zinc-900); border: 2px solid var(--emerald-600); border-radius: 0.75rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}
.sport-list:focus { outline: none; }
.sport-list li {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.6rem; border-radius: 0.5rem;
  color: var(--zinc-200); font-weight: 700; text-transform: uppercase; font-size: 0.9rem; cursor: pointer;
}
.sport-list li img { width: 1.6rem; height: 1.6rem; }
.sport-list li.active { background: var(--zinc-800); color: #fff; }
.sport-list li[aria-selected="true"] { color: var(--emerald-300); }
.sport-list li[aria-selected="true"]::after { content: "✓"; margin-left: auto; color: var(--emerald-400); }

/* Narrow phones (320-360 px): keep the short descriptions on one line. */
@media (max-width: 360px) {
  .game-btn { gap: 0.5rem; padding: 0.75rem 0.625rem; }
  .desc { font-size: 0.75rem; }
}
/* Title as two explicit lines so its box hugs the text and the logo+title group centres exactly. */
.game-title .tl { display: block; white-space: nowrap; }
