/* gfx/menu.css — owned by the 'menu' piece. Case-select screen over the 3D sky of floating diorama worlds.
   Layout (wide): logo + gold title (top) · open stage band where the 3D worlds float · 4 badge tiles · dark info banner.
   gfx/menu.js solves the world positions from these rects, so the band between header and tiles must stay empty. */
/* Google Fonts (latin subset, variable weight) served from gfx/fonts, so the page needs no outside font server. */
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(fonts/fredoka.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 200 1000; font-display: swap;
  src: url(fonts/nunito.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Sky behind everything while the menu is up: shows until the 3D canvas paints (and forever if WebGL is missing). */
body:has(> #menu-view:not([hidden])), body:not([data-nn3d-ready]) {
  background: linear-gradient(180deg, #1f86ea 0%, #4fb2ff 38%, #bfe7ff 66%, #eaf7ff 78%, #cfe9f7 100%) fixed;
}

#menu-view {
  --nnm-css: 1;   /* read by gfx/menu.js: the layout below is live, so the worlds may be placed */
  --ink: #1d1d2b;
  --cream: #fff8e7;
  --gold: #ffc928;
  --disp: 'Fredoka', 'Arial Rounded MT Bold', 'Nunito', ui-rounded, system-ui, sans-serif;
  --body: 'Nunito', ui-rounded, system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--body);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── header: logotype + gold title ────────────────────────────────────────────────────────────── */
#menu-view .menu-header { background: none; color: var(--ink); padding: 12px 24px 0; }
#menu-view .menu-header .inner { max-width: 1232px; margin: 0 auto; display: flex; align-items: center; gap: 30px; }
#menu-view.nnm .menu-header .kicker { display: none; }
#menu-view .menu-teach {
  margin-left: auto; flex: none; align-self: flex-start; cursor: pointer;
  font-family: var(--disp); font-weight: 600; font-size: 16px; line-height: 1.2;
  color: var(--ink); background: var(--cream);
  border: 3px solid var(--ink); border-radius: 999px; padding: 9px 18px;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
#menu-view .menu-teach:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
#menu-view .menu-teach:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
@media (max-width: 900px) {
  #menu-view .menu-teach { align-self: center; margin-left: 0; font-size: 14px; padding: 12px 16px; min-height: 44px; }
}
#menu-view .menu-top-links { margin-left: auto; flex: none; align-self: flex-start; display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
#menu-view .menu-top-links .menu-teach { margin-left: 0; align-self: auto; text-decoration: none; display: inline-flex; align-items: center; }
@media (max-width: 900px) { #menu-view .menu-top-links { align-self: center; margin-left: 0; justify-content: center; } }

.nnm-logo {
  position: relative; flex: none; display: flex; align-items: baseline; gap: 12px;
  font-family: var(--disp); font-weight: 700; font-size: 60px; line-height: 1; letter-spacing: 0.005em;
  padding: 4px 6px 14px 50px; transform: rotate(-3deg); transform-origin: 30% 60%;
  animation: nnm-logo-in .9s cubic-bezier(.34, 1.56, .64, 1) backwards;
}
.nnm-leaf {
  position: absolute; left: 0; top: -4px; width: 56px; height: 56px; transform-origin: 20% 90%;
  filter: drop-shadow(0 4px 0 #1d1d2b); animation: nnm-leaf 3.2s ease-in-out infinite;
}
.nnm-word { position: relative; display: inline-block; isolation: isolate; white-space: nowrap; }
.nnm-word > span {
  position: relative; z-index: 1; display: inline-block;
  background: linear-gradient(180deg, var(--f1) 0%, var(--f2) 52%, var(--f3) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nnm-word::before {   /* thick ink outline + extruded drop */
  content: attr(data-text); position: absolute; left: 0; top: 0; z-index: 0; color: var(--ink);
  -webkit-text-stroke: 14px var(--ink); paint-order: stroke fill;
  text-shadow: 0 7px 0 var(--ink), 0 14px 20px rgba(20, 30, 80, .38);
}
.nnm-word::after {    /* glossy highlight band */
  content: attr(data-text); position: absolute; left: 0; top: 0; z-index: 2; color: transparent;
  background: linear-gradient(180deg, rgba(255,255,255,.8) 0%, rgba(255,255,255,0) 40%);
  -webkit-background-clip: text; background-clip: text; pointer-events: none;
}
.nnm-w1 { --f1: #e4ff9c; --f2: #66e04c; --f3: #1c9e3c; }
.nnm-w2 { --f1: #fff6b0; --f2: #ffc928; --f3: #ff8414; animation: nnm-bob 2.6s ease-in-out infinite; }

.nnm-head-text { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; padding-top: 4px; }
#menu-view .menu-header h1 {
  margin: 0; display: inline-block; font-family: var(--disp); font-weight: 700; font-size: 38px; line-height: 1.05;
  letter-spacing: 0.01em; transform: skewX(-9deg); transform-origin: left bottom; padding: 0 6px;
  background: linear-gradient(180deg, #fffbe0 0%, #ffe25a 34%, #ffb81f 66%, #ff8a12 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(2.5px 0 0 var(--ink)) drop-shadow(-2.5px 0 0 var(--ink)) drop-shadow(0 2.5px 0 var(--ink))
    drop-shadow(0 -2.5px 0 var(--ink)) drop-shadow(0 4px 0 var(--ink)) drop-shadow(0 8px 8px rgba(20, 30, 80, .35));
}
/* "How to play" card: the intro paragraph, large dark text on cream with a tab label */
.nnm-howto {
  position: relative; flex: 1 1 auto; min-width: 0; max-width: 700px; margin: 14px 0 0 auto;
  padding: 18px 22px 14px; border-radius: 22px; background: linear-gradient(180deg, #fffdf4 0%, #fff6dc 100%);
  border: 4px solid var(--ink); box-shadow: 0 6px 0 var(--ink), 0 16px 26px rgba(16, 28, 74, .3);
}
.nnm-howto-label {
  position: absolute; left: 18px; top: -17px; padding: 4px 14px 5px; border-radius: 999px;
  background: var(--ink); color: var(--gold); border: 3px solid var(--ink); box-shadow: 0 0 0 3px #fff;
  font-family: var(--disp); font-weight: 600; font-size: 15px; line-height: 1; letter-spacing: .1em; text-transform: uppercase;
}
#menu-view .menu-header p {
  margin: 0; max-width: none; font-size: 21px; font-weight: 800; line-height: 1.34; opacity: 1; color: var(--ink);
  background: none; border: 0; padding: 0; text-shadow: none;
}

/* ── main column: stage band (empty — the worlds live there) → tiles → banner ─────────────────── */
#menu-view .menu-main {
  flex: 1; width: 100%; max-width: 1232px; margin: 0 auto; padding: 0 16px 14px;
  display: flex; flex-direction: column; justify-content: flex-end; pointer-events: none;
}
#menu-view .menu-main > * { pointer-events: auto; }
#menu-view .menu-label { display: none; }
#menu-view .menu-foot { display: none; }

#menu-view .dossier-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; align-items: stretch; padding: 0 22px; }

/* biome colours: one per world */
#menu-view .dossier { --bio: #2f8cff; --bio2: #1a5fd0; --bioS: rgba(26, 95, 208, .45); }
#menu-view .dossier.nnm-k-prairie { --bio: #ffad2e; --bio2: #e0701a; --bioS: rgba(196, 102, 20, .5); }
#menu-view .dossier.nnm-k-greenway { --bio: #5ccb3a; --bio2: #26962e; --bioS: rgba(30, 128, 40, .5); }
#menu-view .dossier.nnm-k-shore { --bio: #25c4ee; --bio2: #0f84d0; --bioS: rgba(14, 110, 190, .5); }
#menu-view .dossier.nnm-k-forest { --bio: #8b74f0; --bio2: #5340c4; --bioS: rgba(70, 50, 170, .5); }

/* ── select tiles ─────────────────────────────────────────────────────────────────────────────── */
#menu-view .dossier {
  position: relative; display: flex; flex-direction: column; overflow: visible; min-width: 0;
  background: linear-gradient(180deg, #fffdf6 0%, var(--cream) 70%, #f6ead0 100%);
  border: 4px solid var(--ink); border-radius: 24px; color: var(--ink); text-decoration: none;
  box-shadow: 0 6px 0 var(--ink), 0 18px 26px var(--bioS);
  transition: transform .45s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s ease, filter .25s ease;
  filter: brightness(.9) saturate(.92);
  animation: nnm-tile-in .75s cubic-bezier(.34, 1.56, .64, 1) backwards; animation-delay: calc(.15s + var(--i, 0) * .09s);
}
#menu-view .dossier-photo { display: none; }
#menu-view .dossier-body { padding: 0 0 14px; display: flex; flex-direction: column; flex: 1; min-width: 0; }

/* coloured header band holding the medallion, case number and years */
#menu-view .dossier-top {
  position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: 5px;
  margin: 0; min-height: 66px; padding: 8px 12px 8px 112px; border-radius: 20px 20px 0 0; border-bottom: 4px solid var(--ink);
  background-color: var(--bio);
  background-image: linear-gradient(180deg, rgba(255,255,255,.34), rgba(255,255,255,0) 50%, rgba(0,0,0,.08)),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.16) 0 9px, rgba(255,255,255,0) 9px 18px);
  color: #fff; font-family: var(--disp); font-size: 13px; letter-spacing: 0.04em;
}
#menu-view .dossier-top .case-no {
  color: var(--ink); background: #fff; border: 3px solid var(--ink); border-radius: 999px;
  padding: 3px 11px 3px; font-weight: 700; font-size: 15px; line-height: 1; letter-spacing: 0.07em; box-shadow: 0 3px 0 var(--ink);
}
#menu-view .dossier-top > span:last-child {
  font-weight: 600; font-size: 13px; line-height: 1; background: rgba(29, 29, 43, .5); border-radius: 999px; padding: 4px 10px;
}

/* medallion badge */
.nnm-emblem { position: absolute; left: 4px; top: -34px; width: 104px; height: 104px; z-index: 2; pointer-events: none; }
.nnm-laurel { position: absolute; inset: -9px; width: calc(100% + 18px); height: calc(100% + 18px); filter: drop-shadow(0 3px 0 var(--ink)); }
.nnm-disc {
  position: absolute; inset: 9px; border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #ffffff 0%, var(--bio) 34%, var(--bio2) 100%);
  border: 5px solid #fff; box-shadow: 0 0 0 3.5px var(--ink), 0 5px 0 3.5px var(--ink), inset 0 -6px 10px rgba(0,0,0,.18);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.nnm-disc::after {  /* glossy highlight */
  content: ''; position: absolute; left: 12%; top: 6%; width: 76%; height: 40%; border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.65), rgba(255,255,255,0)); pointer-events: none;
}
.nnm-num {
  font-family: var(--disp); font-weight: 700; font-size: 44px; line-height: 1; color: #fff;
  text-shadow: 0 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink);
}
.nnm-has-portrait .nnm-num { display: none; }
.nnm-portrait {
  position: absolute; left: -3px; top: -18px; width: 110px; height: 110px; display: none;
  filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff)
    drop-shadow(2px 0 0 var(--ink)) drop-shadow(-2px 0 0 var(--ink)) drop-shadow(0 2.5px 0 var(--ink)) drop-shadow(0 -2px 0 var(--ink));
  transform-origin: 50% 90%;
  /* the head pops out over the top of the badge; the body is trimmed to the disc below its equator */
  -webkit-mask-image: radial-gradient(circle at 55px 70px, #000 37.5px, transparent 38.5px), linear-gradient(#000 0 70px, transparent 70px);
  mask-image: radial-gradient(circle at 55px 70px, #000 37.5px, transparent 38.5px), linear-gradient(#000 0 70px, transparent 70px);
}
.nnm-has-portrait .nnm-portrait { display: block; }
#menu-view .dossier.nnm-sel .nnm-portrait { animation: nnm-hop 1.2s cubic-bezier(.34, 1.56, .64, 1) infinite; }

#menu-view .dossier h2 { font-family: var(--disp); font-weight: 700; font-size: 26px; line-height: 1.02; margin: 14px 16px 0; letter-spacing: 0.005em; }
#menu-view .dossier .matchup { margin: 5px 16px 0; font-size: 14px; font-weight: 900; line-height: 1.22; color: var(--bio2); flex: 1; }
@supports (color: color-mix(in srgb, red 50%, blue)) {
  #menu-view .dossier .matchup { color: color-mix(in srgb, var(--bio2) 72%, #1d1d2b); }
}
/* details live in the banner on wide screens; tiles show them on phones */
#menu-view .dossier dl, #menu-view .dossier .hook { display: none; }
#menu-view .dossier dl {
  grid-template-columns: auto 1fr; gap: 6px 8px; align-items: start;
  margin: 10px 14px 4px; padding: 9px 10px; border: 0; border-radius: 14px; background: rgba(29, 29, 43, .06); font-size: 14px;
}
#menu-view .dossier dt {
  font-family: var(--disp); font-weight: 600; font-size: 11px; line-height: 1.25; letter-spacing: 0.07em; text-transform: uppercase;
  color: #fff; background: var(--ink); border-radius: 999px; padding: 2px 8px; margin-top: 1px; text-align: center; white-space: nowrap;
}
#menu-view .dossier dd { margin: 0; font-weight: 800; line-height: 1.27; color: var(--ink); }
#menu-view .dossier .hook { margin: 6px 16px 0; font-size: 15px; font-weight: 700; line-height: 1.4; color: #47425a; }

/* the whole card is the click target; the old inner "Open case file" pill is removed by gfx/menu.js */
#menu-view .dossier { cursor: pointer; -webkit-tap-highlight-color: transparent; }
#menu-view .dossier .open { display: none; }
#menu-view .dossier .matchup { margin-right: 52px; }
/* round play badge on the card's bottom-right corner: pops in on the selected / hovered / focused card */
.nnm-go {
  position: absolute; right: 12px; bottom: -16px; z-index: 2; width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; padding-left: 4px; box-sizing: border-box;
  background: linear-gradient(180deg, #ffe880 0%, var(--gold) 55%, #ffb21a 100%); color: var(--ink);
  border: 4px solid var(--ink); box-shadow: 0 4px 0 var(--ink), inset 0 2px 0 rgba(255,255,255,.75);
  font-size: 19px; line-height: 1; pointer-events: none;
  transform: scale(.55); opacity: 0; transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), opacity .15s;
}
#menu-view .dossier.nnm-sel .nnm-go, #menu-view .dossier:hover .nnm-go, #menu-view .dossier:focus-visible .nnm-go { transform: scale(1); opacity: 1; }

/* selected tile: scales up and lifts, gold ring, animated corner brackets; others dim */
#menu-view .dossier::after {
  content: ''; position: absolute; inset: -11px; border-radius: 32px; border: 6px solid var(--gold);
  box-shadow: 0 0 0 3px var(--ink), inset 0 0 0 3px var(--ink), 0 0 30px rgba(255, 214, 80, .85);
  opacity: 0; transform: scale(.92); transition: opacity .2s, transform .45s cubic-bezier(.34, 1.56, .64, 1); pointer-events: none;
}
.nnm-brackets { position: absolute; inset: -24px; pointer-events: none; opacity: 0; transition: opacity .2s; }
.nnm-brackets i {
  position: absolute; width: 30px; height: 30px; border: 7px solid #ffe14d; filter: drop-shadow(0 0 0 var(--ink));
  box-shadow: 0 0 0 0 transparent;
}
.nnm-brackets i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 12px 0 0 0; --dx: -1; --dy: -1; }
.nnm-brackets i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 12px 0 0; --dx: 1; --dy: -1; }
.nnm-brackets i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 12px; --dx: -1; --dy: 1; }
.nnm-brackets i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 12px 0; --dx: 1; --dy: 1; }
.nnm-brackets i { filter: drop-shadow(2px 0 0 var(--ink)) drop-shadow(-2px 0 0 var(--ink)) drop-shadow(0 2px 0 var(--ink)) drop-shadow(0 -2px 0 var(--ink)); }

#menu-view .dossier.nnm-sel, #menu-view .dossier:focus-visible {
  transform: translateY(-12px) scale(1.06); filter: none; z-index: 3;
  box-shadow: 0 10px 0 var(--ink), 0 28px 36px var(--bioS);
}
#menu-view .dossier.nnm-sel::after, #menu-view .dossier:focus-visible::after { opacity: 1; transform: scale(1); animation: nnm-ring 1.6s ease-in-out infinite; }
#menu-view .dossier.nnm-sel .nnm-brackets { opacity: 1; }
#menu-view .dossier.nnm-sel .nnm-brackets i { animation: nnm-bracket 1.1s ease-in-out infinite; }
#menu-view .dossier.nnm-sel .nnm-go { animation: nnm-pulse 1.1s ease-in-out infinite; }
#menu-view .dossier:focus-visible { outline: 4px dashed #fff; outline-offset: 16px; }
#menu-view .dossier:not(.nnm-sel):hover { transform: translateY(-5px); filter: none; }
#menu-view .dossier:active { transform: translateY(-3px) scale(.98); transition-duration: .08s; }

/* ── bottom banner: controls · selected case details · open prompt ────────────────────────────── */
.nnm-bar {
  --bc: #2f8cff;
  position: relative; margin: 30px 2px 0; min-height: 92px; display: flex; align-items: center; gap: 22px;
  padding: 10px 18px 10px 26px; color: #fff;
  isolation: isolate;
}
.nnm-bar::before {  /* slanted dark plate with a biome-coloured edge */
  content: ''; position: absolute; inset: 0; z-index: -1; transform: skewX(-12deg); border-radius: 18px;
  background: linear-gradient(180deg, #343451 0%, #23233a 55%, #1a1a2c 100%);
  border: 4px solid var(--ink); box-shadow: inset 0 3px 0 rgba(255,255,255,.12), inset 7px 0 0 var(--bc), 0 6px 0 var(--ink), 0 16px 26px rgba(16, 28, 74, .35);
}
.nnm-key {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(180deg, #fff, #dfe3ee); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 3px 0 #000;
  font-size: 12px; font-family: var(--disp); font-weight: 700; line-height: 1; flex: none;
}
.nnm-bar-l { display: flex; align-items: center; gap: 6px; flex: none; }
.nnm-bar-lt { margin-left: 6px; font-family: var(--disp); font-weight: 600; font-size: 16px; line-height: 1.05; color: var(--gold); text-transform: uppercase; letter-spacing: .06em; }
.nnm-bar-c { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; border-left: 3px solid rgba(255,255,255,.14); padding-left: 22px; }
.nnm-bar.nnm-swap .nnm-bar-c { animation: nnm-swap .45s cubic-bezier(.34, 1.56, .64, 1); }
.nnm-bar-name { font-family: var(--disp); font-weight: 700; font-size: 29px; line-height: 1.05; display: flex; align-items: center; gap: 10px; }
.nnm-bar-no {
  font-size: 15px; letter-spacing: .08em; color: var(--ink); background: var(--bc); border: 3px solid var(--ink); border-radius: 999px;
  padding: 3px 9px; line-height: 1; box-shadow: 0 0 0 2px rgba(255,255,255,.85);
}
.nnm-bar-rows { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 18px; font-weight: 800; line-height: 1.25; }
.nnm-bar-rows b { font-weight: 800; margin-right: 10px; }
.nnm-chip {
  font-family: var(--disp); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--gold); color: var(--ink); border-radius: 999px; padding: 3px 10px;
}
.nnm-bar-hook { font-size: 19px; font-weight: 700; line-height: 1.35; color: #fff; }
.nnm-info {
  position: relative; flex: none; width: 34px; height: 34px; border-radius: 50%; cursor: help;
  border: 3px solid #fff; background: #3a3a5a; color: #fff; font: 700 italic 18px/1 Georgia, serif; box-shadow: 0 0 0 3px var(--ink);
}
.nnm-tip {
  position: absolute; right: -6px; bottom: calc(100% + 14px); width: 340px; padding: 10px 12px; border-radius: 14px;
  background: #fff; color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink);
  font: 700 13px/1.4 var(--body); font-style: normal; text-align: left;
  opacity: 0; transform: translateY(8px) scale(.96); transform-origin: 90% 100%; pointer-events: none;
  transition: opacity .18s, transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.nnm-info:hover .nnm-tip, .nnm-info:focus-visible .nnm-tip { opacity: 1; transform: none; }

body.nnm-hot #menu-view { cursor: pointer; }

/* short wide screens: tighter */
@media (min-width: 641px) and (max-height: 720px) {
  .nnm-bar-hook { display: none; }
  .nnm-bar { min-height: 70px; margin-top: 24px; }
}

/* integrator: compact 4-up tiles for narrow-desktop / short screens (1024×700 class laptops) — the full-size
   tiles wrapped their CASE/year chips onto two lines and swallowed the floating worlds above them. */
@media (min-width: 1000px) and (max-width: 1180px), (min-width: 1000px) and (max-height: 760px) {
  #menu-view .dossier-grid { gap: 16px; padding: 0 10px; }
  .nnm-logo { font-size: 52px; }
  #menu-view .menu-header h1 { font-size: 32px; white-space: nowrap; }
  .nnm-emblem { zoom: .8; }
  #menu-view .dossier-top { padding-left: 88px; min-height: 54px; gap: 4px; }
  #menu-view .dossier-top .case-no, #menu-view .dossier-top > span:last-child { white-space: nowrap; }
  #menu-view .dossier-top .case-no { font-size: 13px; padding: 3px 9px; }
  #menu-view .dossier-top > span:last-child { font-size: 12px; }
  #menu-view .dossier h2 { font-size: 22px; margin-top: 10px; }
  #menu-view .dossier .matchup { font-size: 13px; }
  #menu-view .menu-header p { font-size: 19px; }
  .nnm-howto { padding: 16px 18px 12px; }
  #menu-view .dossier-body { padding-bottom: 11px; }
  .nnm-bar { margin-top: 18px; min-height: 74px; }
}

/* ── medium: 2 × 2 tiles (worlds ride the turntable carousel above) ───────────────────────────── */
@media (max-width: 999px) {
  #menu-view .menu-header .inner { gap: 20px; }
  .nnm-logo { font-size: 50px; }
  #menu-view .menu-header h1 { font-size: 30px; }
  #menu-view .dossier-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 46px 26px; margin-top: min(46vh, 330px); }
  .nnm-bar-l { display: none; }
  #menu-view .dossier.nnm-sel, #menu-view .dossier:focus-visible { transform: translateY(-10px) scale(1.03); }
  .nnm-brackets { inset: -20px; }
}
/* ── phone ────────────────────────────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #menu-view .menu-header { padding: 12px 16px 0; }
  #menu-view .menu-header .inner { flex-direction: column; align-items: center; gap: 10px; text-align: center; }
  .nnm-logo { font-size: clamp(32px, 11vw, 46px); padding: 4px 4px 10px 38px; gap: 8px; }
  .nnm-leaf { width: 40px; height: 40px; }
  .nnm-word::before { -webkit-text-stroke-width: 10px; text-shadow: 0 5px 0 var(--ink), 0 10px 14px rgba(20, 30, 80, .35); }
  .nnm-head-text { align-items: center; max-width: 100%; }
  #menu-view .menu-header h1 { font-size: clamp(22px, 7vw, 28px); transform-origin: center; margin-bottom: 6px; }
  #menu-view .menu-header p { font-size: 18px; max-width: none; }
  #menu-view .menu-main { padding: 0 16px 24px; }
  #menu-view .dossier-grid { grid-template-columns: 1fr; gap: 54px; margin-top: min(74vw, 290px); padding: 0; }
  #menu-view .dossier { filter: none; }
  #menu-view .dossier.nnm-sel, #menu-view .dossier:focus-visible { transform: translateY(-6px); }
  #menu-view .dossier::after { inset: -7px; border-width: 5px; border-radius: 29px; }
  .nnm-brackets { display: none; }
  #menu-view .dossier dl { display: grid; }
  #menu-view .dossier .hook { display: block; }
  #menu-view .dossier .matchup { flex: none; }
  #menu-view .dossier h2 { font-size: 27px; }
  .nnm-howto { margin: 18px 0 0; max-width: 100%; text-align: left; padding: 18px 16px 12px; }
  #menu-view .dossier .matchup { margin-right: 16px; }
  #menu-view .dossier .hook { font-size: 17px; margin-bottom: 18px; }
  .nnm-go { transform: scale(1); opacity: 1; right: 16px; }
  .nnm-bar { display: none; }
  #menu-view .menu-foot {
    display: block; margin: 26px 0 0; font-size: 12.5px; font-weight: 700; line-height: 1.4; color: var(--ink);
    background: rgba(255, 255, 255, .85); border: 3px solid var(--ink); border-radius: 14px; padding: 8px 12px;
  }
}

@keyframes nnm-logo-in { 0% { transform: rotate(-3deg) scale(.4); opacity: 0; } 60% { opacity: 1; } 100% { transform: rotate(-3deg) scale(1); opacity: 1; } }
@keyframes nnm-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(1.5deg); } }
@keyframes nnm-leaf { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(-3deg) translateY(-2px); } }
@keyframes nnm-tile-in { 0% { transform: translateY(70px) scale(.88); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes nnm-ring { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.012); } }
@keyframes nnm-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes nnm-bracket { 0%, 100% { translate: 0 0; } 50% { translate: calc(var(--dx) * 5px) calc(var(--dy) * 5px); } }
@keyframes nnm-hop { 0%, 55%, 100% { transform: translateY(0) scale(1, 1); } 12% { transform: translateY(0) scale(1.08, .9); } 28% { transform: translateY(-9px) scale(.95, 1.07); } 42% { transform: translateY(0) scale(1.05, .95); } }
@keyframes nnm-swap { 0% { transform: translateX(-14px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  #menu-view *, .nnm-logo, .nnm-leaf { animation: none !important; transition-duration: .01s !important; }
}
/* screenshot mode (?shot=1): skip entrance animations so captures are always the composed layout */
body.nnm-shot #menu-view .dossier, body.nnm-shot .nnm-logo, body.nnm-shot .nnm-bar-c { animation: none !important; }
