/* Midnight Soft Dark. Edit the semantic tokens below to change the entire theme. */
:root {
  color-scheme: dark;
  --bg-color: #0F172A;
  --card-bg: #1E293B;
  --accent-color: #3B82F6;
  --accent-pressed: #2563EB;
  --text-main: #E2E8F0;
  --text-muted: #94A3B8;
  --border-color: #334155;
  --card-radius: 16px;
  --bg: var(--bg-color);
  --panel: var(--card-bg);
  --panel2: var(--bg-color);
  --line: var(--border-color);
  --line-soft: var(--border-color);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --dim: var(--text-muted);
  --accent: var(--accent-color);
  --accent-dark: #233552;
  --primary: var(--accent-color);
  --primary-hover: var(--accent-pressed);
  --on-primary: var(--text-main);
  --good: #93C5B5;
  --bad: #DDA6B1;
  --good-surface: #243B3C;
  --bad-surface: #3C2E40;
  --overlay: #0F172ACC;
  --panel-glass: #1E293BF5;
  --shadow: #0F172A40;
  --safe-top: env(safe-area-inset-top,0px);
  --safe-bottom: env(safe-area-inset-bottom,0px);
}
*{box-sizing:border-box}html{min-width:300px}body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,"Segoe UI",Arial,sans-serif;font-size:15px;-webkit-font-smoothing:antialiased;line-height:1.5}button,input,select{font:inherit}button,a,input{-webkit-tap-highlight-color:transparent}button,a{touch-action:manipulation}button{cursor:pointer;color:inherit;border:0}button:disabled{cursor:default;opacity:.5}button,a,summary,input{outline-offset:4px}button:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid var(--accent)}input:focus-visible{outline:2px solid var(--accent)}a{color:inherit;text-decoration:none}svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.symbols{position:absolute;width:0;height:0;overflow:hidden}[hidden]{display:none!important}h1,h2,h3,p{margin:0}h1{font-size:29px;font-weight:560;letter-spacing:-.7px;line-height:1.3}h2{font-size:21px;font-weight:550;letter-spacing:-.3px}h3{font-size:17px;font-weight:550;letter-spacing:-.2px}.site-header{background:var(--bg);border-bottom:1px solid var(--line-soft);padding-top:var(--safe-top)}.header-inner{max-width:1080px;margin:auto;display:flex;align-items:center;height:82px;padding:0 32px;gap:90px}.brand{font-size:23px;display:flex;align-items:center;gap:10px;font-weight:600;letter-spacing:-.8px}.brand-mark{display:grid;place-items:center;width:31px;height:32px;background:var(--panel2);border-radius:6px;color:var(--text);font-size:25px;line-height:1;padding-bottom:4px;font-weight:550}.site-header nav{display:flex;align-self:stretch;gap:8px}.site-header nav a{display:flex;align-items:center;padding:2px 23px 0;color:var(--muted);font-size:14px;border-bottom:2px solid transparent}.site-header nav a:hover{color:var(--text)}.site-header nav a[aria-current=page]{color:var(--text);border-color:var(--accent)}.app{max-width:1080px;margin:0 auto;padding:42px 32px calc(50px + var(--safe-bottom));min-height:75vh}.page-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:27px}.page-title>span{font-size:13px;color:var(--dim)}.catalog{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.game-card{display:flex;flex-direction:column;border:1px solid var(--line-soft);border-radius:10px;overflow:hidden;background:var(--panel);transition:border-color .18s,background .18s;min-height:285px}.game-card:hover{border-color:var(--dim);background:var(--panel2)}.card-art{height:124px;display:flex;align-items:center;justify-content:center;background:var(--panel2);position:relative;margin:0;border-bottom:1px solid var(--line-soft)}.card-art[data-art=sequence]{background:var(--panel)}.card-art[data-art=numbers]{background:var(--panel2)}.card-art[data-art=compare]{background:var(--panel)}.card-art[data-art=logic]{background:var(--panel2)}.card-copy{padding:21px 22px 19px;display:flex;flex-direction:column;flex:1}.card-title{display:flex;align-items:center;justify-content:space-between;gap:10px}.card-title svg{width:16px;color:var(--muted)}.card-copy p{font-size:13px;line-height:1.65;color:var(--muted);margin-top:9px}.card-last{font-size:11px;color:var(--muted);margin-top:17px;padding-top:12px;border-top:1px solid var(--line-soft)}.art-grid{display:grid;grid-template-columns:repeat(3,21px);gap:6px}.art-grid i{width:21px;height:21px;border:1px solid var(--line);background:var(--line-soft);border-radius:3px}.art-grid i.on{background:var(--text);border-color:var(--text)}.art-dual{display:flex;align-items:center;gap:32px}.art-wave{display:flex;align-items:center;gap:4px;height:42px}.art-wave i{display:block;width:3px;border-radius:2px;background:var(--accent);height:16px}.art-wave i:nth-child(2),.art-wave i:nth-child(6){height:27px}.art-wave i:nth-child(3),.art-wave i:nth-child(5){height:38px}.art-wave i:nth-child(4){height:20px}.art-path{display:flex;align-items:center;gap:8px}.art-path span{height:42px;width:42px;display:grid;place-items:center;border:1px solid var(--line);background:var(--panel2);color:var(--accent);border-radius:5px;font-family:monospace;font-size:18px}.art-path span:nth-child(2){background:var(--panel2);color:var(--muted)}.art-path i{width:13px;height:1px;background:var(--line)}.art-number{font-family:"SFMono-Regular",Consolas,monospace;font-size:34px;letter-spacing:7px;color:var(--accent)}.art-number span{opacity:.3}.art-comparison{font-family:"SFMono-Regular",Consolas,monospace;font-size:18px;letter-spacing:5px;line-height:1.7;color:var(--accent)}.art-comparison span{color:var(--accent)}.art-logic{display:flex;align-items:center;gap:18px;color:var(--accent);font-size:26px;font-family:Georgia,serif}.art-logic span{display:grid;place-items:center;width:45px;height:45px;border:1px solid var(--dim);border-radius:6px}.art-logic b{font-family:Arial,sans-serif;font-size:20px;font-weight:400;color:var(--muted)}.back-link{display:inline-flex;gap:8px;align-items:center;color:var(--muted);font-size:13px;margin-bottom:17px}.back-link svg{width:17px;height:17px}.back-link:hover{color:var(--text)}.game-heading{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:26px}.game-heading h1{font-size:26px}.rules-button{background:transparent;border:1px solid var(--line);padding:7px 13px;border-radius:6px;font-size:12px;color:var(--muted)}.rules-button:hover{color:var(--text);border-color:var(--dim)}.primary,.secondary{border-radius:7px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;gap:9px;padding:11px 20px;font-size:14px;font-weight:500}.primary{background:var(--accent);color:var(--panel2)}.primary:not(:disabled):hover{background:var(--text)}.secondary{background:var(--panel2);border:1px solid var(--line);color:var(--text)}.secondary:not(:disabled):hover{background:var(--line-soft)}.text-button{padding:0;background:none;color:var(--muted);font-size:12px;text-decoration:underline;text-underline-offset:4px}.icon-button{display:grid;place-items:center;width:34px;height:34px;background:transparent;border:1px solid var(--line);border-radius:6px;color:var(--muted)}.icon-button:hover{background:var(--line-soft);color:var(--text)}.game-layout{display:grid;grid-template-columns:minmax(0,1fr) 286px;gap:20px;align-items:start}.game-board-panel{background:var(--panel);border:1px solid var(--line-soft);border-radius:10px;overflow:hidden}.panel-top{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:20px 24px;border-bottom:1px solid var(--line-soft);color:var(--muted);font-size:13px;min-height:66px}.panel-top strong{font-weight:500;color:var(--text)}.panel-tools{display:flex;align-items:center;gap:14px}.settings{background:var(--panel);border:1px solid var(--line-soft);border-radius:10px;padding:23px}.settings h2{font-size:15px;margin-bottom:24px}.field{margin-bottom:23px}.field>label,.field>.label{font-size:13px;color:var(--text);display:block;margin-bottom:10px}.field small{display:block;color:var(--dim);font-size:11px;margin-top:7px;line-height:1.6}.choices{display:flex;gap:5px;padding:4px;background:var(--panel);border:1px solid var(--line-soft);border-radius:7px}.choices button{flex:1;padding:8px 5px;background:transparent;border:1px solid transparent;border-radius:4px;color:var(--muted);font-size:13px}.choices button[aria-pressed=true]{background:var(--line-soft);border-color:var(--dim);color:var(--text)}.choices button:not(:disabled):hover{color:var(--text)}.settings .primary{width:100%;margin-top:4px}.settings-note{font-size:12px;color:var(--muted);line-height:1.65;margin-bottom:22px}.setting-footer{font-size:11px;color:var(--dim);line-height:1.6;margin-top:14px}.stepper{display:flex;align-items:center;justify-content:space-between;gap:15px}.stepper button{background:var(--panel2);border:1px solid var(--line);color:var(--text);width:38px;height:38px;border-radius:6px;font-size:22px;line-height:1}.stepper output{font-size:36px;line-height:1.2;color:var(--text);font-weight:450}.range-row{display:flex;align-items:center;gap:12px}.range-row input{accent-color:var(--accent);width:100%;height:22px;cursor:pointer}.range-row output{font-size:12px;min-width:30px;color:var(--muted)}.sound-status{font-size:11px;color:var(--muted);min-height:17px;margin-top:10px}.stage{position:relative;min-height:335px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:28px}.nback-grid,.sequence-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;width:255px;aspect-ratio:1}.nback-grid>div,.sequence-grid>button{background:var(--panel2);border:1px solid var(--line);border-radius:7px;display:grid;place-items:center;aspect-ratio:1;min-width:0}.nback-grid>div.center{background:var(--panel);border-color:var(--line-soft);color:var(--dim);font-size:22px}.nback-grid>div.lit,.sequence-grid>button.lit{background:var(--text);border-color:var(--text);color:var(--line-soft)}.sequence-grid>button{color:var(--muted);font-size:12px;position:relative;opacity:1}.sequence-grid>button>span{position:absolute;bottom:7px;right:9px;opacity:.6}.sequence-grid>button:not(:disabled):hover{border-color:var(--text)}.sequence-grid>button.wrong{border-color:var(--bad);background:var(--bad-surface);color:var(--bad)}.sequence-grid>button.correct{background:var(--good-surface);border-color:var(--good)}.stage-hint{font-size:12px;line-height:1.7;color:var(--muted);text-align:center;margin-top:20px;min-height:20px}.response-buttons{display:flex;gap:12px;padding:0 24px 23px}.response-buttons button{flex:1;display:flex;align-items:center;justify-content:center;gap:11px;background:var(--line-soft);border:1px solid var(--dim);border-radius:7px;color:var(--text);padding:14px 12px;min-height:53px;font-size:14px}.response-buttons button.selected{background:var(--dim);border-color:var(--accent);color:var(--text);opacity:1}.response-buttons button:disabled{opacity:.5}.response-buttons button.selected:disabled{opacity:1}kbd{font:11px inherit;border:1px solid var(--dim);padding:1px 6px;border-radius:4px;color:var(--accent);line-height:20px}.response-buttons svg{width:18px;height:18px}.timebar{height:3px;background:var(--panel2);overflow:hidden}.timebar i{display:block;height:100%;background:var(--accent);transform-origin:left;width:100%;will-change:transform}.countdown-cover{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:var(--panel-glass);color:var(--text);font-size:76px;font-weight:350;z-index:1}.running-info{padding:24px;border:1px solid var(--line-soft);border-radius:10px;color:var(--muted);font-size:13px;line-height:1.8;background:var(--panel)}.running-info p+p{margin-top:18px}.running-info strong{font-weight:500;color:var(--text)}.running-info .secondary{width:100%;margin-top:24px;font-size:12px}.result-panel{max-width:720px;margin:auto;background:var(--panel);border:1px solid var(--line-soft);border-radius:10px;padding:32px}.result-panel h2{font-size:19px}.result-value{font-size:64px;letter-spacing:-2px;line-height:1.2;margin:20px 0 8px;font-weight:400;color:var(--text)}.result-value>span{font-size:18px;letter-spacing:0;color:var(--muted);margin-left:9px}.result-description{color:var(--muted);font-size:13px;line-height:1.7}.result-stats{display:flex;gap:28px;margin:27px 0;padding:20px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);flex-wrap:wrap}.result-stats:empty{display:none}.result-stats>div{flex:1;display:flex;flex-direction:column;gap:7px;min-width:90px}.result-stats span{color:var(--muted);font-size:12px}.result-stats strong{font-size:22px;font-weight:450}.result-actions{display:flex;gap:12px;margin-top:26px}.result-actions button{min-width:130px}.result-explainer{font-size:12px;color:var(--muted);line-height:1.75;margin-top:23px;border-top:1px solid var(--line);padding-top:16px}.result-explainer summary{cursor:pointer;color:var(--text)}.result-explainer p{margin-top:13px}.table-wrap{max-height:340px;overflow:auto;margin-top:15px}table{border-collapse:collapse;width:100%;font-size:11px;white-space:nowrap}td,th{text-align:left;padding:9px 10px;border-bottom:1px solid var(--line-soft)}th{color:var(--text);font-weight:500}.good{color:var(--good)}.bad{color:var(--bad)}.error{color:var(--bad);font-size:12px;margin:14px 0;line-height:1.6}.numbers-stage{min-height:340px}.number-display{font-family:"SFMono-Regular",Consolas,monospace;font-size:clamp(22px,5vw,44px);letter-spacing:3px;color:var(--text);max-width:100%;text-align:center;overflow-wrap:anywhere}.number-form{width:100%;max-width:340px}.number-form label{display:block;font-size:13px;color:var(--muted);margin-bottom:12px}.number-input{display:block;width:100%;background:var(--panel);color:var(--text);border:1px solid var(--dim);border-radius:7px;padding:14px;font-size:25px;font-family:monospace;letter-spacing:2px;text-align:center;margin-bottom:18px}.number-form .primary{width:100%}.number-feedback{text-align:center;line-height:1.7}.number-feedback h3{font-size:17px;margin-bottom:10px}.number-feedback p{font-size:13px;color:var(--muted)}.number-feedback .primary{margin-top:22px}.digit-review{display:flex;flex-wrap:wrap;gap:25px;margin-top:20px;font-size:13px;color:var(--muted)}.digit-review code{font-family:monospace;font-size:18px;color:var(--text);display:block;margin-top:7px;overflow-wrap:anywhere}.compare-stage{min-height:300px}.symbol-lines{font-family:"SFMono-Regular",Consolas,monospace;font-size:32px;letter-spacing:7px;color:var(--text);line-height:2;text-align:center;padding-left:7px;user-select:none}.compare-feedback{height:23px;font-size:12px;margin-top:20px;color:var(--muted)}.compare-feedback.good{color:var(--good)}.compare-feedback.bad{color:var(--bad)}.logic-panel{max-width:800px;margin:auto;border:1px solid var(--line-soft);border-radius:10px;background:var(--panel);padding:0;overflow:hidden}.logic-conditions{padding:29px 30px 0}.logic-conditions .condition-label{font-size:12px;color:var(--muted);margin-bottom:14px}.logic-conditions ol{padding-left:20px;margin:0;font-size:15px;line-height:1.8;color:var(--text)}.logic-conditions li+li{margin-top:7px}.logic-claim{margin:25px 30px 22px;padding:20px 22px;border-left:2px solid var(--accent);background:var(--panel2);font-size:17px;line-height:1.6}.logic-answers{display:grid;grid-template-columns:1fr;gap:9px;padding:0 30px 27px}.logic-answers button{display:flex;align-items:center;gap:14px;background:var(--panel2);border:1px solid var(--line);padding:14px 16px;border-radius:7px;font-size:14px;text-align:left;min-height:50px}.logic-answers button:not(:disabled):hover{background:var(--line-soft);border-color:var(--accent)}.logic-answers button:disabled{opacity:.7}.logic-answers button.is-correct{border-color:var(--good);background:var(--good-surface);color:var(--good);opacity:1}.logic-answers button.is-wrong{border-color:var(--bad);background:var(--bad-surface);color:var(--bad);opacity:1}.logic-explanation{padding:0 30px 28px;font-size:14px;line-height:1.75;color:var(--accent)}.logic-explanation>strong{display:block;margin-bottom:9px;color:var(--text);font-weight:500}.logic-explanation button{margin-top:20px}.logic-review{font-size:13px;color:var(--accent);line-height:1.7;margin-top:16px}.logic-review article{border-top:1px solid var(--line-soft);padding:17px 0}.logic-review strong{font-weight:500;display:block;margin-bottom:7px}.logic-review p{font-size:12px;color:var(--muted)}.logic-review .review-answer{font-size:12px;margin:8px 0}.logic-setup{max-width:660px;margin:auto;border:1px solid var(--line-soft);border-radius:10px;background:var(--panel);padding:30px}.logic-setup>p{color:var(--muted);line-height:1.75;font-size:14px;margin-bottom:25px}.logic-setup .field{max-width:280px}.logic-setup .primary{min-width:180px}.empty-section{max-width:700px;border:1px solid var(--line-soft);background:var(--panel);border-radius:10px;padding:32px;margin-top:27px;display:flex;align-items:center;gap:21px}.empty-section svg{width:30px;height:30px;color:var(--muted)}.empty-section p{font-size:14px;color:var(--muted);line-height:1.8}.subscription-card{max-width:560px;border:1px solid var(--line-soft);background:var(--panel);border-radius:10px;padding:30px}.subscription-card h2{font-size:18px;margin-bottom:13px}.subscription-card p{color:var(--muted);font-size:14px;line-height:1.8}.subscription-card .primary,.subscription-card .secondary{margin-top:25px;min-width:180px}.subscription-row{display:flex;justify-content:space-between;gap:15px;padding:19px 0;border-bottom:1px solid var(--line);font-size:13px}.subscription-row:last-of-type{margin-bottom:8px}.subscription-row span{color:var(--muted)}.subscription-row strong{font-weight:500}.dialog{width:min(460px,calc(100% - 32px));padding:28px;border-radius:10px;border:1px solid var(--line);background:var(--panel2);color:var(--text);max-height:calc(100dvh - 32px);overflow:auto;box-shadow:0 24px 90px var(--overlay)}.dialog::backdrop{background:var(--overlay);backdrop-filter:blur(3px)}.dialog-top{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:20px}.dialog h2{font-size:21px}.dialog>p{font-size:14px;color:var(--muted);line-height:1.75;margin:18px 0 0}.dialog-actions{display:flex;gap:10px;margin-top:25px}.dialog-actions button{flex:1}.rules-body{font-size:14px;color:var(--text);line-height:1.8;margin-bottom:25px}.rules-body p+p{margin-top:15px}.rules-body ul{padding-left:20px;margin:12px 0}.rules-body .rule-example{background:var(--panel);border:1px solid var(--line);border-radius:6px;padding:15px;margin:17px 0;font-size:13px}.dialog>.primary{width:100%}.noscript{margin:30px;padding:20px;background:var(--panel)}.single-board{max-width:680px;margin:auto}.sequence-idle{color:var(--muted)}.mobile-only{display:none}.running .settings{display:none}.running .game-layout{align-items:start}.paused .stage{filter:blur(6px)}
@media(max-width:920px){.catalog{grid-template-columns:repeat(2,minmax(0,1fr))}.header-inner{gap:65px}.game-layout{grid-template-columns:minmax(0,1fr) 250px;gap:16px}.settings{padding:20px}.stage{padding:24px}.nback-grid,.sequence-grid{width:238px}.response-buttons button{font-size:13px}.response-buttons kbd{display:none}.card-art{height:116px}.game-card{min-height:269px}.symbol-lines{font-size:28px;letter-spacing:5px}}
@media(max-width:650px){.header-inner{padding:0 20px;gap:0;flex-wrap:wrap;height:auto}.brand{height:62px;font-size:22px;width:100%}.brand-mark{width:28px;height:29px;font-size:24px}.site-header nav{width:100%;gap:0;height:47px}.site-header nav a{flex:1;justify-content:center;padding:0 10px;font-size:13px}.app{padding:27px 20px calc(32px + var(--safe-bottom))}h1{font-size:26px}.page-title{margin-bottom:22px}.page-title>span{font-size:12px}.catalog{gap:13px}.game-card{border-radius:8px;min-height:0}.card-art{height:99px}.card-copy{padding:16px 15px 18px}.card-title h3{font-size:15px}.card-title svg{display:none}.card-copy p{font-size:12px;line-height:1.65;margin-top:8px}.card-last{font-size:10px;padding-top:9px;margin-top:12px}.art-grid{grid-template-columns:repeat(3,16px);gap:4px}.art-grid i{width:16px;height:16px;border-radius:2px}.art-dual{gap:14px}.art-wave{gap:3px}.art-wave i{width:2px}.art-wave i:nth-child(3),.art-wave i:nth-child(5){height:27px}.art-wave i:nth-child(2),.art-wave i:nth-child(6){height:19px}.art-path{gap:5px}.art-path span{width:28px;height:31px;font-size:14px}.art-path i{width:7px}.art-number{font-size:24px;letter-spacing:3px}.art-comparison{font-size:15px;letter-spacing:3px}.art-logic{gap:10px}.art-logic span{width:33px;height:35px;font-size:23px}.game-heading{margin-bottom:20px}.game-heading h1{font-size:22px;letter-spacing:-.5px}.rules-button{font-size:11px;padding:6px 10px;flex-shrink:0}.back-link{font-size:12px;margin-bottom:14px}.game-layout{display:flex;flex-direction:column;gap:15px}.game-board-panel{width:100%;border-radius:8px}.settings{order:-1;width:100%;padding:22px;border-radius:8px}.settings h2{margin-bottom:20px}.settings .field{margin-bottom:20px}.settings-note{font-size:13px;margin-bottom:20px}.stage{min-height:320px;padding:23px}.panel-top{padding:15px 19px;min-height:58px;font-size:12px}.nback-grid,.sequence-grid{width:min(62vw,255px);gap:8px}.response-buttons{padding:0 17px 20px;gap:10px}.response-buttons button{padding:12px 9px;font-size:13px;gap:8px;min-height:54px}.response-buttons svg{width:16px}.running-info{display:none}.running .stage{min-height:300px}.running .site-header .brand{display:none}.running .site-header nav{height:50px}.running .app{padding-top:19px}.running .back-link{margin-bottom:10px}.running .game-heading{margin-bottom:16px}.stage-hint{font-size:11px;margin-top:16px}.result-panel{padding:24px 20px}.result-value{font-size:55px}.result-stats{gap:18px}.result-stats>div{min-width:70px}.result-stats span{font-size:11px}.result-stats strong{font-size:20px}.result-actions button{flex:1;min-width:0}.result-description{font-size:12px}.symbol-lines{font-size:26px;letter-spacing:4px}.compare-stage{min-height:290px}.number-display{font-size:32px;letter-spacing:2px}.number-form{max-width:310px}.number-form label{font-size:12px}.logic-setup{padding:24px}.logic-setup>p{font-size:13px}.logic-setup .field{max-width:none}.logic-setup .primary{width:100%}.logic-conditions{padding:22px 22px 0}.logic-conditions ol{font-size:14px;line-height:1.8;padding-left:17px}.logic-conditions .condition-label{font-size:11px}.logic-claim{margin:21px 22px;padding:16px 17px;font-size:15px}.logic-answers{padding:0 22px 22px;gap:8px}.logic-answers button{font-size:13px;padding:13px;gap:11px}.logic-explanation{padding:0 22px 24px;font-size:13px}.logic-explanation button{width:100%}.empty-section{padding:25px 22px;align-items:flex-start;gap:17px}.empty-section p{font-size:13px}.empty-section svg{width:25px;height:25px}.subscription-card{padding:25px}.subscription-card p{font-size:13px}.subscription-row{font-size:12px}.subscription-card .primary,.subscription-card .secondary{width:100%}.dialog{padding:24px}.dialog h2{font-size:20px}.dialog>p,.rules-body{font-size:13px}.dialog-actions{flex-direction:column}.dialog-actions button{width:100%}}
@media(max-width:370px){.app{padding-left:15px;padding-right:15px}.header-inner{padding-left:15px;padding-right:15px}.catalog{grid-template-columns:1fr}.game-card{display:grid;grid-template-columns:103px minmax(0,1fr)}.card-art{height:100%;min-height:138px;border:0;border-right:1px solid var(--line-soft)}.art-dual{gap:0}.art-wave{display:none}.art-path{gap:3px}.art-path i{width:3px}.art-path span{width:22px;height:27px}.art-comparison{font-size:13px;letter-spacing:2px}.art-number{font-size:21px;letter-spacing:2px}.art-logic{gap:5px}.art-logic span{width:27px;height:30px}.game-heading h1{font-size:20px}.response-buttons button{font-size:12px}.symbol-lines{font-size:23px;letter-spacing:3px}.logic-conditions{padding-left:18px;padding-right:18px}.logic-claim{margin-left:18px;margin-right:18px}.logic-answers{padding-left:18px;padding-right:18px}}
@media(max-height:740px) and (max-width:650px){.running .app{padding-top:14px}.running .back-link{margin-bottom:7px}.running .game-heading{margin-bottom:12px}.running .stage{min-height:245px;padding:17px}.running .nback-grid,.running .sequence-grid{width:205px}.running .stage-hint{margin-top:12px}.running .panel-top{min-height:52px;padding-top:12px;padding-bottom:12px}.running .response-buttons{padding-bottom:16px}}
@media(max-width:520px){.catalog{grid-template-columns:1fr;gap:12px}.game-card{display:grid;grid-template-columns:103px minmax(0,1fr)}.card-art{height:100%;min-height:138px;border:0;border-right:1px solid var(--line-soft)}.card-copy{min-width:0;padding:16px}.card-title h3{overflow-wrap:anywhere}.art-dual{gap:0}.art-wave{display:none}.art-path{gap:3px}.art-path i{width:3px}.art-path span{width:22px;height:27px}.art-comparison{font-size:13px;letter-spacing:2px}.art-number{font-size:21px;letter-spacing:2px}.art-logic{gap:5px}.art-logic span{width:27px;height:30px}.card-last{margin-top:11px}.card-copy p{margin-top:7px}}
.header-inner{gap:46px}.language-switch{display:flex;align-items:center;gap:3px;margin-left:auto;border:1px solid var(--line);border-radius:6px;padding:3px;flex-shrink:0}.language-switch button{background:transparent;color:var(--muted);min-width:36px;min-height:32px;padding:4px 7px;border-radius:3px;font-size:11px;letter-spacing:.3px}.language-switch button[aria-pressed=true]{background:var(--line-soft);color:var(--text)}.tests-section{margin-top:40px}.tests-section h2,.profile-section>h2,.section-heading h2{font-size:19px;margin-bottom:17px}.tests-placeholder{padding:23px 25px;border:1px solid var(--line-soft);border-radius:8px;color:var(--muted);font-size:13px;background:var(--panel)}.profile-top-grid{display:grid;grid-template-columns:1.2fr 1fr;gap:20px}.account-card,.iq-card{border:1px solid var(--line-soft);border-radius:9px;padding:27px;background:var(--panel);min-width:0}.account-heading{display:flex;align-items:center;gap:16px;margin-bottom:18px}.profile-avatar{display:grid;place-items:center;width:48px;height:48px;flex-shrink:0;border:1px solid var(--line);background:var(--line-soft);border-radius:9px;font-size:23px;color:var(--text)}.account-heading>div:last-child{min-width:0}.account-heading h2{font-size:20px;overflow-wrap:anywhere}.account-heading p{font-size:12px;color:var(--dim);margin-top:3px}.profile-storage-status{font-size:12px;color:var(--muted);line-height:1.65;margin-top:23px}.profile-device-note{margin-top:12px;font-size:12px;color:var(--dim);line-height:1.7;max-width:400px}.account-card [data-sync]{margin-top:11px}.iq-card{display:flex;flex-direction:column}.iq-card h2{font-size:16px;font-weight:500;color:var(--text)}.iq-value{font-size:63px;line-height:1.35;color:var(--text);font-weight:350;flex:1;display:flex;align-items:center}.iq-card p{font-size:13px;color:var(--muted);line-height:1.7;max-width:310px}.profile-section{margin-top:34px}.section-heading p{font-size:12px;color:var(--muted);margin:-7px 0 18px}.records-list{display:flex;flex-direction:column;gap:10px}.record-card{border:1px solid var(--line-soft);border-radius:8px;background:var(--panel);overflow:hidden}.record-main{display:flex;align-items:center;gap:22px;padding:21px 24px;min-width:0}.record-game{font-size:15px;font-weight:500;flex:1;overflow-wrap:anywhere}.record-game:hover{color:var(--accent)}.record-score{text-align:right;display:flex;flex-direction:column;gap:4px;min-width:0}.record-score strong{font-size:17px;font-weight:500;color:var(--text)}.record-score span{font-size:11px;color:var(--muted)}.record-modes{border-top:1px solid var(--line-soft);padding:13px 24px;font-size:12px;color:var(--muted)}.record-modes summary{cursor:pointer}.record-modes>div{display:flex;justify-content:space-between;gap:20px;margin-top:15px;padding-top:12px;border-top:1px solid var(--line-soft)}.record-modes strong{font-weight:500;color:var(--text);white-space:nowrap}.profile-subscriptions{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-top:34px;padding:25px;border:1px solid var(--line-soft);background:var(--panel);border-radius:8px}.profile-subscriptions:hover{border-color:var(--dim)}.profile-subscriptions h2{font-size:17px}.profile-subscriptions p{font-size:13px;color:var(--muted);margin-top:7px}.profile-subscriptions>svg{color:var(--muted)}.profile-source{margin-top:22px;display:flex;justify-content:flex-end}.profile-source a{font-size:12px;color:var(--dim);display:flex;gap:8px;align-items:center}.profile-source a:hover{color:var(--text)}.profile-source svg{width:15px;height:15px}#nickname-form{margin-top:22px}#nickname-form label{display:block;font-size:13px;color:var(--muted);margin-bottom:9px}#nickname-input{width:100%;padding:12px;background:var(--panel);border:1px solid var(--dim);border-radius:6px;color:var(--text)}
@media(max-width:920px){.header-inner{gap:28px}.site-header nav a{padding-left:17px;padding-right:17px}}
@media(max-width:650px){.header-inner{position:relative;gap:0}.brand{padding-right:93px}.language-switch{position:absolute;right:20px;top:13px}.language-switch button{min-height:30px;min-width:34px}.running .site-header .brand{display:flex;height:53px}.running .language-switch{top:8px}.running .site-header nav{height:47px}.site-header nav a{padding:0 5px;font-size:12px}.profile-top-grid{grid-template-columns:1fr;gap:14px}.account-card,.iq-card{padding:23px}.account-heading h2{font-size:19px}.profile-storage-status{margin-top:19px}.iq-value{font-size:53px;min-height:85px}.profile-section{margin-top:28px}.profile-section>h2,.section-heading h2,.tests-section h2{font-size:18px}.tests-placeholder{padding:20px 22px;font-size:12px}.record-main{gap:12px;padding:18px;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start}.record-game{font-size:14px;grid-column:1;grid-row:1}.record-score{grid-column:1;grid-row:2;text-align:left;gap:5px}.record-score strong{font-size:19px}.record-main>.icon-button{grid-column:2;grid-row:1/3;align-self:center}.record-modes{padding:13px 18px}.record-modes>div{flex-wrap:wrap;gap:5px}.profile-subscriptions{margin-top:28px;padding:22px}.profile-device-note{font-size:11px}.profile-source{justify-content:flex-start}.section-heading p{font-size:11px}.tests-section{margin-top:30px}}
@media(max-width:370px){.language-switch{right:15px}.site-header nav a{font-size:11px}.header-inner{padding-left:15px;padding-right:15px}.profile-top-grid{gap:12px}.account-card,.iq-card{padding:21px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}

.profile-avatar{position:relative;overflow:hidden}.profile-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:var(--surface)}.profile-source{display:flex;gap:24px;flex-wrap:wrap}

/* Quiet, flat surfaces and restrained accents. */
body{background:var(--bg);min-height:100vh}
.site-header{background:var(--panel-glass);backdrop-filter:blur(16px)}
.brand-mark{background:var(--accent-dark);color:var(--accent);border:1px solid var(--line)}
.site-header nav a[aria-current=page]{color:var(--accent);border-color:var(--accent)}
.primary{background:var(--primary);color:var(--on-primary);box-shadow:none}
.primary:not(:disabled):hover{background:var(--primary-hover)}
.game-card:hover{border-color:var(--accent);box-shadow:none}
.card-art,.card-art[data-art]{background:var(--panel)}
.art-grid i.on{background:var(--accent);border-color:var(--accent);box-shadow:none}
.art-path span,.art-logic span{border-color:var(--line);color:var(--accent)}
.art-number,.art-comparison{color:var(--text)}.art-comparison span{color:var(--accent)}
.language-switch button[aria-pressed=true]{color:var(--accent);background:var(--accent-dark);border-color:var(--line)}
.profile-avatar{background:var(--accent-dark);color:var(--accent)}
.profile-avatar img{background:var(--panel)}
/* Test storefront */
.shop-note{color:var(--muted);font-size:14px;margin:-8px 0 28px;max-width:700px}
.mock-label{color:var(--accent)!important;font-size:11px!important;letter-spacing:.04em;border:1px solid var(--line);border-radius:6px;padding:4px 9px;display:inline-flex;align-items:center;width:fit-content}
.shop-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:24px;align-items:start}
.product-list{display:grid;gap:16px}
.product-card{width:100%;display:flex;align-items:center;gap:18px;padding:28px 24px;text-align:left;border:1px solid var(--line-soft);border-radius:14px;background:var(--panel);color:var(--text)}
.product-card:hover{border-color:var(--line)}
.product-card.selected{border-color:var(--accent);background:var(--accent-dark);box-shadow:none}
.product-icon{color:var(--accent);font-size:38px;line-height:1}
.product-copy{display:flex;flex-direction:column;gap:9px;flex:1}.product-copy strong{font-size:19px;font-weight:600}.product-copy>span{font-size:13px;color:var(--muted)}
.product-check{display:grid;place-items:center;width:27px;height:27px;border:1px solid var(--line);border-radius:50%;color:var(--accent);flex-shrink:0}
.checkout{padding:26px;border:1px solid var(--line-soft);border-radius:14px;background:var(--panel)}
.checkout h2{font-size:17px;margin-bottom:19px}
.payment-methods{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-bottom:26px}
.payment-methods button{display:flex;flex-direction:column;align-items:center;gap:8px;background:var(--bg);border:1px solid var(--line-soft);border-radius:9px;padding:14px 4px;font-size:11px;white-space:nowrap;color:var(--muted)}
.payment-methods button>span{font-size:23px;line-height:1;color:var(--accent)}
.payment-methods button[aria-pressed=true]{background:var(--accent-dark);border-color:var(--accent);color:var(--text)}
.checkout-row{display:flex;justify-content:space-between;gap:12px;padding:14px 0;border-top:1px solid var(--line-soft);font-size:12px;color:var(--muted)}
.checkout-row strong{color:var(--text);font-weight:500;text-align:right}.checkout-row.total{align-items:center}.total strong{font-size:27px;font-weight:600;color:var(--accent)}
.checkout-pay{width:100%;min-height:50px;margin-top:13px}.checkout-disclaimer{font-size:11px;color:var(--dim);text-align:center;margin-top:13px;line-height:1.7}
.premium-badge{display:inline-flex;width:fit-content;align-items:center;gap:6px;padding:5px 12px;border:1px solid var(--accent);border-radius:100px;color:var(--accent);font-size:12px;font-weight:600;background:var(--accent-dark)}
.premium-badge:before{content:'✦';font-size:14px}
.premium-profile{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-top:22px;color:var(--muted);font-size:11px}.premium-profile small{width:100%;font-size:11px}
.premium-test-status{display:flex;align-items:center;gap:15px;flex-wrap:wrap;margin-top:24px;font-size:12px;color:var(--muted)}
.purchase-dialog{text-align:center;max-width:430px}.purchase-dialog h2{margin:20px 0 10px}.purchase-dialog>p{color:var(--muted);font-size:14px;line-height:1.7;margin-bottom:20px}.purchase-dialog .premium-badge{margin:0 auto 12px}.purchase-dialog .mock-label{margin:0 auto 24px;display:flex}.purchase-dialog>button{width:100%;margin-top:10px}
.success-mark{width:64px;height:64px;display:grid;place-items:center;font-size:30px;background:var(--accent-dark);border:1px solid var(--accent);color:var(--accent);border-radius:50%;margin:auto}
@media(max-width:760px){.shop-layout{grid-template-columns:1fr}.shop-layout .checkout{max-width:none}.product-card{padding:23px 20px}.shop-note{font-size:13px}.page-title{gap:15px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* Shared card geometry, including compact layouts. */
.game-card,.game-board-panel,.settings,.running-info,.result-panel,.logic-panel,
.logic-setup,.empty-section,.subscription-card,.dialog,.tests-placeholder,
.account-card,.iq-card,.record-card,.profile-subscriptions,
.product-card,.checkout{border-radius:var(--card-radius)}
.primary:not(:disabled):active{background:var(--accent-pressed)}
.site-header nav a[aria-current=page],.language-switch button[aria-pressed=true],
.mock-label,.premium-badge,.total strong,.logic-explanation,.logic-review{color:var(--text-main)!important}

.test-categories{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.test-category{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:25px;background:var(--card-bg);border:1px solid var(--border-color);border-radius:16px;min-height:100px}.test-category strong{font-weight:500}.test-category:hover{border-color:var(--accent-color)}.daily-policy,.shop-support{margin-top:20px;font-size:13px;color:var(--text-muted)}.tests-placeholder .secondary{margin-top:20px}@media(max-width:650px){.test-categories{grid-template-columns:1fr}.test-category{min-height:80px}}

/* Server-confirmed Stars purchase screen. */
.payment-success{max-width:560px;margin:40px auto;padding:40px 24px;text-align:center;border:1px solid #94784d;border-radius:24px;background:radial-gradient(ellipse at top,#443824 0%,#171717 65%);color:#f6f1e7}
.payment-success-star{font-size:80px;color:#f3cf85;text-shadow:0 0 45px #d8a54c80}
.payment-success h1{font-size:30px;line-height:1.2;margin:24px 0 16px}
.payment-success p{color:#d6cbb8;line-height:1.6}
.payment-success .primary,.payment-success .secondary{display:block;width:100%;box-sizing:border-box;margin-top:16px}

/* Relational Training: reuse the existing logic panels and controls. */
.relational-progress{display:block;width:100%;height:4px;margin:0 0 24px;border:0;accent-color:var(--accent);}
.logic-setup [data-section] .choices{flex-wrap:wrap;}
.logic-setup [data-section] .choices button{white-space:normal;}
.logic-setup [data-section].field{max-width:none;width:100%;}
.logic-setup [data-section] .choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;}
.game-card[href="#game/relational"] .card-title{flex-wrap:wrap;}
@media(max-width:360px){.logic-setup [data-section] .choices{grid-template-columns:minmax(0,1fr);}}

/* Statistics use the existing theme. */
.statistics-page{min-width:0}.statistics-page p,.statistics-kpi span{color:var(--muted)}.statistics-page h2{font-size:18px}.statistics-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:18px 0}.statistics-kpi,.statistics-panel{background:var(--panel);border:1px solid var(--line-soft);border-radius:var(--card-radius);padding:18px;min-width:0}.statistics-kpi span{display:block;font-size:13px}.statistics-kpi strong{display:block;font-size:24px;margin-top:8px;overflow-wrap:anywhere}.statistics-panel{margin:14px 0;overflow-wrap:anywhere}.statistics-chart{display:block;width:100%;height:auto;max-height:220px}.statistics-panel input[type=range]{width:100%;accent-color:var(--accent)}.statistics-panel output{display:block;color:var(--muted);font-size:14px}.statistics-calendar{display:grid;grid-template-columns:repeat(13,minmax(0,1fr));gap:5px}.statistics-calendar button{aspect-ratio:1;background:var(--accent);opacity:var(--intensity);padding:0;min-height:0;border:0;border-radius:4px}.statistics-calendar button:focus{opacity:1;outline:2px solid var(--text)}.statistics-distribution{display:grid;grid-template-columns:minmax(0,1fr) 30% 25px;align-items:center;gap:10px;padding:9px 0;font-size:14px}.statistics-distribution meter{width:100%}.statistics-history summary{display:flex;justify-content:space-between;gap:15px;cursor:pointer}.statistics-history small{display:block;color:var(--muted);margin-top:6px}.statistics-lock{text-align:center;padding:38px 20px;overflow:hidden}.statistics-preview{filter:blur(9px);opacity:.35;height:70px;display:flex;gap:18px;align-items:end}.statistics-preview i{background:var(--accent);width:30%;height:50%}.statistics-preview i:nth-child(2){height:100%}.statistics-preview i:nth-child(3){height:75%}.statistics-skeleton{height:240px;border-radius:16px;background:linear-gradient(100deg,var(--panel),var(--line),var(--panel));background-size:200%;animation:stats-loading 1.5s infinite}.statistics-period{margin-top:25px}.statistics-period button{min-height:44px;white-space:normal}@keyframes stats-loading{to{background-position:200%}}@media(max-width:480px){.statistics-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.statistics-kpi,.statistics-panel{padding:14px}.statistics-kpi strong{font-size:22px}}@media(prefers-reduced-motion:reduce){.statistics-skeleton{animation:none}}

.profile-level{margin-top:18px;padding-top:14px;border-top:1px solid var(--line-soft)}.profile-level-labels{display:flex;justify-content:space-between;font-size:12px;color:var(--muted)}.profile-level progress{display:block;width:100%;height:4px;margin:8px 0;appearance:none;border:0;border-radius:2px;overflow:hidden;background:var(--panel2);color:#89966b}.profile-level progress::-webkit-progress-bar{background:var(--panel2)}.profile-level progress::-webkit-progress-value{background:#89966b}.profile-level progress::-moz-progress-bar{background:#89966b}.profile-level>p{font-size:11px;color:var(--muted)}

/* Duels reuse the catalog, logic panels, account cards and semantic theme tokens. */
.duels-page{max-width:850px;margin:auto}.duel-intro{color:var(--muted);margin-bottom:22px}.duel-modes,.duel-players{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:20px 0}.duel-modes .game-card{min-height:0;text-align:left;appearance:none;font:inherit;color:inherit}.duel-modes .is-selected{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}.duel-setup{margin-top:20px}.duel-setup select{display:block;width:100%;padding:10px 12px;margin-top:8px;background:var(--panel2);color:var(--text);border:1px solid var(--line);border-radius:8px}.duel-message{min-height:24px;color:var(--muted);margin:14px 0;overflow-wrap:anywhere}.duel-message.error{color:var(--bad)}.duel-invite{margin-top:24px;padding:20px;background:var(--panel);border-radius:var(--card-radius);border:1px solid var(--line-soft)}.duel-invite h2{font-size:17px}.duel-link{display:block;overflow-wrap:anywhere;user-select:text;color:var(--accent);margin:12px 0 16px}.duel-invite .back-link{margin-top:14px;margin-bottom:0}.duel-players .account-card{min-width:0;padding:18px}.duel-players h3{overflow-wrap:anywhere}.duel-stats{margin:18px 0 0}.duel-stats>div{display:flex;justify-content:space-between;gap:10px;padding:5px 0}.duel-stats dt{color:var(--muted)}.duel-stats dd{margin:0;font-variant-numeric:tabular-nums;white-space:nowrap}.duel-outcome{color:var(--accent);margin-top:12px}.duel-history .profile-subscriptions{padding:14px 16px;margin-top:10px;gap:12px}.duel-history .profile-subscriptions span:last-child{font-size:12px;color:var(--muted)}.duel-players .profile-avatar img{object-fit:cover}.duel-players .account-heading{min-width:0}.duel-invite .dialog-actions{flex-wrap:wrap}
@media(max-width:520px){.duel-modes{gap:10px}.duel-modes .game-card{display:block}.duel-modes .card-copy{padding:15px}.duel-players{grid-template-columns:1fr}.duel-stats{font-size:14px}.duel-invite{padding:16px}.duel-modes h3{font-size:15px}}
