#planet-entry {
  position: absolute;
  top: 0;
  left: 50.8%;
  width: 43.5%;
  height: 20.3%;
  z-index: 2;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  clip-path: polygon(9% 0, 94% 0, 100% 26%, 100% 83%, 94% 100%, 29% 100%, 28% 85%, 5% 88%, 0 81%, 1% 62%, 4% 31%);
}
#planet-entry:hover, #planet-entry:focus-visible {
  background: radial-gradient(ellipse at 32% 52%,#ffe9ab46,transparent 90%);
  outline: none;
}
#sector-key {
  width: min(360px,calc(100% - 24px));
  padding: 0;
  background: #d6d1ca;
  border: 2px solid #8396aa;
  color: #15223a;
}
#sector-key::backdrop, #sector::backdrop { background: #050919dc; }
#sector-key-form { display: grid; gap: 9px; }
#sector-key-error { margin: 0; color: #941b36; }
#sector {
  box-sizing: border-box;
  width: min(1210px,calc(100% - 30px));
  max-width: none;
  max-height: calc(100dvh - 18px);
  padding: 0;
  color: #e5f4fd;
  background: #101929;
  border: 1px solid #526982;
  box-shadow: 0 18px 90px #000b;
  font: 14px/1.4 system-ui,sans-serif;
}
#sector button {
  background: #13263b;
  color: #ecf9ff;
  border: 1px solid #507b93;
  box-shadow: none;
  font: 600 14px/1.3 system-ui,sans-serif;
  padding: 8px 14px;
}
#sector button:hover, #sector button:focus-visible { background: #24516a; }
#sector button:disabled { opacity: .55; }
.sector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 15px;
  background: #111b2b;
  border-bottom: 1px solid #334a62;
}
#sector-name {
  margin: 0;
  color: #a7fae9;
  white-space: nowrap;
  font: 700 25px/1 'Pixelify Sans',monospace;
}
#sector-roster { margin-inline-end: auto; color: #afc5d8; font-size: 12px; }
#sector-location { color: #86d8e7; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sector-menu {
  min-height: min(360px,52dvh);
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 10px;
  padding: 25px clamp(22px,6vw,90px);
  background:
    radial-gradient(ellipse at 82% 30%,#306b6f80,transparent 49%),
    repeating-linear-gradient(0deg,#0f1f2e 0 1px,transparent 1px 36px),
    linear-gradient(125deg,#142537,#0a1122 75%);
}
#sector-menu p { margin: 0; }
.sector-map-name {
  color: #fff;
  font: 700 clamp(26px,5vw,54px)/1.1 'Pixelify Sans',monospace;
}
.sector-menu-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
#sector-error { color: #ffb5a6; }
#sector-admin-entry { margin-inline-start: 5px; }
#sector-lobby {
  padding: 18px clamp(14px,4vw,44px) 24px;
  background: radial-gradient(ellipse at 95% 0%,#193e4b,transparent 60%),#101929;
}
.sector-lobby-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  flex-wrap: wrap;
}
#sector-lobby-title, #sector-invitation-title {
  margin: 0;
  color: #a7fae9;
  font: 700 27px/1.15 'Pixelify Sans',monospace;
}
.sector-lobby-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px;
  margin-block: 14px;
}
.sector-lobby-grid > div {
  min-width: 0;
  padding: 12px;
  background: #0a1423;
  border: 1px solid #33536a;
}
.sector-lobby-grid h4 { margin: 0 0 5px; font-size: 14px; color: #c4e2f1; }
.sector-lobby-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(34dvh,290px);
  overflow: auto;
  overscroll-behavior: contain;
}
.sector-lobby-grid li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px 12px;
  min-height: 40px;
  overflow-wrap: anywhere;
}
.sector-lobby-grid li + li { border-top: 1px solid #24384d; }
.sector-lobby-grid small { color: #9db9cb; }
.sector-lobby-grid button { flex: none; }
.sector-lobby-footer p, #sector-lobby-feedback { margin: 0; }
#sector-lobby #sector-lobby-start { color: #a7fae9; border-color: #63c9bd; }
#sector-lobby-feedback { min-height: 1.4em; margin-top: 8px; color: #ffe0a9; }
#sector-invitation {
  position: fixed;
  z-index: 3;
  right: max(12px,env(safe-area-inset-right));
  bottom: max(38px,env(safe-area-inset-bottom));
  width: min(calc(100vw - 24px),360px);
  box-sizing: border-box;
  padding: 13px;
  border: 1px solid #63c9bd;
  color: #e5f4fd;
  background: #101929;
  box-shadow: 0 10px 30px #000b;
  font: 14px/1.4 system-ui,sans-serif;
}
#sector-invitation-title { font-size: 22px; }
#sector-invitation-text { margin: 8px 0 12px; overflow-wrap: anywhere; }
#sector-invitation .row { flex-wrap: wrap; }
#sector-invitation[hidden], #sector-invitation [hidden] { display: none; }
#sector #sector-invitation { position: sticky; z-index: 5; margin: 0 12px 12px auto; bottom: 8px; }
@media (max-width: 560px) {
  .sector-lobby-grid { grid-template-columns: 1fr; }
  .sector-lobby-grid ul { max-height: min(23dvh,174px); }
}
#sector-admin { padding: 14px clamp(12px,3vw,32px) 20px; color: #edf6fb; }
.admin-heading, .admin-toolbar, .admin-login-row, .admin-pages {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-heading { justify-content: space-between; margin-bottom: 14px; }
.admin-heading h3 { margin: 0; font: 700 25px/1.2 'Pixelify Sans',monospace; color: #a7fae9; }
#sector-admin-form { display: grid; gap: 7px; }
.admin-login-row input {
  width: min(275px,100%);
  border: 1px solid #5a7a97;
  background: #0a1322;
  color: #eefaff;
  padding: 7px 10px;
}
.admin-toolbar { margin-bottom: 10px; }
.admin-toolbar button[aria-pressed="true"] { border-color: #a7fae9; color: #a7fae9; }
.admin-table { max-height: 54dvh; overflow: auto; border: 1px solid #3a536a; }
.admin-table table { border-collapse: collapse; width: 100%; min-width: 440px; }
.admin-table th,.admin-table td { text-align: left; padding: 7px 9px; border-bottom: 1px solid #3a536a; }
.admin-table th { position: sticky; top: 0; background: #15263c; z-index: 1; }
.admin-table td:nth-child(2) { font-family: ui-monospace,monospace; overflow-wrap: anywhere; }
.admin-table tr:nth-child(even) td { background: #172438; }
.admin-pages { justify-content: flex-end; margin-top: 9px; }
#sector-admin-status:empty { display: none; }
#sector-admin-status { color: #ffbaaa; }
.sector-frame { position: relative; overflow: hidden; background: #0a1220; touch-action: none; }
#sector-damage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 53%,transparent 22%,#a4031b62 63%,#eb1529c9 100%);
  box-shadow: inset 0 0 24px 5px #ed2445b5;
}
#sector-view {
  display: block;
  width: 100%;
  height: min(calc(100dvh - 110px),66vw,680px);
  object-fit: contain;
  image-rendering: pixelated;
  touch-action: none;
}
.sector-hud { position: absolute; inset: 0; pointer-events: none; }
.sector-score {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1px;
  white-space: nowrap;
}
.sector-score span, .sector-score time, .sector-stats span {
  background: #091420eb;
  padding: 5px 12px;
  font: 700 16px/1.2 'Pixelify Sans',monospace;
}
#sector-time.sector-countdown { color: #ffdc9a; min-width: 44px; text-align: center; }
.sector-touch-flight, .sector-spectating #sector-inventory { display: none; }
.sector-spectating #sector-hp-bar { visibility: hidden; }
#sector-left { color: #8af8e6; border-bottom: 2px solid #67dcca; }
#sector-right { color: #ffad91; border-bottom: 2px solid #eb8766; }
#sector-radar {
  position: absolute;
  top: 10px;
  right: 12px;
  width: clamp(62px,10vw,111px);
  height: auto;
  image-rendering: pixelated;
  border: 1px solid #587486;
}
#sector-round {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: #eaf7fc;
  background: #0a1725dc;
  width: max-content;
  max-width: 79%;
  padding: 5px 9px;
}
#sector-round:empty { display: none; }
#sector-report {
  position: absolute;
  top: 86px;
  left: 50%;
  z-index: 1;
  transform: translateX(-50%);
  width: min(620px,calc(100% - 16px));
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1.18fr);
  gap: 12px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid #4a697d;
  border-radius: 4px;
  background: #091420f2;
  color: #dcebf4;
  font: 12px/1.3 Tahoma,sans-serif;
}
#sector-report[hidden] { display: none; }
#sector-report h3, #sector-report caption {
  margin: 0 0 4px;
  text-align: left;
  color: #eaf7fc;
  font-size: 13px;
  font-weight: bold;
}
#sector-eliminations { margin: 0; padding: 0; list-style: none; }
#sector-eliminations li { padding: 0 0 2px; overflow-wrap: anywhere; }
#sector-eliminations [data-team="0"] { color: #8af8e6; }
#sector-eliminations [data-team="1"] { color: #ffad91; }
#sector-report table { width: 100%; border-collapse: collapse; text-align: center; }
#sector-report th, #sector-report td { padding: 2px 3px; }
#sector-report th[scope="row"] { text-align: left; white-space: nowrap; }
#sector-report thead { background: #183044; color: #c1d6e6; }
#sector-report tbody td { color: #fff0c9; font-variant-numeric: tabular-nums; }
.sector-stats { position: absolute; inset: auto 12px 12px; display: flex; justify-content: space-between; }
#sector-health { color: #a2fce5; }
#sector-ammo { color: #ffe6b2; }
#sector-armor { color: #a7c8ff; }
.sector-meters { display: grid; gap: 4px; align-self: end; }
.sector-meters div { display: grid; grid-template-columns: minmax(108px,auto) minmax(67px,7vw); align-items: center; background: #091420eb; }
.sector-meters div:has(#sector-armor-bar[hidden]) { display: none; }
.sector-meters span { padding: 4px 8px; white-space: nowrap; }
.sector-meters progress {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  width: calc(100% - 8px);
  height: 7px;
  margin-right: 8px;
  background: #253647;
  color: #8af8e6;
}
.sector-meters progress::-webkit-progress-bar { background: #253647; }
.sector-meters progress::-webkit-progress-value { background: currentColor; }
.sector-meters progress::-moz-progress-bar { background: currentColor; }
#sector-armor-bar { color: #91baff; }
#sector-ammo { align-self: end; }
#sector-ammo:empty, #sector-pickup:empty { display: none; }
#sector-pickup, #sector-inventory {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
  bottom: 12px;
  white-space: nowrap;
}
#sector-pickup { bottom: 49px; padding: 4px 8px; color: #ebfbff; background: #091420eb; }
#sector-inventory span { font-size: 12px; padding: 5px 8px; color: #9da8b2; background: #0a1422df; border: 1px solid #44566a; }
#sector-inventory .has-weapon { color: #eefbff; border-color: #638697; }
#sector-inventory .selected-weapon { color: #a2fce5; border-color: #90e9d8; background: #142b34f5; }
#sector-lock { position: absolute; left: 50%; top: 53%; transform: translate(-50%,-50%); min-width: 145px; }
.sector-frame:has(#sector-report:not([hidden])) #sector-lock { top: auto; bottom: 48px; transform: translateX(-50%); }
.sector-controls {
  display: flex;
  gap: 5px 14px;
  flex-wrap: wrap;
  padding: 7px 14px;
  color: #b4cade;
  font-size: 12px;
  border-top: 1px solid #334a62;
}
#sector-touch { display: none; }
#sector [hidden], #sector-key [hidden] { display: none; }
@media (pointer:coarse) {
  #sector-touch { display: flex; position: absolute; inset: auto 8px 8px; justify-content: space-between; pointer-events: none; }
  #sector-touch button { pointer-events: auto; touch-action: none; min-height: 37px; min-width: 39px; padding: 5px; background: #112d45d9; }
  .sector-dpad, .sector-touch-actions, .sector-touch-weapons { display: grid; grid-template-columns: repeat(2,auto); gap: 4px; }
  .sector-dpad { grid-template-columns: repeat(3,auto); }
  .sector-dpad [data-hold="KeyW"] { grid-column: 2; }
  .sector-dpad [data-hold="KeyA"] { grid-row: 2; grid-column: 1; }
  .sector-dpad [data-hold="KeyS"] { grid-row: 2; grid-column: 2; }
  .sector-dpad [data-hold="KeyD"] { grid-row: 2; grid-column: 3; }
  .sector-touch-weapons { position: absolute; display: flex; left: 50%; bottom: 0; transform: translateX(-50%); }
  .sector-spectating .sector-touch-actions, .sector-spectating .sector-touch-weapons { display: none; }
  .sector-spectating .sector-touch-flight { display: flex; align-items: flex-end; gap: 4px; }
  #sector-touch .sector-touch-weapons button { min-width: 34px; }
  #sector-touch .sector-touch-weapons button[aria-pressed="true"] { border-color: #9de8cf; color: #a2fce5; }
  #sector-inventory { display: none; }
  #sector-pickup { bottom: 67px; }
  .sector-stats { bottom: 88px; }
  .sector-controls { display: none; }
  #sector-view { height: min(calc(100dvh - 58px),75vw); }
  #sector { width: calc(100% - 12px); }
}
@media (pointer:coarse) and (orientation:landscape) {
  #sector:has(#sector-play:not([hidden])) { width: 100%; max-height: 100dvh; }
  #sector:has(#sector-play:not([hidden])) .sector-bar { padding: 4px 10px; }
  #sector-view { height: calc(100dvh - 43px); }
}
@media (max-width:520px) {
  .sector-score span, .sector-score time { padding-inline: 5px; font-size: 12px; }
  .sector-score { left: 8px; transform: none; }
  #sector-round { font-size: 12px; top: 39px; }
  #sector-report { top: 79px; grid-template-columns: 1fr; gap: 5px; padding: 5px 6px; font-size: 10px; }
  #sector-report h3, #sector-report caption { font-size: 11px; margin-bottom: 2px; }
  #sector-report table { grid-row: 1; }
  #sector-eliminations { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 5px; }
  .sector-stats span { font-size: 13px; }
  .sector-meters div { grid-template-columns: auto minmax(44px,10vw); }
  #sector-inventory { bottom: 59px; }
  #sector-pickup { bottom: 92px; }
}
