.lobby-app { max-width: 1180px; }
.network-diagnostics { margin-block: 18px; border: 1px solid var(--line); border-radius: 6px; background: #f7f5ec; }
.network-diagnostics summary { padding: 15px 20px; cursor: pointer; font-size: 12px; color: var(--green); }
.network-diagnostics summary span { margin-left: 14px; font-size: 10px; color: #71816f; }
.network-details { border-top: 1px solid var(--line); padding: 20px; }
.network-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 22px 16px; margin: 0 0 20px; }
.network-metrics dt { font: 9px var(--mono); color: #627363; margin-bottom: 8px; }
.network-metrics dd { margin: 0; font: 12px var(--mono); overflow-wrap: anywhere; }
.network-metrics small { display: block; margin-top: 6px; font-size: 10px; color: #71816f; }
.network-details p, .network-tools span { font-size: 11px; color: #627363; line-height: 1.7; }
.network-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.network-tools span { flex-basis: 100%; }
.back-link, .lobby-help a { font-size: 12px; color: var(--green); text-decoration: none; }
.back-link:hover, .lobby-help a:hover { text-decoration: underline; }
.lobby-intro { padding-top: 48px; padding-bottom: 32px; }
.lobby-badge { font: 9px var(--mono); color: #856a3f; border: 1px solid #c9bb98; border-radius: 4px; padding: 8px 10px; letter-spacing: .7px; white-space: nowrap; }
.lobby-entry, .room-panel { border: 1px solid #cbd1c5; border-radius: 8px; background: #f7f5ec; overflow: hidden; }
.pilot-name-field { padding: 26px 30px; border-bottom: 1px solid var(--line); }
.lobby-app label { display: block; font: 9px var(--mono); letter-spacing: 1px; color: #627363; margin-bottom: 9px; }
.lobby-app input { background: #fffdf6; border: 1px solid #c5cdbd; border-radius: 4px; padding: 12px; color: var(--ink); min-width: 0; font-size: 14px; }
#pilot-name { width: min(100%, 340px); }
.pilot-name-field p, .room-choice p { font-size: 12px; color: #71816f; line-height: 1.7; }
.pilot-name-field p { margin: 8px 0 0; font-size: 10px; }
.room-choices { display: grid; grid-template-columns: 1fr 1fr; }
.room-choice { padding: 30px; margin: 0; }
.room-choice + .room-choice { border-left: 1px solid var(--line); }
.room-choice h2 { font-weight: 500; font-size: 26px; letter-spacing: -.6px; margin: 12px 0; }
.room-choice p { min-height: 43px; max-width: 340px; margin: 0 0 20px; }
.room-choice label { margin-top: 22px; }
.join-row { display: flex; align-items: stretch; gap: 12px; }
#room-code { width: 128px; text-transform: uppercase; letter-spacing: 5px; font: 21px var(--mono); }
.lobby-app .primary-button { font-size: 12px; padding: 13px 20px; white-space: nowrap; }
button:disabled { opacity: .5; cursor: default; }
.secondary-button { padding: 10px 13px; border: 1px solid #c3cdbb; background: transparent; border-radius: 4px; font-size: 11px; }
.secondary-button:hover { background: #e9eddf; }
.lobby-error { padding: 15px 18px; background: #fae4d7; border: 1px solid #dbac95; color: #8f3e24; border-radius: 5px; font-size: 12px; line-height: 1.6; }
.room-top { padding: 25px 30px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.room-top h2 { font-size: 24px; font-weight: 400; margin: 9px 0 0; }
#active-room-code { font: 32px var(--mono); letter-spacing: 5px; padding-left: 12px; }
.room-tools { display: flex; gap: 10px; }
.room-pilots { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.room-pilot { border-top: 3px solid var(--pilot-color); padding: 25px 30px; min-width: 0; }
.room-pilot + .room-pilot { border-left: 1px solid var(--line); }
.room-pilot .eyebrow { color: var(--pilot-color); }
.room-pilot h3 { font-size: 24px; font-weight: 500; margin: 15px 0 12px; overflow-wrap: anywhere; }
.room-pilot p { font: 10px var(--mono); line-height: 1.7; color: #6b7b69; margin: 0; }
.connection-strip { padding: 12px 30px; display: flex; justify-content: space-between; gap: 12px; border-block: 1px solid var(--line); background: #edf0e5; font: 9px var(--mono); color: #6b7b69; }
.connection-state { display: flex; align-items: center; gap: 7px; letter-spacing: .7px; }
.connection-state::before { content: ''; width: 6px; height: 6px; background: #9ca88e; border-radius: 50%; }
.connection-state[data-state="connected"]::before { background: var(--green); }
.connection-state[data-state="failed"]::before { background: var(--orange); }
.ready-section { padding: 28px 30px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.ready-section h3 { font-size: 22px; font-weight: 500; margin: 0 0 9px; letter-spacing: -.4px; }
.ready-section p { color: #71816f; font-size: 12px; line-height: 1.7; margin: 0; }
.ready-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: end; flex-shrink: 0; }
#ready-button[aria-pressed="true"] { background: var(--green); }
.milestone-note { padding: 14px 30px; margin: 0; border-top: 1px solid var(--line); font-size: 11px; color: #7d8775; line-height: 1.7; }
.lobby-help { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; margin: 32px 0 40px; }
.lobby-help h2 { font-size: 14px; font-weight: 500; margin: 0 0 10px; }
.lobby-help p { font-size: 12px; color: #71816f; line-height: 1.8; max-width: 410px; }
@media (max-width: 650px) {
  .online-intro { flex-direction: row; flex-wrap: wrap; gap: 15px; }
  .online-intro h1 { font-size: 31px; }
  .online-guide { flex-direction: column; gap: 10px; }
  .online-options { flex-direction: row; flex-wrap: wrap; }
  .online-game .pilot-top h3 { font-size: 14px; }
  .online-game .canvas-overlay { padding: 10px; }
  .online-game .canvas-overlay h2 { font-size: 21px; }
  .online-game .canvas-overlay .eyebrow { display: none; }
  .lobby-intro { align-items: start; flex-direction: column; padding-top: 30px; gap: 17px; }
  .lobby-intro p { line-height: 1.7; }
  .back-link { max-width: 80px; text-align: right; font-size: 10px; line-height: 1.6; }
  .room-choices, .lobby-help { grid-template-columns: 1fr; }
  .room-choice, .pilot-name-field, .room-top, .ready-section { padding: 23px; }
  .room-choice + .room-choice { border-left: 0; border-top: 1px solid var(--line); }
  .room-choice p { min-height: 0; }
  .room-pilot { padding: 19px 16px; }
  .room-pilot .eyebrow { font-size: 7px; letter-spacing: .7px; }
  .room-pilot h3 { font-size: 20px; }
  .room-pilot p { font-size: 8px; }
  .room-top, .ready-section { flex-wrap: wrap; gap: 17px; }
  .connection-strip { padding: 13px 16px; flex-wrap: wrap; }
  .milestone-note { padding: 16px 23px; }
  .lobby-help { gap: 15px; margin: 28px 0; }
  .lobby-app .primary-button { padding-inline: 14px; }
}

.room-options { display: flex; flex-wrap: wrap; align-items: end; gap: 18px; padding: 22px 0; border-top: 1px solid var(--line); }
.room-options label { display: grid; gap: 9px; font-size: 12px; flex: 1 1 155px; }
.room-options input { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 4px; background: #fffdf6; color: inherit; }
.room-options p { flex-basis: 100%; margin: 0; font-size: 12px; }
.room-pilots, .online-game .scoreboard { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.online-game .pilot-card { min-width: 0; border-top: 3px solid; }
.online-game .pilot-card h3 { overflow-wrap: anywhere; }
.launch-queue { padding: 12px 18px; margin: 0; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.6; }
.online-results { grid-column: 1; padding: 24px; margin-top: 20px; background: #f7f5ed; border: 1px solid var(--line); border-radius: 8px; }
.results-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.results-heading h2 { margin: 0; }
.online-results select, #diagnostic-peer { padding: 8px; margin: 10px; max-width: 230px; }
.stats-scroll { overflow-x: auto; margin-top: 18px; }
.stats-scroll table { border-collapse: collapse; width: 100%; font-size: 12px; text-align: right; }
.stats-scroll th, .stats-scroll td { border-bottom: 1px solid var(--line); padding: 12px 9px; }
.stats-scroll th:first-child, .stats-scroll td:first-child { text-align: left; min-width: 110px; }
.stats-scroll thead th { min-width: 65px; font-size: 11px; }
.stats-note, #round-results { font-size: 12px; line-height: 1.7; }
@media (max-width: 520px) { .room-pilots, .online-game .scoreboard { grid-template-columns: 1fr 1fr; } .online-game .pilot-card { padding: 10px; } .online-results { padding: 14px; } }
