body.atc-game {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  margin: 0;
  background: #111b20;
  color: #e5eeed;
  font: 15px var(--ui);
  color-scheme: dark;
}
.atc-game header,
.atc-game nav,
.atc-game .radio-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.atc-game header {
  padding: 0.65rem 1rem;
  background: #152125;
  border-bottom: 1px solid #364849;
}
.atc-game h1,
.atc-game h2,
.atc-game p {
  margin: 0;
}
.atc-game h1 {
  font-size: 1.06rem;
}
.atc-game header a {
  margin-left: auto;
  color: #bed9d6;
  font-size: 0.83rem;
}
.atc-game .station-name,
.atc-game .sim-clock,
.atc-game .score-pill,
.atc-game .eyebrow,
.atc-game #transcript,
.atc-game kbd {
  font: 12px var(--mono, monospace);
}
.atc-game .sim-clock,
.atc-game .score-pill {
  min-height: 0;
  padding: 0.22rem 0.56rem;
  border-radius: 5px;
  background: #1d2d31;
  border: 1px solid #3c5454;
  color: #cbe6df;
}
.atc-game button.sim-clock:hover,
.atc-game button.sim-clock:focus-visible,
.atc-game button.score-pill:hover,
.atc-game button.score-pill:focus-visible {
  background: #283f44;
  border-color: #7eb8a1;
}
.atc-game .score-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}
.atc-game .score-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #7fd1ae;
  flex: none;
}
.atc-game .score-label {
  color: #9bb8b3;
}
.atc-game .score-value {
  font-weight: 600;
}
.atc-game .score-pill.is-warn {
  background: #2b261b;
  border-color: #746036;
  color: #ffe4a2;
}
.atc-game .score-pill.is-warn .score-dot {
  background: #f0c05a;
}
.atc-game .score-pill.is-warn .score-label {
  color: #d7be83;
}
.atc-game .score-pill.is-bad {
  background: #381b1f;
  border-color: #8c484a;
  color: #ffd6d2;
}
.atc-game .score-pill.is-bad .score-dot {
  background: #ff6b65;
}
.atc-game .score-pill.is-bad .score-label {
  color: #df9f9b;
}
@media (prefers-reduced-motion: no-preference) {
  .atc-game .score-pill.is-drop {
    animation: atc-score-drop 650ms ease;
  }
  .atc-game .score-pill.is-gain {
    animation: atc-score-gain 650ms ease;
  }
}
@keyframes atc-score-drop {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgb(255 107 101 / 55%); }
  35% { transform: scale(1.05); box-shadow: 0 0 0 5px rgb(255 107 101 / 0%); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgb(255 107 101 / 0%); }
}
@keyframes atc-score-gain {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgb(127 209 174 / 55%); }
  35% { transform: scale(1.05); box-shadow: 0 0 0 5px rgb(127 209 174 / 0%); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgb(127 209 174 / 0%); }
}
.atc-game .station-name,
.atc-game small {
  color: #b4c7c4;
}
.atc-game .stage {
  min-height: 0;
  width: 100%;
  container-type: size;
}
.atc-game .stage:has(> #binoculars:not([hidden]))::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  --lens-radius: min(31cqw, 46cqh);
  --lens-offset: calc(var(--lens-radius) * 0.52);
  --lens-edge: transparent 90%, rgb(11 22 25 / 8%) 97%, rgb(11 22 25 / 34%) 100%,
    rgb(11 22 25 / 18%) calc(100% + 2px);
  /* Each half draws the outer arc of one eyepiece, leaving the shared center clear. */
  background:
    radial-gradient(circle var(--lens-radius) at calc(100% - var(--lens-offset)) 50%, var(--lens-edge)) left / 50% 100% no-repeat,
    radial-gradient(circle var(--lens-radius) at var(--lens-offset) 50%, var(--lens-edge)) right / 50% 100% no-repeat;
}
.atc-game #binoculars {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  padding: 0.35rem 0.6rem;
  border-radius: 5px;
  background: #142023eb;
  color: #d1ede2;
  font: 12px var(--mono, monospace);
  pointer-events: none;
}
.atc-game .panel {
  z-index: 3;
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  max-width: min(370px, calc(100% - 2rem));
  box-sizing: border-box;
  background: #142023f5;
  border: 1px solid #506360;
  border-radius: 9px;
  padding: 1rem;
  box-shadow: 0 5px 24px #0004;
}
.atc-game .eyebrow {
  color: #b4ded1;
  letter-spacing: 0.08em;
}
.atc-game h2 {
  font-size: 1.25rem;
  margin: 0.35rem 0;
}
.atc-game #brief p:not(.eyebrow) {
  color: #cfdbd8;
  line-height: 1.45;
  margin: 0.4rem 0 0.8rem;
}
.atc-game button {
  min-height: 40px;
  padding: 0.45rem 0.78rem;
  font: inherit;
  font-size: 0.84rem;
  color: #e0eae8;
  background: #243437;
  border: 1px solid #516364;
  border-radius: 5px;
  cursor: pointer;
}
.atc-game button:hover,
.atc-game button:focus-visible {
  background: #354b4c;
}
.atc-game button:disabled {
  opacity: 0.55;
}
.atc-game button.primary {
  background: #b2dfc9;
  color: #172720;
  font-weight: 650;
}
.atc-game small {
  display: block;
  margin-top: 0.6rem;
}
.atc-game footer {
  display: block;
  flex: none;
  height: auto;
  white-space: normal;
  padding: 0.45rem max(0.7rem, env(safe-area-inset-right)) max(0.55rem, env(safe-area-inset-bottom));
  background: #152125;
}
.atc-game .status-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.7rem;
  padding-bottom: 0.35rem;
}
.atc-game #conflict-alert:not(:empty) {
  padding: 0.2rem 0.55rem;
  border-left: 4px solid currentColor;
  background: #4d1820;
  color: #ffd6d2;
}
.atc-game #conflict-alert:empty { display: none; }
.atc-game #wake-supervisor { color: #ffcc63; }
.atc-game #wake-supervisor:empty { display: none; }
.atc-game #transcript {
  min-height: 1.25rem;
  color: #d1e1dd;
}
.atc-game nav {
  flex-wrap: wrap;
  gap: 0.35rem;
}
.atc-game .radio-title {
  flex: none;
  justify-content: space-between;
  gap: 0.5rem;
}
.atc-game .comms-panel {
  display: flex;
  flex-direction: column;
  width: min(392px, calc(100% - 2rem));
  max-width: calc(100% - 2rem);
  max-height: calc(100% - 2rem);
  padding: 0.72rem 0.82rem;
  background: #121d20eb;
  backdrop-filter: blur(8px);
}
.atc-game .comms-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-width: 0;
}
.atc-game .comms-panel h2 {
  font-size: 0.94rem;
  margin: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #cfe4df;
}
.atc-game #toggle-comms {
  min-height: 30px;
  min-width: 30px;
  padding: 0.15rem 0.5rem;
  font-size: 1rem;
  line-height: 1;
}
.atc-game .comms-flights {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.52rem;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.1rem;
}
.atc-game .comms-flights:empty {
  display: none;
}
.atc-game #lineups {
  flex: none;
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px solid #405454;
}
.atc-game #lineups h3 {
  margin: 0 0 0.2rem;
  font-size: 0.78rem;
}
.atc-game #lineup-list {
  white-space: pre-line;
  max-height: 12dvh;
  overflow-y: auto;
  font: 12px/1.45 var(--mono, monospace);
  color: #bed4cf;
}
.atc-game #shift-progress {
  font: 11px var(--mono, monospace);
  color: #9bb8b3;
}
.atc-game .flight-comms {
  padding: 0.5rem 0.58rem;
  border-radius: 7px;
  border: 1px solid #35494a;
  background: #18262acc;
}
.atc-game .flight-comms.is-selected {
  border-color: #e9d28a;
  background: #272d23e0;
}
.atc-game .flight-comms.is-done {
  opacity: 0.72;
}
.atc-game .flight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}
.atc-game .flight-select {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.38rem;
  min-height: 0;
  padding: 0.16rem 0.4rem;
  margin-left: -0.2rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  text-align: left;
}
.atc-game .flight-select:hover,
.atc-game .flight-select:focus-visible {
  background: #25383c;
  border-color: #516869;
}
.atc-game .flight-comms.is-selected .flight-select {
  color: #fbebb5;
}
.atc-game .flight-callsign {
  font: 700 0.88rem var(--mono, monospace);
  letter-spacing: 0.02em;
}
.atc-game .flight-meta {
  flex-basis: 100%;
  font: 11px var(--mono, monospace);
  color: #a9c4bf;
}
.atc-game .flight-type {
  color: #e2ecea;
  font: 600 0.76rem var(--mono, monospace);
}
.atc-game .flight-phase {
  font: 11px var(--mono, monospace);
  color: #c2d6d2;
  text-align: right;
  white-space: nowrap;
}
.atc-game .flight-phase.is-urgent {
  color: #ffe29a;
}
.atc-game .flight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.42rem;
}
.atc-game .flight-actions select,
.atc-game .flight-actions button {
  min-height: 34px;
  padding: 0.32rem 0.62rem;
  font-size: 0.8rem;
}
.atc-game .flight-actions button.action-highlight {
  background: #25443c;
  border-color: #88bfa9;
  color: #e9f6f0;
}
.atc-game .flight-actions button.action-highlight:hover,
.atc-game .flight-actions button.action-highlight:focus-visible {
  background: #30584e;
}
.atc-game .flight-note {
  margin-top: 0.35rem;
  font: 11.5px var(--mono, monospace);
  color: #9cb5b1;
}
.atc-game [hidden] {
  display: none !important;
}
@media (max-width: 570px) {
  .atc-game .station-name,
  .atc-game .score-label,
  .atc-game kbd {
    display: none;
  }
  .atc-game header {
    padding: 0.5rem;
    gap: 0.45rem;
  }
  .atc-game .score-categories {
    grid-template-columns: 1fr;
  }
  .atc-game .panel {
    left: 0.6rem;
    bottom: 0.6rem;
    width: calc(100% - 1.2rem);
    max-width: calc(100% - 1.2rem);
  }
  .atc-game .comms-panel {
    max-height: min(60%, calc(100% - 1.2rem));
  }
  .atc-game button {
    min-height: 42px;
  }
  .atc-game .flight-actions button {
    min-height: 38px;
  }
  .atc-game .stage {
    flex: 1;
  }
}

.atc-game nav button[aria-pressed="true"]:is(#surface, #air, .speed-btn) {
  background: #35544c;
  border-color: #abcbbb;
}
.atc-game .speed-group {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.atc-game .speed-btn {
  padding: 0.45rem 0.52rem;
  font: 12px var(--mono, monospace);
}
.atc-game #ff-quiet[aria-pressed="true"] {
  background: #4e4220;
  border-color: #e4c778;
  color: #fff0be;
}
.atc-game #radar-range {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: #c6d6d1;
  font: 12px var(--mono);
}
.atc-game #range {
  padding: 0.45rem 0.25rem;
  border: 1px solid #59716b;
  border-radius: 4px;
  background: #223431;
}

.atc-game .difficulty {
  display: block;
  margin: 0.6rem 0 0.85rem;
}
.atc-game .difficulty select {
  margin-left: 0.4rem;
  padding: 0.4rem;
}
.atc-game #channel {
  display: inline-block;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  border: 1px solid #3c5450;
  background: #1a2a2d;
  color: #b2dfc9;
  font: 11px var(--mono, monospace);
}
.atc-game #channel.is-tx {
  background: #234439;
  border-color: #7eb8a1;
  color: #d6f3e5;
}
.atc-game #channel.is-rx {
  background: #1e3745;
  border-color: #71a5bf;
  color: #d6edf8;
}
.atc-game #channel.is-blocked {
  background: #522322;
  border-color: #b85d56;
  color: #ffd1cb;
}
.atc-game #reminder {
  min-height: 30px;
  padding: 0.25rem 0.6rem;
  color: #ffe4a2;
  border-color: #77633d;
  font-size: 0.78rem;
}

.atc-game #game-over,
.atc-game #time-dialog,
.atc-game #score-dialog {
  width: min(25rem, calc(100% - 2rem));
  box-sizing: border-box;
  padding: 1.25rem 1.35rem;
  color: #f2f6f4;
  background: #142023;
  border: 1px solid #506360;
  border-radius: 9px;
}
.atc-game #score-dialog {
  width: min(33rem, calc(100% - 2rem));
}
.atc-game #game-over {
  padding: 1.5rem;
  border-color: #955c5b;
  border-top: 4px solid #ff6b65;
}
.atc-game #game-over::backdrop,
.atc-game #time-dialog::backdrop,
.atc-game #score-dialog::backdrop { background: rgb(8 15 18 / 70%); }
.atc-game #game-over h2 { margin: 0; font-size: 1.8rem; }
.atc-game #incident-detail { color: #cfdbd8; line-height: 1.45; }
.atc-game .game-over-score {
  margin-top: 0.7rem;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  background: #1a2a2d;
  border: 1px solid #35494a;
  color: #cfe4df;
  font: 12px/1.45 var(--mono, monospace);
}
.atc-game .game-over-score:empty {
  display: none;
}
.atc-game .dialog-head,
.atc-game .dialog-row,
.atc-game .dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.atc-game .dialog-note {
  margin: 0.5rem 0 0.85rem;
  font-size: 0.86rem;
  color: #b4c7c4;
  line-height: 1.4;
}
.atc-game .dialog-section {
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  border-top: 1px solid #324647;
}
.atc-game .dialog-section label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.84rem;
  color: #cfe4df;
}
.atc-game #jump-time {
  flex: 1;
  min-width: 140px;
  min-height: 38px;
  padding: 0.35rem 0.55rem;
  border-radius: 5px;
  border: 1px solid #516364;
  background: #1d2d31;
  color: #e5eeed;
  font: 14px var(--mono, monospace);
}
.atc-game .dialog-error {
  margin-top: 0.35rem;
  color: #ff9c97;
}
.atc-game .saved-points {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.55rem;
  max-height: 220px;
  overflow-y: auto;
}
.atc-game .saved-point {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.42rem 0.55rem;
  border-radius: 6px;
  border: 1px solid #35494a;
  background: #1a2a2d;
  font: 12px var(--mono, monospace);
}
.atc-game .saved-point-actions {
  display: inline-flex;
  gap: 0.3rem;
}
.atc-game .saved-point-actions button {
  min-height: 30px;
  padding: 0.22rem 0.55rem;
  font-size: 0.78rem;
}
.atc-game .dialog-foot {
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #324647;
}
.atc-game .score-dialog-head {
  align-items: flex-start;
}
.atc-game .score-total {
  padding: 0.35rem 0.7rem;
  border-radius: 7px;
  border: 1px solid #3c5454;
  background: #1d2d31;
  color: #b2dfc9;
  font: 700 1.35rem/1 var(--mono, monospace);
  white-space: nowrap;
}
.atc-game .score-total span {
  font-size: 0.85rem;
  font-weight: 500;
  color: #8fb2ab;
}
.atc-game .score-total.is-warn {
  background: #2b261b;
  border-color: #746036;
  color: #ffe4a2;
}
.atc-game .score-total.is-warn span {
  color: #c9b078;
}
.atc-game .score-total.is-bad {
  background: #381b1f;
  border-color: #8c484a;
  color: #ff9c97;
}
.atc-game .score-total.is-bad span {
  color: #cf8a86;
}
.atc-game .score-overview {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0.55rem 0 0.8rem;
  font-size: 0.88rem;
  color: #dce9e6;
}
.atc-game #score-meta {
  font: 12px var(--mono, monospace);
  color: #9bb8b3;
}
.atc-game .score-categories {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.atc-game .score-cat {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.34rem;
  min-height: 0;
  padding: 0.6rem 0.65rem;
  border-radius: 7px;
  border: 1px solid #35494a;
  background: #18262a;
  text-align: left;
}
.atc-game .score-cat:hover,
.atc-game .score-cat:focus-visible {
  background: #203338;
  border-color: #617f7c;
}
.atc-game .score-cat[aria-pressed="true"] {
  background: #22383d;
  border-color: #9ed4bd;
  box-shadow: inset 0 0 0 1px rgb(158 212 189 / 30%);
}
.atc-game .score-cat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
}
.atc-game .score-cat-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e5eeed;
}
.atc-game .score-cat-val {
  font: 600 0.82rem var(--mono, monospace);
  color: #cbe6df;
  white-space: nowrap;
}
.atc-game .score-cat-bar {
  height: 5px;
  border-radius: 999px;
  background: #293c40;
  overflow: hidden;
}
.atc-game .score-cat-fill {
  height: 100%;
  border-radius: 999px;
  background: #7fd1ae;
  transition: width 200ms ease;
}
.atc-game .score-cat-fill.is-warn {
  background: #f0c05a;
}
.atc-game .score-cat-fill.is-bad {
  background: #ff6b65;
}
.atc-game .score-cat-sub {
  font-size: 0.72rem;
  line-height: 1.3;
  color: #9cb5b1;
}
.atc-game .score-pilot-mood {
  margin-top: 0.65rem;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  border: 1px solid #304547;
  background: #172428;
  font: 12px/1.4 var(--mono, monospace);
  color: #bed9d3;
}
.atc-game .score-log-section {
  margin-top: 0.8rem;
}
.atc-game .score-log-head {
  margin-bottom: 0.5rem;
}
.atc-game .score-filter-reset {
  min-height: 26px;
  padding: 0.16rem 0.5rem;
  font-size: 0.75rem;
}
.atc-game .score-deductions {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  max-height: 270px;
  overflow-y: auto;
  padding-right: 0.15rem;
}
.atc-game .score-empty {
  padding: 0.85rem 0.75rem;
  border-radius: 6px;
  border: 1px dashed #3a5050;
  background: #172427;
  color: #b4cbc6;
  font-size: 0.85rem;
  line-height: 1.45;
}
.atc-game .score-item {
  padding: 0.52rem 0.65rem;
  border-radius: 6px;
  border: 1px solid #324647;
  background: #18262a;
}
.atc-game .score-item.is-credit {
  border-color: #2f554a;
  background: #162825;
}
.atc-game .score-item-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.atc-game .score-tag {
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font: 600 10.5px/1.3 var(--mono, monospace);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.atc-game .score-tag.is-safety {
  background: #461f24;
  color: #ffb8b3;
  border: 1px solid #7d3e42;
}
.atc-game .score-tag.is-efficiency {
  background: #3b3019;
  color: #ffe099;
  border: 1px solid #725d30;
}
.atc-game .score-tag.is-rapport {
  background: #1e3442;
  color: #b5e0f7;
  border: 1px solid #416880;
}
.atc-game .score-item-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: #eaf2f0;
}
.atc-game .score-item-right {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font: 11.5px var(--mono, monospace);
}
.atc-game .score-item-time {
  color: #8fa9a4;
}
.atc-game .score-item-pts {
  font-weight: 700;
  color: #ff9c97;
}
.atc-game .score-item-pts.is-gain {
  color: #8ee2bd;
}
.atc-game .score-item-detail {
  margin-top: 0.28rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #bfd3cf;
}
