@charset "UTF-8";

:root {
  --paper: #f6f8f2;
  --ink: #284b42;
  --muted: #7c8b80;
  --line: #dfe6dc;
  --green: #456d56;
  --mint: #b7dcca;
  --yellow: #f4d985;
  --coral: #eea48e;
  --lilac: #b8aad9;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
  font-weight: 400;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button, a, input, select { touch-action: manipulation; }
button { border: 0; background: none; }
button:disabled { cursor: not-allowed; opacity: .48; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, canvas:focus-visible { outline: 3px solid #6f9b78; outline-offset: 4px; }
button:not(:disabled):active { transform: translateY(1px); }
a { color: var(--green); text-underline-offset: 3px; overflow-wrap: anywhere; }
canvas { display: block; }
svg { width: 22px; height: 22px; vertical-align: middle; flex-shrink: 0; }
h1, h2, h3, p { margin: 0; }
.site-shell { max-width: 1280px; margin: 0 auto; padding: 0 48px; }
.site-header { display: flex; align-items: center; justify-content: space-between; height: 110px; gap: 30px; }
.brand { padding: 0; display: flex; align-items: center; gap: 12px; text-align: left; }
.brand strong { display: block; font-size: 22px; letter-spacing: 2px; font-weight: 750; line-height: 1.4; }
.brand small { display: block; font-family: Georgia, serif; font-size: 12px; letter-spacing: .9px; opacity: .65; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 15px); grid-template-rows: repeat(2, 15px); gap: 3px; transform: rotate(-7deg); }
.brand-mark i { border-radius: 4px; background: var(--mint); box-shadow: inset 0 -2px #284b4214; }
.brand-mark i:nth-child(2) { background: var(--yellow); transform: translateY(-3px); }
.brand-mark i:nth-child(3) { background: var(--coral); }
.brand-mark i:nth-child(4) { background: var(--lilac); }
.site-header nav { display: flex; gap: 34px; margin-right: 86px; height: 100%; align-items: center; }
.nav-link { position: relative; padding: 12px 1px; font-size: 14px; color: #8b958b; }
.nav-link.active { color: var(--ink); font-weight: 700; }
.nav-link.active::after { content: ""; width: 18px; height: 3px; border-radius: 3px; background: var(--green); position: absolute; bottom: 0; left: calc(50% - 9px); }
.nav-dot { width: 5px; height: 5px; display: inline-block; border-radius: 50%; background: #deb96b; vertical-align: top; margin: 4px 0 0 5px; }
.header-tools { display: flex; align-items: center; gap: 10px; }
.sound-button, .help-button { height: 38px; width: 38px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; background: #ffffff65; }
.sound-button svg { height: 18px; width: 18px; }
.help-button { font: italic 21px Georgia, serif; }
.hero { min-height: 359px; background: #e6eddf; border-radius: 24px; display: grid; grid-template-columns: 1fr 1fr; position: relative; overflow: hidden; }
.hero-copy { padding: 45px 0 42px 48px; position: relative; z-index: 1; }
.hero-eyebrow { font-size: 12px; letter-spacing: 2px; display: flex; align-items: center; gap: 8px; margin-bottom: 15px; color: #67816c; }
.tiny-flower { font-size: 21px; line-height: 1; }
.hero h1 { font-size: clamp(34px, 3.45vw, 47px); line-height: 1.42; letter-spacing: 3px; font-weight: 650; }
.hero-description { font-size: 13px; color: #76856f; margin-top: 15px; line-height: 1.9; }
.hero-actions { display: flex; align-items: center; gap: 19px; margin-top: 25px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 10px 22px; border-radius: 10px; background: #fff; font-size: 13px; font-weight: 600; border: 1px solid var(--line); transition: background .15s, box-shadow .15s; }
.button svg { width: 17px; height: 17px; }
.button.primary { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 3px 0 #34533f; }
.button.primary:not(:disabled):hover { background: #365c46; }
.button.secondary { background: #f9fbf6; }
.button.text { padding-left: 0; padding-right: 0; background: none; border-color: transparent; }
.button.danger { color: #ad624f; }
.button.small { min-height: 36px; padding: 7px 13px; font-size: 12px; border-radius: 8px; }
.button.full { width: 100%; }
.hero-art { position: relative; min-width: 0; }
.hero-art canvas { width: 100%; height: 355px; position: relative; z-index: 1; }
.hero-orbit { position: absolute; width: 330px; height: 330px; border: 1px dashed #a8baa34a; border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.hero-orbit::after { content: ""; position: absolute; inset: 30px; border: 1px solid #ffffff47; border-radius: 50%; }
.art-note { position: absolute; bottom: 20px; right: 29px; color: #829079; font: italic 14px Georgia, serif; transform: rotate(-7deg); z-index: 2; }
.art-spark { position: absolute; right: 67px; top: 37px; font: 40px Georgia, serif; color: #a8bb9c; transform: rotate(12deg); }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin: 37px 0 18px; gap: 12px; }
.section-heading h2 { font-size: 20px; letter-spacing: 1px; font-weight: 650; }
.section-heading p { font-size: 12px; color: #8b9587; }
.mode-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 17px; }
.mode-card { text-align: left; padding: 0; background: #fffefb; border: 1px solid #e4e8df; border-radius: 16px; overflow: hidden; transition: border-color .2s, box-shadow .2s, translate .2s; }
.mode-card:not(:disabled):hover { border-color: #99b298; box-shadow: 0 8px 25px #344e3f0d; translate: 0 -3px; }
.card-visual { height: 133px; position: relative; overflow: hidden; margin: 7px 7px 0; border-radius: 11px; }
.card-visual::before { content: ""; position: absolute; width: 100px; height: 100px; border-radius: 50%; border: 1px solid #ffffff8c; top: 18px; left: calc(50% - 50px); }
.card-visual canvas { position: relative; width: 100%; height: 125px; }
.mode-classic .card-visual { background: #e8eee8; }
.mode-zen .card-visual { background: #eff0dd; }
.mode-garden .card-visual { background: #f6ece1; }
.mode-sprint .card-visual { background: #eeebf5; }
.mode-tag { position: absolute; top: 10px; left: 10px; font-size: 10px; background: #ffffffb0; color: #6d806b; padding: 2px 7px; border-radius: 5px; z-index: 1; }
.card-copy { padding: 17px 18px 15px; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 5px; }
.card-title h3 { font-size: 17px; font-weight: 650; letter-spacing: .5px; }
.card-title svg { width: 16px; opacity: .55; }
.card-copy p { color: #8b9186; font-size: 11px; margin-top: 6px; line-height: 1.8; min-height: 38px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; padding-top: 12px; border-top: 1px solid #eff0e9; font-size: 10px; color: #909687; }
.card-foot strong { color: #687c62; font-weight: 500; }
.lan-banner { margin-top: 26px; padding: 24px 29px; background: #ebeee4; border: 1px solid #dce3d2; border-radius: 16px; display: flex; gap: 20px; align-items: center; }
.lan-icon { display: grid; place-items: center; width: 56px; height: 56px; background: #dde7d4; border-radius: 17px; transform: rotate(-5deg); flex-shrink: 0; }
.lan-icon svg { width: 29px; height: 29px; }
.lan-copy { flex: 1; }
.lan-copy h3 { font-size: 17px; font-weight: 650; }
.lan-copy p { font-size: 11px; color: #819075; margin-top: 4px; }
.lan-actions { display: flex; gap: 10px; }
.site-footer { padding: 30px 0 27px; display: flex; align-items: center; justify-content: space-between; color: #98a08f; font-size: 10px; letter-spacing: .5px; }
.site-footer > span { display: flex; align-items: center; gap: 7px; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: #9eb08a; display: inline-block; }
.footer-flower { font-size: 20px; margin-left: 13px; color: #91a785; }

/* Play room */
.page-top { display: flex; align-items: center; justify-content: space-between; margin: 11px 0 24px; gap: 10px; }
.back-button { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: #7b8a79; padding: 8px 0; }
.back-button svg { width: 17px; }
.page-title { display: flex; gap: 10px; align-items: center; }
.page-title h1 { font-size: 21px; font-weight: 650; letter-spacing: 1px; }
.soft-tag { font-size: 11px; background: #e6eddf; color: #6e8461; border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
.page-top-actions { display: flex; gap: 8px; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fffefa; }
.icon-button svg { width: 18px; height: 18px; }
.play-layout { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(0, 374px) minmax(185px, 1fr); align-items: start; gap: 35px; max-width: 1030px; margin: 0 auto; }
.play-side { padding: 23px 0; }
.play-motto { margin: 15px 0 12px; font-size: 28px; line-height: 1.7; letter-spacing: 2px; font-weight: 500; }
.motto-flower { font: 41px Georgia, serif; color: #a9b891; }
.side-description { font-size: 12px; line-height: 2.1; color: #8b9586; max-width: 190px; }
.rule-list { margin-top: 29px; padding-top: 23px; border-top: 1px solid var(--line); }
.rule-list h3 { font-size: 12px; margin-bottom: 13px; font-weight: 600; }
.rule-list p { color: #8b9586; font-size: 11px; line-height: 2.2; display: flex; align-items: center; gap: 8px; margin: 4px 0; }
kbd { font: 10px inherit; min-width: 21px; padding: 1px 5px; border-radius: 4px; border: 1px solid #dce2d7; background: #fdfef9; color: #6d7f66; display: inline-flex; justify-content: center; }
.board-column { min-width: 0; width: 100%; }
.board-head { display: flex; justify-content: space-between; align-items: end; margin: 0 0 15px; gap: 12px; padding: 0 4px; }
.metric-label { display: block; font-size: 11px; color: #93a087; margin-bottom: 1px; }
.metric-value { font-size: 35px; line-height: 1.2; letter-spacing: -1.3px; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric-sub { text-align: right; }
.metric-sub .metric-value { font-size: 19px; line-height: 1.65; letter-spacing: .5px; }
.board-shell { padding: 11px; background: #dce6d6; border: 1px solid #d3dfcc; border-radius: 17px; box-shadow: 0 5px 0 #c9d5c2, 0 12px 30px #415b3210; }
.board-wrap { width: 100%; position: relative; }
.board-canvas { width: 100%; height: auto; aspect-ratio: 1; border-radius: 6px; touch-action: none; user-select: none; }
.falling .board-column { max-width: 307px; margin: 0 auto; }
.falling .board-canvas { aspect-ratio: 1 / 2; }
.falling.play-layout { grid-template-columns: minmax(170px, 1fr) minmax(0, 307px) minmax(185px, 1fr); max-width: 940px; }
.board-caption { display: flex; justify-content: space-between; align-items: center; padding: 14px 3px 0; color: #84907a; font-size: 10px; min-height: 33px; }
.board-caption strong { color: #658057; font-weight: 500; }
.board-message { text-align: center; color: #55794c; font-size: 13px; height: 32px; margin-top: 8px; font-weight: 600; }
.board-message.pop { animation: message-pop .5s ease-out; }
.tray-section { margin-top: 23px; }
.tray-title { display: flex; justify-content: space-between; font-size: 11px; color: #8b967e; margin-bottom: 9px; }
.tray-title strong { font-weight: 500; }
.tray { display: flex; align-items: stretch; gap: 9px; }
.piece-button { display: block; width: calc((100% - 18px) / 3); height: 91px; padding: 0; border: 1px solid #e0e6da; background: #fffefb; border-radius: 12px; touch-action: none; transition: background .15s, border-color .15s; }
.piece-button.selected { border-color: #8bab7c; background: #eef3e7; box-shadow: inset 0 0 0 1px #8bab7c; }
.piece-button:disabled { opacity: .4; background: #eaf0e5; }
.piece-button canvas { width: 100%; height: 100%; pointer-events: none; }
.tray-help { font-size: 10px; color: #97a08d; text-align: center; margin-top: 11px; }
.info-panel { background: #fffefa; border: 1px solid var(--line); padding: 19px; border-radius: 14px; margin-bottom: 16px; }
.info-panel h3 { font-size: 12px; font-weight: 500; color: #85937c; margin-bottom: 10px; }
.record-value { font: 32px Georgia, serif; letter-spacing: 1px; }
.info-panel .caption { font-size: 10px; color: #97a08c; margin-top: 6px; }
.tiny-stat-row { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: #8b9583; padding: 8px 0; }
.tiny-stat-row + .tiny-stat-row { border-top: 1px solid #edf0e7; }
.tiny-stat-row strong { color: #58724e; font-size: 15px; font-variant-numeric: tabular-nums; }
.piece-previews { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.preview-canvas { width: 100%; max-width: 150px; height: 62px; }
.hold-button { width: 100%; border: 1px dashed #cbd8c1; border-radius: 8px; min-height: 70px; padding: 2px; }
.hold-button canvas { width: 100%; height: 66px; }
.hold-empty { font-size: 11px; color: #98a68f; }
.touch-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.touch-key { border: 1px solid #dce4d4; border-radius: 10px; background: #fffefa; min-height: 43px; touch-action: none; font-size: 11px; display: flex; align-items: center; justify-content: center; gap: 4px; box-shadow: 0 2px 0 #e0e7d8; }
.touch-key svg { width: 17px; height: 17px; }
.touch-key[data-action="hardDrop"] { background: #e2ebd9; }
.overlay { position: absolute; inset: 0; border-radius: 7px; background: #edf2e6e8; backdrop-filter: blur(5px); display: flex; flex-direction: column; align-items: center; justify-content: safe center; padding: 20px; text-align: center; z-index: 5; overflow-y: auto; }
.overlay > * { flex-shrink: 0; }
.overlay.result { padding: 12px 18px; scrollbar-width: thin; scrollbar-color: #a8ba9b transparent; }
.overlay.result .overlay-symbol { font-size: 24px; line-height: 1; }
.overlay.result h2 { font-size: 23px; margin: 9px 0 5px; }
.overlay.result p { font-size: 11px; }
.overlay.result .button { margin-top: 10px; min-height: 38px; padding: 7px 17px; }
.overlay.result .button.text { margin-top: 3px; min-height: 32px; }
.overlay.result .result-list { margin-top: 10px; }
.overlay.result .result-line { padding: 3px 0; }
.overlay[hidden] { display: none; }
.overlay h2 { font-size: 27px; margin: 12px 0 6px; letter-spacing: 1px; }
.overlay p { font-size: 12px; color: #879179; line-height: 1.9; }
.overlay .result-score { font: 48px Georgia, serif; margin: 9px 0 2px; }
.overlay .button { margin-top: 16px; min-width: 145px; }
.overlay-symbol { font-size: 40px; color: #95ab79; line-height: 1.2; }
.countdown-number { font: 82px Georgia, serif; color: var(--green); }
.race-sidebar h3 { margin-bottom: 15px; font-size: 13px; font-weight: 600; }
.racer { margin-bottom: 18px; }
.racer-label { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; margin-bottom: 7px; }
.racer-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.racer-label b { font-weight: 600; font-variant-numeric: tabular-nums; }
.progress-track { height: 6px; background: #e5ebde; border-radius: 8px; overflow: hidden; }
.progress-track i { display: block; height: 100%; background: #a0b78c; border-radius: inherit; transition: width .16s; }
.racer.self .progress-track i { background: #527c58; }
.race-target { padding: 10px 12px; background: #e9efdf; border-radius: 8px; font-size: 12px; margin-bottom: 18px; }
.connection-label { font-size: 10px; color: #8a967d; display: flex; align-items: center; gap: 5px; }
.connection-label.warning { color: #bd824e; }

/* Friends / ready room */
.friends-intro { text-align: center; margin: 20px 0 31px; }
.friends-intro .motto-flower { font-size: 42px; }
.friends-intro h1 { font-size: 30px; letter-spacing: 2px; font-weight: 600; margin: 6px 0 10px; }
.friends-intro p { color: #8d9984; font-size: 13px; }
.friends-grid { display: grid; grid-template-columns: 1.1fr 1fr; max-width: 820px; margin: 0 auto; gap: 22px; }
.form-panel { border: 1px solid var(--line); background: #fffefa; border-radius: 19px; padding: 27px 30px; }
.form-panel h2 { font-size: 19px; margin-bottom: 6px; }
.form-panel > p { font-size: 11px; color: #8f9986; margin-bottom: 22px; }
.form-panel.join { background: #edf1e6; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; margin: 15px 0; }
.field > span { color: #7b8d70; }
input, select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #dbe2d1; background: #fffefb; color: var(--ink); border-radius: 8px; outline: none; }
input::placeholder { color: #b1b9a5; }
input:focus, select:focus { border-color: #83a26d; }
.room-code-input { font-size: 24px; text-transform: uppercase; letter-spacing: 7px; font-variant-numeric: tabular-nums; }
.form-error { color: #ac6651; font-size: 12px; margin: 10px 0; min-height: 20px; }
.wifi-note { border-top: 1px solid #dbe3d0; padding-top: 19px; margin-top: 25px; font-size: 11px; color: #8a987f; line-height: 2; }
.wifi-note svg { width: 16px; height: 16px; margin-right: 5px; }
.lan-addresses { max-width: 820px; margin: 20px auto 0; padding: 14px 18px; font-size: 11px; color: #8c9982; text-align: center; background: #eef1e7; border-radius: 9px; }
.lan-addresses a { margin-left: 7px; }
.room-container { max-width: 820px; margin: 0 auto; }
.room-header { display: flex; align-items: center; justify-content: space-between; padding: 27px 30px; background: #e7eddf; border-radius: 19px 19px 0 0; gap: 15px; }
.room-header h1 { font-size: 14px; font-weight: 400; color: #7c8e6e; }
.room-code { font-size: 36px; font-weight: 600; letter-spacing: 9px; line-height: 1.7; }
.room-header p { font-size: 11px; color: #7e9071; }
.room-body { background: #fffefa; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 19px 19px; padding: 24px 30px; }
.room-player { display: flex; align-items: center; gap: 13px; padding: 15px 0; border-bottom: 1px solid #edf0e5; }
.player-avatar { width: 41px; height: 41px; border-radius: 12px; display: grid; place-items: center; background: #e5eddc; color: #708563; font-size: 17px; }
.player-name { flex: 1; font-size: 14px; }
.player-name small { margin-left: 8px; font-size: 10px; color: #98a289; }
.ready-pill { font-size: 11px; color: #9d9c86; border-radius: 6px; padding: 3px 9px; background: #f2f2e7; }
.ready-pill.yes { background: #e5efdb; color: #6d8e54; }
.room-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 26px; }
.room-footer > p { font-size: 11px; color: #8c9880; }
.room-buttons { display: flex; gap: 9px; }
.room-tip { text-align: center; margin-top: 18px; color: #97a18b; font-size: 11px; }
.result-list { margin-top: 14px; width: 100%; }
.result-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 11px; }
.result-line span { max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Dialogs and feedback */
dialog { border: 1px solid #dce5d1; border-radius: 22px; background: #fcfdf7; color: var(--ink); width: min(440px, calc(100% - 32px)); padding: 29px; box-shadow: 0 20px 80px #243a3030; }
dialog::backdrop { background: #20382a55; backdrop-filter: blur(4px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.dialog-heading h2 { font-size: 21px; }
.dialog-close { width: 30px; height: 30px; display: grid; place-items: center; font-size: 23px; color: #8c9a80; }
.dialog-copy { font-size: 12px; color: #7c8e72; line-height: 2; }
.dialog-copy h3 { color: #4c6941; font-size: 13px; margin: 16px 0 5px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.toast { position: fixed; bottom: max(28px, env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%, 14px); opacity: 0; pointer-events: none; z-index: 30; background: #34513f; color: #fffdf7; padding: 11px 20px; border-radius: 12px; font-size: 12px; box-shadow: 0 5px 20px #34513f26; transition: opacity .2s, transform .2s; max-width: calc(100vw - 28px); width: max-content; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@keyframes message-pop { 0% { transform: translateY(5px); opacity: 0; } 50% { transform: translateY(-2px); } 100% { transform: translateY(0); opacity: 1; } }

@media (min-width: 1450px) {
  .site-shell { max-width: 1340px; padding: 0 65px; }
  .site-header { height: 120px; }
  .hero { min-height: 389px; }
  .hero-copy { padding: 47px 0 45px 54px; }
  .hero h1 { font-size: 49px; }
  .hero-art canvas { height: 385px; }
  .card-visual { height: 147px; }
  .card-visual canvas { height: 140px; }
}
@media (max-width: 1050px) {
  .site-shell { padding: 0 28px; }
  .site-header nav { margin-right: 25px; }
  .hero-copy { padding-left: 30px; }
  .hero-description { font-size: 12px; }
  .hero-actions { gap: 11px; }
  .hero-actions .button { padding: 10px 16px; font-size: 12px; }
  .play-layout, .falling.play-layout { gap: 23px; grid-template-columns: 145px minmax(0, 350px) minmax(165px, 1fr); }
  .play-motto { font-size: 24px; }
  .card-copy { padding: 15px 13px 13px; }
  .mode-grid { gap: 12px; }
  .info-panel { padding: 15px; }
}
@media (max-width: 800px) {
  .site-shell { padding: 0 24px; }
  .site-header { height: 90px; }
  .site-header nav { gap: 20px; margin: 0; }
  .brand strong { font-size: 18px; }
  .hero-copy { padding: 33px 0 30px 27px; }
  .hero h1 { font-size: 34px; letter-spacing: 1px; }
  .hero-description { max-width: 210px; }
  .hero { min-height: 328px; grid-template-columns: 1.05fr 1fr; }
  .hero-art canvas { height: 320px; width: 115%; margin-left: -8%; }
  .hero-orbit { width: 230px; height: 230px; }
  .hero-actions { flex-wrap: wrap; gap: 9px 18px; }
  .mode-grid { grid-template-columns: repeat(2, 1fr); gap: 17px; }
  .card-visual { height: 126px; }
  .card-visual canvas { height: 121px; }
  .card-copy { padding: 15px 18px; }
  .card-copy p { min-height: unset; }
  .lan-banner { padding: 20px; flex-wrap: wrap; gap: 15px; }
  .lan-actions { margin-left: auto; }
  .play-layout, .falling.play-layout { grid-template-columns: minmax(0, 374px) 180px; max-width: 585px; justify-content: center; gap: 25px; }
  .play-left { display: none; }
  .falling .board-column { max-width: 285px; }
  .page-title h1 { font-size: 18px; }
  .friends-grid { gap: 16px; }
  .form-panel { padding: 23px; }
}
@media (max-width: 570px) {
  .site-shell { padding: 0 18px; }
  .site-header { height: 79px; gap: 13px; }
  .brand { gap: 8px; }
  .brand strong { font-size: 17px; letter-spacing: 1px; }
  .brand small { font-size: 9px; letter-spacing: .4px; }
  .brand-mark { grid-template-columns: repeat(2, 12px); grid-template-rows: repeat(2, 12px); gap: 2px; }
  .site-header nav { gap: 15px; margin-left: auto; }
  .nav-link { font-size: 11px; padding: 10px 0; }
  .header-tools { gap: 0; }
  .help-button { display: none; }
  .sound-button { width: 32px; height: 32px; }
  .hero { grid-template-columns: 1fr; min-height: 0; border-radius: 19px; }
  .hero-copy { padding: 27px 27px 0; }
  .hero-eyebrow { font-size: 10px; margin-bottom: 9px; }
  .hero h1 { font-size: 35px; line-height: 1.48; letter-spacing: 2px; }
  .hero-description { font-size: 11px; max-width: none; margin-top: 10px; }
  .hero-description br { display: none; }
  .hero-actions { margin-top: 19px; gap: 19px; }
  .hero-actions .button { min-height: 41px; padding: 8px 17px; font-size: 11px; }
  .hero-actions .button.text { padding: 8px 0; }
  .hero-art { height: 216px; margin-top: -4px; }
  .hero-art canvas { width: 100%; height: 224px; margin: 0; }
  .hero-orbit { width: 210px; height: 210px; left: 54%; }
  .art-note { bottom: 15px; right: 19px; font-size: 12px; }
  .art-spark { right: 26px; top: 20px; font-size: 30px; }
  .section-heading { margin: 27px 0 15px; }
  .section-heading h2 { font-size: 18px; }
  .section-heading p { font-size: 10px; max-width: 110px; text-align: right; }
  .mode-grid { gap: 12px; }
  .card-visual { height: 111px; margin: 5px 5px 0; border-radius: 9px; }
  .card-visual canvas { height: 111px; }
  .mode-card { border-radius: 13px; }
  .card-copy { padding: 13px 12px 12px; }
  .card-title h3 { font-size: 15px; }
  .card-copy p { font-size: 10px; min-height: 36px; }
  .card-foot { font-size: 9px; margin-top: 10px; padding-top: 9px; gap: 3px; }
  .mode-tag { font-size: 9px; padding: 1px 6px; left: 7px; top: 7px; }
  .lan-banner { margin-top: 20px; padding: 18px; gap: 13px; border-radius: 13px; }
  .lan-icon { width: 40px; height: 40px; border-radius: 12px; }
  .lan-icon svg { width: 24px; }
  .lan-copy h3 { font-size: 15px; }
  .lan-copy p { font-size: 10px; }
  .lan-actions { margin: 2px 0 0 53px; gap: 8px; }
  .lan-actions .button { padding: 8px 13px; min-height: 39px; font-size: 11px; }
  .site-footer { padding: 25px 0; font-size: 9px; }
  .site-footer > span:last-child { display: none; }
  .page-top { margin: 0 0 16px; }
  .page-title { gap: 6px; }
  .page-title h1 { font-size: 16px; letter-spacing: .5px; }
  .page-title .soft-tag { display: none; }
  .back-button { font-size: 10px; gap: 3px; }
  .back-button svg { width: 14px; }
  .page-top-actions { gap: 6px; }
  .icon-button { width: 34px; height: 34px; border-radius: 8px; }
  .icon-button svg { width: 15px; }
  .play-layout, .falling.play-layout { display: flex; flex-direction: column; align-items: center; gap: 15px; }
  .board-column { max-width: 374px; }
  .falling .board-column { max-width: min(264px, calc((100dvh - 300px) / 2 + 22px)); min-width: 208px; }
  .board-head { margin-bottom: 10px; }
  .metric-value { font-size: 31px; }
  .metric-label { font-size: 10px; }
  .board-shell { padding: 8px; border-radius: 13px; box-shadow: 0 4px 0 #c9d5c2; }
  .board-caption { font-size: 9px; padding-top: 12px; }
  .tray-section { margin-top: 13px; }
  .tray-title { font-size: 10px; }
  .piece-button { height: 83px; }
  .tray-help { font-size: 9px; margin-top: 8px; }
  .board-message { font-size: 11px; height: 20px; margin-top: 5px; }
  .play-side.play-right { width: 100%; padding: 0; max-width: 374px; display: flex; gap: 12px; flex-wrap: wrap; }
  .solo-stats { flex: 1; margin: 0; padding: 12px 15px; }
  .solo-stats h3 { margin-bottom: 4px; font-size: 10px; }
  .record-value { font-size: 22px; }
  .solo-stats .caption { display: none; }
  .statistics-panel { flex: 1; margin: 0; padding: 7px 13px; }
  .tiny-stat-row { padding: 3px 0; font-size: 10px; }
  .tiny-stat-row strong { font-size: 13px; }
  .falling .play-right { flex-wrap: nowrap; max-width: 335px; gap: 8px; }
  .falling .solo-stats, .falling .statistics-panel { display: none; }
  .next-panel { flex: 2; padding: 9px 11px; margin: 0; min-width: 0; }
  .next-panel h3, .hold-panel h3 { font-size: 9px; margin-bottom: 3px; }
  .piece-previews { flex-direction: row; gap: 0; }
  .preview-canvas { width: 33%; min-width: 0; height: 46px; }
  .hold-panel { flex: 1; padding: 9px; margin: 0; }
  .hold-button { min-height: 45px; }
  .hold-button canvas { height: 44px; }
  .hold-empty { font-size: 9px; }
  .touch-controls { margin-top: 9px; gap: 7px; }
  .touch-key { min-height: 41px; font-size: 10px; }
  body.playing .site-footer { padding: 18px 0; justify-content: center; }
  .friends-intro { margin: 11px 0 24px; }
  .friends-intro h1 { font-size: 26px; }
  .friends-intro p { font-size: 11px; }
  .friends-grid { grid-template-columns: 1fr; gap: 16px; }
  .form-panel { padding: 24px; border-radius: 16px; }
  .lan-addresses { font-size: 10px; padding: 12px; text-align: left; }
  .room-header { padding: 22px; flex-wrap: wrap; }
  .room-code { font-size: 31px; letter-spacing: 7px; }
  .room-body { padding: 14px 22px 22px; }
  .room-footer { flex-direction: column; align-items: stretch; gap: 14px; }
  .room-buttons { justify-content: stretch; }
  .room-buttons .button { flex: 1; }
  .race-sidebar { width: 100%; margin: 0; padding: 14px; }
  .race-sidebar h3 { margin-bottom: 8px; }
  .race-target { margin-bottom: 12px; padding: 7px 10px; font-size: 11px; }
  .racer { margin-bottom: 10px; }
  .falling .play-right:has(.race-sidebar) { flex-wrap: wrap; }
  .falling .race-sidebar { order: 3; }
  .overlay { padding: 12px; }
  .overlay h2 { font-size: 22px; }
  .overlay .result-score { font-size: 37px; }
  .overlay p { font-size: 10px; }
  .overlay .button { min-height: 37px; padding: 8px 14px; margin-top: 10px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
