:root {
  --bg: #12051f;
  --ink: #fff;
  --lime: #7CFC00;
  --pink: #ff2fd2;
  --gold: #ffd400;
  --broc: #4caf34;
  --broc-dark: #2f6b1f;
  --pixel: 'Press Start 2P', monospace;
  --comic: 'Comic Neue', 'Comic Sans MS', 'Comic Sans', cursive;
  /* per-game fonts (all accent-safe) */
  --f-isaac: 'Permanent Marker', 'Patrick Hand', cursive;
  --f-isaac-body: 'Patrick Hand', 'Comic Neue', cursive;
  --f-trajan: 'Cinzel', 'Times New Roman', serif;
  --f-hp: 'IM Fell English', Georgia, serif;
  --f-hp-sc: 'IM Fell English SC', Georgia, serif;
  --f-gungeon: 'Pixelify Sans', 'Press Start 2P', monospace;
  --f-lol: 'Marcellus SC', 'Cinzel', serif;
  --f-lider: 'Baloo 2', 'Arial Rounded MT Bold', sans-serif;
  --f-typewriter: 'Special Elite', 'Courier New', monospace;
  --f-retro: 'VT323', monospace;
  --f-xp: Tahoma, Verdana, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--comic); }

.btn {
  display: inline-block;
  font-family: var(--pixel);
  font-size: 12px;
  line-height: 1.4;
  color: #111;
  background: var(--gold);
  border: 4px solid #111;
  box-shadow: 4px 4px 0 #111;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #111; }
.btn.big { font-size: 15px; padding: 14px 20px; background: var(--lime); }
.btn:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
.pulse { animation: pulse 0.9s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.07); } }

/* achievement toasts (shared by both pages) */
.ach-toasts {
  position: fixed; right: 12px; bottom: 12px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
  max-width: calc(100vw - 24px);
}
.ach-toast {
  position: relative; overflow: hidden;
  display: flex; gap: 12px; align-items: center;
  width: 310px; max-width: 100%;
  background: linear-gradient(180deg, #2a3f5a 0%, #1b2838 55%, #16202d 100%);
  color: #fff; border: 1px solid #3d5a7a; border-top-color: #5c86b0;
  padding: 10px 14px 10px 10px; border-radius: 3px;
  box-shadow: 0 8px 24px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.08);
  font-family: 'Segoe UI', system-ui, sans-serif;
  animation: achIn .45s cubic-bezier(.2, 1.2, .4, 1);
  transition: transform .5s, opacity .5s;
}
.ach-toast::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.14) 50%, transparent 70%);
  transform: translateX(-120%); animation: achShine 1.2s .35s ease-out;
}
.ach-toast.out { transform: translateX(120%); opacity: 0; }
.ach-icon {
  flex: none; font-size: 30px; width: 52px; height: 52px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, #3b5878, #0e1621 75%);
  border: 1px solid #66c0f4; border-radius: 2px; box-shadow: 0 0 10px rgba(102,192,244,.45);
}
.ach-head { font-size: 11px; letter-spacing: .04em; color: #66c0f4; text-transform: uppercase; }
.ach-title { font-weight: 700; font-size: 14px; line-height: 1.25; }
.ach-desc { font-size: 12px; line-height: 1.3; color: #a9bccd; }
@keyframes achIn { from { transform: translateX(120%); opacity: 0; } }
@keyframes achShine { to { transform: translateX(120%); } }
@media (max-width: 640px) {
  .ach-toasts { top: 8px; bottom: auto; right: 8px; left: 8px; align-items: center; }
  .ach-toast { width: 100%; padding: 6px 10px; }
  .ach-icon { width: 38px; height: 38px; font-size: 24px; }
  .ach-toast.out { transform: translateY(-140%); }
  @keyframes achIn { from { transform: translateY(-140%); opacity: 0; } }
}

@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
}
