/* ==========================================================
   AVI'S LAB — shared styles
   Each page sets a theme on <body>: theme-home, theme-book,
   theme-zombie, theme-shelf, theme-space, theme-games.
   Change the colours for a section by editing its block below.
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Creepster&family=Nunito:wght@400;700;900&family=Orbitron:wght@500;800&family=Press+Start+2P&display=swap');

*, *::before, *::after { box-sizing: border-box; }

:root {
  --body-font: 'Nunito', system-ui, sans-serif;
  --radius: 14px;
  --max: 1100px;
}

/* ---------- THEMES ---------- */
.theme-home {
  --bg: #0e1116; --bg2: #161b24; --fg: #e9f2ea; --muted: #9fb0a5;
  --accent: #7cff6b; --accent2: #ff5a4e; --card: #18202a; --card-fg: #e9f2ea;
  --border: #2a3644; --head-font: 'Bangers', cursive; --head-spacing: 1.5px;
}
.theme-book {
  --bg: #c8342b; --bg2: #a0241d; --fg: #fff8e7; --muted: #ffd9cc;
  --accent: #ffd23f; --accent2: #7bc950; --card: #fff8e7; --card-fg: #1b1b1b;
  --border: #1b1b1b; --head-font: 'Bangers', cursive; --head-spacing: 2px;
}
.theme-zombie {
  --bg: #121a10; --bg2: #1b2617; --fg: #e3f5d8; --muted: #a6c299;
  --accent: #9dff3a; --accent2: #ff4040; --card: #1f2b1a; --card-fg: #e3f5d8;
  --border: #3e5a30; --head-font: 'Creepster', cursive; --head-spacing: 2px;
}
.theme-shelf {
  --bg: #1d1029; --bg2: #2a173b; --fg: #f3e9ff; --muted: #c6b3dc;
  --accent: #8cf04a; --accent2: #ffb000; --card: #2e1a42; --card-fg: #f3e9ff;
  --border: #4d2f6b; --head-font: 'Creepster', cursive; --head-spacing: 2px;
}
.theme-space {
  --bg: #04050d; --bg2: #0a0d1f; --fg: #e6ecff; --muted: #9aa6cc;
  --accent: #5ee7ff; --accent2: #b98bff; --card: rgba(18, 24, 52, 0.75); --card-fg: #e6ecff;
  --border: #26305e; --head-font: 'Orbitron', sans-serif; --head-spacing: 1px;
}
.theme-games {
  --bg: #13151c; --bg2: #1b1e28; --fg: #f1f1f1; --muted: #a9adbb;
  --accent: #ffd500; --accent2: #3ddc84; --card: #20242f; --card-fg: #f1f1f1;
  --border: #000; --head-font: 'Press Start 2P', monospace; --head-spacing: 0;
}
.theme-lab {
  --bg: #0c1a1c; --bg2: #102326; --fg: #e8f6f2; --muted: #9dbdb5;
  --accent: #4ff0c0; --accent2: #ffb000; --card: #13292c; --card-fg: #e8f6f2;
  --border: #24464a; --head-font: 'Bangers', cursive; --head-spacing: 2px;
}

/* ---------- BASE ---------- */
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body-font);
  font-size: 17px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: var(--accent); }
h1, h2, h3 {
  font-family: var(--head-font);
  letter-spacing: var(--head-spacing);
  font-weight: normal;
  line-height: 1.15;
  margin: 0 0 .5em;
}
.theme-games h1 { font-size: clamp(1.3rem, 4vw, 2.2rem); line-height: 1.5; }
.theme-games h2 { font-size: clamp(1rem, 3vw, 1.4rem); line-height: 1.5; }
.theme-games h3 { font-size: .85rem; line-height: 1.6; }
.theme-space h1, .theme-space h2 { font-weight: 800; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
section { padding: 56px 0; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 680px; }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* ---------- HEADER / NAV ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg2);
  border-bottom: 3px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px;
}
.logo {
  font-family: 'Bangers', cursive; font-size: 1.8rem; letter-spacing: 2px;
  color: var(--fg); text-decoration: none; white-space: nowrap;
}
.logo span { color: var(--accent); }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav a {
  color: var(--fg); text-decoration: none; font-weight: 700;
  padding: 6px 12px; border-radius: 999px; font-size: .95rem;
}
.site-nav a:hover { background: rgba(255,255,255,.1); }
.site-nav a.active { background: var(--accent); color: #111; }

/* ---------- HERO ---------- */
.hero { padding: 72px 0 48px; }
.hero h1 { font-size: clamp(2.6rem, 8vw, 5rem); }
.theme-space .hero h1 { font-size: clamp(1.8rem, 6vw, 3.4rem); }

/* ---------- CARDS / GRID ---------- */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--card); color: var(--card-fg);
  border: 2px solid var(--border); border-radius: var(--radius);
  padding: 22px;
}
.card p:last-child { margin-bottom: 0; }
.tag {
  display: inline-block; font-size: .75rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: 1px; padding: 3px 10px; border-radius: 999px;
  background: var(--accent); color: #111; margin-bottom: 10px;
}
.btn {
  display: inline-block; font-weight: 900; text-decoration: none;
  padding: 12px 22px; border-radius: 999px; border: 3px solid var(--border);
  background: var(--accent); color: #111; cursor: pointer; font-size: 1rem;
  font-family: var(--body-font);
}
.btn:hover { transform: translateY(-2px); }
.btn.alt { background: transparent; color: var(--fg); border-color: var(--fg); }

/* ---------- HOME ---------- */
.theme-home .hero {
  background:
    radial-gradient(circle at 20% 10%, rgba(124,255,107,.15), transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(255,90,78,.15), transparent 40%);
}
.portal-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.portal {
  display: block; text-decoration: none; border-radius: var(--radius);
  padding: 26px 22px; min-height: 190px; border: 3px solid #000;
  transition: transform .15s;
}
.portal:hover { transform: translateY(-4px) rotate(-.5deg); }
.portal h3 { font-size: 1.7rem; margin-bottom: .3em; }
.portal p { margin: 0; }
.portal .emoji { font-size: 2.2rem; }
.p-book   { background: #c8342b; color: #fff8e7; }
.p-book h3 { font-family: 'Bangers', cursive; color: #ffd23f; letter-spacing: 2px; }
.p-zombie { background: #1b2617; color: #e3f5d8; border-color: #9dff3a; }
.p-zombie h3 { font-family: 'Creepster', cursive; color: #9dff3a; }
.p-shelf  { background: #2a173b; color: #f3e9ff; border-color: #8cf04a; }
.p-shelf h3 { font-family: 'Creepster', cursive; color: #8cf04a; }
.p-space  { background: radial-gradient(circle at 70% 30%, #1e2a6b, #04050d 70%); color: #e6ecff; border-color: #5ee7ff; }
.p-space h3 { font-family: 'Orbitron', sans-serif; color: #5ee7ff; font-size: 1.3rem; }
.p-games  { background: #20242f; color: #f1f1f1; border-color: #ffd500; box-shadow: 6px 6px 0 #ffd500; }
.p-games h3 { font-family: 'Press Start 2P', monospace; color: #ffd500; font-size: .95rem; line-height: 1.6; }

.about-box { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 760px) { .about-box { grid-template-columns: 260px 1fr; } }
.about-cover { transform: rotate(-3deg); border: 4px solid #000; border-radius: 6px; box-shadow: 8px 8px 0 rgba(0,0,0,.5); }

/* ---------- BOOK (comic) ---------- */
.theme-book {
  background-color: #c8342b;
  background-image: radial-gradient(rgba(0,0,0,.12) 1.5px, transparent 1.5px);
  background-size: 14px 14px;
}
.theme-book .hero h1 { color: #fff; text-shadow: 4px 4px 0 #1b1b1b; }
.theme-book .hero h1 .green { color: #7bc950; }
.theme-book .hero h1 .yellow { color: #ffd23f; }
.theme-book .card { border-width: 3px; box-shadow: 6px 6px 0 #1b1b1b; border-radius: 6px; }
.theme-book .card h3 { color: #c8342b; font-size: 1.6rem; }
.theme-book h2 { font-size: 2.6rem; color: #ffd23f; text-shadow: 3px 3px 0 #1b1b1b; }
.book-hero { display: grid; gap: 36px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 820px) { .book-hero { grid-template-columns: 380px 1fr; } }
.book-cover { border: 5px solid #1b1b1b; border-radius: 6px; box-shadow: 10px 10px 0 #1b1b1b; transform: rotate(-2deg); }
.blurb { background: #fff8e7; color: #1b1b1b; border: 3px solid #1b1b1b; box-shadow: 6px 6px 0 #1b1b1b; padding: 22px; border-radius: 6px; font-size: 1.1rem; }
.blurb p:last-child { margin-bottom: 0; }
.speech {
  position: relative; background: #fff; color: #1b1b1b; border: 3px solid #1b1b1b;
  border-radius: 24px; padding: 16px 20px; font-weight: 700; display: inline-block; margin-top: 8px;
}
.speech::after {
  content: ""; position: absolute; left: 30px; bottom: -18px;
  border: 9px solid transparent; border-top-color: #1b1b1b;
}
.diary {
  background: #fffdf3;
  background-image: repeating-linear-gradient(#fffdf3 0 31px, #b8d4f0 31px 32px);
  color: #222; border: 3px solid #1b1b1b; box-shadow: 8px 8px 0 #1b1b1b;
  border-radius: 4px; padding: 28px 28px 28px 64px; position: relative;
  line-height: 32px; font-size: 1.05rem;
}
.diary::before { content: ""; position: absolute; left: 44px; top: 0; bottom: 0; width: 2px; background: #f08080; }
.diary p { margin: 0 0 32px; }
.diary .date { font-weight: 900; color: #c8342b; }
.teaser { text-align: center; }
.teaser h2 { font-size: 3rem; }

/* ---------- ZOMBIE FIELD GUIDE ---------- */
.theme-zombie {
  background:
    radial-gradient(circle at 50% 0%, rgba(157,255,58,.12), transparent 50%),
    #121a10;
}
.theme-zombie h1 { color: var(--accent); text-shadow: 0 0 18px rgba(157,255,58,.5); }
.theme-zombie h2 { color: var(--accent); font-size: 2.4rem; }
.zcard { position: relative; overflow: hidden; }
.zcard h3 { font-size: 2rem; color: var(--accent); }
.zcard .file { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 2px; }
.stat { margin: 10px 0; }
.stat label { display: flex; justify-content: space-between; font-weight: 700; font-size: .9rem; }
.bar { height: 12px; background: #0b1009; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ffde3a, var(--accent2)); }
.zcard .survive { background: rgba(157,255,58,.1); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 6px; }
.stamp {
  position: absolute; top: 16px; right: -34px; transform: rotate(35deg);
  background: var(--accent2); color: #fff; font-weight: 900; font-size: .75rem;
  padding: 4px 40px; letter-spacing: 2px;
}
.tips { counter-reset: tip; list-style: none; padding: 0; display: grid; gap: 12px; }
.tips li { counter-increment: tip; background: var(--card); border: 2px solid var(--border); border-radius: 10px; padding: 14px 16px 14px 58px; position: relative; }
.tips li::before {
  content: counter(tip); position: absolute; left: 14px; top: 12px;
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #111;
  font-weight: 900; display: grid; place-items: center;
}

/* ---------- BOOKSHELF (spooky) ---------- */
.theme-shelf {
  background:
    radial-gradient(ellipse at top, rgba(140,240,74,.12), transparent 50%),
    #1d1029;
}
.theme-shelf h1 { color: var(--accent); text-shadow: 3px 3px 0 #000; }
.theme-shelf h2 { color: var(--accent2); font-size: 2.2rem; }
.slime {
  height: 34px; background: var(--accent);
  -webkit-mask: radial-gradient(circle at 10px 0, #000 18px, transparent 19px) 0 0/40px 34px repeat-x;
          mask: radial-gradient(circle at 10px 0, #000 18px, transparent 19px) 0 0/40px 34px repeat-x;
}
.shelf-card { display: grid; grid-template-columns: 90px 1fr; gap: 18px; align-items: start; }
.spine {
  height: 130px; border-radius: 4px 8px 8px 4px; border: 2px solid #000;
  display: grid; place-items: center; padding: 6px; text-align: center;
  font-family: 'Creepster', cursive; font-size: 1.05rem; line-height: 1.1;
  box-shadow: inset 8px 0 0 rgba(0,0,0,.25);
}
.spine.gb { background: #8cf04a; color: #2a0a3a; }
.spine.mc { background: #5d9c3a; color: #fff; font-family: 'Press Start 2P', monospace; font-size: .55rem; }
.spine.az { background: #ffb000; color: #1d1029; font-family: 'Nunito', sans-serif; font-weight: 900; }
.spine.me { background: #c8342b; color: #ffd23f; font-family: 'Bangers', cursive; font-size: 1.1rem; }
.stars { color: var(--accent2); letter-spacing: 2px; font-size: 1.1rem; }
.why { font-style: italic; color: var(--muted); }

/* ---------- SPACE / SCIENCE ---------- */
#starfield { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; }
.theme-space { background: #04050d; }
.theme-space .site-header { background: rgba(10,13,31,.85); backdrop-filter: blur(6px); }
.theme-space h1 { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.theme-space h2 { color: var(--accent); font-size: 1.7rem; }
.theme-space .card { backdrop-filter: blur(4px); }
.lab { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 860px) { .lab { grid-template-columns: 1.3fr 1fr; } }
.lab canvas { width: 100%; height: 360px; border-radius: var(--radius); border: 2px solid var(--border); background: #070a1a; touch-action: none; cursor: crosshair; }
.control { margin: 14px 0; }
.control label { display: flex; justify-content: space-between; font-weight: 700; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.readout { font-family: 'Orbitron', sans-serif; font-size: 1.5rem; color: var(--accent); }
.readout small { font-family: var(--body-font); font-size: .9rem; color: var(--muted); display: block; }
.coin-stage { display: grid; place-items: center; height: 200px; perspective: 600px; }
.coin {
  width: 130px; height: 130px; border-radius: 50%;
  display: grid; place-items: center; font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: 1.1rem;
  background: radial-gradient(circle at 35% 30%, #fff6, transparent 50%), linear-gradient(135deg, var(--accent), var(--accent2));
  color: #04050d; border: 4px solid #fff3;
  box-shadow: 0 0 30px rgba(94,231,255,.5);
}
.coin.super { animation: spin .5s linear infinite; filter: blur(1px); }
@keyframes spin { to { transform: rotateY(360deg); } }
.fact { border-left: 4px solid var(--accent2); }
.rocket-stage { width: 100%; height: 360px; display: block; border-radius: 10px; background: radial-gradient(circle at 50% 30%, #121a3d, #070a1a 70%); }
.pressure { height: 14px; border-radius: 7px; background: #070a1a; border: 1px solid var(--border); overflow: hidden; }
.pressure span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #ffd23f, #ff5a4e); transition: width .1s linear; }
#rocketStatus { font-weight: 400; color: var(--muted); text-align: right; }

/* ---------- GAMES (pixel) ---------- */
.theme-games {
  background-color: #13151c;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255,255,255,.03) 2px, transparent 2px);
  background-size: 32px 32px;
}
.theme-games .hero h1 { color: var(--accent); text-shadow: 4px 4px 0 #000; }
.theme-games h2 { color: var(--accent2); }
.theme-games .card { border: 4px solid #000; border-radius: 0; box-shadow: 6px 6px 0 #000; }
.theme-games .card h3 { color: var(--accent); }
.game-icon { width: 56px; height: 56px; image-rendering: pixelated; margin-bottom: 14px; border: 3px solid #000; }
.meter { display: flex; gap: 3px; margin: 6px 0 10px; }
.meter i { width: 14px; height: 14px; background: #333; border: 2px solid #000; }
.meter i.on { background: var(--accent2); }
.theme-games .lead { font-size: 1.05rem; }
.press-start { animation: blink 1.1s steps(1) infinite; font-family: 'Press Start 2P', monospace; font-size: .8rem; color: var(--fg); }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- LAB (real experiments: graph-paper notebook) ---------- */
.theme-lab {
  background-color: #0c1a1c;
  background-image:
    linear-gradient(rgba(79,240,192,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79,240,192,.06) 1px, transparent 1px);
  background-size: 24px 24px;
}
.theme-lab h1 { color: var(--accent); font-size: clamp(2.6rem, 8vw, 4.4rem); text-shadow: 3px 3px 0 #000; }
.theme-lab h3 { font-size: 1.6rem; }
.theme-lab .tag { background: var(--accent2); }
.theme-lab #tableGrad stop:first-child { stop-color: #6b4a2e; }
.theme-lab #tableGrad stop:last-child { stop-color: #3a2817; }
.theme-lab .rocket-stage { background: radial-gradient(circle at 50% 30%, #1d3a3f, #0a1416 75%); }

/* ---------- HUB PAGES + SUB-PAGES ---------- */
.hub-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.hub-card {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  text-decoration: none; background: var(--card); color: var(--card-fg);
  border: 2px solid var(--border); border-radius: var(--radius); padding: 24px 22px;
  transition: transform .15s, border-color .15s;
}
.hub-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.hub-card .emoji { font-size: 2.4rem; line-height: 1; }
.hub-card h3 { color: var(--accent); margin: 6px 0 0; }
.hub-card p { margin: 0; color: var(--muted); flex: 1; }
.hub-card .go { font-weight: 900; color: var(--accent); margin-top: 6px; }
.hub-card.real { border-color: #ffb000; }
.hub-card.real h3, .hub-card.real .go { color: #ffb000; }
.badge {
  position: absolute; top: -12px; right: 14px; background: #ffb000; color: #111;
  font-weight: 900; font-size: .75rem; text-transform: uppercase; letter-spacing: 1px;
  padding: 4px 10px; border-radius: 999px; transform: rotate(3deg);
}
.theme-space .hub-card { backdrop-filter: blur(4px); }
.theme-games .hub-card { border: 4px solid #000; border-radius: 0; box-shadow: 6px 6px 0 #000; }
.theme-games .hub-card:hover { border-color: #000; box-shadow: 6px 6px 0 var(--accent); }
.theme-games .hub-card h3 { font-size: .9rem; line-height: 1.6; }
.theme-games .hub-card .go { font-family: 'Press Start 2P', monospace; font-size: .75rem; color: var(--accent2); }
.sub-hero { padding: 36px 0 32px; }
.sub-hero h1 { font-size: clamp(1.8rem, 6vw, 3.2rem); }
.theme-lab .sub-hero h1 { font-size: clamp(2.4rem, 8vw, 4rem); }
.crumb { display: table; margin-bottom: 14px; font-weight: 700; text-decoration: none; }
.crumb:hover { text-decoration: underline; }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- FOOTER ---------- */
.site-footer { border-top: 3px solid var(--border); background: var(--bg2); padding: 26px 0; font-size: .95rem; color: var(--muted); text-align: center; }
.site-footer a { color: var(--accent); }

@media (max-width: 560px) {
  .logo { font-size: 1.5rem; }
  .site-nav a { padding: 5px 9px; font-size: .88rem; }
  section { padding: 40px 0; }
  .shelf-card { grid-template-columns: 70px 1fr; }
  .spine { height: 105px; }
  .diary { padding-left: 52px; }
  .diary::before { left: 34px; }
}

/* ---------- ARCADE ---------- */
.game-layout { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .game-layout { grid-template-columns: 1.5fr 1fr; } }
.game-card { padding: 12px; }
.game-card canvas { display: block; width: 100%; height: auto; background: #000; border: 3px solid #000; touch-action: none; image-rendering: auto; }
.game-msg { margin: 10px 4px 0; font-weight: 700; min-height: 1.6em; }
.game-stats { font-family: 'Press Start 2P', monospace; font-size: .7rem; color: var(--accent); line-height: 1.8; }
.touch-controls { display: flex; justify-content: center; gap: 10px; margin-top: 10px; }
.touch-controls .btn { min-width: 64px; user-select: none; -webkit-user-select: none; touch-action: none; }
.legend { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 4px; }
.legend span { display: inline-block; width: 30px; font-size: 1.2rem; }
details summary { cursor: pointer; font-weight: 700; color: var(--accent2); }
.theme-games .btn { border-radius: 0; border-color: #000; box-shadow: 3px 3px 0 #000; }
.theme-games .btn.alt { background: var(--card); color: var(--fg); border-color: var(--fg); }
.quiz-top { display: flex; justify-content: space-between; font-family: 'Press Start 2P', monospace; font-size: .7rem; color: var(--muted); }
.quiz-q { font-size: 1.35rem; font-weight: 700; margin: 18px 0; min-height: 3.2em; }
.quiz-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.quiz-buttons .btn[disabled] { opacity: .5; transform: none; cursor: default; }
.quiz-feedback { margin: 16px 0 0; min-height: 1.6em; }
.quiz-feedback .right { color: var(--accent2); font-weight: 900; }
.quiz-feedback .wrong { color: #ff5a4e; font-weight: 900; }

/* ---------- NAV DROP-DOWNS (Science, Arcade) ---------- */
.nav-drop { position: relative; display: flex; }
.nav-drop .caret { font-size: .7em; opacity: .8; }
.drop-menu {
  position: absolute; top: 100%; left: 0; z-index: 60; min-width: 230px;
  padding: 8px; margin-top: 6px; display: none; flex-direction: column; gap: 2px;
  background: var(--bg2); border: 2px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
}
.drop-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; } /* hover bridge */
.site-nav .drop-menu a { border-radius: 8px; white-space: nowrap; padding: 8px 12px; }
.site-nav .drop-menu a[aria-current="page"] { background: rgba(255,255,255,.12); }
.nav-drop:hover .drop-menu, .nav-drop:focus-within .drop-menu { display: flex; }
.theme-games .drop-menu { border-radius: 0; border: 3px solid #000; box-shadow: 4px 4px 0 #000; }
.theme-games .site-nav .drop-menu a { border-radius: 0; }
/* the last drop-down sits at the right edge: open it leftwards */
.nav-drop:last-child .drop-menu { left: auto; right: 0; }
/* touch screens have no hover: tapping the item just opens the menu page */
@media (hover: none) { .nav-drop .caret { display: none; } .nav-drop:hover .drop-menu { display: none; } }
.drop-head {
  font-size: .7rem; font-weight: 900; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); padding: 8px 12px 2px;
}
.theme-games .drop-head { font-family: var(--body-font); }
/* long menus (Science) flow into two columns on wide screens */
@media (min-width: 900px) {
  .drop-menu.drop-wide { display: none; min-width: 470px; }
  .nav-drop:hover .drop-menu.drop-wide, .nav-drop:focus-within .drop-menu.drop-wide {
    display: block; columns: 2; column-gap: 6px;
  }
  .drop-wide > * { display: block; break-inside: avoid; }
  .drop-wide .drop-head:not(:first-child) { break-before: column; }
}
.drop-menu.drop-wide { max-height: 80vh; overflow-y: auto; left: auto; right: 0; }

/* hub sections */
.hub-section + .hub-section { margin-top: 8px; }
.hub-intro { color: var(--muted); margin: -4px 0 18px; max-width: 680px; }
.hub-card.todo { border-style: dashed; }
.hub-card.todo .badge { background: var(--card); color: var(--fg); border: 2px dashed currentColor; }

/* ---------- SOUND ON/OFF BUTTON (added by js/sfx.js on game pages) ---------- */
.has-sfx { position: relative; }
.has-sfx .crumb { margin-bottom: 20px; }
.sfx-toggle {
  position: absolute; top: -6px; right: 16px;
  font: 900 .85rem var(--body-font); padding: 5px 12px; cursor: pointer;
  background: var(--accent); color: #111; border: 3px solid #000; border-radius: 0;
  box-shadow: 3px 3px 0 #000; white-space: nowrap;
}
.sfx-toggle span { font-size: 1.1rem; vertical-align: -2px; }
.sfx-toggle[aria-pressed="false"] { background: var(--card); color: var(--fg); }
.sfx-toggle:hover { transform: translateY(-2px); }
.sfx-toggle.floating { position: fixed; top: auto; bottom: 16px; right: 16px; z-index: 70; }
