/* Akari: a night sky (one canvas, with its fireflies) behind the board (a second canvas: cells, walls, numbers, the
   bulbs and their light); the HUD, the tool bar, the coach line, the result card and the panels are HTML over them */
.ak { display: flex; flex-direction: column; color: #e4ebff; --ak-hud: 54px; --ak-bar: 64px; --ak-accent: #55d6ff; --ak-warm: #ffd166; --ak-amber: #ffb547; --ak-red: #ff5d73;
  --ak-line: #1c2b4a; --ak-glass: rgba(9,13,30,0.84); --ak-muted: #8aa3c4; }
.ak-stage { position: relative; width: 100%; height: min(86vh, 800px); min-height: 480px; background: #04060f; 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) { .ak-stage { height: auto; aspect-ratio: 3 / 4.5; max-height: 88vh; min-height: 0; } }
#ak-sky, #ak-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#ak-canvas { touch-action: none; outline: none; cursor: pointer; }
#ak-canvas:focus-visible { box-shadow: inset 0 0 0 2px rgba(85,214,255,.45); }

/* HUD */
.ak-hud { position: absolute; left: 0; right: 0; top: 0; height: var(--ak-hud); display: flex; align-items: center; gap: 14px; padding: 0 8px 0 10px; z-index: 3; pointer-events: none; }
.ak-hud > * { pointer-events: auto; }
.ak-pz { flex: 0 1 auto; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; position: relative; min-width: 96px; max-width: 46vw; height: 44px; padding: 2px 26px 2px 10px; border-radius: 12px;
  border: 1px solid var(--ak-line); background: var(--ak-glass); color: #fff; cursor: pointer; font: inherit; line-height: 1.05; touch-action: manipulation; text-align: left; transition: border-color .15s; }
.ak-pz-lv { font-size: 10px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--lvc, #ffcf7a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ak-pz-n { font-size: 18px; font-weight: 900; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ak-pz-dd { position: absolute; right: 6px; top: 50%; width: 16px; height: 16px; margin-top: -8px; fill: none; stroke: var(--ak-muted); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .ak-pz:hover { border-color: var(--ak-warm); } }
.ak-pz:focus-visible { outline: 2px solid var(--ak-accent); outline-offset: 2px; }
.ak-stat { display: flex; flex-direction: column; line-height: 1.05; flex: none; }
.ak-k { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ak-muted); }
.ak-stat b { font-size: 20px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.ak-stat small { font-size: 12px; font-weight: 700; color: var(--ak-muted); margin-left: 1px; }
.ak-lit b { display: inline-block; min-width: calc(3ch + 11px); transition: color .3s; }
.ak-tight .ak-lit { display: none; }
.ak-lit.full b { color: var(--ak-warm); text-shadow: 0 0 14px rgba(255,209,102,.6); }
.ak-notimer .ak-time { display: none; }
.ak-sp { display: none; }
#ak-daily { margin-left: auto; }
.ak-tool { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; border: 1px solid var(--ak-line); background: var(--ak-glass);
  color: #c9d6f5; cursor: pointer; touch-action: manipulation; padding: 0; transition: border-color .15s, color .15s; }
.ak-tool::after { content: ""; position: absolute; inset: -3px; }
.ak-tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ak-tool .spk, .ak-tool .fill { fill: currentColor; stroke: none; }
#ak-daily .fill { fill: var(--ak-warm); }
@media (hover: hover) { .ak-tool:hover { border-color: var(--ak-accent); color: #fff; } }
.ak-tool:focus-visible { outline: 2px solid var(--ak-accent); outline-offset: 2px; }
#ak-sound .off { display: none; } #ak-sound[aria-pressed="true"] { color: #5f6f94; } #ak-sound[aria-pressed="true"] .on { display: none; } #ak-sound[aria-pressed="true"] .off { display: inline; }
.ak-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--ak-warm); box-shadow: 0 0 8px var(--ak-warm); }
.ak-dot[hidden] { display: none; }

/* the coach line: a lesson, or a hint and its reason */
.ak-coach[hidden] { display: none; }
.ak-coach { position: absolute; left: 50%; transform: translateX(-50%); top: calc(var(--ak-hud) + 4px); z-index: 3; width: min(calc(100% - 20px), 560px); padding: 8px 34px 9px 12px; border-radius: 12px;
  background: rgba(8,11,28,0.93); border: 1px solid rgba(85,214,255,0.4); box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 18px rgba(85,214,255,.1); font-size: 13.5px; line-height: 1.4; color: #e4ebff;
  animation: ak-drop .22s ease-out; pointer-events: auto; }
@keyframes ak-drop { from { opacity: 0; transform: translate(-50%, -6px); } }
@keyframes ak-rise { from { opacity: 0; transform: translate(-50%, 6px); } }
.ak-coach b { color: #9fe6ff; font-weight: 800; margin-right: 6px; }
.ak-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); }
.ak-coach.hint b { color: var(--ak-warm); }
.ak-coach.warn { border-color: rgba(255,93,115,0.6); }
.ak-coach.warn b { color: #ff9aa8; }
.ak-coach small { display: block; color: var(--ak-muted); font-size: 12px; margin-top: 3px; }
.ak-coach-acts { display: flex; gap: 6px; margin-top: 7px; }
.ak-coach-acts:empty { display: none; }
.ak-coach-close { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--ak-muted); font-size: 19px; line-height: 1; cursor: pointer; }
@media (hover: hover) { .ak-coach-close:hover { color: #fff; background: rgba(255,255,255,.08); } }
.ak-cb { font: inherit; font-size: 12.5px; font-weight: 800; padding: 5px 12px; min-height: 32px; border-radius: 9px; border: 1px solid var(--ak-line); background: #0d1430; color: #e4ebff; cursor: pointer; touch-action: manipulation; }
.ak-cb.go { background: linear-gradient(135deg, #ffe08a, #ffb547); border-color: transparent; color: #2a1700; }
.ak-cb:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* the "whole board" button while zoomed in */
.ak-fit[hidden] { display: none; }
.ak-fit { position: absolute; z-index: 3; right: 10px; top: calc(var(--ak-hud) + 6px); width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border-radius: 50%;
  border: 1px solid var(--ak-line); background: var(--ak-glass); color: #e4ebff; cursor: pointer; touch-action: manipulation; }
.ak-fit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* the tool bar */
.ak-bar { position: absolute; left: 50%; transform: translateX(-50%); bottom: 8px; height: calc(var(--ak-bar) - 12px); z-index: 3; display: flex; gap: 6px; padding: 0 6px; width: min(calc(100% - 12px), 600px); }
.ak-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 var(--ak-line);
  background: rgba(9,13,30,0.88); color: #d2ddf7; 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; }
.ak-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ak-btn .fill { fill: currentColor; stroke: none; }
.ak-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (hover: hover) { .ak-btn:hover:not(:disabled) { border-color: var(--ak-accent); color: #fff; } }
.ak-btn:active:not(:disabled) { transform: translateY(1px); }
.ak-btn:focus-visible { outline: 2px solid var(--ak-accent); outline-offset: 2px; }
.ak-btn:disabled { opacity: 0.36; cursor: default; }
.ak-hint { color: #ffe3a3; }
@media (hover: hover) { .ak-hint:hover:not(:disabled) { border-color: var(--ak-warm); } }
.ak-dotmode[aria-pressed="true"] { background: #10264a; border-color: var(--ak-accent); color: #fff; box-shadow: inset 0 0 0 1px rgba(85,214,255,.35), 0 0 16px rgba(85,214,255,.18); }
.ak-next.ready { background: linear-gradient(135deg, #ffe08a, #ffb547); color: #2a1700; border-color: transparent; box-shadow: 0 6px 22px rgba(255,181,71,0.35); }
.ak-side .ak-bar { left: auto; right: 8px; top: calc(var(--ak-hud) + 4px); bottom: 8px; transform: none; height: auto; width: 76px; flex-direction: column; padding: 0; }
.ak-side .ak-btn { font-size: 10.5px; }
.ak-side .ak-coach { left: 10px; transform: none; width: min(36%, 290px); max-height: calc(100% - var(--ak-hud) - 14px); overflow-y: auto; overscroll-behavior: contain; animation-name: ak-drop-side; }
@keyframes ak-drop-side { from { opacity: 0; transform: translateY(-6px); } }
.ak-side .ak-card { left: calc((100% - 94px) / 2 + 5px); width: min(calc(100% - 110px), 460px); }
.ak-side .ak-fit { right: 98px; }

/* the result card: over the bottom of the board, so the lit board stays in view */
.ak-card[hidden] { display: none; }
.ak-card { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 4; width: min(calc(100% - 16px), 460px); padding: 14px 14px 12px; border-radius: 18px;
  background: rgba(9,12,28,0.94); border: 1px solid rgba(255,209,102,0.35); box-shadow: 0 18px 50px rgba(0,0,0,.6), 0 0 40px rgba(255,181,71,.12); animation: ak-up .35s cubic-bezier(.2,.9,.25,1.1);
  max-height: calc(100% - var(--ak-hud) - 20px); overflow: auto; overscroll-behavior: contain; }
@keyframes ak-up { from { opacity: 0; transform: translate(-50%, 24px); } }
.ak-card h2 { margin: 0; font-size: 22px; font-weight: 900; color: #fff; letter-spacing: 0.01em; text-transform: none; line-height: 1.1; text-shadow: 0 0 22px rgba(255,181,71,.6); }
.ak-card p { margin: 3px 0 0; font-size: 13px; color: var(--ak-muted); line-height: 1.45; }
.ak-card .ak-stats { margin-top: 10px; }
.ak-card .ak-actions { margin-top: 12px; }
.ak-card .ak-lb { margin-top: 8px; }

/* panels */
.ak-overlay[hidden] { display: none; }
.ak-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 8px; z-index: 6; overflow: auto;
  background: radial-gradient(ellipse at center, rgba(4,6,16,0.5), rgba(3,4,10,0.86)); animation: ak-fade .18s ease-out; }
.ak-panel { position: relative; width: min(100%, 440px); margin: auto; padding: 20px 18px 18px; border: 1px solid var(--ak-line); border-radius: 18px; text-align: left; outline: none;
  background: rgba(9,12,28,0.96); box-shadow: 0 20px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(85,214,255,0.05) inset; animation: ak-in .26s cubic-bezier(.2,.9,.25,1.1); }
.ak-panel.wide { width: min(100%, 580px); }
@keyframes ak-in { from { opacity: 0; transform: scale(.95) translateY(8px); } }
@keyframes ak-fade { from { opacity: 0; } }
.ak-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; }
.ak-panel h3 { margin: 16px 0 8px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ak-muted); }
.ak-panel p, .ak-panel li { font-size: 13.5px; line-height: 1.5; color: #bccaea; }
.ak-panel p { margin: 0 0 8px; }
.ak-panel ul { margin: 0 0 8px; padding-left: 18px; }
.ak-panel b { color: #fff; }
.ak-panel kbd { display: inline-block; min-width: 1.4em; padding: 0 5px; border-radius: 5px; border: 1px solid #2a3a66; background: #0a1028; color: #fff; font: 700 12px/1.6 system-ui, sans-serif; text-align: center; }
.ak-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: #d2ddf7; cursor: pointer; padding: 0; z-index: 2; }
.ak-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
@media (hover: hover) { .ak-x:hover { background: rgba(255,255,255,.14); color: #fff; } }
.ak-x:focus-visible { outline: 2px solid var(--ak-accent); outline-offset: 2px; }
.ak-fine { font-size: 12px !important; color: #6d80a8 !important; margin: 8px 0 0 !important; }

.ak-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.ak-row { display: flex; gap: 8px; } .ak-row > * { flex: 1 1 0; }
.ak-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 var(--ak-line); background: #0c1230; color: #e4ebff; transition: background .15s, border-color .15s, transform .1s, filter .15s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
@media (hover: hover) { .ak-b:hover:not(:disabled) { border-color: var(--ak-accent); } }
.ak-b:active { transform: translateY(1px); }
.ak-b:disabled { opacity: .45; cursor: default; }
.ak-b:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ak-b svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ak-b span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ak-b-primary { background: linear-gradient(135deg, #ffe08a, #ffb547); color: #2a1700; border-color: transparent; font-size: 16px; font-weight: 800; box-shadow: 0 6px 24px rgba(255,181,71,0.3); }
@media (hover: hover) { .ak-b-primary:hover:not(:disabled) { border-color: transparent; filter: brightness(1.06); } }
.ak-b-sm { min-height: 38px; padding: 6px 10px; font-size: 13px; }

.ak-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: 6px;
  color: #2a1700; background: linear-gradient(90deg, #ffd166, #fff1b8, #ffd166); background-size: 200% 100%; animation: ak-shine 1.6s linear infinite; box-shadow: 0 0 18px rgba(255,209,102,0.5); text-shadow: none; }
@keyframes ak-shine { to { background-position: -200% 0; } }
.ak-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 4px; }
.ak-stats.three { grid-template-columns: repeat(3, 1fr); }
.ak-stats div { padding: 8px 4px; border-radius: 10px; background: #070b1e; border: 1px solid #151f40; text-align: center; min-width: 0; }
.ak-stats span { display: block; font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: #6d80a8; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ak-stats b { display: block; margin-top: 2px; font-size: 17px; color: #e4ebff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ak-stats .gold b { color: var(--ak-warm); } .ak-stats .ok b { color: #7dffcf; } .ak-stats .cy b { color: #9fe6ff; }
.ak-lb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.ak-lb li { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 8px; background: #070b1e; font-size: 13px; }
.ak-lb li span { color: #6d80a8; font-weight: 800; font-variant-numeric: tabular-nums; }
.ak-lb li b { color: #e4ebff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.ak-lb li em { font-style: normal; color: var(--ak-warm); font-weight: 800; font-variant-numeric: tabular-nums; }
.ak-lb li.me { background: rgba(85,214,255,0.12); box-shadow: inset 0 0 0 1px rgba(85,214,255,0.4); }

/* the puzzle picker */
.ak-dayc { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 15px; border: 1px solid rgba(255,209,102,.35); color: #e4ebff; font: inherit; text-align: left; cursor: pointer; touch-action: manipulation;
  background: radial-gradient(120% 160% at 0% 0%, rgba(255,181,71,.2), transparent 60%), #070b1e; transition: border-color .15s, transform .1s; }
.ak-dayc svg { width: 34px; height: 34px; flex: none; }
.ak-dayc b { display: block; font-size: 15.5px; color: #fff; } .ak-dayc small { display: block; font-size: 12px; color: var(--ak-muted); line-height: 1.35; }
.ak-dayc em { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 800; color: var(--ak-warm); white-space: nowrap; }
@media (hover: hover) { .ak-dayc:hover { border-color: var(--ak-warm); } }
.ak-dayc:active { transform: translateY(1px); }
.ak-dayc:focus-visible { outline: 2px solid var(--ak-warm); outline-offset: 2px; }
.ak-seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #070b1e; border: 1px solid var(--ak-line); }
.ak-seg button { flex: 1 1 0; min-width: 0; min-height: 38px; border: 0; border-radius: 8px; background: transparent; color: var(--ak-muted); font: 700 13px system-ui, sans-serif; font-variant-numeric: tabular-nums; cursor: pointer; touch-action: manipulation; padding: 0 2px; }
.ak-seg button[aria-pressed="true"] { background: #17234a; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,209,102,.55), 0 0 14px rgba(255,209,102,.12); }
.ak-seg button:focus-visible { outline: 2px solid var(--ak-accent); outline-offset: 1px; }
.ak-levels { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ak-lvc { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 78px; padding: 10px 11px 9px; border-radius: 14px; border: 1px solid var(--ak-line); background: #070b1e;
  color: #e4ebff; font: inherit; text-align: left; cursor: pointer; touch-action: manipulation; transition: border-color .15s; }
.ak-lvc b { font-size: 14.5px; color: #fff; display: flex; align-items: center; gap: 6px; }
.ak-lvc b i { display: inline-flex; gap: 2px; }
.ak-lvc b i::before { content: ""; }
.ak-pip { width: 7px; height: 7px; border-radius: 50%; background: #23315e; display: inline-block; }
.ak-pip.on { background: var(--lc, #ffd166); box-shadow: 0 0 6px var(--lc, #ffd166); }
.ak-lvc small { font-size: 11.5px; color: var(--ak-muted); line-height: 1.3; }
.ak-lvc em { font-style: normal; font-size: 11px; font-weight: 800; color: #6d80a8; margin-top: auto; padding-top: 3px; font-variant-numeric: tabular-nums; }
.ak-lvc[aria-pressed="true"] { border-color: var(--lc); box-shadow: inset 0 0 0 1px var(--lc), 0 0 18px color-mix(in srgb, var(--lc) 20%, transparent); background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--lc) 16%, transparent), transparent 65%), #070b1e; }
@media (hover: hover) { .ak-lvc:hover { border-color: var(--lc); } }
.ak-lvc:focus-visible { outline: 2px solid var(--lc); outline-offset: 2px; }
.ak-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 5px; }
.ak-gc { position: relative; height: 44px; border-radius: 10px; border: 1px solid #151f40; background: #070b1e; color: #c9d6f5; font: 800 13.5px system-ui, sans-serif; font-variant-numeric: tabular-nums; cursor: pointer; padding: 0; touch-action: manipulation; }
.ak-gc.done { border-color: rgba(255,209,102,.5); color: #fff; background: radial-gradient(circle at 50% 40%, rgba(255,181,71,.25), transparent 70%), #0a0f24; }
.ak-gc.done::after { content: ""; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--ak-warm); box-shadow: 0 0 6px var(--ak-warm); }
.ak-gc.wip { border-color: rgba(85,214,255,.45); }
.ak-gc.cur { box-shadow: 0 0 0 2px var(--ak-accent); }
.ak-gc:focus-visible { outline: 2px solid var(--ak-accent); outline-offset: 2px; }
/* on a desktop the picker fits the stage without scrolling */
@media (min-width: 601px) {
  .ak-p-hub { padding-top: 16px; }
  .ak-p-hub h2 { margin-bottom: 10px; }
  .ak-p-hub h3 { margin: 11px 0 6px; }
  .ak-p-hub .ak-lvc { min-height: 0; padding: 8px 11px; }
  .ak-p-hub .ak-lvc em { padding-top: 2px; }
  .ak-p-hub .ak-gc { height: 40px; }
  .ak-p-hub .ak-actions { margin-top: 12px; }
}
@media (hover: hover) { .ak-gc:hover { border-color: var(--ak-accent); } }

/* calendar */
.ak-cal-head { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; }
.ak-cal-head b { flex: 1 1 auto; text-align: center; color: #fff; font-size: 15px; }
.ak-step { width: 42px; height: 42px; flex: none; display: grid; place-items: center; padding: 0; border-radius: 10px; border: 1px solid #22305a; background: #0c1230; color: #e4ebff; cursor: pointer; }
.ak-step svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ak-step:disabled { opacity: .35; cursor: default; }
.ak-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.ak-cal-w { text-align: center; font-size: 10.5px; font-weight: 800; color: #6d80a8; padding: 2px 0; }
.ak-cal-d { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 9px; border: 1px solid #151f40; background: #070b1e; color: #d2ddf7; font: 700 13px system-ui, sans-serif; cursor: pointer; padding: 0; }
.ak-cal-d.off { opacity: .28; cursor: default; }
.ak-cal-d.ok { background: radial-gradient(circle at 50% 45%, rgba(255,181,71,.32), rgba(255,181,71,.08) 70%); border-color: rgba(255,209,102,0.6); color: #ffe3a3; }
.ak-cal-d.late { background: rgba(255,181,71,0.07); border-color: rgba(255,209,102,0.3); color: #d9c08a; }
.ak-cal-d.wip::after { content: ""; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--ak-accent); }
.ak-cal-d.today { box-shadow: 0 0 0 2px var(--ak-accent), 0 0 14px rgba(85,214,255,.4); }
.ak-cal-pad { aspect-ratio: 1; }
@media (hover: hover) { .ak-cal-d:not(.off):hover { border-color: var(--ak-accent); } }
.ak-cal-d:focus-visible { outline: 2px solid var(--ak-accent); outline-offset: 1px; }

/* settings, tabs, help */
.ak-set { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #141d3c; cursor: pointer; }
.ak-set span { display: flex; flex-direction: column; gap: 2px; } .ak-set b { font-size: 14px; color: #fff; } .ak-set small { font-size: 12px; color: var(--ak-muted); }
.ak-set input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ak-sw { position: relative; width: 46px; height: 27px; flex: none; border-radius: 14px; border: 1px solid #22305a; background: #0c1230; transition: background .15s, border-color .15s; }
.ak-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #5f6f94; transition: transform .15s, background .15s; }
.ak-set input:checked + .ak-sw { background: #3a2a0c; border-color: var(--ak-amber); }
.ak-set input:checked + .ak-sw::after { transform: translateX(19px); background: var(--ak-warm); box-shadow: 0 0 10px rgba(255,209,102,.7); }
.ak-set input:focus-visible + .ak-sw { outline: 2px solid var(--ak-accent); outline-offset: 2px; }
.ak-setg { padding: 10px 0 12px; border-bottom: 1px solid #141d3c; }
.ak-setg > b { display: block; font-size: 14px; color: #fff; margin-bottom: 2px; } .ak-setg > small { display: block; font-size: 12px; color: var(--ak-muted); margin-bottom: 8px; }
.ak-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 13px; background: #070b1e; border: 1px solid var(--ak-line); margin: 0 0 12px; }
.ak-tab { font: inherit; font-size: 13.5px; font-weight: 700; color: var(--ak-muted); background: transparent; border: 0; border-radius: 9px; min-height: 38px; cursor: pointer; }
.ak-tab[aria-selected="true"] { background: #17234a; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,209,102,0.5), 0 0 16px rgba(255,209,102,0.14); }
.ak-tab:focus-visible { outline: 2px solid var(--ak-accent); outline-offset: 1px; }
.ak-howto { display: grid; grid-template-columns: 68px 1fr; gap: 10px 12px; align-items: center; margin: 4px 0 6px; }
.ak-howto svg { width: 68px; height: 68px; border-radius: 10px; }
.ak-howto p { margin: 0; }
.ak-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ak-table th, .ak-table td { padding: 7px 4px; text-align: right; border-bottom: 1px solid #141d3c; font-variant-numeric: tabular-nums; }
.ak-table th:first-child, .ak-table td:first-child { text-align: left; }
.ak-table thead th { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #6d80a8; }
.ak-table tbody th { color: #fff; font-weight: 700; }
.ak-table td { color: #d2ddf7; }
.ak-levelkey { display: flex; flex-direction: column; gap: 6px; }
.ak-levelkey div { display: grid; grid-template-columns: 74px 1fr; gap: 8px; font-size: 13px; color: #bccaea; line-height: 1.4; }
.ak-levelkey div b { color: var(--lc); font-size: 13px; }

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

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

/* narrow phones */
@media (max-width: 560px) { .ak-hud { gap: 10px; } }
@media (max-width: 460px) {
  .ak-hud { gap: 9px; padding-left: 8px; padding-right: 6px; }
  .ak-pz { padding-right: 22px; padding-left: 8px; min-width: 88px; }
  .ak-pz-n { font-size: 16px; }
  .ak-stat b { font-size: 17px; }
  .ak-tool { width: 36px; height: 36px; border-radius: 11px; }
  .ak-btn { font-size: 10.5px; border-radius: 12px; }
  .ak-bar { gap: 5px; padding: 0 4px; }
  .ak-panel { padding: 18px 14px 14px; }
  .ak-stats b { font-size: 15px; }
}
@media (max-width: 410px) { .ak-hud { gap: 6px; padding-left: 6px; padding-right: 5px; } .ak-stat b { font-size: 16px; } .ak-stat small { font-size: 11px; } .ak-pz-lv { letter-spacing: 0.07em; } .ak-pz { padding-right: 18px; min-width: 0; } .ak-pz-dd { right: 4px; width: 14px; height: 14px; margin-top: -7px; } .ak-stat .ak-k { letter-spacing: 0.08em; } }
@media (max-width: 380px) { #ak-sound { display: none; } .ak-btn svg { width: 19px; height: 19px; } }
@media (max-width: 350px) { .ak-lit { display: none; } }

/* full screen: the board takes every pixel */
.stage.is-immersive .stage-body > .ak { min-height: 0; flex: 1 1 auto; }
.stage.is-immersive .ak-stage { flex: 1 1 auto; height: auto; aspect-ratio: auto; max-height: none; min-height: 0; }
.stage.is-immersive .ak-help { display: none; }
@media (prefers-reduced-motion: reduce) { .ak-panel, .ak-toast, .ak-coach, .ak-overlay, .ak-card { animation: none; } .ak-tag { animation: none; } }
.ak-calm .ak-panel, .ak-calm .ak-toast, .ak-calm .ak-coach, .ak-calm .ak-overlay, .ak-calm .ak-card { animation: none; } .ak-calm .ak-tag { animation: none; }
