/* Compact landscape shell. Scope every rule so the existing battlefield HUD is untouched. */
#frontier-app-shell.frontier-shell {
  --fs-bg: #091217; --fs-panel: #14242b; --fs-panel-deep: #0c181e; --fs-line: #496066;
  --fs-text: #e9f1ec; --fs-muted: #9aafb1; --fs-green: #a7db7d; --fs-cyan: #80dce1;
  --fs-amber: #efd08a; --fs-red: #ef8e7e; position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; color: var(--fs-text);
  background: radial-gradient(ellipse at 52% 25%, #1f3940 0%, #0b151b 62%, #060c10 100%);
  font: 13px/1.45 'Segoe UI', Arial, sans-serif; overflow: auto;
}
#frontier-app-shell[hidden] { display: none !important; }
/* The Canvas menu can be reopened while a match keeps rendering. The body
   state is the final visibility guard in case a late realtime packet causes
   the shell to re-render after the match callback hides it. */
body.is-playing #frontier-app-shell { display: none !important; }
#frontier-app-shell *, #frontier-app-shell *::before, #frontier-app-shell *::after { box-sizing: border-box; }
#frontier-app-shell button, #frontier-app-shell input, #frontier-app-shell select { font: inherit; }
#frontier-app-shell button { min-height: 35px; padding: 7px 12px; border: 1px solid #557177; border-radius: 5px; color: var(--fs-text); background: linear-gradient(#2c454c, #1a2d35); cursor: pointer; transition: border-color .15s, background .15s, transform .1s; }
#frontier-app-shell button:hover { border-color: var(--fs-cyan); background: #31525a; }
#frontier-app-shell button:active { transform: translateY(1px); }
#frontier-app-shell button:focus-visible, #frontier-app-shell input:focus-visible, #frontier-app-shell select:focus-visible { outline: 2px solid var(--fs-cyan); outline-offset: 2px; }
#frontier-app-shell button:disabled { opacity: .45; cursor: not-allowed; }
#frontier-app-shell .frontier-stage { width: min(510px, calc(100vw - 24px)); min-height: min(100%, 530px); display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 12px 0; }
#frontier-app-shell .frontier-stage.frontier-wide { width: min(920px, calc(100vw - 24px)); }
#frontier-app-shell .frontier-metrics { display: flex; align-items: center; gap: 13px; align-self: flex-start; color: #a5c4bd; font: 10px/1 var(--mono, Consolas, monospace); letter-spacing: .04em; }
#frontier-app-shell .frontier-metric { display: inline-flex; gap: 4px; padding: 5px 7px; border: 1px solid #62828a44; border-radius: 4px; background: #08141a99; }
#frontier-app-shell .frontier-metric b { color: var(--fs-green); font-weight: 700; }
#frontier-app-shell .frontier-panel { width: 100%; max-height: calc(100dvh - 48px); overflow: auto; padding: clamp(18px, 3vw, 28px); border: 1px solid #718d94; border-top: 3px solid var(--fs-cyan); background: linear-gradient(150deg, #1a3038f5, #0c191ff7); box-shadow: 0 18px 80px #000a, inset 0 1px #d9f8ff24; }
#frontier-app-shell .frontier-title { margin: 0 0 18px; padding-bottom: 13px; border-bottom: 1px solid #58757c66; }
#frontier-app-shell .frontier-kicker { color: var(--fs-cyan); font: 10px/1.2 var(--mono, Consolas, monospace); letter-spacing: .13em; }
#frontier-app-shell h1 { margin: 9px 0 4px; color: #f3f8f1; font-size: clamp(21px, 4vw, 30px); line-height: 1.15; letter-spacing: -.02em; }
#frontier-app-shell h2 { margin: 15px 0 8px; color: var(--fs-green); font-size: 14px; }
#frontier-app-shell .frontier-subtitle { margin: 0; max-width: 68ch; color: var(--fs-muted); line-height: 1.55; }
#frontier-app-shell .frontier-tabs, #frontier-app-shell .frontier-room-tabs { display: flex; gap: 4px; margin: 0 0 15px; border-bottom: 1px solid #5170795e; }
#frontier-app-shell .frontier-tabs button, #frontier-app-shell .frontier-room-tabs button { flex: 1; min-height: 34px; border-color: transparent; border-radius: 4px 4px 0 0; background: transparent; color: var(--fs-muted); }
#frontier-app-shell .frontier-tabs button.is-active, #frontier-app-shell .frontier-room-tabs button.is-active { color: var(--fs-cyan); border-color: #6bbfc955; background: #1d424a; box-shadow: inset 0 -2px var(--fs-cyan); }
#frontier-app-shell .frontier-form { display: flex; flex-direction: column; gap: 10px; }
#frontier-app-shell .frontier-field { display: grid; grid-template-columns: minmax(145px, .46fr) minmax(0, 1fr); align-items: center; gap: 10px; color: #c5d8d2; }
#frontier-app-shell .frontier-field > span { font-size: 12px; }
#frontier-app-shell input, #frontier-app-shell select { width: 100%; min-height: 35px; padding: 7px 9px; border: 1px solid #49636a; border-radius: 4px; color: var(--fs-text); background: #071217cc; }
#frontier-app-shell select { min-height: 29px; padding: 3px 5px; font-size: 11px; }
#frontier-app-shell .frontier-primary { color: #112609; border-color: #c7f89d; background: linear-gradient(#a6f46d, #74bb42); font-weight: 700; }
#frontier-app-shell .frontier-primary:hover { border-color: #e2ffc8; background: #b5ff85; }
#frontier-app-shell .frontier-danger { color: #ffd2c9; border-color: #a96a61; background: #492a2a; }
#frontier-app-shell .frontier-link { margin-top: 15px; padding-inline: 2px; border-color: transparent; background: transparent; box-shadow: none; color: var(--fs-cyan); }
#frontier-app-shell .frontier-link:hover { background: #284a501c; border-color: #618d941f; }
#frontier-app-shell .frontier-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
#frontier-app-shell .frontier-menu button { min-height: 48px; font-weight: 600; }
#frontier-app-shell .frontier-status { min-height: 20px; margin: 10px 0 0; color: var(--fs-green); }
#frontier-app-shell .frontier-status.is-error { color: var(--fs-red); }
#frontier-app-shell .frontier-warning, #frontier-app-shell .frontier-gate-note { margin: 12px 0 0; padding: 9px 11px; border-left: 2px solid var(--fs-amber); color: #efdba8; background: #51462c44; font-size: 11px; line-height: 1.55; }
#frontier-app-shell .frontier-gate-note { border-left-color: var(--fs-cyan); color: #b7e2e2; background: #22454c44; }
#frontier-app-shell .frontier-form-note { margin: 2px 0 0; color: var(--fs-muted); font-size: 11px; }
#frontier-app-shell .frontier-room-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 8px; margin: 0; padding: 0; list-style: none; }
#frontier-app-shell .frontier-room-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; align-items: center; min-width: 0; padding: 6px 7px; border: 1px solid #58727755; border-radius: 4px; background: #0b1a20aa; }
#frontier-app-shell .frontier-room-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d9e8df; font-size: 11px; }
#frontier-app-shell .frontier-room-count { color: var(--fs-muted); font: 10px var(--mono, Consolas, monospace); }
#frontier-app-shell .frontier-small { min-height: 27px; padding: 4px 7px; font-size: 10px; white-space: nowrap; }
#frontier-app-shell .frontier-room-layout { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.2fr); gap: 15px; min-height: 315px; }
#frontier-app-shell .frontier-room-chat { grid-column: 1; grid-row: 1; }
#frontier-app-shell .frontier-room-main { grid-column: 2; grid-row: 1; }
#frontier-app-shell .frontier-room-main { min-width: 0; }
#frontier-app-shell .frontier-member-list { display: flex; flex-direction: column; gap: 5px; margin: 0; padding: 0; list-style: none; }
#frontier-app-shell .frontier-member { display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 5px 7px; border: 1px solid #56717755; border-left: 3px solid var(--fs-green); border-radius: 4px; background: #0b1b21b8; }
#frontier-app-shell .frontier-member.team-2 { border-left-color: #ef8e7e; }
#frontier-app-shell .frontier-member.frontier-empty { border-left-color: #4e6064; color: #789096; font-size: 11px; }
#frontier-app-shell .frontier-color-dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; border: 1px solid #ffffff88; background: #adbab9; }
#frontier-app-shell .color-green { background: #80df74; } #frontier-app-shell .color-blue { background: #74b9fa; } #frontier-app-shell .color-red { background: #ef7e73; } #frontier-app-shell .color-yellow { background: #f4d971; } #frontier-app-shell .color-purple { background: #c38cf5; } #frontier-app-shell .color-cyan { background: #69e5e6; } #frontier-app-shell .color-orange { background: #f5a65c; }
#frontier-app-shell .frontier-member-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#frontier-app-shell .frontier-host, #frontier-app-shell .frontier-ready-mark { color: var(--fs-amber); font: 9px var(--mono, Consolas, monospace); }
#frontier-app-shell .frontier-ready-mark { color: var(--fs-green); font-size: 15px; }
#frontier-app-shell .frontier-member-controls { display: flex; align-items: center; gap: 4px; margin-left: auto; }
#frontier-app-shell .frontier-member-controls select { width: auto; max-width: 100px; }
#frontier-app-shell .frontier-room-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
#frontier-app-shell .frontier-chat { display: flex; flex-direction: column; min-height: 250px; height: 100%; border: 1px solid #536d735e; border-radius: 5px; background: #071419c9; }
#frontier-app-shell .frontier-chat-head { padding: 7px 9px; border-bottom: 1px solid #526b7144; color: var(--fs-cyan); font: 10px var(--mono, Consolas, monospace); }
#frontier-app-shell .frontier-chat-log { flex: 1; min-height: 0; max-height: 270px; overflow-y: auto; padding: 7px 9px; scrollbar-width: thin; }
#frontier-app-shell .frontier-chat-log p { margin: 0 0 7px; color: #c5d5d1; font-size: 11px; overflow-wrap: anywhere; }
#frontier-app-shell .frontier-chat-log b { color: var(--fs-green); }
#frontier-app-shell .frontier-chat-form { display: grid; grid-template-columns: 1fr auto; gap: 5px; margin-top: 6px; }
#frontier-app-shell .frontier-chat-form input { min-width: 0; }
#frontier-app-shell .frontier-stats { display: grid; grid-template-columns: 1fr auto; gap: 7px 15px; margin: 0 0 12px; }
#frontier-app-shell .frontier-stats dt { color: var(--fs-muted); }
#frontier-app-shell .frontier-stats dd { margin: 0; color: var(--fs-text); font-family: var(--mono, Consolas, monospace); }
#frontier-app-shell .frontier-history { margin-top: 18px; padding-top: 4px; border-top: 1px solid #58757c66; }
#frontier-app-shell .frontier-history h2 { margin-top: 10px; }
#frontier-app-shell .frontier-history-empty { margin: 8px 0; padding: 14px 12px; border: 1px solid #58727755; background: #0b1a20aa; color: var(--fs-muted); font-size: 12px; }
#frontier-app-shell .frontier-history-scroll { max-height: min(260px, 42dvh); overflow: auto; margin-top: 8px; border: 1px solid #58727755; background: #0b1a20aa; scrollbar-width: thin; }
#frontier-app-shell .frontier-history-scroll:focus-visible { outline: 2px solid var(--fs-cyan); outline-offset: 2px; }
#frontier-app-shell .frontier-history-table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; white-space: nowrap; font-size: 11px; font-variant-numeric: tabular-nums; }
#frontier-app-shell .frontier-history-table th { position: sticky; top: 0; z-index: 1; padding: 8px 7px; border-bottom: 1px solid #58757c66; background: #183039; color: var(--fs-muted); font-size: 10px; font-weight: 600; }
#frontier-app-shell .frontier-history-table td { padding: 8px 7px; border-bottom: 1px solid #58727733; color: var(--fs-text); }
#frontier-app-shell .frontier-history-table tr:last-child td { border-bottom: 0; }
#frontier-app-shell .frontier-history-table tbody tr:hover { background: #20404955; }
#frontier-app-shell .frontier-history-table time { display: flex; flex-direction: column; gap: 3px; }
#frontier-app-shell .frontier-history-table time small { color: var(--fs-muted); font-size: 10px; }
#frontier-app-shell .frontier-history-room { font-family: var(--mono, Consolas, monospace); }
#frontier-app-shell .frontier-history-result { display: inline-block; padding: 3px 6px; border-radius: 3px; font-size: 10px; font-weight: 600; }
#frontier-app-shell .frontier-history-result.is-win { color: var(--fs-green); background: #58884933; }
#frontier-app-shell .frontier-history-result.is-loss { color: var(--fs-red); background: #99514633; }
#frontier-app-shell .frontier-history-result.is-draw { color: var(--fs-amber); background: #8f754633; }
#frontier-app-shell .frontier-check { display: flex; align-items: center; gap: 10px; margin: 8px 0 12px; color: var(--fs-text); }
#frontier-app-shell .frontier-check input { width: auto; min-height: auto; }
@media (max-width: 700px) {
  #frontier-app-shell .frontier-stage, #frontier-app-shell .frontier-stage.frontier-wide { width: calc(100vw - 14px); min-height: 100%; padding: 7px 0; }
  #frontier-app-shell .frontier-panel { padding: 15px; max-height: calc(100dvh - 22px); }
  #frontier-app-shell .frontier-field { grid-template-columns: 1fr; gap: 3px; }
  #frontier-app-shell .frontier-room-list { grid-template-columns: 1fr; }
  #frontier-app-shell .frontier-room-layout { grid-template-columns: 1fr; }
  #frontier-app-shell .frontier-room-main, #frontier-app-shell .frontier-room-chat { grid-column: auto; grid-row: auto; }
  #frontier-app-shell .frontier-chat { min-height: 150px; }
  #frontier-app-shell .frontier-member-controls { flex-wrap: wrap; }
}
@media (max-height: 520px) and (orientation: landscape) {
  #frontier-app-shell .frontier-stage { min-height: 100%; justify-content: flex-start; }
  #frontier-app-shell .frontier-panel { padding: 12px 16px; }
  #frontier-app-shell .frontier-title { margin-bottom: 10px; }
  #frontier-app-shell h1 { font-size: 21px; margin: 5px 0 2px; }
  #frontier-app-shell .frontier-menu button { min-height: 37px; }
}


