/* Entry screens. Match rendering and controls keep their own layout. */
a:focus-visible, summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
.arcade-home:not(.in-game) { min-height: 100dvh; background: radial-gradient(ellipse at 50% 0, #315e66, #173c49 65%); color: #fff5df; }
.arcade-home:not(.in-game) .lobby-app { max-width: 800px; padding: 24px 24px 40px; }
.title-screen { text-align: center; padding: 12px 0 30px; }
.title-plane .brand-mark { margin: auto; width: 66px; height: 66px; padding: 9px; border-radius: 14px; box-shadow: 0 6px 0 #102e38; }
.title-screen h1 { font-size: clamp(54px, 10vw, 92px); font-weight: 900; letter-spacing: -.055em; margin: 20px 0 8px; text-shadow: 0 5px 0 #102e38; }
.title-screen p { font-size: 18px; color: #c4d7d5; margin: 0; }
.arcade-home:not(.in-game) .lobby-entry, .arcade-home:not(.in-game) .room-panel { background: #102e3bdd; border: 1px solid #ffffff26; border-radius: 18px; box-shadow: 0 12px 32px #071c2533; }
.arcade-home:not(.in-game) label { color: #e0ece6; font: 600 15px -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; letter-spacing: 0; }
.arcade-home:not(.in-game) input { min-height: 52px; font-size: 18px; border: 2px solid transparent; border-radius: 8px; background: #f7f2e7; color: #173c49; }
.arcade-home:not(.in-game) .pilot-name-field { padding: 24px 24px 12px; border: 0; }
.arcade-home #pilot-name { width: 100%; }
.arcade-home .room-choices { padding: 0 24px 24px; gap: 24px; align-items: end; }
.arcade-home .room-choice { padding: 0; border: 0; min-width: 0; }
.arcade-home .room-choice p { min-height: 0; font-size: 14px; color: #c4d7d5; margin: 12px 0; }
.arcade-home .room-choice label { margin: 12px 0 9px; }
.arcade-home .join-row { gap: 8px; }
.arcade-home #room-code { width: 110px; flex: 0 1 110px; font-size: 20px; letter-spacing: 3px; }
.arcade-home:not(.in-game) .primary-button { min-height: 54px; padding: 13px 18px; font-size: 18px; font-weight: 750; border-radius: 8px; white-space: normal; box-shadow: 0 4px 0 #923e29; }
.arcade-home .create-choice .primary-button { width: 100%; }
.arcade-home #join-room { flex: 1; background: #315f65; box-shadow: 0 4px 0 #0a222e; border: 1px solid #83aca766; }
.arcade-home #join-room:hover { background: #42747a; }
.local-play-link { display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 56px; margin: 20px 0 8px; color: #fff5df; font-size: 17px; font-weight: 650; text-decoration: none; border: 1px solid #ffffff33; border-radius: 10px; }
.local-play-link:hover { background: #ffffff0c; }
.arcade-home:not(.in-game) .secondary-button { min-height: 44px; font-size: 14px; color: #e0ece6; border-color: #ffffff40; border-radius: 7px; }
.arcade-home:not(.in-game) .secondary-button:hover { background: #ffffff12; }
.arcade-home .room-top { padding: 24px; }
.arcade-home .room-top h2 { margin: 8px 0 0; }
.arcade-home #your-seat { font: 600 16px -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #bed3ce; letter-spacing: 0; }
.room-code-label { display: block; font-size: 14px; color: #bed3ce; margin-bottom: 5px; }
.arcade-home #active-room-code { padding: 0; font-size: 42px; font-weight: 750; }
.arcade-home .room-pilots { margin: 0 24px; gap: 12px; border: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.arcade-home .room-pilot { background: #ffffff08; border-left: 0; border-radius: 7px; padding: 16px; }
.arcade-home .room-pilot h3 { font-size: 20px; margin: 0 0 10px; }
.arcade-home .room-pilot p { color: #bed3ce; font: 14px -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.room-rules { padding: 0 24px; color: #e6d2a6; line-height: 1.6; font-size: 16px; }
.room-settings { margin: 0 24px; border-top: 1px solid #ffffff26; }
.room-settings summary { padding: 16px 0; cursor: pointer; font-weight: 650; font-size: 16px; }
.arcade-home .room-options { border: 0; padding: 0 0 20px; gap: 14px; }
.arcade-home .room-options label { flex-basis: 170px; }
.arcade-home .room-options p { color: #bed3ce; font-size: 14px; line-height: 1.5; }
.arcade-home .connection-strip { margin: 0 24px; padding: 12px 0; color: #bed3ce; background: transparent; border-color: #ffffff26; font: 13px -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.arcade-home .connection-state { letter-spacing: 0; }
.arcade-home .connection-state[data-state="connected"]::before { background: #83d5ad; }
.arcade-home .ready-section { padding: 24px; gap: 16px; }
.arcade-home .ready-section h3 { font-size: 24px; }
.arcade-home .ready-section p { font-size: 15px; color: #bed3ce; }
.arcade-home #ready-button { min-width: 130px; }
.arcade-home:not(.in-game) .network-diagnostics { border-color: #ffffff20; background: transparent; margin: 14px 0 0; }
.arcade-home:not(.in-game) .network-diagnostics summary { font-size: 14px; color: #bed3ce; padding: 15px; }
.arcade-home:not(.in-game) .network-details { background: #f7f5ec; color: #243a3c; border-radius: 0 0 6px 6px; }
.arcade-home:not(.in-game) .network-tools label, .arcade-home:not(.in-game) .network-tools button { color: #243a3c; }
.arcade-home:not(.in-game) .network-tools button { border-color: #a8b6a6; }
.arcade-home .lobby-error { font-size: 16px; }

/* Local play puts the field first; the original lab tools live in disclosures. */
.local-app { max-width: 1280px; padding: 0 24px 32px; }
.local-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.game-brand { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 850; letter-spacing: 1px; color: var(--ink); text-decoration: none; }
.game-brand .brand-mark { width: 36px; height: 36px; padding: 4px; }
.home-link { color: var(--green); font-size: 16px; font-weight: 600; padding: 12px 0; text-decoration: none; }
.local-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 0; }
.local-intro h1 { font-size: 32px; letter-spacing: -1px; margin: 0; }
.mode-choices { display: flex; gap: 6px; padding: 5px; background: #dce1d5; border-radius: 12px; }
.mode-choices button { min-height: 48px; padding: 10px 22px; border: 0; background: transparent; border-radius: 8px; font-size: 17px; font-weight: 700; }
.mode-choices button[aria-pressed="true"] { color: #fff5df; background: #244d55; box-shadow: 0 3px 0 #16353b; }
.arcade-local .panel-toolbar { min-height: 56px; padding: 4px 16px; }
.arcade-local .panel-toolbar h2 { font: 650 16px -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; letter-spacing: 0; }
.arcade-local .icon-button { min-height: 44px; padding: 8px; font-size: 15px; }
.arcade-local #canvas-scores { container-type: inline-size; }
.arcade-local .canvas-overlay .eyebrow { display: none; }
.arcade-local .canvas-overlay { z-index: 1; }
.arcade-local .canvas-overlay button { min-height: 44px; font-size: 16px; }
.arcade-local .touch-controls { gap: 8px; padding: 8px; align-items: center; }
.arcade-local .touch-controls button { min-height: 48px; padding: 10px 3px; font-size: 20px; }
.arcade-local .touch-controls button span { font-size: 13px; }
.arcade-local .touch-pilot { width: 38px; font-size: 13px; }
.local-extras { margin-top: 18px; display: grid; gap: 10px; }
.arcade-details { background: #f7f5ec; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.arcade-details > summary { padding: 18px 20px; cursor: pointer; font-size: 17px; font-weight: 650; }
.details-content { padding: 20px; border-top: 1px solid var(--line); }
.details-content.tuning-panel { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.details-content h2 { font-size: 20px; margin: 24px 0 18px; }
.arcade-local .scenario-control { width: min(100%, 320px); }
.arcade-local .scenario-control label { font: 600 15px -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; letter-spacing: 0; }
.arcade-local select { min-height: 48px; font-size: 16px; }
.arcade-local .tuning-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.arcade-local .tuning-control { margin: 0; }
.arcade-local .slider-label label, .arcade-local .slider-label output { font-size: 14px; }
.arcade-local input[type="range"] { height: 24px; background-size: 100% 4px; background-repeat: no-repeat; background-position: center; }
.arcade-local input[type="range"]::-webkit-slider-thumb { width: 24px; height: 24px; }
.arcade-local input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; }
.arcade-local .slider-extents { display: none; }
.arcade-local .slider-hint, .arcade-local .recovery-note { font-size: 13px; }
.arcade-local .cloud-options h3, .arcade-local .display-options h3 { font: 650 17px -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; letter-spacing: 0; }
.arcade-local .toggle-row { min-height: 44px; font-size: 16px; max-width: 320px; }
.arcade-local .restore-button { font-size: 16px; min-height: 48px; max-width: 320px; }
.local-help p { font-size: 16px; line-height: 1.65; }
.local-help h2:first-child { margin-top: 0; }
@media (max-width: 650px) {
  .arcade-home:not(.in-game) .lobby-app { padding: 20px 16px 28px; }
  .title-screen { padding: 4px 0 24px; }
  .title-plane .brand-mark { width: 48px; height: 48px; padding: 6px; }
  .title-screen h1 { margin-top: 16px; }
  .title-screen p { font-size: 16px; }
  .arcade-home .room-choices { gap: 24px; padding: 0 20px 24px; }
  .arcade-home:not(.in-game) .pilot-name-field { padding: 20px 20px 4px; }
  .arcade-home .room-choice + .room-choice { padding-top: 16px; border-top: 1px solid #ffffff26; }
  .arcade-home .room-choice label { margin-top: 0; }
  .arcade-home #room-code { width: 120px; flex-basis: 120px; }
  .local-play-link { font-size: 16px; gap: 8px; margin-top: 16px; }
  .arcade-home .room-top, .arcade-home .ready-section { padding: 20px; }
  .arcade-home .room-pilots { margin-inline: 20px; gap: 10px; }
  .arcade-home .room-pilot { padding: 14px 12px; }
  .arcade-home .room-pilot h3 { font-size: 18px; }
  .arcade-home .ready-actions { width: 100%; }
  .arcade-home #ready-button { width: 100%; }
  .arcade-home .room-rules { padding-inline: 20px; }
  .arcade-home .room-settings, .arcade-home .connection-strip { margin-inline: 20px; }
  .local-app { padding: 0 12px 24px; }
  .local-header { padding: 10px 0; }
  .game-brand { font-size: 15px; gap: 8px; }
  .home-link { font-size: 14px; }
  .local-intro { flex-direction: column; align-items: stretch; gap: 16px; padding: 18px 0; }
  .local-intro h1 { font-size: 28px; }
  .mode-choices button { flex: 1; padding-inline: 10px; font-size: 16px; }
  .arcade-local .panel-toolbar { padding-inline: 8px; }
  .arcade-local .toolbar-actions { gap: 4px; }
  .arcade-local .panel-toolbar h2 { font-size: 14px; }
  .arcade-local .tuning-controls { grid-template-columns: 1fr; }
  .details-content { padding: 16px; }
  .arcade-local .telemetry { grid-template-columns: repeat(2, 1fr); gap: 20px 0; }
  .arcade-local .metric > span:first-child, .arcade-local .metric-note { font-size: 10px; }
  .arcade-local .flight-status { flex-wrap: wrap; }
}

.local-keyboard-hints { display: flex; justify-content: space-around; gap: 16px; padding: 12px; font-size: 14px; }
@media (min-width: 900px) and (min-height: 600px) {
  .arcade-local .flight-panel { max-width: min(100%, calc((100dvh - 360px) * 16 / 9)); margin-inline: auto; }
}
@media (max-width: 760px), (pointer: coarse) { .local-keyboard-hints { display: none; } }

.practice-touch-hints { display: none; position: absolute; inset: 0; pointer-events: none; user-select: none; color: #d4e6e8; font-size: 9px; opacity: .55; }
#practice-touch-left, #practice-touch-right { position: absolute; top: 50%; writing-mode: vertical-rl; transform: translateY(-50%); }
#practice-touch-left { left: 5px; }
#practice-touch-right { right: 5px; }
.practice-touch-center { position: absolute; bottom: 4px; left: 40%; width: 20%; text-align: center; font-size: 8px; }
@media (max-width: 760px), (pointer: coarse) { .practice-touch-hints:not([hidden]) { display: block; } }
