/* Shared finishing layer for the current TypeToad application. */
:root{--content-width:1200px;--page-gutter:clamp(32px,7vw,96px);--ui-radius:16px;--ui-ease:cubic-bezier(.2,.8,.2,1)}
html{scrollbar-gutter:stable}
body{font-size:16px;line-height:1.5}
body>header,body>main,#practice-page,#settings-page,#account-page,#leaderboard-page,#racing-page,#journey-page,#test-results-page,#focused-practice-page,.race-resume{width:min(var(--content-width),calc(100% - var(--page-gutter)));margin-inline:auto}
body>header{position:sticky;top:0;align-items:center;padding:14px 0 12px;background:var(--page);min-height:0}
body>header .brand{width:auto;flex:0 0 auto;gap:10px;margin-right:22px;padding:0 4px;height:48px;justify-content:flex-start}
body>header .brand img{width:44px;height:44px}
.brand-name{font-size:21px;letter-spacing:-.05em;font-weight:700;color:var(--ink)}
body>header nav{gap:5px;align-items:center}
body>header nav>button{flex-direction:row;gap:7px;min-height:44px;height:auto;padding:10px 12px;font-size:14px;background:var(--surface);color:var(--muted);border-radius:11px;transition:background .16s var(--ui-ease),color .16s var(--ui-ease)}
body>header nav svg{width:21px;height:21px}
body>header nav>button:hover{background:var(--button);color:var(--ink)}
body>header nav>button[aria-current="page"]{background:var(--lime);color:var(--page)}
header .nav-label small{display:none}
header .nav-label{font-weight:550}
.header-community{padding-top:10px;gap:10px}
.header-community button{min-height:34px;padding:7px 11px;background:var(--surface);font-weight:500}
.header-community button:hover{background:var(--button)}
#header-streak{gap:9px}#header-streak strong{font-size:14px}#header-streak-status{font-size:13px}
#find-people{font-size:13px;font-weight:500;color:var(--muted)}
body>main{padding-bottom:52px}
#settings-page,#account-page,#leaderboard-page,#racing-page,#journey-page,#test-results-page,#focused-practice-page{padding-top:28px}
body>main:not([hidden]):not(#practice-page){animation:page-reveal .18s var(--ui-ease)}
@keyframes page-reveal{from{opacity:.6}to{opacity:1}}
.page-heading{align-items:center;gap:20px;margin-bottom:18px}
.page-heading h1,#settings-title,#account-title,#board-title,#racing-page h1,#journey-page h1,#results-title{font-size:clamp(28px,3.4vw,40px);font-weight:650;line-height:1.15;letter-spacing:-.045em;margin:0 0 10px}
body h1:focus,body h2:focus{outline:none}
.page-heading p,.board-note,.moon-subtitle{font-size:16px;max-width:68ch}
.page-heading>button{background:var(--surface);color:var(--muted);font-size:14px}
body button{min-height:40px;transition:background .16s var(--ui-ease),color .16s var(--ui-ease),transform .12s var(--ui-ease)}
body button:not(:disabled):active{transform:translateY(1px)}
body button:disabled{cursor:default}
body button:focus-visible{outline:0!important;box-shadow:none!important;text-decoration:underline;text-underline-offset:4px;background:var(--hover);color:var(--ink)}
body button[aria-pressed="true"]:focus-visible,body header nav>button[aria-current="page"]:focus-visible{background:var(--lime);color:var(--page)}
body header .brand:focus-visible{outline:0;background:var(--button)}
body input:not([type=range]):not([type=checkbox]):focus-visible{outline:0;background:var(--hover)}
body a:not(.brand):focus-visible{outline:0;text-decoration:underline;text-underline-offset:4px;background:var(--button)}
#practice-page{padding-top:28px}
#practice-page .options{gap:12px 16px;align-items:center}
#practice-page .option-group{padding:4px;gap:3px;background:var(--surface);border-radius:12px}
#practice-page .options button{font-size:14px;min-height:36px;padding:8px 12px;background:transparent;color:var(--muted);border-radius:8px}
#practice-page .options button:hover{background:var(--button);color:var(--ink)}
#practice-page .options button[aria-pressed="true"]{background:var(--button);color:var(--ink)}
#practice-page .options [data-mode][aria-pressed="true"]{background:var(--lime);color:var(--page)}
#practice-page .options button:disabled{opacity:.45}
#practice-page #journey-strip button{background:var(--surface)}
#practice-page .toolbar .metrics{padding:4px 0 0;color:var(--muted)}
#practice-page .metrics small{font-size:13px}#practice-page .metrics strong{font-variant-numeric:tabular-nums}
#practice-page .controls{padding-top:20px}
#practice-page .controls #status{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.keyboard-hint{font-size:13px;line-height:1.7}
.keyboard-hint kbd{font:inherit;background:var(--surface);padding:3px 6px;color:var(--ink);border-radius:5px}
#restart{display:flex;align-items:center;gap:8px;background:var(--surface);font-size:14px}
#settings-page .save-note{font-size:13px;margin:0 0 14px}
#settings-page .settings-bar{top:var(--header-height,120px);padding:10px 0;margin:0 0 6px;gap:6px;width:100%;flex-wrap:wrap}
#settings-page .settings-bar button{background:var(--surface);font-size:14px;min-height:42px;padding:10px 16px}
#settings-page .settings-bar button[aria-pressed="true"]{background:var(--lime);color:var(--page)}
.settings-section{border-radius:var(--ui-radius);padding:28px;margin-top:20px}
.settings-section>h2{font-size:23px;letter-spacing:-.025em;font-weight:600;margin:0 0 6px}
.settings-section>p{font-size:15px;max-width:72ch;line-height:1.65}
#settings-page .audio-row{display:grid;grid-template-columns:180px minmax(0,1fr);gap:24px;padding:20px 0;align-items:start}
#settings-page label.audio-row{align-items:center}
#settings-page .audio-row>.sound-options{max-width:none;justify-content:flex-start;align-items:flex-start;gap:10px}
#settings-page .sound-options [role=group]{display:flex;flex-wrap:wrap;gap:6px}
#settings-page .sound-options button,#settings-page .cursor-choices button{min-height:40px;padding:9px 14px;font-size:14px}
#settings-page .audio-switch{justify-self:start}
#settings-page .audio-row input[type=range]{width:min(260px,70vw);max-width:calc(100% - 64px)}
#settings-page .audio-row>span:not(.audio-switch){min-width:0;flex-wrap:wrap}
#preview-click,#preview-error{color:var(--lime);background:var(--page)}
#settings-page .cursor-row{display:grid;grid-template-columns:180px minmax(0,1fr);gap:10px 24px;align-items:start;margin-top:26px}
#settings-page .cursor-row h3{margin:8px 0 0;font-size:16px;font-weight:500;line-height:1.5}
#settings-page .cursor-row>p{grid-column:2;font-size:14px;margin:0}
#settings-page .cursor-row .cursor-choices{grid-column:2;gap:6px}
#interface-type .cursor-choices{margin:22px 0 16px;gap:8px}
.custom-palette-panel{padding:20px;margin-top:16px}
#palette-grid{grid-template-columns:repeat(auto-fill,minmax(min(164px,100%),1fr));gap:10px}
#palette-grid button{min-height:82px;align-content:space-between;padding:14px;font-size:14px;transition:background .16s var(--ui-ease)}
.palette-swatches{gap:4px}.palette-swatches span{height:10px;flex:1;border-radius:4px}
.theme-controls>.cursor-choices{gap:8px;margin:16px 0}
.page-shortcuts{gap:7px;margin:20px 0 24px}
.page-shortcuts button{font-size:14px;min-height:40px;padding:9px 14px;background:var(--surface);color:var(--muted)}
#account-details,#typing-stats,#following-panel{padding:28px}
#active-profile{font-weight:600;color:var(--ink);margin-top:18px}
.account-profile-actions{margin:16px 0}
#account-page .account-signin-actions{align-items:center;gap:12px;justify-content:flex-start}
#google-signin:empty{display:none}
#account-page .account-signin-actions #email-account{margin:0;border-radius:10px;min-height:44px}
#account-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:22px 0}
#account-metrics div{padding:18px 20px;border-radius:12px;background:var(--page);display:flex;flex-direction:column;gap:8px}
#account-metrics dt{font-size:14px;color:var(--muted)}#account-metrics dd{margin:0;font-size:clamp(28px,3vw,42px);line-height:1.15;font-weight:500;color:var(--lime);font-variant-numeric:tabular-nums;letter-spacing:-.035em}
#stat-charts{gap:16px;margin-top:22px}
#stat-charts figure{background:var(--page);padding:20px;border-radius:12px;margin:0}
#stat-charts figcaption{font-size:14px;margin-bottom:12px;color:var(--muted)}
#format-bests{display:flex;flex-wrap:wrap;gap:8px;list-style:none;padding:0;margin:14px 0 26px}
#format-bests li{padding:10px 14px;background:var(--page);border-radius:9px;font-size:14px}
#profile-history{padding:0;list-style:none;gap:8px;grid-template-columns:repeat(auto-fit,minmax(min(340px,100%),1fr))}
#profile-history li{padding:14px 16px;border-radius:10px;background:var(--page);line-height:1.65;font-size:14px}
#typing-stats>h3{font-size:18px;margin:26px 0 12px;letter-spacing:-.02em}
.board-table-wrap{background:var(--surface);padding:8px 16px;border-radius:var(--ui-radius)}
.board-table th{font-size:13px}.board-table td{font-size:15px}
.board-table th,.board-table td{padding:16px 12px}
.board-table tbody tr:nth-child(odd){background:var(--page)}
.board-table tbody tr:hover{background:var(--button)}
.board-table td:nth-child(3){font-size:23px;font-weight:550;font-variant-numeric:tabular-nums}
#board-status{margin-top:22px;color:var(--muted)}
#racing-page h2{font-size:23px;font-weight:600;letter-spacing:-.025em}
.moon-empty{padding:28px;border-radius:var(--ui-radius)}
.moon-empty p{max-width:60ch;margin-bottom:20px}
.moon-empty .moon-link{background:var(--lime);color:var(--page)}
.moon-players>.moon-empty{grid-column:1/-1}
.moon-passage .wrong{color:var(--error-ink);background:var(--error-fill)}
.result-metrics{font-variant-numeric:tabular-nums}
#test-results-page:has(.key-review-practice) #results-next{background:var(--button);color:var(--ink)}
#test-results-page #result-mistakes li{padding:16px 18px;font-size:14px}
#key-review .key-review-summary{max-width:65ch}
.moon-welcome{display:grid;grid-template-columns:minmax(0,1fr) 320px;align-items:center;gap:40px;min-height:320px;padding:40px}
#racing-page .moon-welcome h2{font-size:28px}.moon-welcome .moon-welcome-note{font-size:13px;margin:16px 0 0}
.moon-welcome-art{position:relative;height:235px;overflow:hidden;color:var(--lime)}
.moon-welcome-moon{position:absolute;width:100px;height:100px;right:12px;top:5px}
.moon-welcome-rocket{position:absolute;width:90px;height:90px;left:20px;bottom:25px;transform:rotate(-35deg)}
.moon-welcome-friend{position:absolute;width:70px;height:70px;left:126px;bottom:0;transform:rotate(-35deg);color:var(--muted)}
.moon-welcome-art>i{position:absolute;width:5px;height:5px;border-radius:50%;background:var(--muted);top:25px;left:50px}
.moon-welcome-art>i:nth-last-child(2){top:90px;left:135px;width:4px;height:4px}.moon-welcome-art>i:last-child{top:160px;left:280px}
@media(max-width:800px){.moon-welcome{grid-template-columns:minmax(0,1fr) 210px;gap:24px;padding:28px}.moon-welcome-art{height:200px}.moon-welcome-moon{width:80px;height:80px}.moon-welcome-rocket{left:0;width:75px;height:75px}.moon-welcome-friend{left:105px;width:60px;height:60px}}
@media(max-width:600px){.moon-welcome{display:flex;flex-direction:column-reverse;gap:24px;align-items:stretch;padding:24px}.moon-welcome-art{width:250px;height:170px;align-self:center}.moon-welcome-rocket{bottom:5px}.moon-welcome-friend{left:120px}.moon-welcome-moon{width:80px;height:80px}.moon-welcome-art>i:nth-last-child(2){top:55px;left:110px}#palette-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:1100px){body>header .brand-name{display:none}body>header .brand{margin-right:12px}body>header nav>button{padding:10px;font-size:13px}body>header nav svg{width:20px;height:20px}}
@media(max-width:800px){body>header nav>button{flex-direction:column;gap:4px;padding:8px;min-height:56px;font-size:12px}#account-metrics div{padding:16px}#settings-page .audio-row,#settings-page .cursor-row{grid-template-columns:145px minmax(0,1fr);gap:12px 18px}}
@media(max-width:600px){
 body>header{padding-top:10px;align-items:start}body>header .brand{margin-right:8px;height:52px}body>header .brand img{width:36px;height:42px}
 body>header nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
 body>header nav>button{font-size:12px;min-height:54px;padding:7px 4px}
 .header-community{padding-top:8px}.header-community button{min-height:34px}#header-streak{display:flex;flex-wrap:wrap;gap:6px;row-gap:3px}#header-streak strong{font-size:13px}#header-streak-status{font-size:12px}#find-people{font-size:12px}
 #settings-page,#account-page,#leaderboard-page,#racing-page,#journey-page,#test-results-page,#focused-practice-page{padding-top:24px}
 .page-heading{align-items:flex-start}.page-heading>button{padding:8px 12px;min-height:36px}
 #practice-page .options{gap:10px}.options .mode-block,.options .length-block{flex-basis:100%}#practice-page .options button{padding:8px 10px;font-size:13px}
 #practice-page .options .option-group{width:100%}.extras-block{flex:1}#practice-page .extras-block button{flex:1}
 .settings-section,#account-details,#following-panel,#typing-stats{padding:20px;border-radius:14px}
 #settings-page .settings-bar{display:flex;flex-wrap:wrap;gap:5px;position:sticky;padding:8px 0}#settings-page .settings-bar button{flex:1 1 auto;min-height:38px;font-size:13px;padding:8px 10px}
 #settings-page .audio-row,#settings-page .cursor-row{grid-template-columns:1fr;gap:12px;padding:16px 0}
 #settings-page .cursor-row{margin-top:18px;padding:0}#settings-page .cursor-row .cursor-choices,#settings-page .cursor-row>p{grid-column:1}#settings-page .cursor-row h3{margin:0}
 #settings-page label.audio-row{grid-template-columns:1fr auto;gap:12px}#settings-page label.audio-row:has([type=range]){grid-template-columns:1fr}
 #settings-page .audio-row input[type=range]{width:min(240px,60vw)}
 #account-metrics{gap:8px}#account-metrics div{padding:14px 10px}#account-metrics dt{font-size:12px}#account-metrics dd{font-size:30px}
 #stat-charts figure{padding:14px}.board-table-wrap{padding:4px 8px}.board-table th,.board-table td{padding:14px 10px}
 .page-shortcuts{gap:6px}.page-shortcuts button{font-size:13px;padding:8px 10px}
}
@media(prefers-reduced-motion:reduce){body>main:not([hidden]):not(#practice-page){animation:none}body button,body>header nav>button,#palette-grid button{transition:none}body button:not(:disabled):active{transform:none}}
/* Color wells are actual editable swatches, without native beveled frames. */
#palette .custom-colors{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;max-width:580px;margin:18px 0}
#palette .custom-colors label{display:flex;flex-direction:column;align-items:flex-start;gap:8px;min-width:0;font-size:13px;color:var(--muted)}
#palette .custom-colors input[type=color]{appearance:none;width:100%;height:38px;padding:0;border:0;border-radius:8px;background:transparent;cursor:pointer;overflow:hidden}
#palette .custom-colors input[type=color]::-webkit-color-swatch-wrapper{padding:0}
#palette .custom-colors input[type=color]::-webkit-color-swatch{border:0;border-radius:8px}
#palette .custom-colors input[type=color]::-moz-color-swatch{border:0;border-radius:8px}
@media(max-width:480px){#palette .custom-colors{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}}
@media(max-width:600px){.result-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}.result-metrics dd{font-size:clamp(40px,13vw,58px)}}
