/* Start page: a quiet landscape and tactile, accessible controls. */
body:has(#start-screen.active) { background: #e4edf4; }
body:has(#start-screen.active) .app-shell { width: min(100% - 40px, 1040px); padding: 0 0 48px; }
#start-screen { max-width: 820px; padding: 0; isolation: isolate; color: #17283e; --muted: #62758e; }
.start-scenery { position: fixed; inset: 0; z-index: -2; background: url('landscape.svg') center center / cover no-repeat; pointer-events: none; }
.start-scenery::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, #e7edf3a8); }
.start-hero { position: relative; padding: 114px 20px 34px; }
#start-screen .start-hero .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .25em; margin-bottom: 12px; }
#start-screen h1 { font-size: clamp(64px, 8vw, 94px); line-height: 1.05; letter-spacing: -.055em; margin: 0 0 18px; text-shadow: 0 3px 0 #ffffff70; }
#start-screen .lead { max-width: 480px; margin: 0 auto 24px; font-size: 16px; line-height: 1.65; text-wrap: pretty; }
#start-screen #start-button { display: inline-flex; align-items: center; justify-content: center; gap: 18px; margin: 0; padding: 18px 40px; min-width: 228px; border: 1px solid #fffb; border-radius: 40px; background: linear-gradient(160deg,#ff895a,#e35b33); box-shadow: 0 10px 28px #d9613633, inset 0 1px 0 #ffffff40; font-size: 21px; letter-spacing: 0; }
#start-screen #start-button:hover { transform: translateY(-3px); box-shadow: 0 14px 32px #d9613650; }
.play-icon { width: 0; height: 0; border-top: 9px solid transparent; border-bottom: 9px solid transparent; border-left: 14px solid white; border-radius: 3px; }
.start-settings { padding: 25px; border: 1px solid #fff; border-radius: 26px; background: #fffdfaeb; box-shadow: 0 20px 65px #294a6920; backdrop-filter: blur(18px); text-align: left; }
.settings-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 8px 20px; gap: 16px; }
#start-screen .settings-heading h2 { font: 700 23px 'Segoe UI', sans-serif; letter-spacing: -.03em; margin: 0; }
.settings-note { color: var(--muted); font-size: 12px; letter-spacing: .03em; }
#start-screen .difficulty-picker, #start-screen .player-name-group { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-width: 0; margin: 0 0 10px; padding: 16px; border: 1px solid #e3e8ef; border-radius: 17px; background: #ffffffa6; }
.setting-description { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.setting-description strong, .setting-description label { font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.setting-description p { font-size: 12px; line-height: 1.4; color: var(--muted); margin: 5px 0 0; }
.setting-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; font-family: 'Segoe UI Symbol', sans-serif; font-size: 28px; background: #fff0e5; color: #d45c32; }
.icon-1 { background: #e4f2ec; color: #408675; }
.icon-2 { background: #ededff; color: #5c63a9; }
.icon-3 { background: #e4f1ff; color: #376e9b; }
.icon-4 { background: #fff1df; color: #b95b25; }
.setting-options { display: flex; gap: 4px; align-items: stretch; }
#start-screen .difficulty-option { position: relative; justify-content: center; flex-wrap: wrap; column-gap: 8px; row-gap: 3px; padding: 11px 16px; min-width: 90px; margin: 0; border-radius: 11px; border: 1px solid #e2e7ed; background: #ffffff70; transition: background .18s, border-color .18s, box-shadow .18s; }
#start-screen .difficulty-option:hover { background: #fff2e9; border-color: #e9b69e; }
#start-screen .difficulty-option:has(input:checked) { border-color: #e97b55; background: linear-gradient(135deg, #fff3e9, #ffe7dc); box-shadow: inset 0 0 0 2px #ffffff90, 0 3px 8px #b8592210; }
#start-screen .difficulty-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
#start-screen .difficulty-option:has(input:focus-visible) { outline: 3px solid #426eaa; outline-offset: 3px; }
#start-screen .difficulty-name { font-size: 13px; }
#start-screen .difficulty-meta { width: 100%; margin: 0; font-size: 10px; text-align: center; }
#start-screen .difficulty-picker:has(input[name='language']) .difficulty-meta, #start-screen .difficulty-picker:has(input[name='theme']) .difficulty-meta { display: none; }
#start-screen .difficulty-picker:has(input[name='difficulty']) .difficulty-option { min-width: 79px; padding: 9px 12px; }
.flag { width: 23px; height: 23px; border-radius: 50%; box-shadow: 0 0 0 1px #00000008; }
.flag-no { background: linear-gradient(90deg,transparent 27%,#173f83 27% 40%,transparent 40%),linear-gradient(transparent 43%,#173f83 43% 57%,transparent 57%),linear-gradient(90deg,transparent 21%,white 21% 46%,transparent 46%),linear-gradient(transparent 37%,white 37% 63%,transparent 63%),#cf2445; }
.flag-en { background: linear-gradient(90deg,transparent 41%,#ce2445 41% 59%,transparent 59%),linear-gradient(transparent 41%,#ce2445 41% 59%,transparent 59%),linear-gradient(90deg,transparent 33%,white 33% 67%,transparent 67%),linear-gradient(transparent 33%,white 33% 67%,transparent 67%),linear-gradient(35deg,transparent 43%,white 43% 57%,transparent 57%),linear-gradient(-35deg,#25477d 43%,white 43% 57%,#25477d 57%); }
#start-screen .text-input { width: 48%; padding: 13px 16px; background: #f5f7fa; border: 1px solid #d6dfe9; border-radius: 11px; font-size: 14px; }
#start-screen .leaderboard-panel { position: relative; margin: 14px 0 0; padding: 20px 20px 20px 88px; background: #ffffff80; border: 1px solid #e3e8ef; border-radius: 17px; }
.trophy-icon { position: absolute; left: 18px; top: 23px; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #fbedd4; color: #ad771e; font-size: 30px; }
#start-screen .leaderboard-header { margin-bottom: 5px; align-items: center; }
#start-screen .leaderboard-header .eyebrow { font-size: 9px; margin-bottom: 5px; letter-spacing: .18em; }
#start-screen .leaderboard-header h3 { font-size: 19px; margin: 0; }
#start-screen .leaderboard-difficulty { font-size: 11px; font-weight: 400; padding: 8px 14px; }
#start-screen .leaderboard-empty { font-size: 12px; }
#start-screen .leaderboard-list:not(:empty) { margin-top: 16px; }
.word-rain { position: absolute; inset: 0 0 auto; height: 420px; z-index: -1; overflow: hidden; pointer-events: none; }
.rain-word { position: absolute; padding: 13px 24px; border: 1px solid #ffffffa0; border-radius: 14px; font-size: 22px; font-weight: 700; color: #235844; background: #d7ebde; transform: rotate(-10deg); box-shadow: 0 8px 25px #ffffff60; animation: word-drift 7s ease-in-out infinite alternate; }
.rain-word::before { content: ''; position: absolute; bottom: 100%; left: 12%; width: 76%; height: 170px; background: linear-gradient(90deg, #ffffffb0 5%, transparent 5% 17%, #ffffffc0 17% 23%, transparent 23% 76%, #ffffffb0 76% 83%, transparent 83%),linear-gradient(0deg, #9cccb280,transparent); }
.rain-mountain { left: 10%; top: 42px; }
.rain-friend { left: 37%; top: -6px; color: #ae482c; background: #ffddce; animation-delay: -2s; }
.rain-dream { right: 16%; top: 35px; color: #275b85; background: #d2e8fe; transform: rotate(7deg); animation-delay: -4s; }
.rain-sun { right: 3%; top: 170px; color: #a66d20; background: #ffecc5; transform: rotate(-5deg); animation-delay: -3s; }
.rain-cat { left: 2%; top: 235px; color: #575799; background: #e1def8; transform: rotate(-15deg); animation-delay: -1s; }
.rain-snow { right: 8%; top: 310px; color: #376a98; background: #daecfc; transform: rotate(10deg); animation-delay: -5s; }
@keyframes word-drift { to { translate: 0 10px; } }
body[data-theme='dark'] #start-screen { color: #e7edf8; --muted: #a5b7cd; }
body[data-theme='dark'] .start-scenery { filter: brightness(.35) saturate(.75); }
body[data-theme='dark'] .start-settings { background: #182438ed; border-color: #45546a; }
body[data-theme='dark'] #start-screen h1 { text-shadow: none; }
body[data-theme='dark'] #start-screen :is(.difficulty-picker,.player-name-group,.leaderboard-panel) { background: #1e2d42b0; border-color: #3a4a61; }
body[data-theme='dark'] #start-screen .difficulty-option { background: #25354c; border-color: #40516a; }
body[data-theme='dark'] #start-screen .difficulty-option:has(input:checked) { background: #563d36; border-color: #f39a75; box-shadow: none; }
body[data-theme='dark'] #start-screen .text-input { background: #172437; border-color: #455670; }
body[data-theme='dark'] .rain-word { filter: brightness(.75); }
@media(min-width: 1400px) { .start-hero { padding-top: 130px; } }
@media(max-width: 680px) {
 body:has(#start-screen.active) .app-shell { width: min(100% - 24px, 520px); padding-bottom: 24px; }
 #start-screen { padding: 0; }
 .start-hero { padding: 104px 10px 28px; }
 #start-screen h1 { font-size: 65px; }
 #start-screen .lead { font-size: 14px; max-width: 340px; }
 .start-settings { padding: 16px; border-radius: 22px; }
 .settings-heading { margin: 2px 2px 16px; }
 #start-screen .settings-heading h2 { font-size: 21px; }
 #start-screen .difficulty-picker, #start-screen .player-name-group { flex-wrap: wrap; gap: 14px; padding: 13px; }
 .setting-description { gap: 12px; }
 .setting-icon { width: 39px; height: 39px; font-size: 24px; }
 .setting-options { width: 100%; }
 #start-screen .difficulty-option { flex: 1; }
 #start-screen .text-input { width: 100%; }
 .rain-word { font-size: 16px; padding: 10px 17px; }
 .rain-mountain { left: 5%; top: 30px; }
 .rain-dream { right: 5%; top: 42px; }
 .rain-friend { left: 43%; top: -12px; }
 .rain-sun, .rain-cat, .rain-snow { display: none; }
 #start-screen .leaderboard-panel { padding: 17px 14px 17px 64px; }
 .trophy-icon { left: 12px; width: 39px; height: 39px; font-size: 25px; }
 #start-screen .leaderboard-header { gap: 8px; }
 #start-screen .leaderboard-header h3 { font-size: 17px; }
 .settings-note { font-size: 11px; }
}
@media(prefers-reduced-motion: reduce) { .rain-word { animation: none; } #start-screen * { transition: none; } }

.setting-icon svg, .trophy-icon svg { width: 25px; height: 25px; }
body[data-theme='dark']:has(#start-screen.active) { background: #182438; }
body[data-theme='dark'] .start-scenery { filter: none; background-image: linear-gradient(#10213bd9, #172f50b8), url('landscape.svg'); }
body[data-theme='dark'] .start-scenery::after { background: linear-gradient(transparent, #18243880); }
body[data-theme='dark'] #start-screen .difficulty-option:hover { background: #35465e; }
body[data-theme='dark'] #start-screen .difficulty-option:has(input:checked) { background: #563d36; }
#start-screen .leaderboard-header { flex-direction: row; text-align: left; }
#start-screen .leaderboard-empty { text-align: left; }
