:root{font-family:Inter,Arial,sans-serif;color:#e5e7eb;background:#020617}*{box-sizing:border-box}body{margin:0;background:radial-gradient(circle at top,#111827,#020617 65%)}button,input,select{font:inherit}button{border:0;border-radius:10px;padding:.8rem 1rem;cursor:pointer}button:disabled{opacity:.6;cursor:not-allowed}input,select{width:100%;padding:.8rem .9rem;border-radius:10px;border:1px solid #334155;background:#0f172a;color:#e5e7eb}label{display:grid;gap:.4rem}.app{width:min(98vw,2200px);margin:0 auto;padding:1rem}.app-game{width:100vw;max-width:none;height:100dvh;min-height:100dvh;padding:.5rem;overflow:hidden}.layout{display:grid;gap:1rem}.app:not(.app-game) .layout{align-items:start}.layout.double{grid-template-columns:repeat(auto-fit,minmax(320px,1fr))}.layout.single{grid-template-columns:1fr}.app-game .layout,.app-game .layout.single,.app-game .game-layout{height:100%}.panel{display:grid;gap:1rem;padding:1.25rem;border:1px solid #1e293b;border-radius:16px;background:#0f172ae6;box-shadow:0 8px 30px #00000040}.app:not(.app-game) .panel{align-content:start}.app-game .panel{height:100%;padding:0;border:0;background:transparent;box-shadow:none}.actions{display:flex;flex-wrap:wrap;gap:.75rem}.actions.vertical{flex-direction:column}.room-list,.players{display:grid;gap:.8rem;padding:0;margin:0;list-style:none}.app:not(.app-game) .room-list,.app:not(.app-game) .players{align-content:start;grid-auto-rows:max-content}.players.compact{gap:.35rem;margin-top:.3rem}.chat-panel{min-height:360px}.competition-chat-overlay{position:absolute;left:calc(50% + min(68vw,1040px)/2 + (100vw - min(68vw,1040px))/4 - (min(26vw,380px)/2));width:min(26vw,380px);z-index:3}.competition-chat-overlay .chat-panel{min-height:0;height:100%;padding:.8rem .9rem;border-radius:18px;background:#020617c7;border:1px solid rgba(148,163,184,.28);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);box-shadow:none;grid-template-rows:auto minmax(0,1fr) auto}.competition-chat-overlay .chat-messages{min-height:0;max-height:none}.archive-modal{width:min(1760px,99vw);max-height:min(92vh,1040px);gap:.8rem}.archive-table-scroll{overflow:auto}.archive-table{width:max-content;min-width:100%;border-collapse:collapse;font-size:.84rem}.archive-table th,.archive-table td{padding:.6rem .62rem;border-bottom:1px solid rgba(148,163,184,.2);text-align:left;vertical-align:middle;white-space:nowrap;word-break:normal}.archive-filter-tabs{display:flex;gap:.55rem;flex-wrap:wrap;justify-content:flex-end;align-items:center}.archive-filter-tabs button{min-height:2.6rem;white-space:nowrap}.lobby-layout{gap:.7rem}.lobby-records-panel{width:100%}.lobby-records-panel>p{margin:0}.lobby-records-table-wrap{overflow-x:visible}.lobby-records-table{width:100%;min-width:100%;table-layout:fixed}.lobby-records-table th,.lobby-records-table td{white-space:normal;word-break:break-word;overflow-wrap:anywhere}.lobby-records-table th:first-child,.lobby-records-table td:first-child{width:8rem}.lobby-secondary-layout{width:100%;gap:.7rem}.app:not(.app-game) .lobby-layout .panel{gap:.7rem;padding:.9rem 1rem}.app:not(.app-game) .lobby-layout h1,.app:not(.app-game) .lobby-layout h2,.app:not(.app-game) .lobby-layout h3,.app:not(.app-game) .lobby-layout h4,.app:not(.app-game) .lobby-layout p{margin:0}.app:not(.app-game) .lobby-layout .actions{gap:.45rem}.app:not(.app-game) .lobby-layout .actions.vertical button,.app:not(.app-game) .lobby-layout .actions.vertical .time-sync-toggle{min-height:2.35rem;padding:.55rem .8rem}.app:not(.app-game) .lobby-layout .online-list,.app:not(.app-game) .lobby-layout .players,.app:not(.app-game) .lobby-layout .room-list{gap:.35rem}.app:not(.app-game) .lobby-layout .time-sync-panel{margin-top:.2rem;gap:.4rem;padding:.65rem .75rem}.app:not(.app-game){min-height:100dvh}.app:not(.app-game).app{padding-top:.7rem;padding-bottom:.7rem}.archive-actions,.race-table-actions{display:flex;align-items:center;gap:.4rem;flex-wrap:nowrap}.table-icon-button{display:inline-grid;place-items:center;width:2.25rem;height:2.25rem;padding:0;border-radius:10px;background:#0f172a;color:#dbeafe;border:1px solid rgba(59,130,246,.3)}.table-icon-button-danger{color:#fecaca;border-color:#f8717159;background:#450a0aa6}.table-icon-button svg,.archive-action-button svg{width:1rem;height:1rem}.archive-stats-note{color:#93c5fd;font-size:.92rem}.archive-version-warning{display:inline-flex;align-items:center;min-height:2rem;padding:.2rem .5rem;border-radius:999px;background:#f59e0b29;border:1px solid rgba(251,191,36,.3);color:#fde68a;font-size:.72rem;font-weight:700;white-space:nowrap}.archive-highlight-row td{background:#3b82f61f}.archive-saved-label{display:inline-flex;align-items:center;justify-content:center;min-height:2rem;padding:.2rem .55rem;border-radius:999px;background:#22c55e24;border:1px solid rgba(74,222,128,.3);color:#bbf7d0;font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.03em}.archive-saved-pill{min-height:40px;padding-inline:.75rem}.chat-messages{min-height:220px;max-height:360px;overflow:auto;display:grid;grid-auto-rows:max-content;align-content:start;gap:.45rem;padding-right:.25rem}.chat-empty-state{margin:0;color:#94a3b8}.chat-message{display:grid;align-content:start;gap:.14rem;min-height:3.35rem;padding:.48rem .68rem;border-radius:12px;background:#0b1220;border:1px solid #334155}.chat-message-header{display:flex;justify-content:space-between;gap:.8rem;color:#94a3b8;font-size:.85rem}.chat-author{display:inline-flex;align-items:center;gap:.15rem;font-weight:700;color:#e2e8f0}.chat-message p{margin:0;line-height:1.3;white-space:pre-wrap;word-break:break-word}.chat-form{display:grid;grid-template-columns:1fr auto;gap:.6rem}.room-card{display:grid;gap:.4rem;padding:1rem;border-radius:12px;background:#0b1220;border:1px solid #334155}.app:not(.app-game) .room-card{align-content:start}.color-dot{display:inline-block;width:12px;height:12px;border-radius:999px;margin-left:.35rem;margin-right:.35rem}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:1rem;background:#020617b8;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);z-index:20}.modal-panel{width:min(920px,96vw);max-height:88vh;overflow:auto}.instructions-modal{gap:.9rem}.instructions-header{display:flex;align-items:center;justify-content:space-between;gap:1rem}.instructions-header h2,.instructions-content h3{margin:0}.instructions-content{display:grid;gap:.9rem}.instructions-content section{display:grid;gap:.35rem;padding:.9rem 1rem;border-radius:12px;background:#0b1220;border:1px solid #334155}.instructions-content p{margin:0;color:#cbd5e1}.toolbar{display:flex;justify-content:flex-end}.game-shell{min-height:88vh;height:88vh;width:100%;border-radius:18px;overflow:hidden;border:1px solid #334155}.game-shell.competition{min-height:88vh;height:88vh}.game-stage{position:relative;height:100%;overflow:hidden;contain:layout size paint}.app-game .game-shell,.app-game .game-shell.competition{min-height:100%;height:100%}.game-shell canvas{display:block;margin:0 auto}.race-overlay{position:absolute;left:50%;transform:translate(-50%);width:min(68vw,1040px);max-height:none;overflow:hidden;padding:.65rem .8rem;border-radius:18px;background:#020617c7;border:1px solid rgba(148,163,184,.28);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);display:grid;grid-template-rows:auto minmax(0,1fr);gap:.5rem}.race-overlay h3{margin:0}.race-overlay-header{display:grid;gap:.45rem}.race-overlay-header-top{display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem}.race-overlay-status{margin:.18rem 0 0;color:#bfdbfe;font-size:.88rem}.race-overlay-controls{display:flex;align-items:flex-start;justify-content:flex-end;gap:.45rem;flex-wrap:wrap}.race-inline-actions{display:flex;align-items:center;justify-content:flex-end;gap:.35rem;flex-wrap:wrap}.compact-inline-button{padding:.3rem .48rem;font-size:.72rem;line-height:1.1}.engine-sound-toggle{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;padding:0;border:1px solid rgba(251,191,36,.35);background:#0f172ae0;color:#f8fafc;box-shadow:inset 0 0 0 1px #ffffff08}.engine-sound-toggle svg{width:21px;height:21px}.archive-action-button{background:#0891b224;color:#a5f3fc;border-color:#22d3ee4d}.engine-sound-toggle.muted{border-color:#f8717159;color:#fca5a5;background:#1e1218e6}.race-meta-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.35rem}.race-meta-grid span{padding:.36rem .5rem;border-radius:10px;background:#0f172ab3;border:1px solid rgba(148,163,184,.18);font-size:.82rem}.race-overlay-grid{display:none}.race-panel-section{min-height:0;padding:.5rem .6rem;border-radius:14px;background:#0f172a9e;border:1px solid rgba(148,163,184,.14);overflow:hidden}.race-panel-section h4{margin:0 0 .35rem;font-size:.88rem;letter-spacing:.02em;text-transform:uppercase;color:#cbd5e1}.race-panel-heading{display:flex;align-items:center;justify-content:space-between;gap:.8rem;margin-bottom:.4rem}.race-table-sort-toggle{display:inline-flex;align-items:center;gap:.3rem;padding:.2rem;border-radius:999px;background:#0f172ac7;border:1px solid rgba(148,163,184,.2)}.race-table-sort-toggle button{padding:.28rem .62rem;border-radius:999px;border:1px solid transparent;background:transparent;color:#cbd5e1;font-size:.74rem}.race-table-sort-toggle button.active{background:#2563eb38;border-color:#60a5fa66;color:#eff6ff}.race-panel-table{overflow:hidden;display:grid;grid-template-rows:auto minmax(0,1fr);align-content:start}.race-table-scroll{min-height:0;overflow:auto}.race-stats-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.45rem}.race-stat-card{display:grid;gap:.2rem;padding:.5rem .55rem;border-radius:12px;background:#1e293b99;border:1px solid rgba(148,163,184,.14);font-size:.75rem}.race-empty-state{margin:0;color:#94a3b8;font-size:.92rem}.race-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:.75rem;align-self:start}.race-table thead,.race-table tbody,.race-table tr{height:auto}.race-table th,.race-table td{border-bottom:1px solid rgba(148,163,184,.22);height:2.1rem;min-height:2.1rem;max-height:2.1rem;padding:.22rem .24rem;text-align:left;vertical-align:middle;line-height:1.15;white-space:nowrap}.race-table th{font-size:.68rem;letter-spacing:.02em}.race-rider-cell{display:flex;align-items:center;gap:.18rem;min-width:0}.race-rider-cell span:last-child{overflow:hidden;text-overflow:ellipsis}.race-cell-highlight{border-radius:8px}.race-cell-highlight-finish{background:#22c55e33}.race-cell-highlight-lap{background:#1e40af57}.race-cell-highlight-value{font-weight:700}.game-toolbar{position:absolute;top:.8rem;left:.8rem;display:flex;gap:.6rem;z-index:3}.countdown-overlay{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-size:clamp(72px,12vw,180px);font-weight:800;color:#fff;text-shadow:0 10px 30px rgba(0,0,0,.55);z-index:4;pointer-events:none}.winner-overlay{position:absolute;left:50%;top:.45rem;transform:translate(-50%);width:min(92vw,1500px);text-align:center;font-size:clamp(16px,1.6vw,28px);font-weight:800;color:#f8fafc;text-shadow:0 6px 20px rgba(0,0,0,.55);z-index:4;pointer-events:none}.finish-overlay{position:absolute;left:50%;top:20%;transform:translate(-50%,-50%);font-size:clamp(30px,4.5vw,72px);font-weight:800;letter-spacing:.06em;color:#fde047;text-shadow:0 10px 30px rgba(0,0,0,.55);z-index:4;pointer-events:none}.replay-badge{position:absolute;top:1.3rem;right:1.3rem;z-index:4;min-width:3rem;padding:.4rem .7rem;border-radius:999px;background:#ef44442e;border:1px solid rgba(248,113,113,.45);color:#fecaca;font-weight:800;letter-spacing:.14em;text-align:center;animation:replay-pulse 1.1s steps(2,end) infinite}@keyframes replay-pulse{50%{opacity:.35}}.status-message{margin:0;color:#93c5fd}.error-message{margin:0;color:#fca5a5}.online-list{margin:0;padding-left:1rem;display:grid;gap:.25rem}.color-picker-row{display:flex;align-items:center;gap:.8rem}.color-field{display:grid;gap:.45rem}.checkbox-row{display:inline-flex;align-items:center;gap:.45rem}.time-sync-panel{display:grid;gap:.55rem;margin-top:.6rem;padding:.8rem .9rem;border:1px solid #334155;border-radius:12px;background:#0f172ab3}.time-sync-toggle{justify-self:start;border:1px solid #334155;background:#0f172a;color:#e5e7eb;padding:.55rem .8rem}.time-sync-toggle.active{border-color:#22c55e;background:#14532dcc;color:#dcfce7}.time-sync-grid{display:grid;grid-template-columns:auto 1fr;gap:.25rem .75rem;font-size:.92rem}.time-sync-grid span{color:#94a3b8}.time-sync-grid strong{color:#e2e8f0}.time-sync-note{margin:0;color:#bfdbfe;font-size:.84rem;line-height:1.35}.time-sync-debug-log{display:grid;gap:.25rem;max-height:10rem;overflow-y:auto;padding:.45rem .55rem;border:1px solid #1e293b;border-radius:10px;background:#020617b8;font-size:.74rem}.time-sync-debug-entry{display:grid;gap:.1rem}.time-sync-debug-entry span,.time-sync-debug-empty{color:#64748b}.time-sync-debug-entry strong{color:#cbd5e1;font-weight:600}.turn-key-field,.turn-key-row{display:grid;gap:.45rem}.turn-key-button{justify-self:start;min-width:220px;border:1px solid #334155;background:#0f172a;color:#e5e7eb}.turn-key-button.capturing{border-color:#f59e0b;color:#fde68a}.local-rider-form{display:grid;gap:.9rem}.local-rider-item{display:flex;align-items:center;justify-content:space-between;gap:1rem}input[type=checkbox]{width:auto}input[type=color]{width:56px;height:36px;padding:0;border:0;border-radius:8px;background:transparent}@media(max-width:1100px){.race-overlay{width:min(86vw,980px)}.competition-chat-overlay{left:50%;top:calc(29% + min(36vh,330px) + .8rem);transform:translate(-50%);width:min(86vw,980px)}.competition-chat-overlay .chat-panel{height:auto;min-height:220px}.race-panel-heading{flex-direction:column;align-items:stretch}}
