/* Cube Solver – „HUD“-Stil: schiefer-blauer Verlauf, Cyan als Akzent mit Leuchten, runde Bedienelemente,
   feine Linien, kleine Überschriften in Versalien. Abstände im 8-Punkt-Raster, Schrift 13/16/20/28. */
:root {
  --bg: #1d2834;
  --bg-top: #2d3e50;
  --bg-bottom: #18212b;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .08);
  --surface-3: rgba(255, 255, 255, .14);
  --line: rgba(140, 210, 255, .10);
  --line-2: rgba(140, 210, 255, .18);
  --text: #eef6fb;
  --text-2: rgba(238, 246, 251, .74);
  --muted: rgba(238, 246, 251, .5);
  --accent: #2ec5f2;
  --accent-2: #1eaedb;
  --accent-soft: rgba(46, 197, 242, .12);
  --accent-line: rgba(46, 197, 242, .55);
  --glow: 0 0 16px rgba(46, 197, 242, .45), 0 0 40px rgba(46, 197, 242, .18);
  --ok: #3ee0a8;
  --ok-soft: rgba(62, 224, 168, .12);
  --warn: #ffc14d;
  --err: #ff7a7a;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(8, 14, 22, .45);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --mono: ui-monospace, "SF Mono", "Roboto Mono", "Cascadia Mono", Menlo, monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
html { background: var(--bg-bottom); }
body {
  background: linear-gradient(165deg, var(--bg-top) 0%, var(--bg) 45%, var(--bg-bottom) 100%) fixed;
  color: var(--text);
  font: 500 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
h1, h2 { margin: 0; line-height: 1.2; font-weight: 700; }
h1 { font-size: 28px; letter-spacing: .02em; }
h2 { font-size: 16px; }
b { font-weight: 700; }
.small { font-size: 13px; color: var(--muted); }
.center { text-align: center; }

.screen { display: none; min-height: 100dvh; flex-direction: column; padding-top: var(--safe-top); padding-bottom: var(--safe-bottom); }
.screen.active { display: flex; animation: screen-in .32s var(--ease-out); }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } }

/* Icons */
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Buttons */
.btn {
  appearance: none; border: 0; cursor: pointer; user-select: none; white-space: nowrap; touch-action: manipulation;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 16px; border-radius: 12px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  box-shadow: 0 0 0 1px var(--line-2) inset;
  transition: transform .16s var(--ease-out), background-color .2s, box-shadow .2s;
}
.btn .i { color: var(--accent); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: #062a38; box-shadow: var(--glow); }
.btn.primary .i { color: #062a38; }
.btn.primary:active { background: var(--accent-2); }
.btn.ghost { background: transparent; color: var(--text-2); box-shadow: none; }
.btn.big { min-height: 56px; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.small .i { width: 16px; height: 16px; }
.btn:disabled { opacity: .4; pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background-color: var(--surface-2); }
  .btn.primary:hover { background-color: #4fd0f6; }
  .icon-btn:hover { background: var(--surface-2); }
}

.icon-btn {
  appearance: none; border: 0; cursor: pointer; background: transparent; color: var(--text); touch-action: manipulation;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  transition: transform .16s var(--ease-out), background-color .2s, opacity .2s, box-shadow .2s;
}
.icon-btn:active { transform: scale(.94); background: var(--surface-2); }
.icon-btn.lg { width: 48px; height: 48px; background: var(--surface); box-shadow: 0 0 0 1px var(--line-2) inset; }
/* Abspielen: runder Knopf mit leuchtendem Doppelring */
.icon-btn.primary {
  position: relative; width: 68px; height: 68px; color: #062a38; background: var(--accent);
  box-shadow: var(--glow), 0 0 0 6px rgba(46, 197, 242, .14), 0 0 0 7px rgba(46, 197, 242, .35);
}
.icon-btn.primary .i { width: 26px; height: 26px; }
.icon-btn .pause { display: none; }
.icon-btn.playing .play { display: none; }
.icon-btn.playing .pause { display: block; }
.icon-btn.playing { animation: breathe 2s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 24px rgba(46, 197, 242, .65), 0 0 56px rgba(46, 197, 242, .25), 0 0 0 9px rgba(46, 197, 242, .12), 0 0 0 10px rgba(46, 197, 242, .3); } }
.icon-btn:disabled { opacity: .3; pointer-events: none; }

/* Kopfzeile: Titel klein in Versalien, feine Linie darunter */
.bar { display: flex; align-items: center; gap: 8px; padding: 8px 8px; min-height: 60px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.bar-title { flex: 1; text-align: center; font-size: 13px; text-transform: uppercase; letter-spacing: .16em; }
.bar .icon-btn { color: var(--accent); }
.spacer { width: 44px; flex: none; }

/* Fester Aktionsbereich unten (Daumenzone) */
.dock {
  position: sticky; bottom: 0; z-index: 5;
  margin: auto -16px 0; padding: 16px;
  background: linear-gradient(180deg, rgba(24, 33, 43, 0), var(--bg-bottom) 32%);
  display: flex; flex-direction: column; gap: 8px;
}
.dock-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Karten / Hilfe */
.help {
  text-align: left; background: var(--surface); border-radius: var(--radius); padding: 0 16px;
  color: var(--text-2); font-size: 13px; box-shadow: 0 0 0 1px var(--line) inset;
}
.help summary {
  cursor: pointer; color: var(--text); font-weight: 700; font-size: 13px; list-style: none; text-transform: uppercase; letter-spacing: .1em;
  display: flex; align-items: center; gap: 12px; min-height: 52px;
}
.help summary::-webkit-details-marker { display: none; }
.help summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); transition: transform .2s var(--ease-out); }
.help[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.help summary .i { color: var(--accent); }
.help ul { padding-left: 16px; margin: 0 0 16px; }
.help li { margin: 4px 0; }
.help p { margin: 0 0 12px; }

/* Start */
.home {
  flex: 1; display: flex; flex-direction: column; gap: 16px;
  padding: 24px 16px 0; max-width: 480px; margin: 0 auto; width: 100%;
}
.hero { text-align: center; padding: 16px 0 8px; }
/* Logo im leuchtenden Ring */
.logo-wrap {
  position: relative; width: 128px; height: 128px; margin: 0 auto 24px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, rgba(46, 197, 242, .16), rgba(46, 197, 242, 0) 70%);
  box-shadow: 0 0 0 2px var(--accent), var(--glow), inset 0 0 24px rgba(46, 197, 242, .25);
}
.logo-wrap::after { content: ""; position: absolute; inset: -12px; border-radius: 50%; border: 1px solid rgba(46, 197, 242, .25); }
/* Icon (dunkles Quadrat) als runde Scheibe in den Ring setzen */
.logo { width: 112px; height: 112px; display: block; border-radius: 50%; animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-3px) rotate(-3deg); } }
.hero h1 { text-transform: uppercase; letter-spacing: .14em; font-size: 20px; }
.lead { color: var(--text-2); margin: 8px auto 0; max-width: 300px; font-size: 13px; }
.section-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.section-label > span { font-size: 13px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .16em; }
.status {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 4px 12px; border-radius: 999px;
  font-size: 13px; color: var(--muted); background: var(--surface); box-shadow: 0 0 0 1px var(--line) inset;
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); animation: pulse 1.2s ease-in-out infinite; }
.status.ok { color: var(--ok); background: var(--ok-soft); }
.status.ok::before { background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: none; }
@keyframes pulse { 50% { opacity: .35; } }

/* Link zur Datenschutzerklärung */
.legal-link { align-self: center; color: var(--muted); font-size: 13px; text-decoration: none; padding: 8px 16px; min-height: 44px; display: inline-flex; align-items: center; }
.legal-link:active { color: var(--accent); }

/* Puzzle-Auswahl: Symbole in runden, leuchtenden Scheiben */
.size-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.size-opt {
  appearance: none; border: 0; background: var(--surface); color: var(--text); border-radius: var(--radius);
  padding: 16px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; font: inherit;
  box-shadow: 0 0 0 1px var(--line) inset; touch-action: manipulation;
  transition: transform .16s var(--ease-out), box-shadow .2s, background-color .2s;
}
.size-opt:active { transform: scale(.97); }
.size-opt b { font-size: 16px; letter-spacing: .06em; text-transform: uppercase; }
.size-opt span:last-child { font-size: 13px; color: var(--muted); }
.size-opt.sel { background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset, 0 0 24px rgba(46, 197, 242, .18); }
.size-grid, .size-tri {
  box-sizing: content-box; padding: 16px; margin-bottom: 8px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  box-shadow: 0 0 0 1px var(--line-2), inset 0 2px 8px rgba(0, 0, 0, .25);
  transition: box-shadow .25s;
}
.size-opt.sel .size-grid, .size-opt.sel .size-tri { box-shadow: 0 0 0 2px var(--accent), var(--glow); }
.size-grid { display: grid; gap: 3px; width: 40px; height: 40px; }
.size-grid.g2 { grid-template-columns: repeat(2, 1fr); }
.size-grid.g3 { grid-template-columns: repeat(3, 1fr); }
.size-grid.g4 { grid-template-columns: repeat(4, 1fr); gap: 2px; }
.size-grid i { background: rgba(238, 246, 251, .28); border-radius: 3px; transition: background-color .25s; }
.size-opt.sel .size-grid i { background: var(--accent); }
.size-tri { width: 44px; height: 40px; overflow: visible; }
.size-tri polygon { fill: rgba(238, 246, 251, .28); stroke: #24323f; stroke-width: 2.5; stroke-linejoin: round; transition: fill .25s; }
.size-opt.sel .size-tri polygon { fill: var(--accent); }

/* Scannen */
.steps { flex: 1; display: flex; justify-content: center; gap: 8px; }
.steps .dot {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; background: var(--surface); color: var(--muted); box-shadow: 0 0 0 1px var(--line-2) inset;
  transition: transform .25s var(--ease-out), box-shadow .2s;
}
.steps .dot.current { box-shadow: 0 0 0 2px var(--accent) inset, var(--glow); color: var(--text); transform: scale(1.08); }
.steps .dot.done { color: rgba(0, 0, 0, .7); box-shadow: 0 0 0 2px rgba(255, 255, 255, .25) inset; }
.scan-body { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 0 16px; max-width: 520px; width: 100%; margin: 0 auto; }
.instruction {
  display: flex; gap: 16px; align-items: center; background: var(--surface); border-radius: var(--radius); padding: 12px 16px 12px 12px;
  box-shadow: 0 0 0 1px var(--line) inset;
}
.instruction h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); }
.instruction p { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }
.instr-icon {
  flex: 0 0 80px; width: 80px; height: 80px; position: relative; border-radius: 50%;
  background: radial-gradient(circle, rgba(46, 197, 242, .12), rgba(255, 255, 255, .02)); box-shadow: 0 0 0 1px var(--line-2);
}
.instr-icon svg { width: 64px; height: 64px; }
.viewfinder {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 20px; overflow: hidden; background: #0c1218;
  box-shadow: 0 0 0 1px var(--line-2), var(--shadow);
}
.viewfinder canvas { width: 100%; height: 100%; display: block; touch-action: none; }
/* Sucher-Ecken in Cyan */
.viewfinder::before {
  content: ""; position: absolute; inset: 16px; pointer-events: none; z-index: 1;
  --c: var(--accent); --l: 28px; --w: 3px;
  filter: drop-shadow(0 0 6px rgba(46, 197, 242, .7));
  background:
    linear-gradient(var(--c) 0 0) top left / var(--l) var(--w), linear-gradient(var(--c) 0 0) top left / var(--w) var(--l),
    linear-gradient(var(--c) 0 0) top right / var(--l) var(--w), linear-gradient(var(--c) 0 0) top right / var(--w) var(--l),
    linear-gradient(var(--c) 0 0) bottom left / var(--l) var(--w), linear-gradient(var(--c) 0 0) bottom left / var(--w) var(--l),
    linear-gradient(var(--c) 0 0) bottom right / var(--l) var(--w), linear-gradient(var(--c) 0 0) bottom right / var(--w) var(--l);
  background-repeat: no-repeat;
}
.vf-msg { position: absolute; inset: 0; display: none; place-items: center; text-align: center; padding: 24px; color: var(--text-2); }
.vf-msg.show { display: grid; }
.scan-status {
  align-self: center; text-align: center; font-size: 13px; color: var(--text-2); min-height: 40px;
  display: flex; align-items: center; justify-content: center; padding: 8px 16px; border-radius: 999px;
  background: var(--surface); box-shadow: 0 0 0 1px var(--line) inset; margin-top: -8px;
  transition: background-color .25s, color .25s;
}
.scan-status.ok { color: var(--ok); background: var(--ok-soft); }
.scan-status.warn { color: var(--warn); background: rgba(255, 193, 77, .12); }
.zoom-row, .speed-row { display: flex; align-items: center; gap: 12px; color: var(--accent); }
.zoom-row .small { color: var(--muted); }
.zoom-row input, .speed-row input { flex: 1; }
.scan-actions { flex-direction: row; gap: 8px; }
.scan-actions > * { flex: 1; }
.scan-actions .shutter { flex: 1.6; }
.last-face {
  display: flex; align-items: center; gap: 12px; justify-content: center; color: var(--muted); font-size: 13px;
  padding: 8px 8px 8px 16px; background: var(--surface); border-radius: 999px; box-shadow: 0 0 0 1px var(--line) inset;
}
.mini-face { display: grid; grid-template-columns: repeat(var(--n, 3), 14px); gap: 2px; }
.mini-face i { width: 14px; height: 14px; border-radius: 3px; display: block; }
.viewfinder.flash::after { content: ""; position: absolute; inset: 0; background: #bff0ff; animation: flash .35s ease-out forwards; pointer-events: none; z-index: 2; }
@keyframes flash { from { opacity: .7; } to { opacity: 0; } }

.vf-guide {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: rgba(20, 30, 40, .86); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  text-align: center; padding: 16px; cursor: pointer; animation: fadein .25s var(--ease-out);
}
.vf-guide-title { color: var(--ok); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; padding: 4px 12px; border-radius: 999px; background: var(--ok-soft); }
.vf-guide-cube { width: 70%; aspect-ratio: 1; position: relative; }
.guide-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.vf-guide-text { font-size: 20px; font-weight: 700; }
.vf-guide-skip { font-size: 13px; color: var(--muted); }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* Prüfen */
.review-body { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 0 16px; max-width: 560px; width: 100%; margin: 0 auto; }
.review-body > p.small { color: var(--text-2); margin: 0; }
.net { display: grid; grid-template-columns: repeat(var(--net-cols, 12), minmax(0, 1fr)); gap: 3px; width: 100%; }
.net .st {
  aspect-ratio: 1; min-width: 0; width: 100%; border-radius: 4px; border: 0; padding: 0; cursor: pointer; background: #555;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18); transition: transform .14s var(--ease-out);
}
.net .st:active { transform: scale(.88); }
.net .st.center { cursor: pointer; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .3); }
.net .st.unknown { background: repeating-linear-gradient(45deg, #3a4a58, #3a4a58 4px, #2b3843 4px, #2b3843 8px); }
.net .st.bad { outline: 2px solid var(--err); outline-offset: 1px; }
.net .gap { aspect-ratio: 1; }
.net .label { aspect-ratio: 1; display: grid; place-items: center; font-size: 13px; color: var(--muted); }
.palette {
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;
  padding: 12px; background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line) inset;
}
.palette button {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; touch-action: manipulation;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2);
  transition: transform .16s var(--ease-out), box-shadow .2s;
}
.palette button:active { transform: scale(.92); }
.palette button.sel { transform: scale(1.06); box-shadow: 0 0 0 3px #22303d, 0 0 0 5px var(--accent), var(--glow); }
.palette button.rotate { background: var(--surface-2); color: var(--accent); font-size: 20px; font-weight: 700; box-shadow: 0 0 0 1px var(--line-2) inset; }
.msg { min-height: 24px; text-align: center; font-size: 13px; color: var(--text-2); }
.msg.err { color: var(--err); }
.msg.ok { color: var(--ok); }
.msg.warn { color: var(--warn); }
.review-actions { flex-direction: row; display: grid; grid-template-columns: auto 1fr; }
.dock .btn { padding: 0 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* kleine Bildschirme: Kopfbereich der Startseite verkleinern, damit die Puzzle-Auswahl sichtbar bleibt */
@media (max-height: 760px) {
  .home { gap: 12px; padding-top: 8px; }
  .hero { padding: 8px 0 0; }
  .logo-wrap { width: 88px; height: 88px; margin-bottom: 16px; }
  .logo { width: 76px; height: 76px; }
  .size-opt { padding: 12px 8px; }
  .size-grid, .size-tri { padding: 12px; margin-bottom: 4px; }
}
@media (max-width: 380px) {
  .btn { letter-spacing: .06em; }
}

/* Lösung */
.solve-body { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 0 16px 16px; max-width: 560px; width: 100%; margin: 0 auto; }
#screen-solve .bar { margin-bottom: 8px; }
.hold { text-align: center; font-size: 13px; color: var(--text-2); }
.hold .chip { display: inline-flex; align-items: center; gap: 4px; color: var(--text); font-weight: 700; }
.hold .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25) inset; }
.stage {
  position: relative; flex: 1 1 auto; min-height: 240px; max-height: 42dvh; border-radius: 20px; overflow: hidden;
  background: radial-gradient(circle at 50% 46%, rgba(46, 197, 242, .16) 0%, rgba(46, 197, 242, .04) 35%, rgba(0, 0, 0, .18) 75%);
  box-shadow: 0 0 0 1px var(--line) inset;
}
/* feiner Ring hinter dem Würfel */
.stage::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: min(78%, 78vh); aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; border: 1px solid rgba(46, 197, 242, .18); box-shadow: 0 0 0 16px rgba(46, 197, 242, .03); pointer-events: none;
}
.stage canvas { display: block; position: relative; }
.searching {
  position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: rgba(20, 30, 40, .74); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: var(--text-2); z-index: 2; text-align: center; padding: 24px; font-size: 13px;
}
.searching p { margin: 0; }
.searching.show { display: flex; }
.spinner { width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--surface-2); border-top-color: var(--accent); filter: drop-shadow(0 0 6px rgba(46, 197, 242, .8)); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.move-card {
  display: flex; align-items: center; gap: 16px; background: var(--surface); border-radius: var(--radius); padding: 12px 16px 12px 12px;
  box-shadow: 0 0 0 1px var(--line) inset; transition: background-color .3s, box-shadow .3s;
}
/* Zug in einem Fortschrittsring (--p = 0…1, aus app.js) */
.move-big {
  --p: 0;
  position: relative; font: 700 20px/1 var(--mono); width: 72px; height: 72px; flex: none; display: grid; place-items: center;
  border-radius: 50%; color: var(--text);
  background:
    radial-gradient(circle, #22303d 0 calc(50% - 4px), transparent calc(50% - 3px)),
    conic-gradient(var(--accent) calc(var(--p) * 360deg), rgba(255, 255, 255, .08) 0);
  filter: drop-shadow(0 0 8px rgba(46, 197, 242, .35));
}
.move-desc { flex: 1; font-weight: 700; min-width: 0; }
.move-desc .small { font-weight: 500; margin-top: 2px; }
.move-count { color: var(--accent); font: 700 13px var(--mono); white-space: nowrap; padding: 4px 8px; border-radius: 999px; background: var(--accent-soft); }
.move-count:empty { display: none; }
.move-card.solved { background: var(--ok-soft); box-shadow: 0 0 0 1px rgba(62, 224, 168, .35) inset, 0 8px 32px rgba(62, 224, 168, .12); }
.move-card.solved .move-big {
  color: #06281b; font-size: 28px;
  background: radial-gradient(circle, var(--ok) 0 calc(50% - 6px), transparent calc(50% - 5px)), conic-gradient(var(--ok) 360deg, transparent 0);
  filter: drop-shadow(0 0 12px rgba(62, 224, 168, .6)); animation: pop .5s var(--ease-out);
}
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.1); } 100% { transform: scale(1); } }

.moves {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-content: flex-start;
  flex: 1 1 0; min-height: 96px; overflow-y: auto; padding: 4px; position: relative;
}
.moves button {
  appearance: none; border: 0; cursor: pointer; font: 700 13px var(--mono);
  min-width: 44px; height: 36px; padding: 0 8px; border-radius: 999px; background: transparent; color: var(--muted);
  box-shadow: 0 0 0 1px var(--line-2) inset; transition: background-color .2s, color .2s, transform .16s var(--ease-out);
}
.moves button:active { transform: scale(.94); }
.moves button.done { color: var(--text-2); background: var(--surface); }
.moves button.current { background: var(--accent); color: #062a38; box-shadow: var(--glow); }
.controls { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 8px 0; }

/* Slider */
input[type=range] { -webkit-appearance: none; appearance: none; height: 32px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .14); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .14); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--accent);
  box-shadow: var(--glow), 0 0 0 4px rgba(46, 197, 242, .2);
}
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--accent); box-shadow: var(--glow); }

/* Konfetti beim Lösen */
.celebrate { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 3; }
.celebrate i { position: absolute; width: 8px; height: 12px; border-radius: 2px; opacity: 0; }
.celebrate.go i { animation: confetti 1.4s var(--ease-out) forwards; }
@keyframes confetti {
  0% { opacity: 1; transform: translate(0, 0) rotate(0) scale(.6); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 80px)) rotate(var(--r)) scale(1); }
}

@media (min-height: 820px) { .stage { min-height: 340px; } }

/* Lösungsansicht: feste Bildschirmhöhe – Würfel und Steuerung bleiben sichtbar, nur die Zugliste scrollt */
#screen-solve.active { height: 100dvh; min-height: 0; }
#screen-solve .solve-body { min-height: 0; overflow: hidden; }
/* feste Höhen, damit der Würfel bei wechselnden Zugtexten nicht größer/kleiner wird */
#screen-solve .stage { flex: 0 0 auto; height: clamp(150px, calc(100dvh - 540px), 40dvh); min-height: 0; max-height: none; }
#screen-solve .move-card { flex: 0 0 auto; height: 96px; overflow: hidden; }
#screen-solve .move-desc > div { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
#screen-solve .controls, #screen-solve .speed-row { flex: 0 0 auto; }
#screen-solve .help { flex: none; }

/* Pyraminx-Netz im Prüfen-Bildschirm */
.net .pyra-net { width: 100%; height: auto; max-height: 52dvh; display: block; }
.net .pyra-net .st { cursor: pointer; stroke: #22303d; stroke-width: .04; aspect-ratio: auto; width: auto; box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  .screen.active, .logo, .status::before, .icon-btn.playing { animation: none; }
  .celebrate.go i { animation-duration: .6s; }
  .move-card.solved .move-big { animation: none; }
}
