@font-face {
  font-family: Barlow Condensed;
  src: url(../assets/barlow-condensed.ttf) format('truetype');
  font-weight: 800;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --white: #f4f1e7;
  --orange: #ff8043;
  --dim: #b4b2a8;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --title: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --pad: clamp(22px, 4.6vw, 88px);
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  background: #141511;
  color: var(--white);
  font:
    15px/1.45 Inter,
    Arial,
    sans-serif;
  overflow: hidden;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}
button:focus-visible {
  outline: 2px solid #ffbb87;
  outline-offset: 3px;
}
button,
canvas {
  touch-action: manipulation;
}
button:hover {
  color: white;
}
svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.symbols {
  display: none;
}
[hidden] {
  display: none !important;
}
#game,
.keyart,
#start,
#result,
#paused,
.hud {
  position: fixed;
  inset: 0;
}
#game {
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: none;
}
#start {
  overflow: auto;
  isolation: isolate;
  display: flex;
  flex-direction: column;
}
.keyart {
  z-index: -1;
  pointer-events: none;
}
/* Key art shows until the live battle behind the menu draws its first frame, then it fades out. */
.keyart::before,
.keyart::after {
  content: '';
  position: absolute;
  inset: 0;
}
.keyart::before {
  background: url(../assets/keyart.webp) center 45% / cover;
  transition: opacity 1.6s ease;
}
.live-backdrop .keyart::before {
  opacity: 0;
}
.keyart::after {
  background:
    linear-gradient(0deg, #101310 2%, rgba(15, 18, 16, 0.9) 34%, rgba(13, 16, 14, 0.3) 75%),
    linear-gradient(90deg, rgba(10, 14, 13, 0.82), rgba(12, 14, 13, 0.45) 55%, rgba(12, 14, 13, 0.7));
}
/* Over the live battle, a soft vignette as if looking down from high above. */
.live-backdrop .keyart::after {
  background:
    linear-gradient(0deg, #101310 2%, rgba(15, 18, 16, 0.86) 30%, rgba(13, 16, 14, 0.2) 70%),
    linear-gradient(90deg, rgba(10, 14, 13, 0.82), rgba(12, 14, 13, 0.36) 55%, rgba(12, 14, 13, 0.62)),
    radial-gradient(ellipse at 62% 40%, transparent 45%, rgba(8, 10, 9, 0.45));
}
.mast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 var(--pad);
  padding: clamp(15px, 2.4vh, 28px) 0;
  border-bottom: 1px solid #e8dbbb3a;
}
.wordmark,
.tools,
.eyebrow,
.section-head,
.deploy,
.instruments,
.armament {
  display: flex;
  align-items: center;
}
.wordmark {
  gap: 10px;
  font: 800 30px/0.95 var(--title);
  white-space: nowrap;
  letter-spacing: 0.025em;
}
.wordmark svg {
  width: 34px;
  height: 34px;
  color: var(--orange);
}
.wordmark span {
  font: 10px var(--mono);
  letter-spacing: 0.17em;
  border-left: 1px solid #ffffff52;
  margin-left: 7px;
  padding: 6px 0 6px 17px;
  color: #d3cfc1;
}
.tools {
  gap: 10px;
}
.tools button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-transform: uppercase;
  font: 10px var(--mono);
  letter-spacing: 0.11em;
  border: 1px solid #f6ecd740;
  padding: 9px 13px;
  background: #17171490;
  min-height: 36px;
}
.tools button:hover,
.text-button:hover {
  background: #524b3c;
}
.tools .muted svg {
  opacity: 0.45;
}
/* The menu: set up the walker in the hangar first, then deploy solo or with a crew. */
.briefing {
  padding: clamp(24px, 4.5vh, 56px) var(--pad) clamp(24px, 4.7vh, 60px);
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  align-items: start;
  gap: clamp(24px, 3.4vw, 64px);
}
.hangar {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.6vh, 28px);
  min-width: 0;
}
.hangar .callsign {
  max-width: 320px;
  margin: 0;
}
.sortie {
  position: sticky;
  top: 16px;
  border: 1px solid #6f766988;
  border-top: 3px solid var(--orange);
  background: #141a18e6;
  backdrop-filter: blur(6px);
  padding: clamp(18px, 2.4vw, 28px);
}
.sortie > .eyebrow {
  margin-bottom: 14px;
}
.eyebrow,
.section-head span,
small {
  font: 10px/1.4 var(--mono);
  letter-spacing: 0.13em;
}
.eyebrow {
  gap: 10px;
  font-weight: bold;
  color: var(--orange);
}
.eyebrow i {
  width: 27px;
  height: 2px;
  background: var(--orange);
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font: 800 clamp(48px, min(6vw, 9vh), 104px)/0.88 var(--title);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: -6px 0 0;
  color: #f5f1e5;
  text-shadow: 0 3px 38px #120d0b44;
}
h1 span {
  color: var(--orange);
}
.sortie p {
  font-size: clamp(14px, 1.05vw, 16px);
  line-height: 1.55;
  color: #d6d3c9;
  text-wrap: pretty;
}
.deploy {
  margin-top: 20px;
  gap: 42px;
  justify-content: space-between;
  min-height: 49px;
  padding: 0 22px;
  background: var(--orange);
  color: #211910;
  text-transform: uppercase;
  font: 800 19px var(--title);
  letter-spacing: 0.05em;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
}
.deploy svg {
  width: 24px;
}
.deploy:hover {
  background: #ff9e68;
  color: #171511;
}
.deploy:active {
  transform: translateY(1px);
}
.section-head {
  gap: 11px;
  margin-bottom: 12px;
}
.section-head svg {
  width: 17px;
  color: var(--orange);
}
.section-head h2 {
  font: 800 20px var(--title);
  text-transform: uppercase;
  letter-spacing: 0.065em;
}
.section-head div {
  height: 1px;
  background: #ffffff33;
  flex: 1;
}
.section-head span {
  font-size: 9px;
  color: #b3b5ac;
}
.map-check {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 12px;
  height: 12px;
  border: 1px solid #d6dbce7d;
  transform: rotate(45deg);
}
[aria-pressed='true'] .map-check {
  border-color: var(--orange);
  background: var(--orange);
  box-shadow: inset 0 0 0 2px #3d2b1f;
}
dialog,
.result-card {
  border: 1px solid #6f7669;
  border-top: 3px solid var(--orange);
  background: #1a201e;
  color: var(--white);
  padding: 30px;
  max-width: min(420px, 90vw);
}
dialog::backdrop,
#result {
  background: #080d0cbf;
  backdrop-filter: blur(5px);
}
dialog h2,
.result-card h2 {
  font: 800 44px/1 var(--title);
  text-transform: uppercase;
  margin: 12px 0 18px;
}
.close {
  position: absolute;
  top: 9px;
  right: 12px;
  font-size: 24px;
}
dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  font-size: 13px;
}
dd {
  margin: 0;
  color: #d4ad89;
}
dialog p,
.result-card p {
  font-size: 14px;
  color: #c6c9bd;
}
.hud {
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(12px, 2.4vw, 32px);
  background: radial-gradient(ellipse, transparent 47%, #0f171c35);
}
.hud button {
  pointer-events: auto;
}
.hud-top,
.hud-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.hud-bottom {
  align-items: flex-end;
}
.mission,
.instruments,
#weapon,
.fire-btn {
  background: #141b19da;
  border: 1px solid #e8ebd444;
  color: #f4f2e8;
  padding: 12px 16px;
}
.mission {
  border-left: 3px solid var(--orange);
}
.mission h2 {
  font: 800 30px var(--title);
  text-transform: uppercase;
}
.mission small,
.instruments small,
.armament small {
  color: #cfcec1;
  font-size: 9px;
}
.instruments,
.armament {
  gap: 12px;
}
.instruments {
  padding: 7px 14px 7px 7px;
}
#radar {
  width: 74px;
  height: 74px;
}
.health {
  width: 100%;
  height: 5px;
  background: #62665f;
  margin: 7px 0;
}
.health b {
  display: block;
  background: #eab387;
  height: 100%;
  width: 100%;
}
.health b.recharging {
  background: #88e1bd;
}
.health.shield {
  height: 3px;
  margin: 6px 0 -4px;
}
.health.shield b {
  background: #7fd4ff;
}
#shield-value {
  color: #9fdcff;
}
#hull.shield-down #shield-value {
  color: #8d918a;
}
#hull-status:not(:empty) {
  display: block;
  margin-bottom: 3px;
  text-transform: uppercase;
  color: #b6e8d2;
}
.armament {
  align-items: stretch;
}
#weapon {
  min-width: 250px;
}
#fire {
  display: flex;
  flex-direction: column;
  gap: 4px;
  touch-action: none;
}
.fire-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 12px;
  font: 800 17px var(--title);
  text-transform: uppercase;
  min-width: 74px;
  border-color: var(--orange);
  color: var(--orange);
  touch-action: none;
}
.fire-btn b {
  font: bold 10px var(--mono);
  color: #ffd3b0;
}
.fire-btn:hover {
  background: #30362de8;
}
.fire-btn.firing {
  background: #764a2d;
}
#reticle,
#contact {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  color: #fff4d8;
}
#reticle {
  width: 24px;
  height: 24px;
  border: 1px solid currentColor;
  border-radius: 50%;
  filter: drop-shadow(0 1px 2px #16170e);
}
#reticle:before,
#reticle:after {
  content: '';
  position: absolute;
  top: 10px;
  height: 2px;
  width: 8px;
  background: currentColor;
}
#reticle:before {
  left: -5px;
}
#reticle:after {
  right: -5px;
}
#reticle i {
  position: absolute;
  inset: 10px;
  background: currentColor;
}
#reticle.hit {
  color: #ff713d;
  transform: translate(-50%, -50%) scale(1.25);
}
#reticle.acquiring {
  color: #ffd690;
}
#reticle.acquiring b {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(currentColor var(--lock-angle), transparent 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), black 0);
}
#reticle.locked {
  color: #9ff8bc;
}
#contact i {
  display: block;
  width: 12px;
  height: 12px;
  border: 1px solid #ff9f65;
  transform: rotate(45deg);
  margin: auto;
}
#contact span {
  display: block;
  margin-top: 4px;
  font: bold 9px var(--mono);
  color: #fff0d0;
  text-shadow: 0 1px 3px #000;
}
#damage {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 85px #f65f38;
  opacity: 0;
}
#stick {
  position: fixed;
  width: 100px;
  height: 100px;
  margin: -50px;
  border: 1px solid #fff9;
  border-radius: 50%;
  pointer-events: none;
  display: none;
}
#stick.show {
  display: block;
}
#stick-knob {
  position: absolute;
  top: 35px;
  left: 35px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff9;
}
#result,
#paused {
  display: grid;
  place-items: center;
}
#paused {
  background: #080d0cbf;
  backdrop-filter: blur(5px);
}
.result-card {
  min-width: min(360px, 90vw);
}
.text-button {
  margin-top: 12px;
  padding: 8px 0;
  color: var(--dim);
}
@media (max-width: 700px) {
  .mast {
    padding: 14px 0;
  }
  .tools {
    gap: 5px;
  }
  .tools button {
    padding: 8px;
  }
  .mast .tools span {
    display: none;
  }
  .wordmark span {
    font-size: 8px;
    padding-left: 10px;
    margin-left: 0;
  }
  .keyart::before {
    background-position: 61% center;
  }
  .map-check {
    width: 8px;
    height: 8px;
    right: 6px;
    top: 6px;
  }
  .section-head h2 {
    font-size: 17px;
  }
  .mission h2 {
    font-size: 21px;
  }
  .mission,
  #weapon {
    padding: 8px;
  }
  #weapon {
    min-width: 0;
  }
  .slot span {
    display: none;
  }
  .armament,
  .instruments {
    gap: 5px;
  }
  .instruments {
    padding: 5px;
  }
  #radar {
    width: 49px;
    height: 49px;
  }
  .hud small,
  .hud .eyebrow {
    font-size: 8px;
    letter-spacing: 0.04em;
  }
  .fire-btn {
    min-width: 45px;
    padding: 4px 8px;
    font-size: 14px;
  }
}
@media (max-height: 590px) and (min-width: 600px) {
  .mast {
    padding: 8px 0;
  }
  .briefing {
    padding-top: 12px;
    padding-bottom: 10px;
  }
  .hangar {
    gap: 10px;
  }
  .hangar h1 {
    font-size: 44px;
  }
  .sortie p {
    font-size: 13px;
  }
  .deploy {
    margin-top: 10px;
    min-height: 36px;
  }
  .section-head {
    margin-bottom: 5px;
  }
}
#contact > div {
  height: 2px;
  background: #18222080;
  width: 42px;
  margin: 4px auto;
}
#contact b {
  display: block;
  height: 100%;
  background: #ffb578;
}
#confirm {
  position: absolute;
  left: 50%;
  bottom: 22%;
  transform: translateX(-50%);
  color: #ffe1bf;
  background: #17211dd9;
  border-left: 2px solid var(--orange);
  padding: 7px 12px;
  font: 10px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

#combo {
  color: var(--orange);
}
#hull.critical .health:not(.shield) b {
  background: #ff5a36;
  animation: hull-alarm 0.8s ease-in-out infinite;
}
#hull.critical #hull-value {
  color: #ff7a55;
}
@keyframes hull-alarm {
  50% {
    opacity: 0.35;
  }
}
#threats {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
#threats i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(64vh, 64vw);
  height: min(64vh, 64vw);
  border: 6px solid transparent;
  border-top-color: #ff5a36;
  border-radius: 50%;
  opacity: 0;
  filter: drop-shadow(0 0 6px #ff3c1c);
  -webkit-mask: linear-gradient(#000 0 18%, transparent 30%);
  mask: linear-gradient(#000 0 18%, transparent 30%);
}
#banner {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  text-align: center;
  text-shadow: 0 2px 14px #000c;
  white-space: nowrap;
}
#banner.pop {
  animation: banner-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
#banner strong {
  display: block;
  font: 800 clamp(38px, 7vw, 72px) / 1 var(--title);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
#banner small {
  display: block;
  margin-top: 6px;
  font: 10px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: #ffd3b0;
  white-space: normal;
  max-width: 86vw;
}
@keyframes banner-in {
  from {
    opacity: 0;
    transform: translateX(-50%) scale(1.25);
  }
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 18px 0;
  font-size: 12px;
}
.stats dt {
  font: 9px var(--mono);
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.stats dd {
  font: 800 24px/1.1 var(--title);
  color: var(--white);
}
#record {
  margin-bottom: 16px;
  color: var(--orange);
}
@media (prefers-reduced-motion: reduce) {
  #banner.pop,
  #hull.critical .health:not(.shield) b {
    animation: none;
  }
}

#modules,
#defenses {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.module-btn {
  position: relative;
  text-align: left;
  border: 1px solid #d6dbc13b;
  background: #141b19c4;
  padding: 11px 26px 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.module-btn:hover {
  background: #2a2f27d9;
}
.module-btn[aria-pressed='true'] {
  border-color: var(--orange);
  box-shadow: inset 3px 0 var(--orange);
  background: #2a1f17d9;
}
.module-code {
  font: bold 9px var(--mono);
  letter-spacing: 0.12em;
  color: var(--orange);
}
.module-btn strong {
  text-transform: uppercase;
  font: 800 clamp(16px, 1.45vw, 21px)/1 var(--title);
  letter-spacing: 0.025em;
}
.module-btn small {
  font-size: 9px;
  letter-spacing: 0.04em;
  color: #c9c6b8;
}
.loadout .section-head b {
  color: var(--orange);
  font-weight: bold;
}
.slots {
  display: grid;
  gap: 3px;
  margin-top: 6px;
}
.slot {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font: normal 9px var(--mono);
  letter-spacing: 0.06em;
  color: #bdbcae;
}
.slot b {
  min-width: 13px;
  text-align: center;
  border: 1px solid #e8ebd444;
  color: #8f8e83;
}
.slot em {
  font-style: normal;
  color: #f4f2e8;
}
.slot small {
  margin-left: auto;
  padding-left: 8px;
  white-space: nowrap;
}
.slot.on b {
  border-color: var(--orange);
  color: var(--orange);
}
.slot.on em {
  color: #ffd3b0;
}
.slot.auto b {
  border-style: dashed;
  color: #b6e8d2;
}
.slot.auto small {
  color: #b6e8d2;
}
.slot.defend {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid #e8ebd422;
}
.slot.defend b {
  color: #c8d6e0;
}
.slot.defend.on b {
  border-color: #c8d6e0;
  color: #fff;
}
.defend-btn {
  border-color: #c8d6e0;
  color: #c8d6e0;
}
.defend-btn.firing {
  background: #3d4a52;
}
@media (max-width: 1000px) {
  .briefing {
    grid-template-columns: minmax(0, 1fr);
  }
  .sortie {
    position: static;
    max-width: 560px;
  }
}
@media (max-width: 700px) {
  #modules,
  #defenses {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }
}
@media (max-width: 480px) {
  .wordmark span {
    display: none;
  }
  .module-btn {
    padding: 8px 18px 8px 8px;
  }
  .module-btn small {
    display: none;
  }
  .module-btn strong {
    font-size: 15px;
  }
  .slot {
    font-size: 8px;
  }
}
@media (max-height: 590px) and (min-width: 600px) {
  .module-btn small {
    display: none;
  }
  .module-btn {
    padding: 7px 18px 7px 10px;
  }
}
/* Co-op: host / join on the menu, then the lobby panel. */
.coop {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid #ffffff2a;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.coop-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #f6ecd759;
  background: #17171499;
  text-transform: uppercase;
  font: 800 16px var(--title);
  letter-spacing: 0.06em;
}
.ghost:hover {
  background: #524b3c;
}
.ghost:disabled {
  opacity: 0.5;
  cursor: progress;
}
.ghost svg {
  color: var(--orange);
  stroke: none;
  fill: currentColor;
  width: 20px;
}
.join {
  display: flex;
  flex: 1;
  min-width: 190px;
}
.join input,
.callsign input {
  min-width: 0;
  min-height: 40px;
  border: 1px solid #f6ecd759;
  background: #0f1311cc;
  color: var(--white);
  padding: 0 12px;
  font: bold 15px var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.join input {
  flex: 1;
  border-right: 0;
}
.join input:focus-visible,
.callsign input:focus-visible {
  outline: 2px solid #ffbb87;
  outline-offset: -2px;
}
#coop-status,
#lobby-status {
  min-height: 1.4em;
  color: #e7b08c;
}
#lobby {
  margin-top: 4px;
}
.lobby-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #ffffff33;
  padding-bottom: 12px;
}
.lobby-head small {
  color: var(--orange);
  font-weight: bold;
}
.lobby-head strong {
  display: block;
  font: 800 52px/0.9 var(--title);
  letter-spacing: 0.12em;
}
#lobby-brief {
  margin: 12px 0;
  color: #d6d3c9;
  font-size: 14px;
}
.callsign {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}
.callsign input {
  letter-spacing: 0.08em;
  text-transform: none;
}
#crew,
.crew-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
#crew li,
.crew-stats li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 10px;
  padding: 8px 10px;
  border: 1px solid #d6dbc12e;
  background: #141b19c4;
}
#crew li.me {
  border-color: var(--orange);
  box-shadow: inset 3px 0 var(--orange);
}
#crew li.open {
  border-style: dashed;
  color: #8d8b82;
}
#crew b,
.crew-stats b {
  font: bold 11px var(--mono);
  color: var(--orange);
  grid-row: span 2;
}
#crew strong,
.crew-stats strong {
  font: 800 19px/1 var(--title);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#crew em,
.crew-stats em {
  font: bold 9px var(--mono);
  font-style: normal;
  letter-spacing: 0.12em;
  color: #211910;
  background: var(--orange);
  padding: 2px 6px;
  justify-self: end;
}
#crew em.you {
  background: #d9d4c4;
}
#crew small,
.crew-stats small {
  grid-column: 2 / -1;
  color: #c9c6b8;
}
.crew-stats {
  margin: 4px 0 8px;
}
.crew-stats li {
  grid-template-columns: 22px minmax(0, 1fr) auto;
}
.crew-stats span {
  font: 12px var(--mono);
  color: #d4ad89;
  justify-self: end;
}
#result-wait {
  display: block;
  margin-top: 18px;
  color: #e7b08c;
}
.mp-only {
  display: none;
}
.mp .mp-only {
  display: block;
}
#crew-hud {
  margin-top: 3px;
  color: #9fd6f2;
}
.mp .solo-only {
  display: none !important;
}
@media (max-width: 700px) {
  .lobby-head strong {
    font-size: 40px;
  }
  .coop {
    margin-top: 18px;
  }
}
/* Lobby browser on the menu. */
.browser {
  margin-top: 4px;
  border-top: 1px solid #ffffff33;
  padding-top: 8px;
}
.browser-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.browser-head small:first-child {
  color: var(--orange);
  font-weight: bold;
}
.browser-head small:nth-child(2) {
  flex: 1;
  color: var(--dim);
}
.browser-head .text-button {
  margin: 0;
  padding: 4px 10px;
  font: bold 10px var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
#browser-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
  max-height: min(236px, 32vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}
#browser-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 2px 10px;
  padding: 7px 7px 7px 10px;
  border: 1px solid #d6dbc12e;
  background: #141b19c4;
}
#browser-list li.empty {
  display: block;
  border-style: dashed;
  color: #8d8b82;
  font-size: 13px;
}
#browser-list strong {
  font: 800 18px/1 var(--title);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#browser-list li > small {
  grid-column: 1;
  color: #c9c6b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#browser-list .seats {
  grid-row: span 2;
  font: bold 12px var(--mono);
  color: #d9d4c4;
  text-align: right;
}
#browser-list .seats em {
  display: block;
  font: bold 9px var(--mono);
  font-style: normal;
  letter-spacing: 0.1em;
  color: #9fd6f2;
}
#browser-list .seats em.live {
  color: #e7b08c;
}
#browser-list .ghost {
  grid-row: span 2;
  min-height: 36px;
  padding: 0 12px;
  font-size: 15px;
}
.ghost[aria-disabled='true'] {
  opacity: 0.45;
  cursor: not-allowed;
}
/* Lobby panel: name, listing, ready, kick, chat. */
#lobby-title {
  margin: 12px 0 0;
  font: 800 24px/1.05 var(--title);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  overflow-wrap: anywhere;
}
.lobby-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0 10px;
}
.toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 12px;
  cursor: pointer;
  font-size: 14px;
}
.toggle input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--orange);
}
.toggle small {
  display: block;
  color: var(--dim);
}
#lobby:not(.hosting) .host-only {
  display: none;
}
#crew .kick {
  grid-row: span 2;
  margin: 0;
  padding: 4px 8px;
  min-height: 0;
  border: 1px solid #f6ecd740;
  background: none;
  color: var(--dim);
  font: bold 9px var(--mono);
  letter-spacing: 0.1em;
}
#crew .kick:hover {
  background: #6b2a1d;
  color: var(--white);
}
#crew li.host-view {
  grid-template-columns: 22px minmax(0, 1fr) auto auto;
}
#crew li.host-view small {
  grid-column: 2 / 4;
}
#crew li.host-view .kick {
  grid-column: 4;
  grid-row: 1 / span 2;
  margin-left: 4px;
}
#crew em.ready {
  background: #7fc79a;
}
#crew em.waiting {
  background: #4c4a43;
  color: #d9d4c4;
}
.deploy:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
#lobby-ready[aria-pressed='true'] {
  background: #7fc79a;
}
.chat {
  margin-top: 10px;
  border-top: 1px solid #ffffff33;
  padding-top: 8px;
}
#chat-log {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
  height: 112px;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
#chat-log li b {
  color: var(--orange);
  margin-right: 6px;
}
#chat-log li.sys {
  color: var(--dim);
  font-style: italic;
}
#chat-log li.empty {
  color: #8d8b82;
}
.chat .join input {
  letter-spacing: 0.02em;
  text-transform: none;
  font: 14px var(--mono);
}
#tags {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.tag {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font: bold 10px var(--mono);
  letter-spacing: 0.12em;
  color: #9fd6f2;
  text-shadow: 0 1px 3px #000c;
  white-space: nowrap;
  will-change: transform;
}
.tag i {
  display: block;
  width: 46px;
  height: 3px;
  background: #0b1418b3;
}
.tag b {
  display: block;
  height: 100%;
  background: #5fc8ff;
}
.tag.down {
  color: #8d8b82;
}
#rewards {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.reward {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}
.reward span {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: reward-pop 1.5s ease-out forwards;
}
.reward b {
  font: 700 22px 'Barlow Condensed', sans-serif;
  letter-spacing: 0.04em;
  color: #ffe1bf;
  text-shadow: 0 0 6px #ff804399, 0 1px 2px #000c;
}
.reward.big b {
  font-size: 28px;
}
.reward.chain b {
  color: var(--orange);
}
.reward small {
  font: bold 9px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #ffe1bf;
  text-shadow: 0 1px 2px #000c;
}
.reward small:empty {
  display: none;
}
@keyframes reward-pop {
  0% { opacity: 0; transform: scale(0.4); }
  12% { opacity: 1; transform: scale(1.25); }
  24% { transform: scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: scale(0.92); }
}
@media (prefers-reduced-motion: reduce) {
  .reward span {
    animation-name: reward-fade;
  }
  @keyframes reward-fade {
    0%, 70% { opacity: 1; }
    100% { opacity: 0; }
  }
}
