/* Spot the Difference: two pictures (side by side, or one above the other on a phone held upright) between the HUD and
   the tool bar; each picture is a background and its objects as HTML, with an SVG over it for the rings, the hint
   and the finder. game.js lays the pictures out and keeps their zoom in step. */
.sd { display: flex; flex-direction: column; color: #e8ecff; --sd-hud: 54px; --sd-bar: 64px; --sd-accent: #55d6ff; --sd-gold: #ffd166; --sd-coral: #ff8a6b; --sd-mint: #7dffcf;
  --sd-line: #1c2b4a; --sd-glass: rgba(9,14,32,0.84); }
.sd-stage { position: relative; width: 100%; height: min(86vh, 800px); min-height: 480px; overflow: hidden; outline: none;
  background: radial-gradient(120% 90% at 50% 0%, rgba(255,170,90,0.10), transparent 60%), radial-gradient(90% 70% at 50% 110%, rgba(85,214,255,0.08), transparent 60%), #050a17;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
@media (min-width: 900px) { .sd-stage { height: auto; aspect-ratio: 1.9; max-height: min(86vh, 800px); } }
@media (max-width: 600px) { .sd-stage { height: 88vh; height: min(88svh, 900px); min-height: 520px; max-height: 88vh; } }

/* the pictures */
.sd-board { position: absolute; inset: 0; outline: none; touch-action: none; }
.sd-board:focus-visible .sd-pic { box-shadow: 0 0 0 2px rgba(85,214,255,.55), 0 14px 40px rgba(0,0,0,.5); }
.sd-pic { position: absolute; overflow: hidden; border-radius: 14px; background: #0d1426; cursor: pointer; touch-action: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.10), 0 14px 40px rgba(0,0,0,0.5); transition: box-shadow .2s; }
.sd-pic.grab { cursor: grab; } .sd-pic.grabbing { cursor: grabbing; }
.sd-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
/* a layer only while the view moves: a standing one would keep the pictures rasterised at the old zoom (blurry) */
.sd-board.sd-moving .sd-world { will-change: transform; }
.sd-bg { position: absolute; inset: 0; background-size: 100% 100%; background-repeat: no-repeat; }
.sd-bg.mir { transform: scaleX(-1); }
.sd-o { position: absolute; display: block; background-repeat: no-repeat; pointer-events: none; }
.sd-sh { position: absolute; display: block; pointer-events: none; border-radius: 50%; background: radial-gradient(closest-side, rgba(40,25,10,0.26), rgba(40,25,10,0.12) 55%, transparent); }
.sd-ov { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.sd-pic.shake { animation: sd-shake .36s cubic-bezier(.36,.07,.19,.97); }
@keyframes sd-shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.sd-pic.flash::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 3px rgba(255,107,107,.75); animation: sd-flash .45s ease-out forwards; pointer-events: none; }
@keyframes sd-flash { to { opacity: 0; } }
.sd-pic.won { box-shadow: 0 0 0 2px rgba(255,209,102,.7), 0 0 34px rgba(255,209,102,.28), 0 14px 40px rgba(0,0,0,.5); }

/* rings, misses, the hint and the finder (inside each picture's SVG) */
.sd-ring { fill: none; stroke: #ffc933; stroke-width: 3.8; }
.sd-ring-u { fill: none; stroke: rgba(70,35,0,.62); stroke-width: 7.5; }
.sd-ring-g { transform-box: fill-box; transform-origin: center; animation: sd-pop .5s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes sd-pop { 0% { transform: scale(1.7); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1); } }
.sd-ring-g.reveal .sd-ring { stroke: #ff9fc9; stroke-dasharray: 7 6; filter: drop-shadow(0 0 5px rgba(255,120,180,.8)); }
.sd-miss { fill: none; stroke: #ff5d6c; stroke-width: 3.4; stroke-linecap: round; animation: sd-miss .8s ease-out forwards; filter: drop-shadow(0 0 3px rgba(0,0,0,.6)); }
@keyframes sd-miss { 0% { opacity: 0; } 15% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
.sd-hint-dim { fill: rgba(5,8,20,0.55); animation: sd-fadein .35s ease-out both; }
.sd-hint-ring { fill: none; stroke: var(--sd-accent); stroke-width: 2.6; stroke-dasharray: 8 7; filter: drop-shadow(0 0 6px rgba(85,214,255,.9)); animation: sd-spin 8s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes sd-spin { to { transform: rotate(360deg); } }
@keyframes sd-fadein { from { opacity: 0; } }
.sd-cur { fill: none; stroke: #fff; stroke-width: 2; filter: drop-shadow(0 0 2px rgba(0,0,0,.9)); }
.sd-cur-c { fill: none; stroke: var(--sd-accent); stroke-width: 2; }

/* HUD */
.sd-hud { position: absolute; left: 0; right: 0; top: 0; height: var(--sd-hud); display: flex; align-items: center; gap: 14px; padding: 0 8px 0 10px; z-index: 3; pointer-events: none; }
.sd-hud > * { pointer-events: auto; }
.sd-pz { flex: 0 1 auto; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; position: relative; min-width: 96px; max-width: 42vw; height: 44px; padding: 2px 26px 2px 10px; border-radius: 12px;
  border: 1px solid var(--sd-line); background: var(--sd-glass); color: #fff; cursor: pointer; font: inherit; line-height: 1.05; touch-action: manipulation; text-align: left; transition: border-color .15s; }
.sd-pz-lv { font-size: 10px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--lvc, #9fb1d8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sd-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%; }
.sd-pz-dd { position: absolute; right: 6px; top: 50%; width: 16px; height: 16px; margin-top: -8px; fill: none; stroke: #9fb1d8; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .sd-pz:hover { border-color: var(--sd-accent); } }
.sd-pz:focus-visible { outline: 2px solid var(--sd-accent); outline-offset: 2px; }
.sd-stat { display: flex; flex-direction: column; line-height: 1.05; flex: none; position: relative; }
.sd-k { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #9fb1d8; white-space: nowrap; }
.sd-k em { font-style: normal; color: #fff; font-weight: 800; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; margin-left: 3px; }
.sd-stat b { font-size: 19px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; margin-top: 3px; }
.sd-dots { display: flex; gap: 4px; margin-top: 6px; height: 11px; align-items: center; }
.sd-dots i { width: 11px; height: 11px; border-radius: 50%; background: #18223f; box-shadow: inset 0 0 0 1.5px #2c3a66; transition: background .25s, box-shadow .25s, transform .25s; }
.sd-dots i.on { background: var(--sd-gold); box-shadow: 0 0 8px rgba(255,209,102,.75); }
.sd-dots i.pop { animation: sd-dot .45s cubic-bezier(.2,1.8,.4,1); }
.sd-dots i.rev { background: #ff9fc9; box-shadow: 0 0 6px rgba(255,159,201,.6); }
@keyframes sd-dot { 0% { transform: scale(.4); } 60% { transform: scale(1.45); } 100% { transform: scale(1); } }
.sd-pen[hidden] { display: none; }
.sd-pen { position: absolute; left: 100%; bottom: 0; margin-left: 4px; font-style: normal; font-size: 12px; font-weight: 800; color: #ff8c8c; white-space: nowrap; animation: sd-penf 1.1s ease-out forwards; }
@keyframes sd-penf { 0% { opacity: 0; transform: translateY(6px); } 20% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }
.sd-notimer .sd-time { display: none; }
.sd-sp { flex: 1 1 auto; }
.sd-tool { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; border: 1px solid var(--sd-line); background: var(--sd-glass);
  color: #c9d4ff; cursor: pointer; touch-action: manipulation; padding: 0; transition: border-color .15s, color .15s; }
.sd-tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sd-tool .spk { fill: currentColor; stroke: none; }
@media (hover: hover) { .sd-tool:hover { border-color: var(--sd-accent); color: #fff; } }
.sd-tool:focus-visible { outline: 2px solid var(--sd-accent); outline-offset: 2px; }
#sd-sound .off { display: none; } #sd-sound[aria-pressed="true"] { color: #6b7aa8; } #sd-sound[aria-pressed="true"] .on { display: none; } #sd-sound[aria-pressed="true"] .off { display: inline; }
.sd-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--sd-coral); box-shadow: 0 0 8px var(--sd-coral); }
.sd-dot[hidden] { display: none; }

/* the coach line */
.sd-coach[hidden] { display: none; }
.sd-coach { position: absolute; left: 50%; transform: translateX(-50%); top: calc(var(--sd-hud) + 4px); z-index: 4; width: min(calc(100% - 20px), 520px); padding: 8px 34px 8px 12px; border-radius: 12px;
  background: rgba(8,12,30,0.92); border: 1px solid rgba(255,209,102,0.45); box-shadow: 0 10px 30px rgba(0,0,0,.45); font-size: 13.5px; line-height: 1.38; color: #e8ecff; animation: sd-drop .22s ease-out; }
@keyframes sd-drop { from { opacity: 0; transform: translate(-50%, -6px); } }
@keyframes sd-rise { from { opacity: 0; transform: translate(-50%, 6px); } }
.sd-coach b { color: var(--sd-gold); font-weight: 800; margin-right: 6px; }
.sd-coach.hint { border-color: rgba(85,214,255,0.55); } .sd-coach.hint b { color: var(--sd-accent); }
.sd-coach-close { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: #9fb1d8; font-size: 19px; line-height: 1; cursor: pointer; }
@media (hover: hover) { .sd-coach-close:hover { color: #fff; background: rgba(255,255,255,.08); } }

/* the tool bar */
.sd-bar { position: absolute; left: 50%; transform: translateX(-50%); bottom: 8px; height: calc(var(--sd-bar) - 12px); z-index: 3; display: flex; gap: 6px; padding: 0 6px; width: min(calc(100% - 12px), 560px); }
.sd-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(--sd-line);
  background: rgba(9,14,32,0.88); color: #d6defe; font: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; cursor: pointer; touch-action: manipulation; padding: 0 2px; overflow: hidden;
  transition: border-color .15s, color .15s, opacity .15s, background .15s, transform .08s; }
.sd-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sd-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sd-btn em { font-style: normal; color: var(--sd-gold); font-variant-numeric: tabular-nums; }
@media (hover: hover) { .sd-btn:hover:not(:disabled) { border-color: var(--sd-accent); color: #fff; } }
.sd-btn:active:not(:disabled) { transform: translateY(1px); }
.sd-btn:focus-visible { outline: 2px solid var(--sd-accent); outline-offset: 2px; }
.sd-btn:disabled { opacity: 0.36; cursor: default; }
.sd-hint { color: #ffe6a8; }
@media (hover: hover) { .sd-hint:hover:not(:disabled) { border-color: var(--sd-gold); } }
.sd-charge { position: absolute; left: 10px; right: 10px; bottom: 4px; height: 3px; border-radius: 2px; background: rgba(255,209,102,.16); overflow: hidden; }
.sd-charge::after { content: ""; position: absolute; inset: 0; width: var(--c, 0%); background: var(--sd-gold); border-radius: 2px; transition: width .5s linear; }
.sd-charge.full::after { width: 100%; box-shadow: 0 0 6px rgba(255,209,102,.8); }
.sd-next.ready { background: linear-gradient(135deg, #ffd166, #ffb36b); color: #241400; border-color: transparent; box-shadow: 0 6px 22px rgba(255,190,90,0.35); }
.sd-side .sd-bar { left: auto; right: 8px; top: calc(var(--sd-hud) + 4px); bottom: 8px; transform: none; height: auto; width: 78px; flex-direction: column; padding: 0; }
.sd-side .sd-btn { font-size: 10.5px; }
.sd-side .sd-toast { left: calc(50% - 43px); }

/* the result card */
.sd-card[hidden] { display: none; }
.sd-card { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 5; width: min(calc(100% - 16px), 470px); padding: 14px 14px 12px; border-radius: 18px;
  background: rgba(8,12,30,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,209,102,.10); animation: sd-up .35s cubic-bezier(.2,.9,.25,1.1);
  max-height: calc(100% - var(--sd-hud) - 20px); overflow: auto; overscroll-behavior: contain; }
@keyframes sd-up { from { opacity: 0; transform: translate(-50%, 24px); } }
.sd-card:focus { outline: none; }
.sd-card-top { display: flex; align-items: center; gap: 12px; }
.sd-card-top > div { flex: 1 1 auto; min-width: 0; }
.sd-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,209,102,.4); }
.sd-card p { margin: 3px 0 0; font-size: 13px; color: #9fb1d8; line-height: 1.4; }
.sd-card .sd-actions { margin-top: 12px; }
.sd-card .sd-lb { margin-top: 8px; }
.sd-card-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }

/* panels */
.sd-overlay[hidden] { display: none; }
.sd-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; z-index: 7; overflow: auto;
  background: radial-gradient(ellipse at center, rgba(4,6,18,0.55), rgba(3,5,12,0.88)); animation: sd-fade .18s ease-out; }
.sd-panel { position: relative; width: min(100%, 440px); margin: auto; padding: 20px 18px 18px; border: 1px solid var(--sd-line); border-radius: 18px; text-align: left; outline: none;
  background: rgba(8,12,30,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: sd-in .26s cubic-bezier(.2,.9,.25,1.1); }
.sd-panel.wide { width: min(100%, 600px); }
@keyframes sd-in { from { opacity: 0; transform: scale(.95) translateY(8px); } }
@keyframes sd-fade { from { opacity: 0; } }
.sd-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; }
.sd-panel h3 { margin: 16px 0 8px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: #9fb1d8; }
.sd-panel p, .sd-panel li { font-size: 13.5px; line-height: 1.5; color: #c1cbec; }
.sd-panel p { margin: 0 0 8px; }
.sd-panel ul { margin: 0 0 8px; padding-left: 18px; }
.sd-panel kbd { display: inline-block; min-width: 1.4em; padding: 0 5px; border-radius: 5px; border: 1px solid #2c3a66; background: #0b1128; color: #fff; font: 700 12px/1.6 system-ui, sans-serif; text-align: center; }
.sd-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: #d6defe; cursor: pointer; padding: 0; z-index: 2; }
/* a slightly larger touch area than the drawn button */
.sd-x::before, .sd-tool::before { content: ""; position: absolute; inset: -4px; }
.sd-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
@media (hover: hover) { .sd-x:hover { background: rgba(255,255,255,.14); color: #fff; } }
.sd-x:focus-visible { outline: 2px solid var(--sd-accent); outline-offset: 2px; }
.sd-fine { font-size: 12px !important; color: #6f7ea8 !important; margin: 8px 0 0 !important; }

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

/* stars and stats */
.sd-stars { display: flex; justify-content: center; gap: 4px; flex: none; }
.sd-stars svg { width: 28px; height: 28px; }
.sd-stars .s-on { fill: var(--sd-gold); filter: drop-shadow(0 0 8px rgba(255,209,102,.75)); }
.sd-stars .s-off { fill: #1f2a52; }
.sd-stars.anim svg { animation: sd-star .5s cubic-bezier(.2,1.7,.4,1) both; } .sd-stars.anim svg:nth-child(2) { animation-delay: .12s; } .sd-stars.anim svg:nth-child(3) { animation-delay: .24s; }
@keyframes sd-star { from { transform: scale(0) rotate(-40deg); opacity: 0; } }
.sd-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: #1a1200; background: linear-gradient(90deg, #ffd166, #fff1b8, #ffd166); background-size: 200% 100%; animation: sd-shine 1.6s linear infinite; box-shadow: 0 0 18px rgba(255,209,102,0.5); }
@keyframes sd-shine { to { background-position: -200% 0; } }
.sd-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 4px; }
.sd-stats.three { grid-template-columns: repeat(3, 1fr); }
.sd-stats div { padding: 8px 4px; border-radius: 10px; background: #070c20; border: 1px solid #172042; text-align: center; min-width: 0; }
.sd-stats span { display: block; font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: #6f7ea8; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-stats b { display: block; margin-top: 2px; font-size: 17px; color: #e8ecff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sd-stats .gold b { color: var(--sd-gold); } .sd-stats .hot b { color: #ff9fc9; } .sd-stats .ok b { color: var(--sd-mint); }
.sd-lb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.sd-lb h3 { margin-top: 6px; }
.sd-card .sd-lb h3 { margin: 12px 0 6px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: #9fb1d8; line-height: 1.3; }
.sd-lb li { display: grid; grid-template-columns: 26px 1fr auto auto; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 8px; background: #070c20; font-size: 13px; }
.sd-lb li span { color: #6f7ea8; font-weight: 800; font-variant-numeric: tabular-nums; }
.sd-lb li b { color: #e8ecff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.sd-lb li em { font-style: normal; color: var(--sd-gold); font-weight: 800; font-variant-numeric: tabular-nums; }
.sd-lb li i { font-style: normal; color: #9fb1d8; font-variant-numeric: tabular-nums; font-size: 12px; }
.sd-lb li.me { background: rgba(85,214,255,0.12); box-shadow: inset 0 0 0 1px rgba(85,214,255,0.4); }

/* the hub */
.sd-hubs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sd-hubc { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 96px; padding: 12px 12px 10px; border-radius: 15px; border: 1px solid var(--sd-line);
  background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--hc) 22%, transparent), transparent 60%), #070c20; color: #e8ecff; font: inherit; text-align: left; cursor: pointer; touch-action: manipulation; transition: border-color .15s, transform .1s; overflow: hidden; }
.sd-hubc.big { grid-column: 1 / -1; min-height: 112px; padding-right: 120px; }
.sd-hubc svg { width: 28px; height: 28px; fill: none; stroke: var(--hc); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 2px; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--hc) 60%, transparent)); }
.sd-hubc b { font-size: 15.5px; color: #fff; }
.sd-hubc small { font-size: 12px; color: #9fb1d8; line-height: 1.35; }
.sd-hubc em { position: absolute; top: 10px; right: 12px; font-style: normal; font-size: 11.5px; font-weight: 800; color: var(--hc); font-variant-numeric: tabular-nums; }
.sd-hubc .thumb { position: absolute; right: 10px; bottom: 10px; width: 104px; height: 78px; border-radius: 10px; background-size: cover; background-position: center; box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 6px 18px rgba(0,0,0,.4); }
.sd-hubc.big em { top: auto; bottom: 92px; right: 14px; }
@media (hover: hover) { .sd-hubc:hover { border-color: var(--hc); } }
.sd-hubc:active { transform: translateY(1px); }
.sd-hubc:focus-visible { outline: 2px solid var(--hc); outline-offset: 2px; }

/* packs */
.sd-packs { display: flex; flex-direction: column; gap: 8px; max-height: min(62vh, 560px); overflow: auto; margin: 0 -4px; padding: 2px 4px; overscroll-behavior: contain; }
.sd-pack { display: grid; grid-template-columns: 92px 1fr; gap: 10px 12px; align-items: center; padding: 10px; border-radius: 14px; border: 1px solid #172042; background: #070c20; }
.sd-pack.cur { border-color: color-mix(in srgb, var(--pc) 60%, transparent); box-shadow: 0 0 18px color-mix(in srgb, var(--pc) 15%, transparent); }
.sd-pack.locked { opacity: .55; }
.sd-pack .thumb { width: 92px; height: 69px; border-radius: 9px; background-size: cover; background-position: center; box-shadow: 0 0 0 1px rgba(255,255,255,.1); grid-row: span 2; }
.sd-pack.locked .thumb { filter: grayscale(.8) brightness(.6); }
.sd-pack-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.sd-pack-h b { font-size: 15px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-pack-h small { font-size: 12px; color: var(--sd-gold); font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sd-lvls { display: grid; grid-template-columns: repeat(5, minmax(0, 46px)); gap: 6px; }
.sd-lvl { position: relative; width: 100%; height: 42px; border-radius: 12px; border: 1px solid #22305a; background: #0c1230; color: #d6defe; font: 800 14px system-ui, sans-serif; cursor: pointer; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; touch-action: manipulation; font-variant-numeric: tabular-nums; }
.sd-lvl i { font-style: normal; font-size: 8.5px; color: var(--sd-gold); letter-spacing: -1px; line-height: 1; }
.sd-lvl.done { border-color: color-mix(in srgb, var(--pc) 55%, transparent); background: color-mix(in srgb, var(--pc) 14%, #0c1230); color: #fff; }
.sd-lvl.cur { box-shadow: 0 0 0 2px var(--pc), 0 0 14px color-mix(in srgb, var(--pc) 50%, transparent); }
.sd-lvl.locked { opacity: .4; cursor: default; }
@media (hover: hover) { .sd-lvl:not(.locked):hover { border-color: var(--sd-accent); } }
.sd-lvl:focus-visible { outline: 2px solid var(--sd-accent); outline-offset: 2px; }

/* lists: endless tiers and scenes */
.sd-list { display: flex; flex-direction: column; gap: 6px; }
.sd-p-endless .sd-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
@media (max-width: 520px) { .sd-p-endless .sd-list { grid-template-columns: 1fr; } }
.sd-li { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 13px; border: 1px solid #172042; background: #070c20; color: #e8ecff; font: inherit; text-align: left; cursor: pointer; touch-action: manipulation; transition: border-color .15s; }
@media (hover: hover) { .sd-li:hover { border-color: var(--lc, var(--sd-accent)); } }
.sd-li:focus-visible { outline: 2px solid var(--sd-accent); outline-offset: 2px; }
.sd-li-ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; background: color-mix(in srgb, var(--lc, #55d6ff) 16%, transparent); color: var(--lc, #55d6ff); font-weight: 900; font-size: 14px; font-variant-numeric: tabular-nums; }
.sd-li-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sd-li-t b { font-size: 14.5px; color: #fff; } .sd-li-t small { font-size: 12px; color: #9fb1d8; }
.sd-li-s { font-size: 12px; font-weight: 800; color: #6f7ea8; white-space: nowrap; font-variant-numeric: tabular-nums; } .sd-li-s.ok { color: var(--sd-gold); }
.sd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sd-chip { font: 700 12.5px system-ui, sans-serif; padding: 7px 11px; border-radius: 999px; border: 1px solid #22305a; background: #0c1230; color: #c1cbec; cursor: pointer; touch-action: manipulation; }
.sd-chip[aria-pressed="true"] { background: color-mix(in srgb, var(--cc, #55d6ff) 22%, #0c1230); border-color: var(--cc, #55d6ff); color: #fff; }
.sd-chip:focus-visible { outline: 2px solid var(--sd-accent); outline-offset: 2px; }

/* calendar */
.sd-cal-head { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; }
.sd-cal-head b { flex: 1 1 auto; text-align: center; color: #fff; font-size: 15px; }
.sd-step { width: 42px; height: 42px; flex: none; display: grid; place-items: center; padding: 0; border-radius: 10px; border: 1px solid #22305a; background: #0c1230; color: #e8ecff; cursor: pointer; }
.sd-step svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sd-step:disabled { opacity: .35; cursor: default; }
.sd-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.sd-cal-w { text-align: center; font-size: 10.5px; font-weight: 800; color: #6f7ea8; padding: 2px 0; }
.sd-cal-d { position: relative; height: 38px; display: grid; place-items: center; border-radius: 9px; border: 1px solid #172042; background: #070c20; color: #d6defe; font: 700 13px system-ui, sans-serif; cursor: pointer; padding: 0; }
.sd-cal-d.off { opacity: .28; cursor: default; }
.sd-cal-d.ok { background: rgba(125,255,207,0.12); border-color: rgba(125,255,207,0.55); color: var(--sd-mint); }
.sd-cal-d.today { box-shadow: 0 0 0 2px var(--sd-coral), 0 0 14px rgba(255,138,107,.45); }
.sd-cal-pad { height: 38px; }
@media (hover: hover) { .sd-cal-d:not(.off):hover { border-color: var(--sd-accent); } }
.sd-cal-d:focus-visible { outline: 2px solid var(--sd-accent); outline-offset: 1px; }

/* settings, tabs, help */
.sd-set { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #172042; cursor: pointer; }
.sd-set span { display: flex; flex-direction: column; gap: 2px; } .sd-set b { font-size: 14px; color: #fff; } .sd-set small { font-size: 12px; color: #9fb1d8; }
.sd-set input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sd-sw { position: relative; width: 46px; height: 27px; flex: none; border-radius: 14px; border: 1px solid #22305a; background: #0c1230; transition: background .15s, border-color .15s; }
.sd-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #6f7ea8; transition: transform .15s, background .15s; }
.sd-set input:checked + .sd-sw { background: #3a2a12; border-color: var(--sd-gold); }
.sd-set input:checked + .sd-sw::after { transform: translateX(19px); background: var(--sd-gold); box-shadow: 0 0 10px rgba(255,209,102,.7); }
.sd-set input:focus-visible + .sd-sw { outline: 2px solid var(--sd-accent); outline-offset: 2px; }
.sd-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 13px; background: #070c20; border: 1px solid var(--sd-line); margin: 0 0 12px; }
.sd-tab { font: inherit; font-size: 13.5px; font-weight: 700; color: #9fb1d8; background: transparent; border: 0; border-radius: 9px; min-height: 38px; cursor: pointer; }
.sd-tab[aria-selected="true"] { background: #1a2246; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,209,102,0.45), 0 0 16px rgba(255,209,102,0.12); }
.sd-tab:focus-visible { outline: 2px solid var(--sd-accent); outline-offset: 1px; }
.sd-howto { display: grid; grid-template-columns: 76px 1fr; gap: 10px 12px; align-items: center; margin: 4px 0 6px; }
.sd-howto svg { width: 76px; height: 58px; }
.sd-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sd-table th, .sd-table td { padding: 6px 4px; text-align: right; border-bottom: 1px solid #172042; font-variant-numeric: tabular-nums; }
.sd-table th:first-child, .sd-table td:first-child { text-align: left; }
.sd-table thead th { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #6f7ea8; }
.sd-table tbody th { color: #fff; font-weight: 700; }
.sd-table td { color: #d6defe; }

.sd-toast[hidden] { display: none; }
.sd-toast { position: absolute; left: 50%; bottom: calc(var(--sd-bar) + 10px); transform: translateX(-50%); z-index: 8; padding: 8px 14px; border-radius: 999px; background: #e8ecff; color: #07051a; font-size: 13px; font-weight: 800; animation: sd-rise .2s ease-out; pointer-events: none; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.sd-side .sd-toast { bottom: 14px; }
.sd-loading[hidden] { display: none; }
.sd-loading { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(3,5,12,0.55); color: #d6defe; font-size: 14px; pointer-events: none; }
.sd-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,209,102,.2); border-top-color: var(--sd-gold); animation: sd-rot .9s linear infinite; }
@keyframes sd-rot { to { transform: rotate(360deg); } }
.sd-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sd-confetti { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.sd-confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: sd-fall var(--t, 2.2s) cubic-bezier(.25,.6,.4,1) var(--dl, 0s) forwards; opacity: 0; }
@keyframes sd-fall { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 400px)) rotate(var(--r, 360deg)); } }

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

/* narrow phones */
@media (max-width: 560px) { .sd-hud { gap: 10px; } }
@media (max-width: 460px) {
  .sd-hud { gap: 8px; padding-left: 8px; padding-right: 6px; }
  .sd-pz { padding-right: 22px; padding-left: 8px; min-width: 88px; }
  .sd-pz-n { font-size: 16px; }
  .sd-stat b { font-size: 16px; }
  .sd-dots { gap: 3px; } .sd-dots i { width: 9px; height: 9px; }
  .sd-tool { width: 36px; height: 36px; border-radius: 11px; }
  .sd-btn { font-size: 10.5px; border-radius: 12px; }
  .sd-panel { padding: 18px 14px 14px; }
  .sd-stats b { font-size: 15px; }
  .sd-stats span { letter-spacing: 0.07em; }
  .sd-hubc.big { padding-right: 12px; } .sd-hubc .thumb { display: none; } .sd-hubc.big em { bottom: auto; top: 10px; }
  .sd-pack { grid-template-columns: 72px 1fr; } .sd-pack .thumb { width: 72px; height: 54px; }
  .sd-lvl { height: 40px; }
}
@media (max-width: 400px) { .sd-btn { letter-spacing: 0; } .sd-card h2 { font-size: 19.5px; } .sd-stats div { padding-left: 2px; padding-right: 2px; } .sd-stats span { font-size: 9px; }
  .sd-hud { gap: 6px; } .sd-pz { min-width: 0; padding-left: 7px; padding-right: 18px; } .sd-pz-n { font-size: 15px; letter-spacing: 0; } .sd-pz-dd { right: 3px; } .sd-k { letter-spacing: 0.1em; } .sd-time { display: none; } #sd-sound { display: none; }
  .sd-dots { gap: 2px; } .sd-dots i { width: 6px; height: 6px; box-shadow: inset 0 0 0 1px #2c3a66; } .sd-k em { margin-left: 2px; } .sd-timed .sd-time { display: flex; } .sd-timed .sd-k { letter-spacing: 0.06em; } }


/* full screen: the pictures take every pixel */
.stage.is-immersive .stage-body > .sd { min-height: 0; flex: 1 1 auto; }
.stage.is-immersive .sd-stage { flex: 1 1 auto; height: auto; max-height: none; min-height: 0; }
.stage.is-immersive .sd-help { display: none; }
@media (prefers-reduced-motion: reduce) { .sd-panel, .sd-toast, .sd-coach, .sd-overlay, .sd-card, .sd-ring-g, .sd-dots i, .sd-stars.anim svg, .sd-hint-ring, .sd-tag, .sd-pic.shake { animation: none !important; } }
.sd-calm .sd-panel, .sd-calm .sd-toast, .sd-calm .sd-coach, .sd-calm .sd-overlay, .sd-calm .sd-card, .sd-calm .sd-ring-g, .sd-calm .sd-dots i, .sd-calm .sd-stars.anim svg, .sd-calm .sd-hint-ring, .sd-calm .sd-tag, .sd-calm .sd-pic.shake { animation: none !important; }
