/* Futoshiki: a lantern-lit grid at night. The board is HTML (cells and the signs between them in one CSS grid that
   game.js sizes to the stage); the HUD, the tool bar, the number pad, the hint coach, the result card and the panels
   sit around it; one canvas behind everything draws the sky and the win's rising sparks. */
.fu { display: flex; flex-direction: column; color: #e3ebff; --fu-accent: #55d6ff; --fu-gold: #ffd166; --fu-amber: #ffb54d; --fu-rose: #ff7aa8; --fu-bad: #ff6b81; --fu-ok: #7dffcf;
  --fu-line: #1c2b4a; --fu-glass: rgba(9,14,34,0.86); --fu-cell: #0c1533; --fu-given: #15214a; --fu-cs: 56px; --fu-gs: 20px; }
.fu [hidden] { display: none !important; }
.fu-stage { position: relative; width: 100%; height: min(86vh, 800px); min-height: 500px; display: flex; flex-direction: column; overflow: hidden; outline: none;
  background: radial-gradient(120% 80% at 50% 0%, #121a44 0%, #070b1f 55%, #04060f 100%);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
@media (max-width: 600px) { .fu-stage { height: auto; aspect-ratio: 3 / 4.7; max-height: 88vh; min-height: 0; } }
.fu-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.fu button { font-family: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* HUD */
.fu-hud { position: relative; z-index: 3; flex: none; height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 8px 0 10px; }
.fu-pz { flex: 0 1 auto; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; position: relative; min-width: 96px; max-width: 52vw; height: 44px; padding: 2px 28px 2px 11px;
  border-radius: 12px; border: 1px solid var(--fu-line); background: var(--fu-glass); color: #fff; cursor: pointer; font: inherit; line-height: 1.05; text-align: left; transition: border-color .15s; }
.fu-pz-k { font-size: 10px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--lvc, #9fb0dc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fu-pz-n { font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fu-pz-dd { position: absolute; right: 7px; top: 50%; width: 16px; height: 16px; margin-top: -8px; fill: none; stroke: #9fb0dc; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .fu-pz:hover { border-color: var(--fu-accent); } }
.fu-pz:focus-visible, .fu-tool:focus-visible, .fu-btn:focus-visible, .fu-key:focus-visible { outline: 2px solid var(--fu-accent); outline-offset: 2px; }
.fu-stat { display: flex; flex-direction: column; line-height: 1.05; flex: none; }
.fu-k { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #8aa3c4; }
.fu-stat b { font-size: 20px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.fu-notimer .fu-time { visibility: hidden; }
.fu-sp { flex: 1 1 auto; }
.fu-tool { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; border: 1px solid var(--fu-line); background: var(--fu-glass); color: #c8d6f5; cursor: pointer; padding: 0; transition: border-color .15s, color .15s; }
.fu-tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fu-tool .spk { fill: currentColor; stroke: none; }
@media (hover: hover) { .fu-tool:hover { border-color: var(--fu-accent); color: #fff; } }
#fu-sound .off { display: none; } #fu-sound[aria-pressed="true"] { color: #6b7aa6; } #fu-sound[aria-pressed="true"] .on { display: none; } #fu-sound[aria-pressed="true"] .off { display: inline; }
.fu-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--fu-rose); box-shadow: 0 0 8px var(--fu-rose); }

/* the play area: the board, and the tools and pad below it (or beside it on a wide screen) */
.fu-main { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 0 8px 10px; gap: 8px; }
.fu-wide .fu-main { padding-top: 0 !important; padding-bottom: 14px !important; }
.fu-boardbox { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.fu-side { flex: none; display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 560px; margin: 0 auto; }
.fu-wide .fu-main { flex-direction: row; padding: 0 14px 14px 10px; gap: 18px; align-items: center; }
.fu-wide .fu-boardbox { height: 100%; }
.fu-wide .fu-side { width: var(--fu-sw, 300px); max-width: none; margin: 0; justify-content: center; gap: 12px; }

/* the board */
.fu-board { position: relative; display: grid; padding: var(--fu-bp, 14px); border-radius: calc(var(--fu-cs) * 0.32); outline: none; touch-action: none; cursor: pointer; flex: none;
  background: linear-gradient(180deg, rgba(20,30,72,0.72), rgba(8,12,32,0.86)); border: 1px solid var(--fu-line);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(85,214,255,0.04) inset, 0 0 44px rgba(255,181,77,0.06); transition: box-shadow .5s; }
.fu-board:focus-visible { border-color: rgba(85,214,255,0.42); }
.fu-c { position: relative; width: var(--fu-cs); height: var(--fu-cs); border-radius: calc(var(--fu-cs) * 0.2); display: grid; place-items: center; background: var(--fu-cell);
  box-shadow: inset 0 0 0 1px rgba(122,150,220,0.14), inset 0 -3px 8px rgba(0,0,0,0.25); color: var(--fu-accent); font-weight: 750; font-size: calc(var(--fu-cs) * 0.54); line-height: 1;
  font-variant-numeric: tabular-nums; transition: background-color .14s, box-shadow .14s, color .14s, transform .1s; }
.fu-c.given { background: var(--fu-given); color: #f4f7ff; font-weight: 900; box-shadow: inset 0 0 0 1px rgba(160,180,240,0.22), inset 0 2px 0 rgba(255,255,255,0.05), inset 0 -3px 8px rgba(0,0,0,0.3); }
.fu-c.peer { background: #142456; }
.fu-c.given.peer { background: #1d2f66; }
.fu-c.same { color: var(--fu-gold); box-shadow: inset 0 0 0 2px rgba(255,209,102,0.5), inset 0 -3px 8px rgba(0,0,0,0.25); }
.fu-c.given.same { color: #ffe7ad; }
.fu-c.sel { box-shadow: inset 0 0 0 2px var(--fu-accent), 0 0 18px rgba(85,214,255,0.35); background: #16295c; z-index: 1; }
.fu-c.sel.given { box-shadow: inset 0 0 0 2px #b8c7ef, 0 0 14px rgba(184,199,239,0.25); }
.fu-c.clash { color: var(--fu-bad); background: rgba(255,107,129,0.14); }
.fu-c.clash.given { color: #ffb3bf; }
.fu-c.hinted { color: #ffe3a3; }
.fu-c.look { box-shadow: inset 0 0 0 2px rgba(255,209,102,0.75), 0 0 14px rgba(255,209,102,0.25); }
.fu-c.unit:not(.look):not(.target) { background: #1a2550; }
.fu-c.target { box-shadow: inset 0 0 0 3px var(--fu-gold), 0 0 22px rgba(255,209,102,0.5); animation: fu-target 1.2s ease-in-out infinite; z-index: 1; }
.fu-c.wrongcell { box-shadow: inset 0 0 0 3px var(--fu-bad), 0 0 20px rgba(255,107,129,0.45); }
@keyframes fu-target { 50% { box-shadow: inset 0 0 0 3px var(--fu-gold), 0 0 34px rgba(255,209,102,0.75); } }
.fu-c.pop { animation: fu-pop .22s cubic-bezier(.3,1.7,.5,1); }
@keyframes fu-pop { 40% { transform: scale(1.12); } }
.fu-c.shake { animation: fu-shake .28s ease; }
@keyframes fu-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.fu-c.line { animation: fu-line .6s ease-out both; }
@keyframes fu-line { 30% { background: rgba(125,255,207,0.22); box-shadow: inset 0 0 0 1px rgba(125,255,207,0.6), 0 0 16px rgba(125,255,207,0.3); } }
.fu-v { pointer-events: none; }
/* pencil marks: a little grid in the cell, each digit in its own place */
.fu-n { position: absolute; inset: 7%; display: grid; grid-template-columns: repeat(var(--fu-nc, 3), 1fr); grid-template-rows: repeat(var(--fu-nr, 3), 1fr); pointer-events: none;
  font-size: max(9px, calc(var(--fu-cs) * var(--fu-nf, 0.22))); font-weight: 700; color: #9fb0dc; line-height: 1; }
.fu-n i { font-style: normal; display: grid; place-items: center; opacity: 0; transition: opacity .1s; }
.fu-n i.on { opacity: 1; }
.fu-n i.on.same { color: #1a1200; background: var(--fu-gold); border-radius: 4px; }
.fu-n i.on.out { color: #ff9aab; text-decoration: line-through; opacity: .7; }

/* the signs between cells: glowing chevrons that point at the smaller number */
.fu-s { display: grid; place-items: center; pointer-events: none; }
.fu-s { overflow: visible; z-index: 1; }
.fu-s svg { width: max(10px, calc(var(--fu-gs) * 0.84)); height: max(10px, calc(var(--fu-gs) * 0.84)); flex: none; fill: none; stroke: var(--fu-amber); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 3px rgba(255,181,77,0.65)); transition: stroke .2s, opacity .3s, filter .2s; }
.fu-s.gt svg { transform: rotate(180deg); } .fu-s.up svg { transform: rotate(90deg); } .fu-s.dn svg { transform: rotate(-90deg); }
.fu-s.ok svg { opacity: .42; filter: none; }
.fu-s.bad svg { stroke: var(--fu-bad); opacity: 1; filter: drop-shadow(0 0 5px rgba(255,107,129,0.9)); animation: fu-blink .9s ease-in-out 2; }
.fu-s.look svg { stroke: #fff6d8; opacity: 1; stroke-width: 3.8; filter: drop-shadow(0 0 4px #ffd166) drop-shadow(0 0 10px rgba(255,209,102,0.9)); animation: fu-signlook 1.2s ease-in-out infinite; }
.fu-s.gt.look svg { --fu-r: 180deg; } .fu-s.up.look svg { --fu-r: 90deg; } .fu-s.dn.look svg { --fu-r: -90deg; }
@keyframes fu-signlook { 50% { transform: rotate(var(--fu-r, 0deg)) scale(1.3); } }
@keyframes fu-blink { 50% { opacity: .35; } }

/* the win: a wave of light across the board */
.fu-board.won { box-shadow: 0 0 0 2px rgba(255,209,102,0.7), 0 0 60px rgba(255,209,102,0.3), 0 20px 60px rgba(0,0,0,0.5); }
.fu-c.win { animation: fu-win .7s cubic-bezier(.3,1.5,.5,1) both; animation-delay: var(--fu-d, 0s); }
@keyframes fu-win { 0% { transform: scale(1); } 45% { transform: scale(1.14); background: #ffd166; color: #2a1800; box-shadow: 0 0 26px rgba(255,209,102,0.9); } 100% { transform: scale(1); } }
.fu-board.won .fu-c { background: linear-gradient(180deg, #1c2656, #111939); color: #ffe3a3; box-shadow: inset 0 0 0 1px rgba(255,209,102,0.5), 0 0 16px rgba(255,209,102,0.14); text-shadow: 0 0 14px rgba(255,209,102,0.45); }
.fu-board.won .fu-s svg { stroke: var(--fu-gold); opacity: .8; }

/* the coach: a hint and why */
.fu-coach { position: relative; flex: none; width: min(100%, 560px); padding: 9px 36px 10px 12px; border-radius: 12px; background: rgba(9,13,34,0.94); border: 1px solid rgba(255,209,102,0.5);
  box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 18px rgba(255,209,102,.12); font-size: 13.5px; line-height: 1.42; color: #e3ebff; animation: fu-drop .22s ease-out; z-index: 2; }
.fu-coach.wrong { border-color: rgba(255,107,129,0.6); }
.fu-coach.tip { border-color: rgba(85,214,255,0.45); box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 18px rgba(85,214,255,.12); }
@keyframes fu-drop { from { opacity: 0; transform: translateY(-6px); } }
.fu-coach-t { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; color: var(--fu-gold); margin-bottom: 2px; }
.fu-coach.wrong .fu-coach-t { color: #ff9aab; } .fu-coach.tip .fu-coach-t { color: var(--fu-accent); }
.fu-coach-x { margin: 0; }
.fu-coach-a { display: flex; gap: 6px; margin-top: 8px; }
.fu-coach-a:empty { display: none; }
.fu-coach-close { position: absolute; top: 2px; right: 2px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: #8aa3c4; font-size: 19px; line-height: 1; cursor: pointer; }
@media (hover: hover) { .fu-coach-close:hover { color: #fff; background: rgba(255,255,255,.08); } }
.fu-wide .fu-coach, .fu-side .fu-coach { width: 100%; }
/* while a hint or tip shows on a phone, it stands where the tools were */
.fu-coaching:not(.fu-wide) .fu-bar, .fu-coaching.fu-short .fu-bar { display: none; }
.fu-coachhint:not(.fu-wide) .fu-pad { display: none; }

/* the tool bar */
.fu-bar { display: flex; gap: 6px; height: 52px; }
.fu-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: 13px; border: 1px solid var(--fu-line);
  background: var(--fu-glass); color: #d3def8; font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; cursor: pointer; padding: 0 2px; transition: border-color .15s, color .15s, opacity .15s, background .15s, transform .08s; }
.fu-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fu-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (hover: hover) { .fu-btn:hover:not(:disabled) { border-color: var(--fu-accent); color: #fff; } }
.fu-btn:active:not(:disabled) { transform: translateY(1px); }
.fu-btn:disabled { opacity: 0.36; cursor: default; }
.fu-hint { color: #ffe3a3; }
@media (hover: hover) { .fu-hint:hover:not(:disabled) { border-color: var(--fu-gold); } }
.fu-flag { position: absolute; top: -7px; right: 5px; font-size: 8.5px; font-weight: 900; line-height: 1.25; letter-spacing: .06em; padding: 1px 5px; border-radius: 6px; border: 1px solid #24365f; background: #111a3d; color: #8aa3c4; text-transform: uppercase; }
.fu-notes[aria-pressed="true"] { border-color: var(--fu-accent); color: #fff; background: rgba(85,214,255,0.14); box-shadow: 0 0 16px rgba(85,214,255,0.18); }
.fu-notes[aria-pressed="true"] .fu-flag { background: var(--fu-accent); border-color: var(--fu-accent); color: #04121c; box-shadow: 0 0 10px rgba(85,214,255,0.45); }
.fu-wide .fu-bar { display: grid; grid-template-columns: repeat(3, 1fr); height: auto; gap: 8px; }
.fu-wide .fu-btn { height: 58px; font-size: 12px; }

/* the number pad */
.fu-pad { display: flex; gap: 5px; height: 54px; }
.fu-key { position: relative; flex: 1 1 0; min-width: 0; max-width: 72px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 13px;
  border: 1px solid #24365f; background: linear-gradient(180deg, #14214a, #0c1433); color: #fff; font-size: 23px; font-weight: 800; font-variant-numeric: tabular-nums; cursor: pointer; padding: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 4px 12px rgba(0,0,0,0.25); transition: border-color .15s, background .15s, transform .08s, opacity .2s; }
.fu-key small { font-size: 9.5px; font-weight: 700; color: #6f82b0; margin-top: 1px; letter-spacing: .02em; }
@media (hover: hover) { .fu-key:hover:not(:disabled) { border-color: var(--fu-accent); } }
.fu-key:active:not(:disabled) { transform: translateY(1px) scale(.97); background: #1b2d63; }
.fu-key.done { opacity: .35; }
.fu-key.same { border-color: rgba(255,209,102,0.7); color: var(--fu-gold); }
.fu-notesmode .fu-key { color: var(--fu-accent); font-size: 17px; border-color: rgba(85,214,255,0.4); }
.fu-wide .fu-pad { display: grid; grid-template-columns: repeat(3, 1fr); height: auto; gap: 8px; }
.fu-wide .fu-key { max-width: none; height: 62px; font-size: 26px; margin: 0; }
.fu-wide.fu-notesmode .fu-key { font-size: 20px; }
.fu-wide .fu-side { max-height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding: 2px; }
/* a phone on its side: shorter keys so the tools and the pad fit beside the board */
.fu-short .fu-hud { height: 50px; }
.fu-short .fu-btn { height: 44px; font-size: 11px; gap: 1px; }
.fu-short .fu-btn svg { width: 18px; height: 18px; }
.fu-short .fu-key { height: 46px; font-size: 22px; }
.fu-short .fu-side { gap: 8px; }
.fu-short .fu-coach { font-size: 12.5px; padding: 7px 32px 8px 10px; }

/* the result card: over the bottom of the play area, so the lit board stays in view */
.fu-card { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 4; width: min(calc(100% - 16px), 470px); padding: 15px 15px 13px; border-radius: 18px;
  background: rgba(8,12,32,0.95); border: 1px solid rgba(255,209,102,0.4); box-shadow: 0 18px 50px rgba(0,0,0,.6), 0 0 40px rgba(255,209,102,.12); animation: fu-up .35s cubic-bezier(.2,.9,.25,1.1);
  max-height: calc(100% - 66px); overflow: auto; overscroll-behavior: contain; }
@keyframes fu-up { from { opacity: 0; transform: translate(-50%, 24px); } }
.fu-card h2 { margin: 0; font-size: 22px; font-weight: 900; color: #fff; letter-spacing: 0.01em; text-transform: none; line-height: 1.15; text-shadow: 0 0 22px rgba(255,209,102,.45); }
.fu-card p { margin: 3px 0 0; font-size: 13px; color: #9fb0dc; line-height: 1.45; }
.fu-card .fu-stats { margin-top: 10px; }
/* beside the board on a wide screen, over the tools it no longer needs */
.fu-wide .fu-card { left: auto; right: 14px; top: 50%; bottom: auto; transform: translateY(-50%); width: calc(var(--fu-sw, 300px) + 8px); max-height: calc(100% - 76px); animation-name: fu-upw; }
.fu-wide .fu-card .fu-stats { grid-template-columns: repeat(2, 1fr); }
.fu-card .fu-row { flex-wrap: wrap; gap: 6px; } .fu-card .fu-row > * { flex: 1 1 auto; }
.fu-card .fu-b-sm { min-height: 40px; padding: 6px 9px; gap: 6px; }
@keyframes fu-upw { from { opacity: 0; transform: translateY(calc(-50% + 24px)); } }

/* panels */
.fu-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(4,6,18,0.55), rgba(3,4,12,0.88)); animation: fu-fade .18s ease-out; }
.fu-panel { position: relative; width: min(100%, 440px); margin: auto; padding: 20px 18px 18px; border: 1px solid var(--fu-line); border-radius: 18px; text-align: left; outline: none;
  background: rgba(8,12,32,0.97); box-shadow: 0 20px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(85,214,255,0.05) inset; animation: fu-in .26s cubic-bezier(.2,.9,.25,1.1); }
.fu-panel.wide { width: min(100%, 560px); }
@keyframes fu-in { from { opacity: 0; transform: scale(.95) translateY(8px); } }
@keyframes fu-fade { from { opacity: 0; } }
.fu-panel h2 { margin: 0 44px 12px 0; font-size: 20px; font-weight: 900; color: #fff; text-transform: none; letter-spacing: 0.01em; line-height: 1.25; }
.fu-panel h3 { margin: 16px 0 8px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: #8aa3c4; }
.fu-panel p, .fu-panel li { font-size: 13.5px; line-height: 1.52; color: #bccae8; }
.fu-panel p { margin: 0 0 9px; }
.fu-panel ul { margin: 0 0 8px; padding-left: 18px; }
.fu-panel kbd { display: inline-block; min-width: 1.4em; padding: 0 5px; border-radius: 5px; border: 1px solid #2c3d70; background: #0b1230; color: #fff; font: 700 12px/1.6 system-ui, sans-serif; text-align: center; }
.fu-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 0; background: rgba(255,255,255,.07); color: #d3def8; cursor: pointer; padding: 0; z-index: 2; }
.fu-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
@media (hover: hover) { .fu-x:hover { background: rgba(255,255,255,.14); color: #fff; } }
.fu-x:focus-visible { outline: 2px solid var(--fu-accent); outline-offset: 2px; }
.fu-fine { font-size: 12px !important; color: #6f82b0 !important; margin: 8px 0 0 !important; }

.fu-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.fu-row { display: flex; gap: 8px; } .fu-row > * { flex: 1 1 0; }
.fu-b { font: inherit; font-weight: 700; font-size: 14.5px; padding: 10px 14px; min-height: 46px; border-radius: 12px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--fu-line); background: #0d1433; color: #e3ebff; transition: background .15s, border-color .15s, transform .1s, filter .15s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
@media (hover: hover) { .fu-b:hover:not(:disabled) { border-color: var(--fu-accent); } }
.fu-b:active { transform: translateY(1px); }
.fu-b:disabled { opacity: .45; cursor: default; }
.fu-b:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.fu-b svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fu-b span { white-space: nowrap; }
.fu-b-primary { background: var(--fu-gold); color: #1a1200; border-color: transparent; font-size: 16px; font-weight: 800; box-shadow: 0 6px 24px rgba(255,209,102,0.28); }
@media (hover: hover) { .fu-b-primary:hover:not(:disabled) { border-color: transparent; filter: brightness(1.06); } }
.fu-b-sm { min-height: 42px; padding: 6px 12px; font-size: 13px; }
.fu-coach .fu-b { min-height: 34px; padding: 5px 12px; font-size: 13px; }
.fu-coach .fu-b-primary { font-size: 13.5px; box-shadow: none; }

/* stats tiles */
.fu-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 4px; }
.fu-stats.three { grid-template-columns: repeat(3, 1fr); }
.fu-stats div { padding: 8px 4px; border-radius: 10px; background: #070b20; border: 1px solid #16204a; text-align: center; min-width: 0; }
.fu-stats span { display: block; font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: #6f82b0; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fu-stats b { display: block; margin-top: 2px; font-size: 17px; color: #e3ebff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fu-stats .gold b { color: var(--fu-gold); } .fu-stats .ok b { color: var(--fu-ok); } .fu-stats .hot b { color: #ffa6c4; }
.fu-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; vertical-align: middle; margin-left: 8px;
  color: #1a1200; background: linear-gradient(90deg, #ffd166, #fff1b8, #ffd166); background-size: 200% 100%; animation: fu-shine 1.6s linear infinite; box-shadow: 0 0 18px rgba(255,209,102,0.5); }
@keyframes fu-shine { to { background-position: -200% 0; } }

/* the new-puzzle panel: the daily, a size, a difficulty */
.fu-dcard { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 15px; border: 1px solid rgba(255,122,168,0.45); color: #e3ebff; font: inherit; text-align: left; cursor: pointer;
  background: radial-gradient(120% 140% at 100% 0%, rgba(255,122,168,0.2), transparent 60%), #070b20; transition: border-color .15s, transform .1s; }
.fu-dcard svg { width: 30px; height: 30px; flex: none; fill: none; stroke: var(--fu-rose); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(255,122,168,.6)); }
.fu-dcard span { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fu-dcard b { font-size: 15.5px; color: #fff; } .fu-dcard small { font-size: 12px; color: #9fb0dc; }
.fu-dcard em { font-style: normal; font-size: 12.5px; font-weight: 800; color: var(--fu-rose); white-space: nowrap; }
@media (hover: hover) { .fu-dcard:hover { border-color: var(--fu-rose); } }
.fu-dcard:focus-visible { outline: 2px solid var(--fu-rose); outline-offset: 2px; }
.fu-seg { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 13px; background: #070b20; border: 1px solid var(--fu-line); }
.fu-seg button { min-width: 0; min-height: 40px; padding: 0 2px; border: 0; border-radius: 9px; background: transparent; color: #8aa3c4; font: 800 14px system-ui, sans-serif; cursor: pointer; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fu-seg button[aria-pressed="true"] { background: #17255a; color: #fff; box-shadow: inset 0 0 0 1px rgba(85,214,255,.55), 0 0 14px rgba(85,214,255,.15); }
.fu-seg button:focus-visible { outline: 2px solid var(--fu-accent); outline-offset: 1px; }
.fu-list { display: flex; flex-direction: column; gap: 6px; }
.fu-li { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 13px; border: 1px solid #16204a; background: #070b20; color: #e3ebff; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s; }
.fu-li:disabled { opacity: .4; cursor: default; }
.fu-li[aria-pressed="true"] { border-color: var(--lc); box-shadow: inset 0 0 0 1px var(--lc); }
@media (hover: hover) { .fu-li:not(:disabled):hover { border-color: var(--lc, var(--fu-accent)); } }
.fu-li:focus-visible { outline: 2px solid var(--fu-accent); outline-offset: 2px; }
.fu-li-ic { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--lc, #55d6ff) 16%, transparent); color: var(--lc, #55d6ff); font-weight: 900; font-size: 13px; }
.fu-li-ic i { display: block; width: 5px; height: 14px; margin: 0 1px; border-radius: 2px; background: currentColor; opacity: .25; }
.fu-li-ic i.on { opacity: 1; }
.fu-li-ic span { display: flex; align-items: flex-end; }
.fu-li-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fu-li-t b { font-size: 14.5px; color: #fff; } .fu-li-t small { font-size: 12px; color: #8aa3c4; }
.fu-li-s { font-size: 12px; font-weight: 800; color: #6f82b0; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; } .fu-li-s.ok { color: var(--fu-gold); }

/* calendar */
.fu-cal-head { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; }
.fu-cal-head b { flex: 1 1 auto; text-align: center; color: #fff; font-size: 15px; }
.fu-step { width: 42px; height: 42px; flex: none; display: grid; place-items: center; padding: 0; border-radius: 10px; border: 1px solid #243566; background: #0d1433; color: #e3ebff; cursor: pointer; }
.fu-step svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fu-step:disabled { opacity: .35; cursor: default; }
.fu-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.fu-cal-w { text-align: center; font-size: 10.5px; font-weight: 800; color: #6f82b0; padding: 2px 0; }
.fu-cal-d { position: relative; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: 9px; border: 1px solid #16204a; background: #070b20; color: #d3def8;
  font: 700 13px system-ui, sans-serif; cursor: pointer; padding: 0; font-variant-numeric: tabular-nums; }
.fu-cal-d small { font-size: 8.5px; font-weight: 800; color: #6f82b0; letter-spacing: .02em; }
.fu-cal-d.off { opacity: .28; cursor: default; }
.fu-cal-d.ok { background: rgba(125,255,207,0.12); border-color: rgba(125,255,207,0.55); color: var(--fu-ok); }
.fu-cal-d.ok small { color: rgba(125,255,207,0.8); }
.fu-cal-d.part { border-color: rgba(255,209,102,0.5); }
.fu-cal-d.today { box-shadow: 0 0 0 2px var(--fu-rose), 0 0 14px rgba(255,122,168,.45); }
.fu-cal-pad { aspect-ratio: 1; }
@media (hover: hover) { .fu-cal-d:not(.off):hover { border-color: var(--fu-accent); } }
.fu-cal-d:focus-visible { outline: 2px solid var(--fu-accent); outline-offset: 1px; }
.fu-lb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.fu-lb li { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 8px; background: #070b20; font-size: 13px; }
.fu-lb li span { color: #6f82b0; font-weight: 800; font-variant-numeric: tabular-nums; }
.fu-lb li b { color: #e3ebff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.fu-lb li em { font-style: normal; color: var(--fu-gold); font-weight: 800; font-variant-numeric: tabular-nums; }
.fu-lb li.me { background: rgba(85,214,255,0.12); box-shadow: inset 0 0 0 1px rgba(85,214,255,0.4); }

/* settings, tabs, help, tables */
.fu-set { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #16204a; cursor: pointer; position: relative; }
.fu-set span { display: flex; flex-direction: column; gap: 2px; } .fu-set b { font-size: 14px; color: #fff; } .fu-set small { font-size: 12px; color: #8aa3c4; line-height: 1.4; }
.fu-set input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fu-sw { position: relative; width: 46px; height: 27px; flex: none; border-radius: 14px; border: 1px solid #243566; background: #0d1433; transition: background .15s, border-color .15s; }
.fu-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #6f82b0; transition: transform .15s, background .15s; }
.fu-set input:checked + .fu-sw { background: #102c45; border-color: var(--fu-accent); }
.fu-set input:checked + .fu-sw::after { transform: translateX(19px); background: var(--fu-accent); box-shadow: 0 0 10px rgba(85,214,255,.7); }
.fu-set input:focus-visible + .fu-sw { outline: 2px solid var(--fu-accent); outline-offset: 2px; }
.fu-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 13px; background: #070b20; border: 1px solid var(--fu-line); margin: 0 0 12px; }
.fu-tab { font: inherit; font-size: 13.5px; font-weight: 700; color: #8aa3c4; background: transparent; border: 0; border-radius: 9px; min-height: 40px; padding: 0 4px; white-space: nowrap; cursor: pointer; }
.fu-tab[aria-selected="true"] { background: #17255a; color: #fff; box-shadow: inset 0 0 0 1px rgba(85,214,255,0.5), 0 0 16px rgba(85,214,255,0.14); }
.fu-tab:focus-visible { outline: 2px solid var(--fu-accent); outline-offset: 1px; }
.fu-howto { display: grid; grid-template-columns: 70px 1fr; gap: 12px 14px; align-items: center; margin: 4px 0 8px; }
.fu-howto svg { width: 70px; height: 58px; }
.fu-howto p { margin: 0; }
.fu-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fu-table th, .fu-table td { padding: 7px 4px; text-align: right; border-bottom: 1px solid #16204a; font-variant-numeric: tabular-nums; }
.fu-table th:first-child, .fu-table td:first-child { text-align: left; }
.fu-table thead th { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #6f82b0; }
.fu-table tbody th { color: #fff; font-weight: 700; }
.fu-table td { color: #d3def8; } .fu-table td.none { color: #3d4c78; }
.fu-techs { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 8px; font-size: 13px; }
.fu-techs b { color: #fff; white-space: nowrap; } .fu-techs span { color: #bccae8; line-height: 1.45; }

.fu-toast { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); z-index: 7; padding: 8px 15px; border-radius: 999px; background: #e9efff; color: #07102a; font-size: 13px; font-weight: 800;
  animation: fu-tin .2s ease-out; pointer-events: none; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
@keyframes fu-tin { from { opacity: 0; transform: translate(-50%, -6px); } }
.fu-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,14,0.62); color: #d3def8; font-size: 14px; pointer-events: auto; }
.fu-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,209,102,.18); border-top-color: var(--fu-gold); animation: fu-rot .9s linear infinite; }
@keyframes fu-rot { to { transform: rotate(360deg); } }
.fu-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

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

/* narrow phones */
@media (max-width: 460px) {
  .fu-hud { gap: 10px; padding-left: 8px; padding-right: 6px; }
  .fu-pz { padding-right: 24px; padding-left: 9px; }
  .fu-pz-n { font-size: 16px; }
  .fu-stat b { font-size: 18px; }
  .fu-btn { font-size: 10.5px; border-radius: 12px; }
  .fu-btn svg { width: 19px; height: 19px; }
  .fu-panel { padding: 18px 14px 14px; }
  .fu-stats b { font-size: 15px; }
  .fu-seg.fu-seg5 { gap: 2px; padding: 3px; }
  .fu-seg.fu-seg5 button { font-size: 12px; padding: 0; }
  .fu-pad { gap: 4px; }
  .fu-key { font-size: 21px; border-radius: 11px; }
  .fu-coach { font-size: 13px; line-height: 1.38; padding: 8px 32px 9px 11px; }
  .fu-coach-t { font-size: 10px; margin-bottom: 1px; }
  .fu-coach-a { margin-top: 7px; }
  .fu-coach .fu-b { min-height: 32px; padding: 4px 11px; font-size: 12.5px; }
}
@media (max-width: 370px) { .fu-btn span { font-size: 9.5px; } .fu-hud { gap: 7px; } .fu-tab { font-size: 13px; } .fu-stats span { font-size: 9px; letter-spacing: .06em; } }

/* full screen: the stage takes every pixel */
.stage.is-immersive .stage-body > .fu { min-height: 0; flex: 1 1 auto; }
.stage.is-immersive .fu-stage { flex: 1 1 auto; height: auto; aspect-ratio: auto; max-height: none; min-height: 0; }
.stage.is-immersive .fu-help { display: none; }
@media (prefers-reduced-motion: reduce) {
  .fu-panel, .fu-toast, .fu-coach, .fu-overlay, .fu-card, .fu-c.pop, .fu-c.shake, .fu-c.line, .fu-c.target, .fu-tag, .fu-s.bad svg, .fu-s.look svg { animation: none; }
  .fu-c.win { animation: none; }
}
.fu-calm .fu-panel, .fu-calm .fu-toast, .fu-calm .fu-coach, .fu-calm .fu-overlay, .fu-calm .fu-card, .fu-calm .fu-c.pop, .fu-calm .fu-c.shake, .fu-calm .fu-c.line, .fu-calm .fu-c.target, .fu-calm .fu-tag, .fu-calm .fu-s.bad svg, .fu-calm .fu-s.look svg { animation: none; }
.fu-calm .fu-c.win { animation: none; }
.fu-calm .fu-c, .fu-calm .fu-s svg { transition: none; }

/* the new-puzzle panel stays compact on a phone */
.fu-p-hub .fu-li { padding: 8px 10px; }
.fu-p-hub .fu-li-ic { width: 30px; height: 30px; }
.fu-p-hub h3 { margin: 12px 0 7px; }
@media (max-width: 600px), (max-height: 720px) {
  .fu-p-hub { padding: 16px 12px 12px; }
  .fu-p-hub h2 { margin-bottom: 10px; font-size: 18px; }
  .fu-p-hub .fu-dcard { padding: 9px 10px; }
  .fu-p-hub .fu-dcard small { font-size: 11.5px; }
  .fu-p-hub .fu-li { padding: 6px 10px; gap: 10px; }
  .fu-p-hub .fu-li-t b { font-size: 14px; } .fu-p-hub .fu-li-t small { font-size: 11.5px; }
  .fu-p-hub h3 { margin: 10px 0 6px; }
  .fu-p-hub .fu-seg button { min-height: 36px; font-size: 13px; }
  .fu-p-hub .fu-fine { display: none; }
  .fu-panel { padding: 16px 13px 13px; }
}
