:root {
  --bg: #f6f5f2; --card: #ffffff; --text: #1c1917; --muted: #6b6560; --line: #e7e3dc;
  --accent: #e11d48; --ok: #16a34a;
  --st-f: #e7e5e4; --st-u: #f5f5f4; --st-r: #d6d3d1; --st-edge: #44403c;
  --hl-f: #f59e0b; --hl-u: #fbbf24; --hl-r: #d97706;
  --arrow: #1c1917; --halo: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121110; --card: #1c1a19; --text: #f5f5f4; --muted: #a8a29e; --line: #2e2b29;
    --st-f: #44403c; --st-u: #57534e; --st-r: #292524; --st-edge: #0c0a09;
    --arrow: #ffffff; --halo: #000000;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 18px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 32px; line-height: 1.15; margin: 8px 0 8px; }
h2 { font-size: 22px; margin: 0 0 12px; }
.intro { font-size: 20px; margin: 0 0 24px; }
.muted { color: var(--muted); margin-top: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin: 0 0 20px; }

.hold { display: flex; gap: 16px; align-items: center; }
.hold p { margin: 0; font-size: 20px; }
#holdPic { width: 150px; flex: none; }

.moves { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.move { border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; background: var(--bg); }
.move .name { font-size: 34px; font-weight: 800; line-height: 1; margin-top: 4px; }
.move .num { font-size: 13px; color: var(--muted); }
.move .what { font-size: 15px; line-height: 1.3; margin-top: 6px; }

.steps { list-style: none; padding: 0; margin: 0 0 20px; counter-reset: step; }
.steps > li { counter-increment: step; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 20px 20px 72px; margin: 0 0 16px; position: relative; }
.steps > li::before { content: counter(step); position: absolute; left: 20px; top: 18px; width: 36px; height: 36px; border-radius: 50%; background: var(--text); color: var(--bg); font-weight: 800; display: grid; place-items: center; }
.steps h3 { margin: 4px 0 6px; font-size: 20px; }
.steps p { margin: 0 0 12px; white-space: pre-line; }
.steps .part { border-top: 1px dashed var(--line); padding-top: 14px; margin-top: 14px; }
.steps .moves { margin-bottom: 4px; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.steps .move { padding: 6px; }
.steps .move .name { font-size: 26px; }
.steps .move .what { font-size: 13px; }

svg.cube { width: 100%; height: auto; display: block; }
.st { stroke: var(--st-edge); stroke-width: 1.5; stroke-linejoin: round; }
.st.F { fill: var(--st-f); } .st.U { fill: var(--st-u); } .st.R { fill: var(--st-r); }
.st.F.hl { fill: var(--hl-f); } .st.U.hl { fill: var(--hl-u); } .st.R.hl { fill: var(--hl-r); }
.arrow path { fill: none; stroke: var(--arrow); stroke-width: 5; stroke-linecap: round; }
.arrow polygon { fill: var(--arrow); stroke: var(--arrow); stroke-width: 2; stroke-linejoin: round; }
.arrow .halo { stroke: var(--halo); stroke-width: 10; fill: var(--halo); }
.arrow path.halo { fill: none; }
.lbl { font: 800 13px system-ui, sans-serif; fill: var(--text); text-anchor: middle; dominant-baseline: middle; }
.lbl.small { font-size: 10px; }

.lock .row { display: flex; gap: 8px; margin-top: 8px; }
.lock input { flex: 1; min-width: 0; font: 700 28px/1 ui-monospace, monospace; letter-spacing: 0.3em; text-transform: uppercase;
  padding: 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); color: var(--text); }
.lock input:focus { outline: none; border-color: var(--text); }
.lock button { font: 700 18px system-ui, sans-serif; padding: 0 20px; border-radius: 12px; border: 0; background: var(--text); color: var(--bg); cursor: pointer; }
.msg { min-height: 1.5em; margin: 8px 0 0; color: var(--accent); font-weight: 600; }
.shake { animation: shake 0.35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
#unlocked { animation: appear 0.6s ease-out; }
@keyframes appear { from { opacity: 0; transform: translateY(12px); } }

@media (max-width: 480px) {
  .hold { flex-direction: column; align-items: flex-start; }
  .moves { grid-template-columns: repeat(2, 1fr); }
  .steps .moves { grid-template-columns: repeat(3, 1fr); }
  .steps .move .what { display: none; } /* too small on phones; the picture says it */
  .steps > li { padding-left: 20px; padding-top: 64px; }
}
