:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #071018;
  color: #f2f7fb;
}

* { box-sizing: border-box; }

body {
  min-width: 340px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(900px 500px at 5% -10%, rgba(24, 143, 204, .21), transparent 62%),
    radial-gradient(700px 430px at 105% 8%, rgba(227, 66, 80, .16), transparent 64%),
    #071018;
}

button, select { font: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }

.race-control-app { width: min(1280px, 100%); margin: 0 auto; padding: 22px clamp(16px, 3vw, 42px) 44px; }
.topbar { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; letter-spacing: .02em; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(137, 221, 255, .55); border-radius: 11px; background: linear-gradient(135deg, #1ebdeb, #1775b9); box-shadow: 0 6px 22px rgba(0, 168, 227, .2); font-size: .8rem; font-weight: 950; }
.brand b, .brand small { display: block; line-height: 1; }
.brand b { font-size: 1.06rem; letter-spacing: .11em; }
.brand small, .eyebrow { color: #82b4c9; font-size: .64rem; font-weight: 800; letter-spacing: .14em; }
.brand small { margin-top: 5px; }
.connection-status { display: inline-flex; align-items: center; min-height: 32px; padding: 0 11px; border: 1px solid rgba(132, 177, 198, .24); border-radius: 999px; color: #a9c7d6; background: rgba(16, 39, 52, .7); font-size: .76rem; white-space: nowrap; }
.connection-status i { width: 7px; height: 7px; border-radius: 50%; background: #e3ae5e; box-shadow: 0 0 0 4px rgba(227, 174, 94, .12); }
.connection-status.is-connected i { background: #65df9d; box-shadow: 0 0 0 4px rgba(101, 223, 157, .12); }
.connection-status.is-error i { background: #ff6874; box-shadow: 0 0 0 4px rgba(255, 104, 116, .12); }
.access-denied { margin-top: 54px; padding: 24px; border: 1px solid rgba(255, 102, 112, .42); border-radius: 16px; background: rgba(91, 23, 31, .36); color: #ffc2c6; }
.access-denied strong, .access-denied span { display: block; }
.access-denied span { margin-top: 5px; color: #dca4a9; font-size: .9rem; }

.race-overview { display: grid; grid-template-columns: minmax(280px, 1.7fr) repeat(3, minmax(135px, .72fr)); gap: 12px; margin-top: 28px; }
.track-card, .status-card, .command-deck, .rooms-section { border: 1px solid rgba(129, 182, 207, .19); background: linear-gradient(145deg, rgba(20, 47, 62, .78), rgba(9, 25, 35, .87)); box-shadow: 0 18px 45px rgba(0, 0, 0, .16); }
.track-card { min-height: 158px; padding: 23px; border-radius: 18px; background: linear-gradient(125deg, rgba(27, 78, 101, .91), rgba(12, 32, 45, .92) 60%, rgba(43, 34, 46, .86)); }
.track-name-row { display: flex; align-items: center; gap: 12px; margin-top: 13px; }
.flag { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: rgba(255, 255, 255, .1); font-size: 1.18rem; }
h1 { max-width: 100%; margin: 0; overflow: hidden; font-size: clamp(1.34rem, 2.3vw, 2rem); line-height: 1.12; text-overflow: ellipsis; white-space: nowrap; }
.track-card p { margin: 10px 0 0 50px; color: #b0cfdb; font-size: .84rem; }
.status-card { min-height: 158px; padding: 22px 18px; border-radius: 18px; display: flex; flex-direction: column; justify-content: center; }
.status-card strong { margin-top: 9px; font-size: clamp(1.15rem, 2.2vw, 1.65rem); line-height: 1.05; }
.status-card small { margin-top: 8px; color: #9fbcca; font-size: .76rem; }
.phase-card strong { color: #ffcf72; }.timer-card strong { color: #8de2ff; font-variant-numeric: tabular-nums; }.drivers-card strong { color: #82e0ab; }

.live-map-card { margin-top: 18px; padding: 20px 22px 15px; border: 1px solid rgba(129, 182, 207, .19); border-radius: 18px; background: linear-gradient(145deg, rgba(20, 47, 62, .78), rgba(9, 25, 35, .87)); box-shadow: 0 18px 45px rgba(0, 0, 0, .16); }
.live-map-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; }.live-map-header h2 { margin: 6px 0 0; font-size: 1.05rem; }.live-map-count { padding: 5px 9px; border: 1px solid rgba(119, 213, 157, .26); border-radius: 999px; color: #91e6b2; background: rgba(60, 157, 102, .12); font-size: .73rem; font-weight: 750; }.live-map-frame { position: relative; height: 248px; margin-top: 15px; overflow: hidden; border: 1px solid rgba(126, 187, 211, .15); border-radius: 13px; background: radial-gradient(ellipse at center, rgba(28, 82, 100, .38), rgba(5, 18, 27, .78) 72%); }.live-map-frame::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .2; background-image: linear-gradient(rgba(129, 201, 229, .28) 1px, transparent 1px), linear-gradient(90deg, rgba(129, 201, 229, .28) 1px, transparent 1px); background-size: 24px 24px; }.live-map { position: relative; z-index: 1; width: 100%; height: 100%; overflow: visible; }.live-map-track { fill: none; stroke: rgba(235, 246, 251, .76); stroke-width: 3.9; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(108, 216, 255, .26)); }.live-map-empty { position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; margin: 0; color: #8dafbd; font-size: .82rem; }.live-map-empty[hidden] { display: none; }.live-map-note { margin: 10px 0 0; color: #779baa; font-size: .72rem; }

.track-queue-card { margin-top: 18px; padding: 21px 22px; border: 1px solid rgba(129, 182, 207, .19); border-radius: 18px; background: linear-gradient(145deg, rgba(20, 47, 62, .78), rgba(9, 25, 35, .87)); box-shadow: 0 18px 45px rgba(0, 0, 0, .16); }.queue-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }.queue-heading h2 { margin: 6px 0 0; font-size: 1.08rem; }.queue-heading p { margin: 6px 0 0; color: #9dbac8; font-size: .8rem; }.queue-fill-button { min-height: 35px; padding: 0 11px; border: 1px solid rgba(150, 199, 218, .26); border-radius: 9px; color: #c9e9f5; background: rgba(36, 78, 96, .54); font-size: .76rem; font-weight: 750; }.queue-fill-button:hover { background: rgba(47, 104, 128, .72); }.queue-add-row { display: flex; gap: 9px; margin-top: 17px; }.queue-add-row select { min-width: 0; flex: 1; min-height: 43px; padding: 0 11px; border: 1px solid rgba(134, 191, 214, .27); border-radius: 10px; outline: none; color: #d6edf5; background: #102c3d; }.queue-add-row select:focus { border-color: #52c9f0; box-shadow: 0 0 0 3px rgba(82, 201, 240, .12); }.track-queue { display: grid; gap: 7px; margin: 13px 0 0; padding: 0; list-style: none; }.queue-item { min-height: 57px; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 9px; border: 1px solid rgba(128, 181, 204, .15); border-radius: 11px; background: rgba(5, 18, 27, .36); }.queue-item.is-next { border-color: rgba(100, 214, 153, .42); background: linear-gradient(90deg, rgba(39, 137, 87, .2), rgba(7, 31, 31, .3)); }.queue-order { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: #acd5e4; background: rgba(114, 178, 201, .13); font-size: .75rem; font-weight: 850; }.queue-item.is-next .queue-order { color: #b9f5ce; background: rgba(72, 191, 116, .25); }.queue-track-info { min-width: 0; }.queue-track-info strong, .queue-track-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.queue-track-info strong { color: #effaff; font-size: .83rem; }.queue-track-info small { margin-top: 3px; color: #90b5c5; font-size: .68rem; }.queue-item-actions { display: flex; gap: 5px; }.queue-icon-button { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid rgba(145, 194, 212, .21); border-radius: 7px; color: #bfdeea; background: rgba(50, 90, 106, .45); font-size: .9rem; }.queue-icon-button:hover:not(:disabled) { color: #fff; background: rgba(73, 132, 155, .75); }.queue-icon-button:last-child { color: #ff9fa7; }.queue-icon-button:disabled { opacity: .26; }.queue-empty { padding: 17px; border: 1px dashed rgba(130, 184, 208, .22); border-radius: 10px; color: #8aaab9; font-size: .79rem; text-align: center; }

.command-deck { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 18px; padding: 21px 23px; border-radius: 18px; }
.command-copy strong { display: block; margin-top: 7px; font-size: 1.08rem; }.command-copy p { max-width: 590px; margin: 6px 0 0; color: #a5c1ce; font-size: .86rem; }
.command-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.button { min-height: 46px; display: inline-flex; align-items: center; gap: 9px; padding: 0 16px; border-radius: 11px; color: #effaff; font-weight: 750; transition: transform .15s ease, filter .15s ease, background .15s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.12); }.button-primary { background: linear-gradient(135deg, #158fc0, #1866b2); box-shadow: 0 7px 19px rgba(11, 115, 188, .26); }.button-outline { border: 1px solid rgba(163, 203, 220, .3); background: rgba(30, 63, 79, .62); }.button-icon { width: 16px; font-size: 1.05rem; text-align: center; }
.competition-points-toggle { min-height: 52px; display: inline-flex; align-items: center; gap: 10px; margin-left: auto; padding: 8px 12px; border: 1px solid rgba(255, 205, 104, .28); border-radius: 12px; color: #e9f5fa; background: rgba(112, 81, 28, .16); cursor: pointer; }.competition-points-toggle input { width: 18px; height: 18px; margin: 0; accent-color: #ffc45c; cursor: pointer; }.competition-points-toggle span { display: grid; gap: 2px; }.competition-points-toggle b { font-size: .8rem; }.competition-points-toggle small { color: #c3ab7b; font-size: .68rem; }

.rooms-section { margin-top: 18px; padding: 23px; border-radius: 18px; }.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }.section-heading h2 { margin: 6px 0 0; font-size: 1.2rem; }.room-control-actions { display: flex; align-items: center; justify-content: end; gap: 12px; }.section-heading p { max-width: 430px; margin: 0; color: #9dbac8; font-size: .82rem; line-height: 1.45; text-align: right; }.rooms { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 12px; }
.room-card { min-height: 126px; overflow: hidden; border: 1px solid rgba(130, 184, 208, .16); border-radius: 13px; background: rgba(4, 16, 24, .39); transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }.room-card.is-drop-target, .room-create-target.is-drop-target { border-color: rgba(105, 226, 155, .8); background: rgba(31, 120, 78, .2); box-shadow: inset 0 0 0 1px rgba(105, 226, 155, .24), 0 0 24px rgba(66, 206, 123, .1); }.room-card > header { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; border-bottom: 1px solid rgba(130, 184, 208, .14); background: rgba(57, 102, 122, .13); }.room-card h3 { margin: 0; font-size: .94rem; }.occupancy { padding: 3px 8px; border-radius: 999px; color: #a6c9d9; background: rgba(119, 180, 205, .12); font-size: .7rem; font-weight: 750; }.driver-list { padding: 3px 13px 8px; }.driver { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 9px; border-bottom: 1px solid rgba(135, 181, 201, .1); cursor: grab; transition: opacity .12s ease, background .12s ease; }.driver:active { cursor: grabbing; }.driver.is-dragging { opacity: .36; }.driver.is-drop-target { background: rgba(41, 125, 86, .3); outline: 1px solid rgba(105, 226, 155, .55); }.driver:last-child { border-bottom: 0; }.driver-identity { min-width: 0; flex: 1; display: flex; align-items: center; gap: 9px; }.driver-avatar { width: 27px; height: 27px; flex: 0 0 27px; display: grid; place-items: center; border-radius: 9px; color: #bcecff; background: linear-gradient(135deg, #276c88, #173d55); font-size: .72rem; font-weight: 900; }.driver-name { min-width: 0; overflow: hidden; color: #e9f4f9; font-size: .83rem; text-overflow: ellipsis; white-space: nowrap; }.driver-name small { display: block; margin-top: 2px; color: #7ea7ba; font-size: .67rem; }.drag-handle { color: #7196a7; font-size: 1.15rem; letter-spacing: -2px; line-height: 1; }.driver select { max-width: 114px; min-height: 31px; padding: 0 23px 0 8px; border: 1px solid rgba(134, 191, 214, .27); border-radius: 8px; outline: 0; color: #cce6f1; background: #123043; font-size: .75rem; cursor: pointer; }.driver select:focus { border-color: #52c9f0; box-shadow: 0 0 0 3px rgba(82, 201, 240, .12); }.room-create-target { min-height: 126px; display: grid; place-content: center; gap: 7px; padding: 18px; border: 1px dashed rgba(119, 187, 215, .4); border-radius: 13px; color: #c0e7f5; background: rgba(21, 63, 82, .26); text-align: center; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }.room-create-target strong { font-size: .92rem; }.room-create-target span { color: #89b4c6; font-size: .76rem; }.empty-room, .empty-rooms { margin: 15px 0; color: #769bab; font-size: .8rem; font-style: italic; }.empty-rooms { grid-column: 1 / -1; padding: 32px; border: 1px dashed rgba(130, 184, 208, .22); border-radius: 12px; text-align: center; }

@media (max-width: 930px) { .race-overview { grid-template-columns: minmax(250px, 1.5fr) repeat(2, minmax(130px, 1fr)); }.drivers-card { grid-column: 2; }.command-deck { align-items: flex-start; flex-direction: column; }.command-actions { width: 100%; }.button { flex: 1; justify-content: center; }.competition-points-toggle { width: 100%; margin-left: 0; } }
@media (max-width: 620px) { .race-control-app { padding: 16px 13px 30px; }.topbar { align-items: flex-start; flex-direction: column; gap: 12px; }.race-overview { grid-template-columns: 1fr 1fr; }.track-card { grid-column: 1 / -1; min-height: 140px; }.drivers-card { grid-column: auto; }.status-card { min-height: 113px; padding: 16px; }.live-map-card, .track-queue-card { padding: 17px 14px 13px; }.live-map-frame { height: 210px; }.queue-heading, .room-control-actions { align-items: flex-start; flex-direction: column; }.queue-add-row { align-items: stretch; flex-direction: column; }.section-heading { align-items: flex-start; flex-direction: column; }.section-heading p { text-align: left; }.rooms-section { padding: 17px 14px; }.command-deck { padding: 17px; }.command-actions { flex-direction: column; }.button { width: 100%; flex: auto; } }
