:root {
  --avr-blue: #3a7dce;
  --avr-deep: #174f91;
  --avr-ink: #17304e;
  --avr-muted: #53677e;
  --avr-line: #dce5ee;
  --bs-font-sans-serif: Arial, Helvetica, sans-serif;
  --bs-body-font-family: Arial, Helvetica, sans-serif;
  --bs-primary: #175db3;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 24px; }
body { margin: 0; background: var(--avr-blue); color: var(--avr-ink); font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 1.5; }
input, select, textarea, button { font: inherit; }
a { color: #14549f; text-underline-offset: 3px; }
button, a, input, select, summary { touch-action: manipulation; }
button, .btn, .form-control, .form-select { min-height: 48px; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 10px 17px; border-radius: 8px; font-weight: 600; white-space: normal; }
.btn-primary { --bs-btn-bg: #175db3; --bs-btn-border-color: #175db3; --bs-btn-hover-bg: #124b91; --bs-btn-hover-border-color: #124b91; --bs-btn-disabled-bg: #526b89; --bs-btn-disabled-border-color: #526b89; }
.btn-outline-primary { --bs-btn-color: #14549f; --bs-btn-border-color: #7a9ec8; --bs-btn-hover-bg: #175db3; --bs-btn-hover-border-color: #175db3; }
.btn-outline-secondary { --bs-btn-color: #405571; --bs-btn-border-color: #a6b7c9; }
.btn-wide { width: 100%; }
.btn-sm { font-size: 14px; }
.form-control, .form-select { border-color: #9aadc0; border-radius: 8px; padding: 11px 12px; color: #182f4a; font-size: 16px; }
.form-select { padding-right: 36px; }
.form-label { font-weight: 600; margin-bottom: 7px; }
.form-text { color: var(--avr-muted); font-size: 13px; line-height: 1.5; margin-top: 8px; }
.muted { color: var(--avr-muted); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid #f5a623; outline-offset: 3px; box-shadow: none; }
.skip-link { position: absolute; top: -80px; left: 12px; padding: 14px 20px; background: white; z-index: 9999; }
.skip-link:focus { top: 8px; }
.site-header { background: #fff; border-bottom: 1px solid rgba(21, 64, 112, .13); }
.header-inner { max-width: 1440px; margin: 0 auto; padding: 12px 32px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #132f50; flex-shrink: 0; }
.brand img { object-fit: contain; }
.brand strong { display: block; letter-spacing: .09em; font-size: 18px; line-height: 1.3; }
.brand-subtitle { display: block; font-size: 12px; letter-spacing: .04em; color: #53677e; }
.header-links { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.header-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 10px; text-decoration: none; font-size: 14px; font-weight: 600; color: #34516f; }
.header-links a:hover { background: #eef4fb; border-radius: 7px; }
.app-shell { max-width: 1440px; padding: 30px 32px 20px; margin: 0 auto; outline: none; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; color: #fff; margin: 0 0 24px; }
.page-heading h1 { font-size: clamp(27px, 3vw, 36px); font-weight: 700; letter-spacing: -.02em; margin: 0; line-height: 1.2; }
.page-heading p:not(.eyebrow) { color: #f0f5fd; margin: 8px 0 0; }
.eyebrow { letter-spacing: .13em; font-weight: 600; font-size: 11px; margin: 0 0 6px; color: #ecf5ff; }
.version-badge { border: 1px solid #b8d5f6; border-radius: 30px; padding: 5px 13px; white-space: nowrap; font-size: 13px; }
.surface { background: #fff; border: 1px solid rgba(21, 64, 112, .13); border-radius: 14px; padding: 26px; box-shadow: 0 3px 12px rgba(13, 50, 94, .07); min-width: 0; }
h2 { font-size: 21px; line-height: 1.3; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 19px; line-height: 1.35; font-weight: 700; margin: 0 0 10px; }
.login-heading, .login-grid { max-width: 1010px; margin-left: auto; margin-right: auto; }
.login-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .9fr); gap: 26px; align-items: start; }
.login-surface { padding: 30px; }
.login-surface form { margin-top: 23px; }
.login-aside { display: grid; gap: 22px; }
.section-kicker { display: block; font-size: 11px; font-weight: 700; letter-spacing: .09em; color: var(--avr-deep); margin-bottom: 12px; }
.hosting-card { text-align: center; color: #fff; padding: 14px 20px; }
.hosting-card img { margin-bottom: 14px; border-radius: 12px; }
.hosting-card h2 { font-size: 22px; }
.hosting-card p { color: #ecf5ff; }
.password-input { display: flex; gap: 8px; }
.password-input input { min-width: 0; }
.password-input button { min-width: 74px; }
.credential-options { background: #f4f7fb; border-radius: 8px; padding: 5px 12px; }
.credential-options summary { cursor: pointer; min-height: 44px; align-content: center; font-size: 14px; color: #34516f; }
.credential-options[open] { padding-bottom: 14px; }
.existing-servers-link { display: block; margin-top: 20px; font-size: 14px; text-align: center; padding: 10px 0; }
.site-footer { max-width: 1440px; margin: 0 auto; padding: 20px 32px 30px; display: flex; justify-content: space-between; gap: 16px; color: #eef6ff; font-size: 12px; flex-wrap: wrap; }
.site-footer a { color: #fff; }
.server-overview { margin-bottom: 24px; }
.server-toolbar { display: flex; gap: 12px; align-items: flex-end; padding-bottom: 21px; border-bottom: 1px solid var(--avr-line); }
.server-picker { flex: 1; min-width: 0; max-width: 580px; margin-right: auto; }
.server-picker .form-label { font-size: 13px; color: var(--avr-muted); }
.server-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 21px 0 17px; }
.server-title-row h2 { margin: 0; overflow-wrap: anywhere; }
.state-pill { display: inline-flex; align-items: center; border-radius: 20px; background: #edf3fa; padding: 5px 11px; font-size: 12px; font-weight: 600; color: #335a84; flex-shrink: 0; }
.state-pill.online { background: #e9f7ef; color: #206b40; }
.state-pill.warning { background: #fff2d6; color: #775113; }
.server-facts { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 20px; }
.server-facts > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fact-label { color: #63758b; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.server-facts strong { font-size: 19px; overflow-wrap: anywhere; }
.server-facts code { color: #3a587b; font-family: Arial, Helvetica, sans-serif; font-size: 13px; overflow-wrap: anywhere; }
.server-facts .muted { font-size: 12px; }
.pending-banner { margin-top: 22px; padding: 15px; background: #edf5ff; border: 1px solid #b4d0f1; border-radius: 9px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.pending-banner p { font-size: 13px; margin-top: 3px; }
.pending-banner button { flex-shrink: 0; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr); gap: 24px; align-items: start; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-heading h2 { margin: 0; }
.team-scores { display: flex; gap: 9px; margin-bottom: 17px; flex-wrap: wrap; }
.team-score { padding: 9px 12px; border-radius: 8px; flex: 1; min-width: 120px; display: flex; justify-content: space-between; font-weight: 600; background: #f1f4f8; font-size: 14px; }
.team-score[data-team="0"] { color: #154e90; background: #eaf2ff; }
.team-score[data-team="1"] { color: #9a2f38; background: #fff0f0; }
.selection-note { background: #f4f7fb; color: #47607c; padding: 10px 12px; border-radius: 7px; font-size: 13px; overflow-wrap: anywhere; }
.selection-note.has-selection { background: #eaf2ff; color: #144b8a; }
.player-table-wrap { overflow: auto; max-height: 640px; }
.player-table { vertical-align: middle; font-size: 13px; width: 100%; }
.player-table thead { background: #fff; position: sticky; top: 0; z-index: 1; }
.player-table th { color: #62738a; font-size: 11px; text-transform: uppercase; font-weight: 700; white-space: nowrap; padding: 10px 8px; }
.player-table td { padding: 6px 8px; }
.player-table tbody tr.selected td { background: #edf5ff; }
.player-select { border: 0; background: transparent; text-align: left; color: #183b65; width: 100%; padding: 5px 2px; min-width: 96px; }
.player-select strong, .player-select span { display: block; overflow-wrap: anywhere; }
.player-select span { font-size: 10px; color: #617188; }
.player-select[aria-pressed="true"] strong::before { content: 'Selected: '; color: #175db3; }
.player-select:hover { color: #0c56a7; }
.team-label { font-size: 11px; white-space: nowrap; }
.player-table td:nth-child(3), .player-table td:nth-child(4) { white-space: nowrap; }
.command-tabs { gap: 4px; border-bottom: 1px solid #c9d8e7; margin: 4px 0 22px; display: grid; grid-template-columns: 1.3fr 1fr .8fr; }
.command-tabs .nav-link { padding: 10px 7px; color: #516b87; font-weight: 600; font-size: 14px; border-radius: 7px 7px 0 0; }
.command-tabs .nav-link.active { color: #144c8b; border-color: #c9d8e7 #c9d8e7 white; background: #fff; }
.command-picker { margin-bottom: 24px; }
.command-picker label { font-size: 13px; }
.command-form-host { border-top: 1px solid var(--avr-line); padding-top: 21px; }
.command-form-host > p { font-size: 14px; }
.command-code { color: #5d7087; font-size: 11px; margin: -3px 0 9px; }
.command-form .form-label { font-size: 14px; }
.command-form .field { margin-bottom: 17px; }
.command-form .metadata-row { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; }
.metadata-row .form-select { min-width: 0; font-size: 14px; }
.metadata-row button { font-size: 12px; flex-shrink: 0; }
.target-mode { margin-bottom: 8px; }
.target-detail { margin-top: 8px; }
.command-limitation { padding: 11px 13px; background: #f4f7fb; border-left: 3px solid #96adc5; border-radius: 4px; font-size: 12px; line-height: 1.5; }
.effect-note { color: #285788; font-size: 13px; font-weight: 600; margin: 12px 0; }
.plus-setup { background: #eff6ff; border-radius: 8px; padding: 14px; }
.plus-setup strong { display: block; margin-bottom: 5px; }
.button-row { display: flex; gap: 9px; flex-wrap: wrap; }
.status-message { border-radius: 8px; padding: 13px 15px; margin-top: 17px; overflow-wrap: anywhere; border: 1px solid #b7cbe3; background: #eef5fe; color: #244d7d; font-size: 14px; }
.status-message[data-tone="success"] { border-color: #afd6bd; background: #edf8f1; color: #215f3a; }
.status-message[data-tone="warning"] { border-color: #e0cc96; background: #fff8e8; color: #735616; }
.status-message[data-tone="error"] { border-color: #dfb0b6; background: #fff0f1; color: #8a2530; }
#dashboard-status { margin-top: 0; margin-bottom: 22px; }
.status-message details { margin-top: 10px; }
.status-message summary { min-height: 44px; align-content: center; cursor: pointer; }
.status-message pre, .log-entry pre { white-space: pre-wrap; word-break: break-word; font-family: Arial, Helvetica, sans-serif; font-size: 12px; max-height: 300px; overflow: auto; margin: 0; }
.log-panel { margin-top: 24px; }
.command-log { list-style: none; padding: 0; margin: 19px 0 0; max-height: 460px; overflow: auto; }
.log-entry { border-top: 1px solid var(--avr-line); padding: 14px 0; font-size: 13px; }
.log-entry-head { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 12px; margin-bottom: 5px; color: var(--avr-muted); }
.log-entry-command { font-weight: 700; color: #214e81; overflow-wrap: anywhere; }
.log-entry p { margin: 4px 0; overflow-wrap: anywhere; }
.log-entry details { margin-top: 7px; }
.log-entry summary { cursor: pointer; min-height: 44px; align-content: center; color: #345b8d; }
.log-empty { padding: 15px 0; font-size: 14px; }
.empty-state { text-align: center; padding: 50px 26px; }
.empty-state .btn { margin: 6px; }
.reset-warning { border-left: 4px solid #bf4b38; background: #fff3ee; border-radius: 5px; padding: 14px 16px; font-size: 14px; margin: 22px 0; }
.reset-warning p { margin-top: 5px; }
.recovery-guide ol { padding-left: 22px; }
.recovery-guide li { padding-left: 5px; margin: 13px 0; }
.cooldown-label { margin-top: 15px; background: #edf3fa; padding: 13px; border-radius: 7px; font-weight: 700; }
.modal-content { border: 0; border-radius: 14px; }
.modal-header, .modal-footer { padding: 18px 22px; }
.modal-body { padding: 22px; overflow-wrap: anywhere; }
.btn-close { min-width: 44px; min-height: 44px; padding: 10px; }
@media (max-width: 1050px) {
  .app-shell { padding: 25px 22px 20px; }
  .header-inner { padding-left: 22px; padding-right: 22px; }
  .surface { padding: 21px; }
  .dashboard-grid { gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .player-table th, .player-table td { padding-left: 4px; padding-right: 4px; }
}
@media (max-width: 800px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .players-panel { order: 1; }
  .commands-panel { order: 2; }
  .player-table-wrap { max-height: 360px; }
  .server-toolbar { flex-wrap: wrap; }
  .server-picker { flex-basis: 100%; max-width: none; }
  #refresh-button { flex: 1; }
  #disconnect-button { flex: 1; }
  .login-grid { gap: 20px; }
}
@media (max-width: 620px) {
  .header-inner { flex-wrap: wrap; justify-content: center; padding: 10px 16px 2px; gap: 0; }
  .brand { margin-right: auto; }
  .brand img { width: 42px; height: 42px; }
  .header-links { width: 100%; justify-content: space-between; gap: 3px; }
  .header-links a { font-size: 12px; padding: 8px 6px; }
  .app-shell { padding: 21px 14px 12px; }
  .page-heading { margin-bottom: 19px; gap: 10px; align-items: flex-start; }
  .page-heading h1 { font-size: 27px; }
  .page-heading .btn { font-size: 13px; padding: 9px 11px; }
  .page-heading p:not(.eyebrow) { font-size: 14px; }
  .login-grid { grid-template-columns: 1fr; }
  .surface { padding: 20px 17px; border-radius: 11px; }
  .login-surface { padding: 23px 20px; }
  .version-badge { font-size: 11px; padding: 5px 9px; }
  .server-title-row { flex-wrap: wrap; }
  .server-facts { grid-template-columns: 1fr 1fr; gap: 15px; }
  .server-facts > div:first-child { grid-column: 1 / -1; }
  .server-facts strong { font-size: 18px; }
  .pending-banner { flex-direction: column; align-items: stretch; gap: 12px; }
  .panel-heading { align-items: flex-start; }
  .panel-heading h2 { margin-top: 9px; }
  .panel-heading .btn { font-size: 12px; padding: 8px 11px; }
  .player-table { font-size: 12px; }
  .player-table th { font-size: 10px; }
  .player-select span { max-width: 155px; }
  .player-table td:last-child, .player-table th:last-child { display: none; }
  .command-tabs .nav-link { font-size: 13px; padding: 9px 5px; }
  .metadata-row { flex-wrap: wrap; }
  .metadata-row select { flex-basis: 100%; }
  .site-footer { padding: 15px 20px 25px; font-size: 11px; gap: 9px; }
  .site-footer span:first-child { width: 100%; }
  .log-panel .panel-heading { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
