/* Neon Gridlock: the lot is a canvas filling the stage; the HUD, the tool bar, the coach line and the panels are HTML
   over it (game.js keeps the lot between them) */
.ng { display: flex; flex-direction: column; color: #dfe9ff; --ng-hud: 54px; --ng-bar: 64px; --ng-accent: #55d6ff; --ng-hot: #ff3b6b; }
.ng-stage { position: relative; width: 100%; height: min(84vh, 780px); min-height: 460px; background: #03050c; overflow: hidden;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: none; outline: none; }
@media (max-width: 600px) { .ng-stage { height: auto; aspect-ratio: 3 / 4.3; max-height: 86vh; min-height: 0; } }
#ng-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#ng-canvas:focus-visible { box-shadow: inset 0 0 0 2px rgba(85,214,255,.55); }

/* HUD: puzzle, moves against par, time, best, and the icons */
.ng-hud { position: absolute; left: 0; right: 0; top: 0; height: var(--ng-hud); display: flex; align-items: center; gap: 14px; padding: 0 8px 0 10px; z-index: 3; pointer-events: none; }
.ng-hud > * { pointer-events: auto; }
.ng-pz { flex: none; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; position: relative; min-width: 0; height: 44px; padding: 2px 26px 2px 10px; border-radius: 12px;
  border: 1px solid #1c2b4a; background: rgba(11,19,40,0.8); color: #fff; cursor: pointer; font: inherit; line-height: 1.05; touch-action: manipulation; text-align: left; transition: border-color .15s; }
.ng-pz-lv { font-size: 10px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--lvc, #8aa3c4); white-space: nowrap; }
.ng-pz-n { font-size: 18px; font-weight: 900; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ng-pz-dd { position: absolute; right: 6px; top: 50%; width: 16px; height: 16px; margin-top: -8px; fill: none; stroke: #8aa3c4; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .ng-pz:hover { border-color: var(--ng-accent); } }
.ng-pz:focus-visible { outline: 2px solid var(--ng-accent); outline-offset: 2px; }
.ng-stat { display: flex; flex-direction: column; line-height: 1.05; flex: none; }
.ng-tb { display: flex; gap: 14px; flex: none; }
.ng-k { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #8aa3c4; }
.ng-stat b { font-size: 21px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.ng-moves b { display: inline-block; transition: transform .16s cubic-bezier(.3,1.6,.5,1), color .16s; transform-origin: left center; }
.ng-moves b.pop { transform: scale(1.16); color: #b8f6ff; }
.ng-moves b.over #ng-mv { color: #ffb38a; }
.ng-moves small { font-size: 12.5px; font-weight: 700; color: #8aa3c4; margin-left: 4px; letter-spacing: 0; }
.ng-time b { font-size: 17px; margin-top: 3px; color: #dfe9ff; }
.ng-best b { font-size: 15px; margin-top: 4px; color: #ffd166; }
.ng-notimer .ng-time { display: none; }
.ng-sp { flex: 1 1 auto; }
.ng-tool { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; border: 1px solid #1c2b4a; background: rgba(11,19,40,0.8);
  color: #bfe0ff; cursor: pointer; touch-action: manipulation; padding: 0; transition: border-color .15s, color .15s, opacity .15s; }
.ng-tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ng-tool .spk { fill: currentColor; stroke: none; }
@media (hover: hover) { .ng-tool:hover:not(:disabled) { border-color: var(--ng-accent); color: #fff; } }
.ng-tool:focus-visible { outline: 2px solid var(--ng-accent); outline-offset: 2px; }
.ng-tool[aria-pressed="true"]#ng-daily { color: #04121a; background: var(--ng-accent); border-color: var(--ng-accent); }
#ng-sound .off { display: none; } #ng-sound[aria-pressed="true"] { color: #6f84a3; } #ng-sound[aria-pressed="true"] .on { display: none; } #ng-sound[aria-pressed="true"] .off { display: inline; }
.ng-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--ng-hot); box-shadow: 0 0 8px var(--ng-hot); }
.ng-dot[hidden] { display: none; }

/* the coach line: a lesson's tip, or a hint's reasoning */
.ng-coach[hidden] { display: none; }
.ng-coach { position: absolute; left: 50%; transform: translateX(-50%); top: calc(var(--ng-hud) + 4px); z-index: 3; width: min(calc(100% - 20px), 560px); padding: 8px 34px 8px 12px; border-radius: 12px;
  background: rgba(8,13,30,0.9); border: 1px solid rgba(85,214,255,0.45); box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 18px rgba(85,214,255,.12); font-size: 13.5px; line-height: 1.38; color: #dfe9ff;
  animation: ng-in .22s ease-out; pointer-events: auto; }
.ng-coach b { color: var(--ng-accent); font-weight: 800; margin-right: 6px; }
.ng-coach.hint { border-color: rgba(255,209,102,0.6); box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 18px rgba(255,209,102,.14); }
.ng-coach.hint b { color: #ffd166; }
.ng-coach small { display: block; color: #8aa3c4; font-size: 12px; margin-top: 2px; }
.ng-coach-close { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: #8aa3c4; font-size: 19px; line-height: 1; cursor: pointer; }
@media (hover: hover) { .ng-coach-close:hover { color: #fff; background: rgba(255,255,255,.08); } }

/* the tool bar */
.ng-bar { position: absolute; left: 50%; transform: translateX(-50%); bottom: 8px; height: calc(var(--ng-bar) - 12px); z-index: 3; display: flex; gap: 6px; padding: 0 6px; width: min(calc(100% - 12px), 560px); }
.ng-btn { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 14px; border: 1px solid #1c2b4a;
  background: rgba(11,19,40,0.86); color: #cfe3ff; font: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; cursor: pointer; touch-action: manipulation; padding: 0 2px;
  transition: border-color .15s, color .15s, opacity .15s, background .15s, transform .08s; }
.ng-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ng-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (hover: hover) { .ng-btn:hover:not(:disabled) { border-color: var(--ng-accent); color: #fff; } }
.ng-btn:active:not(:disabled) { transform: translateY(1px); }
.ng-btn:focus-visible { outline: 2px solid var(--ng-accent); outline-offset: 2px; }
.ng-btn:disabled { opacity: 0.36; cursor: default; }
.ng-hint { color: #ffe3a3; }
@media (hover: hover) { .ng-hint:hover:not(:disabled) { border-color: #ffd166; } }
.ng-hint.live { border-color: rgba(255,209,102,0.7); box-shadow: 0 0 16px rgba(255,209,102,.18); }
.ng-count { position: absolute; top: 4px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #ffd166; color: #1a1200; font-size: 11px; font-weight: 900; line-height: 17px; text-align: center; font-variant-numeric: tabular-nums; }
.ng-count.none { background: #24375e; color: #8aa3c4; }
.ng-next.ready { background: linear-gradient(135deg, #3dffb5, #55d6ff); color: #03141c; border-color: transparent; box-shadow: 0 6px 22px rgba(85,214,255,0.3); }

/* landscape phones and short stages: the tools stand in a column beside the lot */
.ng-side .ng-bar { left: auto; right: 8px; top: calc(var(--ng-hud) + 4px); bottom: 8px; transform: none; height: auto; width: 76px; flex-direction: column; padding: 0; }
.ng-side .ng-btn { font-size: 10.5px; }

/* panels */
.ng-overlay[hidden] { display: none; }
.ng-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; z-index: 6; overflow: auto;
  background: radial-gradient(ellipse at center, rgba(3,6,16,0.45), rgba(3,5,12,0.84)); animation: ng-fade .18s ease-out; }
.ng-panel { position: relative; width: min(100%, 420px); margin: auto; padding: 20px 18px 18px; border: 1px solid #1c2b4a; border-radius: 18px; text-align: left; outline: none;
  background: rgba(8,13,30,0.94); box-shadow: 0 20px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(85,214,255,0.06) inset; animation: ng-in .26s cubic-bezier(.2,.9,.25,1.1); }
.ng-panel.wide { width: min(100%, 520px); }
@keyframes ng-in { from { opacity: 0; transform: scale(.95) translateY(8px); } }
@keyframes ng-fade { from { opacity: 0; } }
.ng-panel h2 { margin: 0 36px 12px 0; font-size: 20px; font-weight: 900; color: #fff; letter-spacing: 0.01em; text-transform: none; line-height: 1.25; }
.ng-panel h3 { margin: 14px 0 8px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: #8aa3c4; }
.ng-panel p, .ng-panel li { font-size: 13.5px; line-height: 1.5; color: #b9c9e4; }
.ng-panel p { margin: 0 0 8px; }
.ng-panel ul { margin: 0 0 8px; padding-left: 18px; }
.ng-panel kbd { display: inline-block; min-width: 1.4em; padding: 0 5px; border-radius: 5px; border: 1px solid #2a3c62; background: #0b1328; color: #fff; font: 700 12px/1.6 system-ui, sans-serif; text-align: center; }
.ng-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 0; background: rgba(255,255,255,.07); color: #cfe0ff; cursor: pointer; padding: 0; }
.ng-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
@media (hover: hover) { .ng-x:hover { background: rgba(255,255,255,.14); color: #fff; } }
.ng-x:focus-visible { outline: 2px solid var(--ng-accent); outline-offset: 2px; }
.ng-fine { font-size: 12px !important; color: #6f84a3 !important; margin: 8px 0 0 !important; }
.ng-center { text-align: center; }

.ng-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.ng-row { display: flex; gap: 8px; } .ng-row > * { flex: 1 1 0; }
.ng-b { font: inherit; font-weight: 700; font-size: 14.5px; padding: 10px 14px; min-height: 46px; border-radius: 12px; cursor: pointer; touch-action: manipulation; text-decoration: none;
  border: 1px solid #1c2b4a; background: #0b1328; color: #dfe9ff; transition: background .15s, border-color .15s, transform .1s, filter .15s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
@media (hover: hover) { .ng-b:hover:not(:disabled) { border-color: var(--ng-accent); } }
.ng-b:active { transform: translateY(1px); }
.ng-b:disabled { opacity: .45; cursor: default; }
.ng-b:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ng-b svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ng-b-primary { background: linear-gradient(135deg, #3dffb5, #55d6ff); color: #03141c; border-color: transparent; font-size: 16px; font-weight: 800; box-shadow: 0 6px 24px rgba(85,214,255,0.3); }
@media (hover: hover) { .ng-b-primary:hover:not(:disabled) { border-color: transparent; filter: brightness(1.08); } }
.ng-b-hot { background: linear-gradient(135deg, #ff6b9a, #ff3b6b 55%, #ff7a3d); color: #1d0008; border-color: transparent; font-weight: 800; box-shadow: 0 6px 24px rgba(255,59,107,0.32); }

/* the puzzles panel: daily card, levels, the number to play */
.ng-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 14px; border: 1px solid #1c2b4a; background: #050a18; color: #dfe9ff; font: inherit; text-align: left; cursor: pointer; touch-action: manipulation; transition: border-color .15s; }
@media (hover: hover) { .ng-card:hover { border-color: var(--ng-accent); } }
.ng-card:focus-visible { outline: 2px solid var(--ng-accent); outline-offset: 2px; }
.ng-card-ic { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 11px; background: rgba(255,59,107,0.14); color: var(--ng-hot); box-shadow: inset 0 0 0 1px rgba(255,59,107,0.4); }
.ng-card-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ng-card-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ng-card-t b { font-size: 15px; color: #fff; }
.ng-card-t small { font-size: 12.5px; color: #8aa3c4; }
.ng-card-t > [data-rg-daily] { align-self: flex-start; color: #8aa3c4; }
.ng-card-s { font-size: 12px; font-weight: 800; color: #8aa3c4; white-space: nowrap; }
.ng-card-s.ok { color: #3dffb5; }
.ng-link { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 0; padding: 4px 2px; border: 0; background: none; color: var(--ng-accent); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.ng-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ng-levels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.ng-lv { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 9px 10px 8px; border-radius: 13px; border: 1px solid #1c2b4a; background: #050a18; color: #dfe9ff; font: inherit; text-align: left; cursor: pointer; touch-action: manipulation; transition: border-color .15s, box-shadow .15s; }
.ng-lv b { font-size: 15px; color: #fff; }
.ng-lv small { font-size: 12px; color: #8aa3c4; }
.ng-lv em { font-style: normal; font-size: 11.5px; font-weight: 700; color: #6f84a3; }
.ng-lv .pips { display: flex; gap: 3px; margin-bottom: 3px; } .ng-lv .pips i { width: 14px; height: 4px; border-radius: 2px; background: #1c2b4a; } .ng-lv .pips i.on { background: var(--lvc); box-shadow: 0 0 8px var(--lvc); }
.ng-lv[aria-checked="true"] { border-color: var(--lvc); box-shadow: inset 0 0 0 1px var(--lvc), 0 0 18px color-mix(in srgb, var(--lvc) 25%, transparent); }
.ng-lv:focus-visible { outline: 2px solid var(--ng-accent); outline-offset: 2px; }
.ng-pick { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.ng-pick label { font-size: 13px; font-weight: 700; color: #8aa3c4; white-space: nowrap; }
.ng-input { flex: 1 1 auto; min-width: 0; width: 100%; font: 700 15px/1.2 system-ui, sans-serif; padding: 10px 12px; border-radius: 10px; border: 1px solid #24375e; background: #050a18; color: #fff; font-variant-numeric: tabular-nums; }
.ng-input:focus { outline: 2px solid var(--ng-accent); outline-offset: 1px; }
.ng-step { width: 42px; height: 42px; flex: none; display: grid; place-items: center; padding: 0; border-radius: 10px; border: 1px solid #24375e; background: #0b1328; color: #dfe9ff; cursor: pointer; font: 800 18px system-ui; }
.ng-prog { margin: 10px 0 0; font-size: 12.5px; color: #8aa3c4; }
.ng-prog b { color: #fff; }

/* the escape panel */
.ng-res-badge { display: block; width: 74px; height: 74px; margin: 0 auto 6px; overflow: visible; filter: drop-shadow(0 0 7px rgba(255,59,107,.75)); }
.ng-res-badge .ring { fill: none; stroke: var(--ng-hot); stroke-width: 3; }
.ng-res-badge .car { fill: var(--ng-hot); }
.ng-res-badge .star { fill: #fff; }
.ng-panel .ng-big { margin: 0 0 2px; font-size: 30px; font-weight: 900; line-height: 1.05; text-align: center; color: #fff; letter-spacing: 0.02em; text-shadow: 0 0 22px rgba(255,59,107,0.55); }
.ng-panel .ng-sub { margin: 0 0 10px !important; text-align: center; color: #8aa3c4 !important; font-size: 13px !important; }
.ng-stars { display: flex; justify-content: center; gap: 6px; margin: 4px 0 8px; }
.ng-stars svg { width: 30px; height: 30px; }
.ng-stars .s-on { fill: #ffd166; filter: drop-shadow(0 0 8px rgba(255,209,102,.75)); }
.ng-stars .s-off { fill: #1c2b4a; }
.ng-tag { display: block; width: max-content; margin: 2px auto 8px; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase;
  color: #1a1200; background: linear-gradient(90deg, #ffd166, #fff1b8, #ffd166); background-size: 200% 100%; animation: ng-shine 1.6s linear infinite; box-shadow: 0 0 22px rgba(255,209,102,0.55); }
@keyframes ng-shine { to { background-position: -200% 0; } }
.ng-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0 4px; }
.ng-stats.three { grid-template-columns: repeat(3, 1fr); }
.ng-stats div { padding: 8px 4px; border-radius: 10px; background: #050a18; border: 1px solid #16223d; text-align: center; min-width: 0; }
.ng-stats span { display: block; font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: #6f84a3; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ng-stats b { display: block; margin-top: 2px; font-size: 17px; color: #dfe9ff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ng-stats .gold b { color: #ffd166; } .ng-stats .hot b { color: #ff8fab; } .ng-stats .ok b { color: #3dffb5; }
.ng-lb { margin-top: 10px; }
.ng-lb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.ng-lb li { display: grid; grid-template-columns: 26px 1fr auto auto; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 8px; background: #050a18; font-size: 13px; }
.ng-lb li span { color: #6f84a3; font-weight: 800; font-variant-numeric: tabular-nums; }
.ng-lb li b { color: #dfe9ff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.ng-lb li em { font-style: normal; color: #ffd166; font-weight: 800; font-variant-numeric: tabular-nums; }
.ng-lb li i { font-style: normal; color: #8aa3c4; font-variant-numeric: tabular-nums; font-size: 12px; }
.ng-lb li.me { background: rgba(85,214,255,0.12); box-shadow: inset 0 0 0 1px rgba(85,214,255,0.4); }
.ng-lb a { display: inline-block; margin-top: 6px; font-size: 12.5px; color: var(--ng-accent); }

/* calendar */
.ng-cal-head { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; }
.ng-cal-head b { flex: 1 1 auto; text-align: center; color: #fff; font-size: 15px; }
.ng-cal-head small { color: #8aa3c4; font-size: 12px; }
.ng-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.ng-cal-w { text-align: center; font-size: 10.5px; font-weight: 800; color: #6f84a3; padding: 2px 0; }
.ng-cal-d { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 9px; border: 1px solid #16223d; background: #050a18; color: #cfe3ff; font: 700 13px system-ui, sans-serif; cursor: pointer; padding: 0; }
.ng-cal-d.off { opacity: .28; cursor: default; }
.ng-cal-d.ok { background: rgba(61,255,181,0.13); border-color: rgba(61,255,181,0.55); color: #3dffb5; }
.ng-cal-d.prog { border-color: rgba(255,209,102,0.55); color: #ffd166; }
.ng-cal-d.today { box-shadow: 0 0 0 2px var(--ng-hot), 0 0 14px rgba(255,59,107,.45); }
.ng-cal-d i { position: absolute; bottom: 3px; left: 50%; width: 12px; height: 3px; margin-left: -6px; border-radius: 2px; background: var(--lvc); opacity: .85; }
.ng-cal-pad { aspect-ratio: 1; }
@media (hover: hover) { .ng-cal-d:not(.off):hover { border-color: var(--ng-accent); } }
.ng-cal-d:focus-visible { outline: 2px solid var(--ng-accent); outline-offset: 1px; }

/* settings */
.ng-set { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #16223d; cursor: pointer; }
.ng-set span { display: flex; flex-direction: column; gap: 2px; } .ng-set b { font-size: 14px; color: #fff; } .ng-set small { font-size: 12px; color: #8aa3c4; }
.ng-set input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ng-sw { position: relative; width: 46px; height: 27px; flex: none; border-radius: 14px; border: 1px solid #24375e; background: #0b1328; transition: background .15s, border-color .15s; }
.ng-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #6f84a3; transition: transform .15s, background .15s; }
.ng-set input:checked + .ng-sw { background: #0d3a4a; border-color: var(--ng-accent); }
.ng-set input:checked + .ng-sw::after { transform: translateX(19px); background: var(--ng-accent); box-shadow: 0 0 10px rgba(85,214,255,.6); }
.ng-set input:focus-visible + .ng-sw { outline: 2px solid var(--ng-accent); outline-offset: 2px; }
.ng-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 13px; background: #050a18; border: 1px solid #1c2b4a; margin: 0 0 12px; }
.ng-tab { font: inherit; font-size: 13.5px; font-weight: 700; color: #8aa3c4; background: transparent; border: 0; border-radius: 9px; min-height: 38px; cursor: pointer; }
.ng-tab[aria-selected="true"] { background: #13234a; color: #fff; box-shadow: inset 0 0 0 1px rgba(85,214,255,0.45), 0 0 16px rgba(85,214,255,0.18); }
.ng-tab:focus-visible { outline: 2px solid var(--ng-accent); outline-offset: 1px; }
.ng-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ng-table th, .ng-table td { padding: 6px 4px; text-align: right; border-bottom: 1px solid #16223d; font-variant-numeric: tabular-nums; }
.ng-table th:first-child, .ng-table td:first-child { text-align: left; }
.ng-table thead th { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #6f84a3; }
.ng-table tbody th { color: #fff; font-weight: 700; }
.ng-table td { color: #cfe3ff; }
.ng-howto { display: grid; grid-template-columns: 64px 1fr; gap: 10px 12px; align-items: center; margin: 4px 0 6px; }
.ng-howto svg { width: 64px; height: 44px; }

.ng-toast[hidden] { display: none; }
.ng-toast { position: absolute; left: 50%; bottom: calc(var(--ng-bar) + 10px); transform: translateX(-50%); z-index: 7; padding: 8px 14px; border-radius: 999px; background: #dfe9ff; color: #04060f; font-size: 13px; font-weight: 800; animation: ng-in .2s ease-out; pointer-events: none; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.ng-side .ng-toast { bottom: 14px; }
.ng-loading[hidden] { display: none; }
.ng-loading { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(3,5,12,0.55); color: #cfe3ff; font-size: 14px; pointer-events: none; }
.ng-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(85,214,255,.18); border-top-color: var(--ng-accent); animation: ng-rot .9s linear infinite; }
@keyframes ng-rot { to { transform: rotate(360deg); } }
.ng-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.ng-help { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px; }
.ng-help .hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .ng-help .hint-kb { display: none; } .ng-help .hint-touch { display: inline; } }
.stage .ng-help { padding: 10px 14px 12px; }

/* narrow phones */
@media (max-width: 460px) {
  .ng-hud { gap: 8px; padding-left: 8px; padding-right: 6px; }
  .ng-pz { padding-right: 22px; padding-left: 8px; }
  .ng-pz-n { font-size: 16px; }
  .ng-stat b { font-size: 19px; }
  .ng-moves small { font-size: 11.5px; margin-left: 2px; }
  /* time and best stack, each with its label beside it */
  .ng-tb { flex-direction: column; gap: 3px; }
  .ng-tb .ng-stat { flex-direction: row; align-items: baseline; gap: 5px; }
  .ng-tb .ng-k { font-size: 9px; letter-spacing: 0.1em; width: 30px; }
  .ng-time b, .ng-best b { font-size: 13.5px; margin-top: 0; }
  .ng-tool { width: 36px; height: 36px; border-radius: 11px; }
  .ng-btn { font-size: 10.5px; border-radius: 12px; }
  .ng-panel { padding: 18px 14px 14px; }
  .ng-stats b { font-size: 15px; }
}
@media (max-width: 400px) {
  #ng-sound { display: none; }   /* sound stays in Settings */
  .ng-pz-lv { letter-spacing: 0.08em; }
  .ng-tb .ng-k { display: none; }
  .ng-tb .ng-stat b::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 4px; vertical-align: -1px; background: currentColor; opacity: .8;
    -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
  .ng-time b { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='13' r='8' fill='none' stroke='black' stroke-width='2.6'/%3E%3Cpath d='M12 9v4.5l3 2M9 2.5h6' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
  .ng-best b { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6l2.8 6 6.5.7-4.9 4.4 1.4 6.4L12 16.9l-5.8 3.2 1.4-6.4-4.9-4.4 6.5-.7z'/%3E%3C/svg%3E"); }
}

/* full screen: the lot takes every pixel */
.stage.is-immersive .stage-body > .ng { min-height: 0; flex: 1 1 auto; }
.stage.is-immersive .ng-stage { flex: 1 1 auto; height: auto; aspect-ratio: auto; max-height: none; min-height: 0; }
.stage.is-immersive .ng-help { display: none; }
@media (prefers-reduced-motion: reduce) { .ng-panel, .ng-toast, .ng-coach, .ng-overlay { animation: none; } .ng-tag { animation: none; } .ng-moves b { transition: none; } }
.ng-row > .ng-wide { flex: 2.2 1 0; }
.ng-b span { white-space: nowrap; }
