:root{color-scheme:dark;--bg:#0e131a;--sidebar:#141b24;--panel:#1a222c;--hover:#293742;--muted:#a1b0bc;--accent:#75e0ba;--text:#f2f5f7;--red:#ef5350;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;font-size:16px}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text)}button,input{font:inherit}button{border:1px solid transparent;background:var(--panel);color:var(--text);border-radius:8px;padding:12px 14px;min-height:44px;cursor:pointer;transition:background .15s}button:hover:enabled{background:var(--hover)}button:disabled{opacity:.42;cursor:default}button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:4px}button.primary,button.active{background:var(--accent);color:#10251e}button.primary:hover:enabled,button.active:hover:enabled{background:#9ceace}button.subtle{background:transparent;border-color:#35434f}p{line-height:1.55}h1,h2,p{margin-top:0}[hidden]{display:none!important}.shell{min-height:100dvh;max-width:1600px;margin:auto;display:grid;grid-template-columns:248px 1fr}.sidebar{background:var(--sidebar);padding:32px 24px 24px;display:flex;flex-direction:column}.brand{display:flex;gap:12px;align-items:flex-start;margin-bottom:40px}.brand strong{font-size:22px;letter-spacing:.16em}.brand p{font-size:13px;color:var(--muted);margin:8px 0 0}.brand-icon{color:var(--accent);font-size:30px;line-height:1}.eyebrow{text-transform:uppercase;letter-spacing:.11em;font-size:13px;font-weight:600;color:var(--accent)}.sidebar h2{margin-bottom:18px}.levels{display:grid;gap:7px}.level-button{display:flex;align-items:center;justify-content:space-between;text-align:left;padding:10px 14px;min-height:42px}.level-button .state{font-size:16px;color:var(--accent)}.level-button.active .state{color:#10251e}.lock{width:14px;height:14px;display:block}.pages{display:flex;gap:4px;margin-top:18px;align-items:center}.pages>button{padding:0;width:28px;background:transparent;font-size:26px;flex-shrink:0}#ranges{display:flex;gap:6px;flex:1}#ranges button{padding:8px 4px;flex:1;font-size:14px}.progress-area{margin-top:auto;padding-top:28px}.progress-area p{margin-bottom:12px}progress{width:100%;height:4px;border:0;display:block;background:#2b3844;accent-color:var(--accent);border-radius:8px;overflow:hidden}progress::-webkit-progress-bar{background:#2b3844}progress::-webkit-progress-value{background:var(--accent)}progress::-moz-progress-bar{background:var(--accent)}.motto{font-size:12px;color:var(--muted);margin:16px 0 0}main{padding:24px 36px 30px;min-width:0;align-self:center;width:100%}.topline{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:16px}.topline .eyebrow{font-size:12px}.puzzle-heading{display:flex;justify-content:space-between;gap:18px;min-height:110px;align-items:flex-start}h1{font-size:clamp(26px,2.8vw,38px);letter-spacing:-.035em;line-height:1.15;margin-bottom:12px}.puzzle-heading p{color:var(--muted);margin-bottom:24px}#level-number{white-space:nowrap;color:var(--muted);font-size:20px;padding-top:7px;font-variant-numeric:tabular-nums}.play-area{display:grid;grid-template-columns:minmax(0,1.75fr) minmax(240px,1fr);gap:24px}.puzzle-card{height:330px;background:var(--panel);border:1px solid #283440;border-radius:12px;display:flex;align-items:center;justify-content:center;padding:32px}.puzzle-card img{width:100%;height:100%;object-fit:contain}#answer-form{margin-top:22px}label{display:block;margin-bottom:12px}.answer-row{display:flex;gap:12px}.answer-row input{width:0;flex:1;min-width:0;border:1px solid #34414e;border-radius:8px;background:var(--panel);color:var(--text);padding:14px 16px;font-size:23px;font-variant-numeric:tabular-nums}.answer-row input::placeholder{font-size:17px;color:var(--muted)}.answer-row button{min-width:125px;font-weight:600}.answer-row button span{margin-left:10px}.keypad{display:grid;grid-template-columns:repeat(10,minmax(0,1fr)) 1.55fr;gap:5px;margin-top:18px}.keypad button{padding:9px 0}.feedback{min-height:48px;font-size:15px;color:var(--muted);margin:17px 0 0}.feedback.success{color:var(--accent)}.feedback.error{color:var(--red);animation:feedback-in .18s ease-out}@keyframes feedback-in{from{opacity:0}to{opacity:1}}.help-column{display:flex;flex-direction:column;gap:14px}.help-slot{flex:1;min-height:330px}.help-panel{background:#ebeee6;color:#2d443c;border-radius:12px;padding:18px 20px;min-height:100%;display:flex;flex-direction:column}.help-header{display:flex;align-items:center;justify-content:space-between;gap:10px}.help-header h2{color:#38584b;margin:0}.help-header button{padding:0;background:transparent;color:#2d443c;font-size:26px;width:38px}.help-header button:hover{background:#d5ddd1}.help-panel img{width:100%;height:260px;object-fit:contain;display:block;margin:10px 0 18px}.help-panel p{font-size:15px;margin:0}.paired{display:grid;grid-template-columns:1fr 1fr;gap:12px}.navigation{margin-bottom:12px}.storage-warning{border-left:3px solid #e8b96a;padding:12px;color:#e8b96a;font-size:14px;margin-top:20px}dialog{color:var(--text);background:var(--sidebar);border:1px solid #35434f;border-radius:14px;padding:28px;width:min(520px,calc(100% - 32px))}dialog::backdrop{background:#000b}dialog h2{font-size:25px}dialog p{color:var(--muted)}.dialog-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}button.danger{background:#c13938;color:white}button.danger:hover:enabled{background:#e64a47}.ending{min-height:100dvh;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:32px}.ending h1{font-size:clamp(32px,5vw,60px);margin-top:20px}.ending>p:not(.eyebrow){color:var(--muted)}.end-word{font-size:clamp(60px,12vw,110px);letter-spacing:.1em;color:var(--accent);font-weight:700;margin:42px 0 60px;animation:reveal 1.05s step-end}@keyframes reveal{0%,95%{opacity:0}100%{opacity:1}}
@media(min-width:1500px){.puzzle-card{height:390px}.help-panel img{height:320px}}
@media(max-width:1100px){.shell{grid-template-columns:210px 1fr}.sidebar{padding:26px 16px}main{padding:24px}.play-area{gap:16px;grid-template-columns:minmax(0,1.5fr) minmax(210px,1fr)}.keypad{grid-template-columns:repeat(6,1fr)}.keypad button:last-child{grid-column:span 2}.puzzle-card{padding:24px}.answer-row button{min-width:100px}.answer-row button span{display:none}.help-panel{padding:14px}.help-panel img{height:240px}}
@media(max-width:850px){.shell{display:flex;flex-direction:column}.sidebar{padding:20px 24px}.brand{margin-bottom:20px}.brand p{margin-top:3px}.sidebar h2{display:none}.levels{grid-template-columns:repeat(5,1fr);gap:6px}.level-button{font-size:14px;padding:9px;gap:6px}.pages{margin:12px auto 0;width:240px}.progress-area{padding-top:12px;display:grid;grid-template-columns:150px 1fr;gap:16px;align-items:center}.progress-area p{margin:0;font-size:14px}.progress-area .motto{display:none}main{padding:24px;align-self:stretch}.play-area{grid-template-columns:minmax(0,1.6fr) minmax(220px,1fr)}.puzzle-heading{min-height:100px}}
@media(max-width:600px){.sidebar{padding:16px}.brand{margin-bottom:14px}.brand strong{font-size:19px}.levels{grid-template-columns:repeat(5,1fr)}.level-button{font-size:12px;justify-content:center;flex-wrap:wrap;gap:4px;padding:8px 3px}.level-button .state{font-size:12px}.lock{width:11px;height:11px}main{padding:20px 16px}.topline{margin-bottom:20px}.topline .eyebrow{font-size:10px}.puzzle-heading{gap:12px}#level-number{font-size:15px}h1{font-size:28px}.puzzle-heading p{font-size:15px}.play-area{display:flex;flex-direction:column;gap:4px}.puzzle-card{height:280px;padding:24px}.keypad{grid-template-columns:repeat(6,1fr);gap:7px}.keypad button{min-height:46px}.help-column{display:grid;grid-template-columns:1fr;gap:12px}.help-slot{min-height:0;grid-row:2}.help-slot:has([hidden]){display:none}.help-panel img{height:auto;max-height:310px;min-height:120px}.navigation{margin:0}.feedback{margin-bottom:12px;min-height:42px}.answer-row input{font-size:22px}.progress-area{grid-template-columns:145px 1fr}.help-panel{padding:18px}.help-header button:focus-visible{outline-color:#275442}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}


.top-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.topline{flex-wrap:wrap}.top-actions button{font-size:14px}body{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
