.race-entry{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:48px;margin:0 0 16px;padding:12px 18px;border:1px solid #467e89;border-radius:13px;background:#163947;color:#dffbf7;font:600 16px/1.35 Arial,sans-serif;cursor:pointer}.race-entry:hover{background:#204958}.race-entry:focus-visible,.race-dialog button:focus-visible,.race-dialog input:focus-visible,.race-dialog textarea:focus-visible,.race-dialog select:focus-visible,.race-dialog summary:focus-visible{outline:3px solid #efd073;outline-offset:3px}.focus-play .race-entry{display:none}
body.race-open{overflow:hidden}.race-dialog{--race-top:max(12px,env(safe-area-inset-top));--race-bottom:calc(max(12px,env(safe-area-inset-bottom)) + 16px);--race-content-height:calc(var(--race-height,100dvh) - var(--race-top) - var(--race-bottom));position:fixed;inset:auto;margin:0;top:var(--race-offset-top,0px);left:var(--race-offset-left,0px);width:var(--race-width,100vw);height:var(--race-height,100dvh);max-width:none;max-height:none;box-sizing:border-box;padding:var(--race-top) max(12px,env(safe-area-inset-right)) var(--race-bottom) max(12px,env(safe-area-inset-left));border:0;border-radius:0;background:#0b1926;color:#eff7fa;font:400 16px/1.5 Arial,sans-serif;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.race-dialog::backdrop{background:#0b1926}.race-dialog [hidden]{display:none!important}.race-shell{max-width:860px;min-height:var(--race-content-height);margin:auto;display:flex;flex-direction:column;gap:12px}.race-dialog p,.race-dialog h2,.race-dialog h3{margin:0}.race-dialog h2{font-size:clamp(20px,4.7vw,28px);line-height:1.2;color:#eff7fa;letter-spacing:-.4px}.race-dialog h3{font-size:18px;line-height:1.35;color:#eff7fa}.race-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:0 0 auto}.race-tag{color:#79cbc5;font-size:12px;line-height:1.4;letter-spacing:1.1px;margin-bottom:5px!important}.race-dialog button{min-height:48px;padding:10px 14px;box-sizing:border-box;border:1px solid #3b5969;border-radius:11px;color:#eff7fa;background:#203b4b;font:600 16px/1.3 Arial,sans-serif;cursor:pointer;touch-action:manipulation}.race-dialog button:disabled{opacity:.5;cursor:default}.race-dialog .race-close{flex:0 0 auto;max-width:128px;min-height:48px;font-size:14px;background:transparent}.race-dialog .race-primary{background:#73d6ce;border-color:#73d6ce;color:#0d2932}.race-dialog .race-secondary{background:#203b4b;color:#e0f0f4}.race-dialog .race-quiet{background:transparent;border-color:transparent;color:#b9cdd7}.race-dialog input,.race-dialog select,.race-dialog textarea{width:100%;min-width:0;box-sizing:border-box;border:1px solid #516d7b;border-radius:10px;background:#122a39;color:#eff7fa;font:400 16px/1.5 Arial,sans-serif;padding:11px 12px;min-height:48px}.race-dialog select{padding-right:36px}.race-dialog input::placeholder,.race-dialog textarea::placeholder{color:#aec4ce}.race-dialog label{display:block;color:#cbdce2;font-size:14px;font-weight:600}.race-status{color:#a8cad4;font-size:14px;line-height:1.4;min-height:20px;flex:0 0 auto}.race-status:empty{display:none}.race-status-error{padding:10px 12px;background:#46352a;border-radius:10px;color:#ffe2b3}.race-landing{display:flex;flex-direction:column;gap:18px}.race-intro{max-width:580px;color:#d5e6ed;font-size:18px}.race-invite{padding:12px 14px;background:#153c41;border:1px solid #427e81;border-radius:10px}.race-guide{padding:18px;border-radius:14px;background:#132c3c;border:1px solid #2b4b5e}.race-guide ol{padding-left:24px;margin:12px 0 0}.race-guide li+li{margin-top:10px}.race-setup{display:grid;grid-template-columns:1fr 1fr;gap:18px}.race-create,.race-join{display:flex;flex-direction:column;align-items:stretch;gap:10px;padding:16px;border:1px solid #345363;border-radius:14px}.race-create button,.race-join button{margin-top:auto}.race-small{color:#b0c5d0;font-size:14px;line-height:1.5}.race-saved{display:flex;flex-wrap:wrap;gap:10px}.race-lobby{display:flex;flex-direction:column;gap:16px;max-width:650px;width:100%;margin:0 auto}.race-room-code{font-size:16px;color:#b3cbd5}.race-room-code strong{display:block;letter-spacing:3px;font-size:26px;color:#eff7fa;overflow-wrap:anywhere}.race-invite-actions,.race-ready-actions{display:flex;gap:10px;flex-wrap:wrap}.race-invite-actions button,.race-ready-actions button{flex:1}.race-seats{display:grid;grid-template-columns:1fr 1fr;gap:10px}.race-seat{display:flex;flex-direction:column;gap:7px;padding:15px;background:#142d3c;border:1px solid #325567;border-radius:12px}.race-seat b{font-size:16px}.race-seat span{font-size:14px;color:#a5d9d5}.race-lobby-note{color:#bbd0da}.race-room-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between;flex:0 0 auto}.race-clock-note{color:#a9c0cd;font-size:14px;line-height:1.4;flex:0 0 auto}.race-privacy{font-size:14px;color:#aec5d0;margin-top:auto}.race-privacy summary{min-height:44px;display:flex;align-items:center;cursor:pointer;color:#c6dee8}.race-privacy p{padding:8px 0 12px;max-width:700px}.race-reconnect{align-self:flex-start}.race-game{display:flex;flex-direction:column;gap:10px;min-height:0;flex:1 0 auto}.race-scores{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;flex:0 0 auto}.race-scores>div:nth-child(2){text-align:center}.race-scores>div:last-child{text-align:right}.race-label{display:block;font-size:14px;color:#a9c9d6;line-height:1.3}.race-scores strong{display:block;font-size:27px;line-height:1.3;font-variant-numeric:tabular-nums}.race-scores>div:nth-child(2) strong{color:#7cdfd4}.race-stage{display:grid;grid-template-columns:minmax(0,1fr) minmax(72px,20%);gap:12px;align-items:start;min-height:240px;width:100%;max-width:720px;margin:auto}.race-own{position:relative;display:flex;align-items:center;justify-content:flex-start;width:100%;min-width:0}.race-board{display:block;aspect-ratio:1/2;width:auto;max-width:100%;height:var(--race-board-height,min(65dvh,calc((100vw - 140px)*2)));min-height:240px;box-sizing:border-box;border:2px solid #587a88;border-bottom-color:#80babd;border-radius:9px;background:#0b1d2a}.race-opponent{display:flex;flex-direction:column;gap:6px;min-width:0;padding-top:4px}.race-presence{font-size:14px;color:#c1d5dc;overflow-wrap:anywhere}.race-partner-board{width:100%;height:auto;aspect-ratio:1/2;display:block;border:1px solid #496471;border-radius:6px;margin:4px 0 8px;max-height:min(45dvh,330px);object-fit:contain;background:#0b1d2a}.race-next{display:block;width:100%;height:auto;max-width:120px;aspect-ratio:4/3}.race-board-note{position:absolute;top:40%;left:10px;right:10px;margin:auto!important;width:fit-content;max-width:90%;padding:15px 18px;border:1px solid #41616f;border-radius:12px;background:#0c2439ed;text-align:center;font-size:18px;color:#eff7fa}.race-controls{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;flex:0 0 auto;width:100%;max-width:720px;margin:auto}.race-dialog .race-control{display:flex;align-items:center;justify-content:center;min-height:58px;padding:8px;font-size:14px;line-height:1;border-bottom:4px solid #416a7b;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.race-dialog .race-control:active{background:#366579}.race-dialog .race-drop{background:#d6b367;color:#16242c;border-color:#e1bd75;border-bottom-color:#9b7b3f}.race-result{border:1px solid #3b797c;background:#12383f;border-radius:12px;padding:15px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}.race-result h3{width:100%}.race-result-scores{font-size:18px;font-variant-numeric:tabular-nums}.race-result button{margin-left:auto}.race-chat{display:flex;flex-direction:column;gap:12px;min-height:0;flex:1}.race-chat-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}.race-chat-heading button{font-size:14px}.race-chat-log{min-height:100px;max-height:46dvh;flex:1;overflow:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:10px;padding:8px 0}.race-message{background:#213846;padding:10px 13px;border-radius:12px;width:fit-content;max-width:88%;overflow-wrap:anywhere;flex-shrink:0}.race-message.own{align-self:flex-end;background:#164d50}.race-message b{display:block;font-size:14px;color:#bde6e2;margin-bottom:4px}.race-message p{white-space:pre-wrap;font-size:16px;color:#eff7fa}.race-chat-form{display:grid;gap:7px;flex:0 0 auto}.race-chat-form textarea{resize:vertical;max-height:160px;min-height:74px}.race-counter{justify-self:end;font-size:14px;color:#aec6d0}.race-is-playing:not(.race-chat-open):not(.race-help-open) .race-privacy{display:none}.race-chat-open .race-clock-note{display:none}.race-chat-open .race-privacy{display:none}
@media(max-width:540px){.race-setup{grid-template-columns:1fr}.race-header{gap:8px}.race-dialog .race-close{max-width:102px;padding:8px;font-size:14px}.race-tag{max-width:225px;letter-spacing:.6px}.race-shell{gap:10px}.race-invite-actions,.race-ready-actions{flex-direction:column}.race-game{gap:8px}.race-stage{gap:9px}.race-opponent{gap:4px}.race-room-actions button{font-size:14px}.race-clock-note{font-size:14px}.race-is-playing:not(.race-chat-open):not(.race-help-open) .race-room-actions{gap:4px}.race-is-playing:not(.race-chat-open):not(.race-help-open) .race-room-actions button{min-height:48px;padding:7px 10px}.race-chat-heading{align-items:flex-start}.race-chat-heading h3{font-size:18px}.race-chat-heading button{max-width:120px}}
@media(max-width:350px){.race-controls{gap:4px}.race-dialog .race-control{font-size:14px;padding:6px 2px}.race-stage{grid-template-columns:minmax(0,1fr) 72px;gap:7px}.race-dialog{padding-left:8px;padding-right:8px}.race-scores strong{font-size:24px}.race-room-actions button{flex:1}.race-header h2{font-size:20px}}
.race-control-symbol{display:block;width:28px;height:28px;pointer-events:none}.race-control-symbol svg{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}.race-board:focus-visible{outline:3px solid #efd073;outline-offset:3px}
.race-partner-board{max-height:clamp(70px,calc(var(--race-board-height,400px) - 170px),330px)}
.race-compact .race-next{max-height:42px;object-fit:contain}
.race-is-playing:not(.race-chat-open):not(.race-help-open) .race-tag{display:none}.race-is-playing:not(.race-chat-open):not(.race-help-open) .race-shell,.race-is-playing:not(.race-chat-open):not(.race-help-open) .race-game{gap:8px}.race-is-playing:not(.race-chat-open):not(.race-help-open) .race-header h2{font-size:clamp(20px,4.4vw,24px)}
@media(orientation:landscape) and (min-width:600px){.race-shell{max-width:960px}.race-is-playing:not(.race-chat-open):not(.race-help-open) .race-game{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto auto;gap:10px;align-items:start}.race-is-playing:not(.race-chat-open):not(.race-help-open) .race-scores{grid-column:2;grid-row:1}.race-is-playing:not(.race-chat-open):not(.race-help-open) .race-stage{grid-column:1;grid-row:1/3;grid-template-columns:minmax(0,1fr) minmax(70px,28%)}.race-is-playing:not(.race-chat-open):not(.race-help-open) .race-controls{grid-column:2;grid-row:2;grid-template-columns:repeat(3,minmax(0,1fr));align-self:end}.race-is-playing:not(.race-chat-open):not(.race-help-open) .race-controls .race-drop{grid-column:2/4}.race-is-playing:not(.race-chat-open):not(.race-help-open) .race-clock-note{max-width:800px}.race-chat{max-width:760px;width:100%;margin:auto}}

/* Keep the invitation and agreement steps short; instructions live in Help. */
.race-header>div:first-child{min-width:0;flex:1}.race-dialog .race-help-button{flex:0 0 48px;width:48px;min-width:48px;max-width:48px;padding:8px;font-size:24px;line-height:1;background:#163947;border-color:#467080}.race-setup{display:block;width:100%;max-width:600px;margin-inline:auto}.race-create{gap:16px;padding:18px}.race-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.race-options>label,.race-options>div{min-width:0}.race-options label{display:flex;flex-direction:column;gap:7px}.race-options select{min-width:0}.race-dialog select{appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%23b9d6df' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;background-size:20px;padding-right:38px}.race-create>.race-primary{width:100%;margin-top:0}.race-manual-join{margin-top:14px;border-top:1px solid #2b4859}.race-manual-join>summary,.race-settings-edit>summary,.race-room-code>summary{display:flex;align-items:center;min-height:48px;padding:8px 0;box-sizing:border-box;cursor:pointer;color:#c6dfe7;font-size:14px;font-weight:600;list-style:none}.race-manual-join>summary::-webkit-details-marker,.race-settings-edit>summary::-webkit-details-marker,.race-room-code>summary::-webkit-details-marker{display:none}.race-manual-join>summary::after,.race-settings-edit>summary::after,.race-room-code>summary::after{content:'+';margin-left:auto;padding-left:12px;font-size:22px;font-weight:400;color:#92b7c5}.race-manual-join[open]>summary::after,.race-settings-edit[open]>summary::after,.race-room-code[open]>summary::after{content:'−'}.race-manual-join .race-join{margin-top:0;padding:12px 0 0;border:0;border-radius:0}.race-direct-invite{display:flex;flex-direction:column;gap:18px;padding:22px;border:1px solid #427e81;border-radius:16px;background:#15363e;max-width:600px;width:100%;box-sizing:border-box;margin-inline:auto}.race-direct-invite .race-primary{width:100%}.race-direct-invite p{font-size:16px;color:#d9edea}.race-lobby{gap:14px}.race-settings-summary{padding:13px 16px;border:1px solid #397579;border-radius:12px;background:#12383f;color:#cceee9;font-size:16px;font-weight:600;line-height:1.5}.race-settings-edit{padding:0 14px;border:1px solid #345363;border-radius:12px;background:#102837}.race-settings-edit[open]{padding-bottom:14px}.race-host-settings{display:flex;flex-direction:column;gap:12px}.race-host-settings>.race-options{width:100%}.race-host-settings>.race-primary{align-self:flex-start}.race-room-code{padding:0 14px;border:1px solid #2f4e60;border-radius:12px;background:#102532;font-size:14px}.race-room-code[open]{padding-bottom:12px}.race-room-code strong{font-size:20px;letter-spacing:2px;margin:3px 0 8px}.race-room-code button{font-size:14px}.race-invite-actions{display:flex;flex-direction:column;gap:7px}.race-invite-actions .race-primary{width:100%}.race-invite-actions .race-quiet{align-self:center;flex:0 0 auto;min-height:48px;font-size:14px;padding:8px 12px}.race-ready-actions{gap:8px}.race-ready-actions .race-confirmed{background:#164e49;border-color:#4a9c8e;color:#c9f2e6}.race-seat{padding:13px;gap:5px}.race-seat span{line-height:1.4}.race-lobby-note{font-size:16px;line-height:1.5}.race-help{display:flex;flex-direction:column;gap:18px;min-height:0;flex:1;width:100%;max-width:760px;margin-inline:auto}.race-help-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.race-help-heading h3{font-size:22px;line-height:1.35}.race-help-heading button{flex:0 0 auto;font-size:14px;max-width:150px}.race-help-content{display:flex;flex-direction:column;gap:16px;color:#d2e3eb;font-size:16px;line-height:1.65}.race-help-content ol,.race-help-content ul{padding-left:24px;margin:0}.race-help-content li+li{margin-top:12px}.race-help-content h4{margin:0;color:#eff7fa;font-size:16px;line-height:1.4}.race-help-content p{font-size:16px}.race-help-content details{padding:0 14px;border:1px solid #345363;border-radius:12px;background:#102837}.race-help-content summary{display:flex;align-items:center;min-height:48px;font-size:14px;font-weight:600;cursor:pointer;color:#c6dfe7}.race-help-content details p{padding:8px 0 14px}.race-help-content .race-quiet{align-self:flex-start}.race-help-open .race-privacy,.race-help-open .race-clock-note{display:none}.race-help-open .race-shell{gap:16px}.race-help-open .race-tag{display:block}.race-help-open .race-room-actions{display:none}.race-is-playing:not(.race-chat-open):not(.race-help-open) .race-room-actions{justify-content:flex-start}.race-is-playing:not(.race-chat-open):not(.race-help-open) .race-room-actions button{min-height:48px}.race-help-open .race-game{display:none}
@media(max-width:540px){.race-landing{gap:14px}.race-create{padding:16px}.race-options{gap:10px}.race-help-heading h3{font-size:20px}.race-help-heading button{max-width:110px}.race-help-open .race-header{gap:8px}.race-help-open .race-tag{display:none}.race-help-content{gap:14px}.race-invite-actions{flex-direction:column}.race-ready-actions{flex-direction:column}.race-direct-invite{padding:18px}}
@media(max-width:350px){.race-header{gap:6px}.race-dialog .race-close{max-width:88px;font-size:14px;padding:7px}.race-options{gap:8px}.race-options label{font-size:14px}.race-create{padding:13px}.race-settings-edit{padding-inline:12px}.race-help-heading{gap:8px}.race-help-heading button{max-width:100px}}

.race-help-open .race-help .race-privacy{display:block}
