/* Nova & Blip: the canvas fills the stage; HUD, touch pad and menus are HTML over it */
.nvb { display: flex; flex-direction: column; color: #dfe9ff; --nova: #ffb057; --blip: #c9a4ff; }
.nb-stage { position: relative; width: 100%; height: min(78vh, 700px); min-height: 380px; background: #070b18; overflow: hidden;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
@media (max-width: 600px) { .nb-stage { height: min(80vh, 660px); min-height: 420px; } }
@media (max-height: 520px) and (orientation: landscape) { .nb-stage { height: min(86vh, 440px); min-height: 250px; } }
.stage.is-immersive .stage-body > .nvb { min-height: 0; flex: 1 1 auto; }
.stage.is-immersive .nb-stage { flex: 1 1 auto; height: auto; max-height: none; min-height: 0; }
.stage.is-immersive .nb-help { display: none; }
#nb-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.nb-stage.is-panel, .nb-stage.is-panel #nb-canvas { touch-action: pan-y; }
.nvb [hidden] { display: none !important; }
.nb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nvb :focus-visible { outline: 2px solid #55d6ff; outline-offset: 2px; }

/* HUD */
.nb-hud { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; padding: 8px 8px 0; z-index: 6; pointer-events: none; }
.nb-hud-l, .nb-hud-r { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.nb-hud-r { flex: none; flex-wrap: nowrap; }
.nb-hud button { pointer-events: auto; }
.nb-stat { padding: 0 9px; height: 30px; display: inline-flex; align-items: center; border-radius: 10px; background: rgba(6,10,24,0.66); border: 1px solid rgba(120,160,220,0.2);
  font-size: 14px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nb-starrow { color: #ffd166; letter-spacing: 1px; font-size: 16px; }
.nb-par { color: #9db4d6; font-weight: 600; }
.nb-par.is-late { text-decoration: line-through; opacity: 0.7; }
.nb-chip { display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 13px 0 10px; border-radius: 22px; border: 2px solid var(--nova); background: rgba(8,13,30,0.78);
  color: #fff; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; touch-action: manipulation; }
.nb-chip .nb-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--nova); box-shadow: 0 0 10px var(--nova); }
.nb-chip.is-blip { border-color: var(--blip); } .nb-chip.is-blip .nb-dot { background: var(--blip); box-shadow: 0 0 10px var(--blip); }
.nb-chip.is-duo { border-color: rgba(120,160,220,0.4); cursor: default; } .nb-chip.is-duo .nb-dot { background: linear-gradient(90deg, var(--nova) 50%, var(--blip) 50%); box-shadow: none; }
.nb-tool { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1px solid rgba(120,160,220,0.28); background: rgba(8,13,30,0.72);
  color: #cfe4ff; cursor: pointer; touch-action: manipulation; padding: 0; }
@media (hover: hover) { .nb-tool:hover { border-color: #55d6ff; color: #fff; } }
#nb-mute .nb-cross { display: none; }
#nb-mute[aria-pressed="true"] { color: #7f93b3; }
#nb-mute[aria-pressed="true"] .nb-wave { display: none; }
#nb-mute[aria-pressed="true"] .nb-cross { display: block; }

/* touch pad: only on touch screens, laid out again for a phone held sideways */
.nb-pad { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 10px 12px; pointer-events: none; }
.nb-pad-l, .nb-pad-r { pointer-events: auto; touch-action: none; display: grid; gap: 8px; }
.nb-pad-l { grid-template-columns: 72px 72px; padding: 14px 10px 0 0; }
.nb-pad-r { grid-template-columns: 62px 78px; grid-template-areas: "follow swap" "act jump"; align-items: end; justify-items: end; padding: 14px 0 0 10px; }
.nb-btn { display: grid; place-items: center; height: 64px; border-radius: 18px; border: 1.5px solid rgba(150,190,240,0.4); background: rgba(10,18,42,0.62); color: #e8f2ff;
  font: inherit; font-size: 13px; font-weight: 800; letter-spacing: 0.02em; padding: 0; touch-action: none; cursor: pointer; width: 100%; }
.nb-btn.is-down { background: rgba(85,214,255,0.34); border-color: #55d6ff; color: #fff; }
.nb-b-jump { grid-area: jump; height: 78px; border-radius: 50%; font-size: 15px; border-color: rgba(255,209,102,0.7); color: #ffe7b0; }
.nb-b-act { grid-area: act; height: 58px; }
.nb-b-swap { grid-area: swap; height: 48px; border-color: var(--blip); }
.nb-b-follow { grid-area: follow; height: 48px; }
.nb-b-follow[aria-pressed="true"] { background: rgba(125,240,192,0.3); border-color: #7df0c0; color: #fff; }
.nvb.is-duo .nb-b-swap, .nvb.is-duo .nb-b-follow { visibility: hidden; }
.nb-stage.is-short .nb-pad { padding: 0 8px 8px; }
.nb-stage.is-short .nb-pad-l { grid-template-columns: 64px 64px; }
.nb-stage.is-short .nb-btn { height: 56px; }
.nb-stage.is-short .nb-pad-r { grid-template-columns: 56px 68px; }
.nb-stage.is-short .nb-b-jump { height: 68px; } .nb-stage.is-short .nb-b-act { height: 52px; }
.nb-stage.is-short .nb-b-swap, .nb-stage.is-short .nb-b-follow { height: 44px; }

.nb-toast { position: absolute; left: 50%; top: 62px; transform: translateX(-50%); z-index: 7; max-width: 88%; padding: 8px 14px; border-radius: 14px; background: rgba(6,10,24,0.86);
  border: 1px solid rgba(120,160,220,0.3); font-size: 14px; font-weight: 600; text-align: center; pointer-events: none; animation: nb-in .25s ease-out; }
@keyframes nb-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* menus */
.nb-overlay { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: 10px; background: rgba(4,6,15,0.58); }
.nb-overlay[hidden] { display: none; }
.nb-overlay.is-clear { background: rgba(4,6,15,0.3); }
.nb-panel { width: min(100%, 560px); max-height: 100%; overflow: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 20px 20px 16px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(16,26,56,0.97), rgba(9,15,34,0.97)); border: 1px solid #24365f; box-shadow: 0 18px 50px rgba(0,0,0,0.55); text-align: center; animation: nb-pop .22s ease-out; }
.nb-panel.is-wide { width: min(100%, 720px); }
@keyframes nb-pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.nb-panel h2 { margin: 0 0 4px; font-size: 26px; line-height: 1.15; color: #fff; letter-spacing: -0.01em; }
.nb-panel h2 .nb-n { color: var(--nova); } .nb-panel h2 .nb-b { color: var(--blip); }
.nb-sub { margin: 0 0 14px; color: #a9bfdf; font-size: 15px; line-height: 1.45; }
.nb-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.nb-bt { min-height: 46px; padding: 0 16px; border-radius: 13px; border: 1px solid #2b4170; background: #121d3f; color: #e6f0ff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
@media (hover: hover) { .nb-bt:hover:not(:disabled) { border-color: #55d6ff; background: #17264d; } }
.nb-primary { display: block; width: 100%; min-height: 58px; border: 0; border-radius: 16px; background: linear-gradient(180deg, #ffe08a, #ffb347); color: #2a1700; font-size: 20px; font-weight: 800; }
@media (hover: hover) { .nb-primary:hover:not(:disabled) { background: linear-gradient(180deg, #ffeaa8, #ffb955); } }
.nb-seg { display: inline-flex; padding: 3px; border-radius: 14px; background: #0b1328; border: 1px solid #24365f; margin: 4px 0 12px; }
.nb-seg button { min-height: 42px; padding: 0 14px; border: 0; border-radius: 11px; background: transparent; color: #a9bfdf; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.nb-seg button[aria-pressed="true"] { background: #22386b; color: #fff; }
.nb-bigstars { font-size: 46px; line-height: 1; letter-spacing: 6px; color: #33456e; margin: 6px 0 8px; }
.nb-bigstars .is-on { color: #ffd166; text-shadow: 0 0 18px rgba(255,209,102,0.55); display: inline-block; animation: nb-star .45s cubic-bezier(.3,1.7,.5,1) both; }
.nb-bigstars .is-on:nth-child(2) { animation-delay: .15s; } .nb-bigstars .is-on:nth-child(3) { animation-delay: .3s; }
@keyframes nb-star { from { transform: scale(0.2) rotate(-40deg); opacity: 0; } }
.nb-facts { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.nb-fact { padding: 6px 12px; border-radius: 12px; background: #0b1328; border: 1px solid #1c2b4a; font-size: 14px; color: #a9bfdf; }
.nb-fact b { color: #fff; font-variant-numeric: tabular-nums; } .nb-fact.is-gold { border-color: #ffd166; color: #ffe7b0; }
.nb-worlds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 8px; }
.nb-world { min-width: 0; min-height: 46px; padding: 5px 6px; border-radius: 12px; border: 1px solid #24365f; background: #0d1731; color: #a9bfdf; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; line-height: 1.2; }
.nb-world small { display: block; font-weight: 600; font-size: 11px; color: #7f93b3; }
.nb-world[aria-pressed="true"] { background: #22386b; color: #fff; border-color: #55d6ff; }
.nb-world:disabled { opacity: 0.5; cursor: default; }
.nb-levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.nb-lv { min-height: 62px; padding: 6px 2px 4px; border-radius: 13px; border: 1px solid #2b4170; background: #121d3f; color: #fff; font: inherit; font-size: 18px; font-weight: 800; cursor: pointer; line-height: 1.1; position: relative; }
.nb-lv small { display: block; font-size: 12px; color: #33456e; letter-spacing: 1px; margin-top: 3px; } .nb-lv small b { color: #ffd166; font-weight: 400; }
.nb-lv.is-medal::after { content: ""; position: absolute; top: 5px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: #7df0c0; box-shadow: 0 0 8px #7df0c0; }
.nb-lv:disabled { opacity: 0.4; cursor: default; }
.nb-lv.is-next { border-color: #ffd166; }
@media (hover: hover) { .nb-lv:hover:not(:disabled), .nb-world:hover:not(:disabled) { border-color: #55d6ff; } }
.nb-how { text-align: left; margin: 0 0 6px; padding: 0 0 0 20px; color: #c6d6ee; font-size: 14.5px; line-height: 1.5; }
.nb-how li { margin: 0 0 6px; } .nb-how b { color: #fff; }
.nb-note { margin: 10px 0 0; font-size: 13px; color: #8aa3c4; line-height: 1.4; }
.nb-help { margin: 10px 4px 0; font-size: 13px; color: #8aa3c4; line-height: 1.7; text-align: center; }
.nb-help kbd { display: inline-block; min-width: 20px; padding: 0 5px; margin: 0 1px; border-radius: 5px; border: 1px solid #2b4170; background: #0b1328; color: #dfe9ff; font: inherit; font-size: 12px; text-align: center; }
.nb-hint-touch { display: none; }
.nvb.is-touch .nb-hint-touch { display: inline; } .nvb.is-touch .nb-hint-kb { display: none; }
@media (max-width: 600px) {
  .nb-help { display: none; } .nb-panel { padding: 16px 14px 12px; } .nb-panel h2 { font-size: 23px; } .nb-stat { font-size: 13px; padding: 0 7px; height: 28px; }
  .nb-chip { padding: 0 10px 0 8px; font-size: 14px; } .nb-hud { gap: 4px; padding: 6px 6px 0; } .nb-hud-l, .nb-hud-r { gap: 4px; } .nb-lv { min-height: 56px; }
}
@media (max-width: 380px) { .nb-par { display: none; } .nb-levels { gap: 6px; } .nb-bigstars { font-size: 40px; } }
@media (max-height: 520px) { .nb-panel { padding: 12px 14px 10px; } .nb-primary { min-height: 50px; } .nb-bigstars { font-size: 34px; margin: 2px 0 4px; } .nb-sub { margin-bottom: 8px; } .nb-panel h2 { font-size: 21px; } .nb-toast { top: 54px; } }
@media (prefers-reduced-motion: reduce) { .nb-panel, .nb-toast, .nb-bigstars .is-on { animation-duration: .01s; } }
.nb-toast b { display: block; color: #fff; font-weight: 800; } .nb-toast span { display: block; margin-top: 2px; color: #b9cdea; font-weight: 500; font-size: 13.5px; line-height: 1.35; }
.nb-tool.is-pulse { animation: nb-pulse 0.9s ease-in-out 4; }
@keyframes nb-pulse { 50% { border-color: #ffd166; color: #ffd166; box-shadow: 0 0 0 5px rgba(255,209,102,0.25); } }
.nb-hud-l { flex-wrap: nowrap; min-width: 0; } .nb-stat, .nb-chip { white-space: nowrap; flex: none; }
@media (max-width: 600px) { #nb-lvl, .nb-par { display: none; } .nb-tool { width: 42px; height: 42px; } }
/* narrow phones: the hero chip shrinks to its coloured dot so the clock never runs under the buttons (320 px and up) */
@media (max-width: 384px) { #nb-who-name { display: none; } .nb-chip { width: 44px; padding: 0; justify-content: center; } .nb-chip .nb-dot { width: 18px; height: 18px; } .nb-starrow { letter-spacing: 0; font-size: 14px; } }
@media (max-width: 340px) { .nb-tool, .nb-chip { width: 40px; height: 40px; } .nb-stat { padding: 0 4px; font-size: 12px; } .nb-starrow { font-size: 12px; } .nb-hud, .nb-hud-l, .nb-hud-r { gap: 3px; } }
/* very narrow phones (320-359 px): a slimmer touch pad so Swap and Jump stay inside the stage */
@media (max-width: 359px) {
  .nb-pad { padding: 0 6px 10px; } .nb-pad-l, .nb-pad-r { gap: 6px; }
  .nb-pad-l { grid-template-columns: 60px 60px; padding-right: 4px; } .nb-pad-r { grid-template-columns: 54px 66px; padding-left: 4px; }
  .nb-b-jump { height: 66px; }
}
