:root {
  color-scheme: light;
  --glass: rgba(246, 248, 241, 0.84);
  --glass-strong: rgba(252, 253, 247, 0.94);
  --ink: #1f2923;
  --muted: #667067;
  --line: rgba(31, 41, 35, 0.18);
  --green: #285f4e;
  --red: #9d3833;
  --gold: #d09b2b;
  --shadow: 0 16px 40px rgba(21, 28, 24, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #d8ddd5;
}

body.loading-active {
  background: #000;
}

body.menu-active .app-shell,
body.faction-active .app-shell {
  opacity: 0;
  pointer-events: none;
}

body.faction-active .main-menu,
body.game-active .main-menu,
body.credits-active .main-menu,
body.game-active .credits-screen {
  opacity: 0;
  pointer-events: none;
}

body.settings-open .settings-panel {
  opacity: 1;
  pointer-events: auto;
}

button {
  font: inherit;
}

.main-menu,
.faction-select,
.credits-screen,
.settings-panel,
.cloud-transition {
  position: fixed;
  inset: 0;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: #000;
  color: #f4f6ef;
  opacity: 1;
  transition:
    opacity 520ms ease,
    visibility 520ms ease;
}

.loading-screen.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loading-core {
  display: grid;
  justify-items: center;
  width: min(420px, calc(100vw - 56px));
}

.mobile-notice {
  position: fixed;
  inset: 0;
  z-index: 1002;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 28%, rgba(70, 108, 83, 0.18), transparent 42%),
    rgba(8, 12, 10, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  backdrop-filter: blur(12px);
}

.mobile-notice.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-notice[hidden] {
  display: none;
}

.mobile-notice-card {
  width: min(440px, calc(100vw - 36px));
  padding: 24px;
  border: 1px solid rgba(237, 243, 232, 0.28);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(246, 248, 241, 0.94), rgba(225, 232, 221, 0.88)),
    rgba(246, 248, 241, 0.92);
  box-shadow:
    0 28px 84px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  color: var(--ink);
  transform: translateY(10px) scale(0.98);
  transition: transform 220ms ease;
}

.mobile-notice.open .mobile-notice-card {
  transform: translateY(0) scale(1);
}

.mobile-notice-kicker {
  display: block;
  margin-bottom: 8px;
  color: rgba(40, 95, 78, 0.72);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.18em;
}

.mobile-notice-card h2 {
  margin: 0 0 14px;
  font-size: clamp(24px, 7vw, 34px);
  line-height: 1.12;
}

.mobile-notice-card p {
  margin: 0 0 22px;
  color: rgba(31, 41, 35, 0.74);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.8;
}

.mobile-notice-card button {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(40, 95, 78, 0.24);
  border-radius: 16px;
  background: rgba(40, 95, 78, 0.14);
  color: #1f2923;
  cursor: pointer;
  font-size: 16px;
  font-weight: 950;
}

.mobile-notice-card button:hover {
  background: rgba(40, 95, 78, 0.22);
}

.loading-spinner {
  width: 86px;
  height: 86px;
  border: 8px solid rgba(255, 255, 255, 0.1);
  border-top-color: rgba(245, 246, 236, 0.92);
  border-right-color: rgba(83, 133, 111, 0.82);
  border-radius: 50%;
  box-shadow:
    0 0 34px rgba(72, 128, 105, 0.32),
    inset 0 0 24px rgba(255, 255, 255, 0.08);
  animation:
    loading-spin 980ms linear infinite,
    loading-pulse 1800ms ease-in-out infinite;
}

.loading-percent {
  margin-top: 24px;
  font-size: 28px;
  font-weight: 950;
  letter-spacing: 0;
}

.loading-bar {
  width: 100%;
  height: 12px;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.loading-bar i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4d7f68, #d1b15b, #f4f6ef);
  box-shadow: 0 0 18px rgba(209, 177, 91, 0.42);
  transition: width 180ms ease;
}

.loading-core p {
  min-height: 24px;
  margin: 16px 0 0;
  color: rgba(244, 246, 239, 0.72);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

.loading-continue {
  margin-top: 18px;
  padding: 11px 26px;
  border: 1px solid rgba(244, 246, 239, 0.32);
  border-radius: 14px;
  background: rgba(244, 246, 239, 0.9);
  color: #17201a;
  cursor: pointer;
  font-size: 17px;
  font-weight: 950;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.36);
}

.loading-continue:hover {
  background: #fffef4;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes loading-pulse {
  0%,
  100% {
    filter: brightness(0.9);
  }
  50% {
    filter: brightness(1.25);
  }
}

.main-menu {
  z-index: 30;
  display: grid;
  align-content: center;
  justify-items: start;
  padding-left: clamp(54px, 8vw, 126px);
  background:
    linear-gradient(90deg, rgba(240, 241, 232, 0.2), rgba(10, 14, 12, 0.04) 36%, rgba(10, 14, 12, 0.34)),
    linear-gradient(0deg, rgba(6, 8, 7, 0.42), transparent 38%, rgba(245, 246, 236, 0.14)),
    url("assets/主页.png") center / cover no-repeat;
  transition:
    opacity 760ms ease,
    filter 760ms ease;
}

.main-menu::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.05) 1px,
    transparent 1px,
    transparent 8px
  );
  mix-blend-mode: overlay;
}

.title-block {
  position: relative;
  z-index: 1;
  margin-top: -8vh;
}

.title-block p {
  margin: 0 0 -6px;
  color: rgba(242, 246, 235, 0.62);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 6vw, 92px);
  font-style: italic;
  letter-spacing: 0;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.42);
}

.title-block h1 {
  margin: 0;
  color: #f4f0df;
  font-family: Impact, "Arial Black", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(72px, 9vw, 138px);
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow:
    0 4px 0 rgba(63, 30, 24, 0.72),
    0 24px 44px rgba(0, 0, 0, 0.52);
}

.title-block h1,
.main-options {
  transition:
    opacity 520ms ease,
    transform 520ms ease,
    filter 520ms ease;
}

body.menu-idle:not(.settings-open) .title-block h1,
body.menu-idle:not(.settings-open) .main-options {
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  filter: blur(4px);
}

.main-options {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  margin-top: 42px;
}

.menu-option {
  width: 260px;
  padding: 13px 18px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  background: rgba(244, 246, 238, 0.76);
  color: #1e2821;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
  cursor: pointer;
  font-size: 20px;
  font-weight: 950;
  text-align: left;
  backdrop-filter: blur(10px);
  transition:
    transform 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.menu-option:hover,
.menu-option.active {
  background: rgba(255, 255, 248, 0.92);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3);
  transform: translateX(8px);
}

.menu-option.disabled {
  cursor: default;
  opacity: 0.5;
}

.menu-option.disabled:hover {
  transform: none;
}

.faction-select {
  z-index: 34;
  overflow: hidden;
  background: #070b0e;
  color: #e8edf1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 520ms ease;
}

.faction-select[hidden] {
  display: none;
}

body.faction-active .faction-select {
  opacity: 1;
  pointer-events: auto;
}

.faction-select::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 10, 16, 0.18), transparent 40%, rgba(12, 3, 4, 0.28)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.045) 1px, transparent 1px, transparent 9px);
  mix-blend-mode: screen;
}

.faction-select::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -8vh;
  z-index: 8;
  width: 3px;
  height: 116vh;
  background: linear-gradient(180deg, transparent, rgba(221, 240, 255, 0.98) 18%, rgba(255, 255, 255, 0.95) 50%, rgba(255, 92, 79, 0.82) 84%, transparent);
  box-shadow:
    0 0 18px rgba(160, 215, 255, 0.9),
    0 0 38px rgba(255, 63, 52, 0.26);
  transform: rotate(13deg);
  transform-origin: center;
}

.faction-header {
  position: absolute;
  top: 36px;
  left: 50%;
  z-index: 12;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.faction-header h2 {
  margin: 0;
  color: rgba(238, 240, 235, 0.88);
  font-size: clamp(28px, 3.4vw, 54px);
  font-weight: 950;
  letter-spacing: 10px;
  text-indent: 10px;
  text-shadow: 0 12px 28px rgba(0, 0, 0, 0.68);
}

.faction-header p,
.faction-en,
.faction-button span {
  letter-spacing: 4px;
}

.faction-header p {
  margin: 8px 0 0;
  color: rgba(238, 240, 235, 0.62);
  font-size: 13px;
  font-weight: 900;
}

.faction-side {
  position: absolute;
  inset-block: 0;
  overflow: hidden;
}

.faction-faculty {
  left: 0;
  width: 56vw;
  clip-path: polygon(0 0, 100% 0, 82% 100%, 0 100%);
}

.faction-students {
  right: 0;
  width: 56vw;
  clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%);
}

.faction-bg,
.faction-shade,
.faction-logo,
.faction-representative,
.faction-copy,
.faction-button {
  position: absolute;
}

.faction-bg {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
}

.faction-shade {
  inset: 0;
}

.faction-faculty .faction-shade {
  background:
    radial-gradient(circle at 48% 42%, rgba(35, 102, 161, 0.18), transparent 34%),
    linear-gradient(90deg, rgba(2, 16, 35, 0.76), rgba(4, 27, 49, 0.38) 54%, rgba(4, 6, 10, 0.72));
}

.faction-students .faction-shade {
  background:
    radial-gradient(circle at 58% 42%, rgba(137, 24, 24, 0.18), transparent 36%),
    linear-gradient(90deg, rgba(4, 6, 10, 0.76), rgba(44, 10, 9, 0.46) 44%, rgba(7, 3, 3, 0.78));
}

.faction-logo {
  top: 16%;
  width: min(24vw, 330px);
  opacity: 0.72;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.55));
}

.faction-faculty .faction-logo {
  left: 10%;
}

.faction-students .faction-logo {
  right: 12%;
  opacity: 0.36;
}

.faction-representative {
  bottom: 0;
  z-index: 2;
  max-height: 82vh;
  object-fit: contain;
  filter: drop-shadow(0 28px 42px rgba(0, 0, 0, 0.72));
}

.faction-faculty .faction-representative {
  right: 18%;
  max-width: min(28vw, 420px);
}

.faction-students .faction-representative {
  right: 8%;
  max-width: min(38vw, 610px);
  opacity: 0.92;
}

.faction-copy {
  z-index: 3;
  top: 44%;
  width: min(34vw, 520px);
  transform: translateY(-50%);
}

.faction-faculty .faction-copy {
  left: 9%;
}

.faction-students .faction-copy {
  right: 11%;
  text-align: right;
}

.faction-copy > span {
  display: block;
  margin-bottom: 18px;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 4px;
}

.faction-faculty .faction-copy > span,
.faction-faculty .faction-values {
  color: #4ca5ff;
}

.faction-students .faction-copy > span,
.faction-students .faction-values {
  color: #ff554c;
}

.faction-copy h3 {
  margin: 0;
  color: rgba(244, 247, 246, 0.92);
  font-size: clamp(34px, 4vw, 66px);
  letter-spacing: 10px;
  text-indent: 10px;
  text-shadow: 0 16px 32px rgba(0, 0, 0, 0.7);
}

.faction-en {
  margin: 8px 0 12px;
  color: rgba(238, 240, 235, 0.62);
  font-size: 13px;
  font-weight: 900;
}

.faction-values {
  margin: 0 0 24px;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 5px;
}

.faction-desc {
  max-width: 450px;
  margin: 0;
  color: rgba(238, 240, 235, 0.78);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.8;
}

.faction-students .faction-desc {
  margin-left: auto;
}

.faction-button {
  z-index: 4;
  bottom: 8.5%;
  display: grid;
  gap: 5px;
  place-items: center;
  width: min(26vw, 380px);
  min-width: 250px;
  padding: 17px 22px;
  border-radius: 6px;
  background: rgba(4, 8, 14, 0.54);
  color: rgba(246, 248, 246, 0.94);
  cursor: pointer;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    filter 150ms ease,
    transform 150ms ease;
}

.faction-button strong {
  font-size: 23px;
  letter-spacing: 6px;
  text-indent: 6px;
}

.faction-button span {
  color: rgba(238, 240, 235, 0.66);
  font-size: 11px;
  font-weight: 900;
}

.faculty-button {
  left: 12%;
  border: 1px solid rgba(58, 150, 255, 0.78);
  box-shadow: 0 0 28px rgba(58, 150, 255, 0.22);
}

.student-button {
  right: 12%;
  border: 1px solid rgba(255, 72, 62, 0.88);
  box-shadow: 0 0 28px rgba(255, 72, 62, 0.26);
}

.student-button:hover {
  background: rgba(70, 11, 10, 0.72);
  transform: translateY(-3px);
}

.faculty-button:hover {
  border-color: rgba(170, 176, 178, 0.8);
  background: rgba(40, 43, 44, 0.72);
  color: rgba(221, 224, 224, 0.72);
  filter: grayscale(0.75);
  transform: translateY(-3px);
}

.faculty-button:hover strong {
  font-size: 21px;
}

.settings-panel {
  z-index: 38;
  display: grid;
  place-items: center;
  background: rgba(8, 12, 10, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  backdrop-filter: blur(5px);
}

.settings-panel[hidden] {
  display: none;
}

.settings-card {
  width: min(420px, calc(100vw - 40px));
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 18px;
  background: rgba(244, 246, 238, 0.9);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.settings-head h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.settings-head h2 img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.settings-head button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(31, 41, 35, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  cursor: pointer;
  font-size: 24px;
  font-weight: 900;
}

.setting-row {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.setting-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.setting-row select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(31, 41, 35, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  font: inherit;
  font-weight: 850;
}

.mode-icons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.mode-icons span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid rgba(31, 41, 35, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.mode-icons img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.app-shell {
  opacity: 1;
  transition: opacity 760ms ease;
}

.credits-screen {
  z-index: 34;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #010101;
  color: #f5f5f0;
}

.cloud-transition {
  z-index: 60;
  display: block;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.cloud-transition.active {
  opacity: 1;
}

.cloud-bank {
  position: absolute;
  top: -8vh;
  bottom: -8vh;
  width: 62vw;
  transition: transform 1100ms cubic-bezier(0.66, 0.02, 0.14, 1);
}

.cloud-bank-left {
  left: -10vw;
}

.cloud-bank-right {
  right: -10vw;
}

.cloud-transition.open .cloud-bank-left {
  transform: translateX(-78vw);
}

.cloud-transition.open .cloud-bank-right {
  transform: translateX(78vw);
}

.cloud-bank img {
  position: absolute;
  width: clamp(320px, 40vw, 720px);
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.18));
  opacity: 0.96;
}

.cloud-bank-left img:nth-child(1) {
  left: -5vw;
  top: -6vh;
}

.cloud-bank-left img:nth-child(2) {
  left: 9vw;
  top: 19vh;
  width: clamp(360px, 44vw, 760px);
}

.cloud-bank-left img:nth-child(3) {
  left: -2vw;
  bottom: 11vh;
  width: clamp(350px, 42vw, 740px);
}

.cloud-bank-left img:nth-child(4) {
  left: 17vw;
  bottom: -8vh;
}

.cloud-bank-right img:nth-child(1) {
  right: -5vw;
  top: -4vh;
}

.cloud-bank-right img:nth-child(2) {
  right: 9vw;
  top: 18vh;
  width: clamp(360px, 44vw, 760px);
}

.cloud-bank-right img:nth-child(3) {
  right: -2vw;
  bottom: 9vh;
  width: clamp(350px, 42vw, 740px);
}

.cloud-bank-right img:nth-child(4) {
  right: 17vw;
  bottom: -10vh;
}

.credits-screen[hidden] {
  display: none;
}

.credits-back {
  position: fixed;
  top: 22px;
  left: 22px;
  z-index: 2;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  backdrop-filter: blur(10px);
  transition:
    background 140ms ease,
    transform 140ms ease;
}

.credits-back:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(4px);
}

.credits-roll {
  position: absolute;
  top: -62vh;
  width: min(620px, 88vw);
  text-align: center;
  animation: credits-scroll 22s linear infinite;
}

.credits-roll p,
.credits-roll h2 {
  margin: 0;
  letter-spacing: 0;
}

.credits-roll .credits-title {
  margin-bottom: 14px;
  font-size: 36px;
  font-weight: 900;
}

.credits-roll > p {
  margin-bottom: 78px;
  font-size: 28px;
  font-weight: 700;
}

.credits-roll h2 {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 22px;
  font-weight: 800;
}

.credits-roll h2 + p {
  margin-bottom: 86px;
  font-size: 30px;
  font-weight: 900;
}

@keyframes credits-scroll {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(190vh);
  }
}

.app-shell,
.game-layout,
.map-stage,
.map-viewport {
  position: fixed;
  inset: 0;
}

.app-shell {
  isolation: isolate;
}

.topbar {
  position: fixed;
  top: 8px;
  left: 8px;
  right: 22px;
  z-index: 8;
  display: block;
  pointer-events: none;
}

.hud-stack {
  display: inline-grid;
  gap: 5px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  background: rgba(246, 248, 241, 0.58);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  pointer-events: auto;
}

.hud-row {
  display: flex;
  gap: 5px;
  align-items: center;
}

.resource-chip,
.meter-chip,
.time-chip,
.action-chip {
  display: flex;
  align-items: center;
  min-height: 31px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 9px;
  background: var(--glass-strong);
  box-shadow: 0 10px 26px rgba(17, 26, 21, 0.16);
  backdrop-filter: blur(12px);
}

.resource-chip {
  gap: 5px;
  justify-content: center;
  min-width: 45px;
  padding: 5px 8px;
}

.resource-chip strong {
  font-size: 14px;
  font-weight: 950;
}

.meter-chip {
  position: relative;
  gap: 6px;
  min-width: 112px;
  padding: 5px 8px;
}

.hud-tip-chip {
  z-index: 1;
}

.hud-tip-chip:hover {
  z-index: 80;
}

.meter-chip .hud-tooltip {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 90;
  display: grid;
  gap: 7px;
  width: 246px;
  min-height: 82px;
  padding: 10px 12px;
  border: 1px solid rgba(31, 41, 35, 0.16);
  border-radius: 10px;
  background: rgba(252, 253, 247, 0.98);
  box-shadow: 0 12px 28px rgba(17, 26, 21, 0.18);
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  overflow-wrap: break-word;
  white-space: normal;
}

.hud-row .hud-tip-chip:first-child .hud-tooltip {
  left: 0;
  transform: translate(0, -4px);
}

.hud-row .hud-tip-chip:first-child:hover .hud-tooltip {
  transform: translate(0, 0);
}

.hud-tip-chip:hover .hud-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.hud-tooltip .hud-tooltip-title {
  display: block;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  white-space: normal;
}

.hud-tooltip .hud-tooltip-value {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  white-space: normal;
}

.hud-tooltip .hud-tooltip-meter {
  overflow: hidden;
  height: 8px;
  border: 1px solid rgba(31, 41, 35, 0.14);
  border-radius: 999px;
  background: rgba(31, 41, 35, 0.08);
}

.hud-tooltip .hud-tooltip-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #307c62, #86b95d);
}

.meter-chip.danger .hud-tooltip-meter i {
  background: linear-gradient(90deg, #a43d37, #df8a42);
}

.meter-chip.fame .hud-tooltip-meter i {
  background: linear-gradient(90deg, #695aa6, #40a1a4);
}

.hud-tooltip .hud-tooltip-value strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.hud-tooltip .hud-tooltip-copy {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.45;
  white-space: normal;
}

.meter-chip span,
.time-chip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.meter {
  width: 46px;
  height: 7px;
  overflow: hidden;
  border: 1px solid rgba(31, 41, 35, 0.16);
  border-radius: 999px;
  background: rgba(31, 41, 35, 0.1);
}

.meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #307c62, #86b95d);
}

.meter-chip.danger .meter i {
  background: linear-gradient(90deg, #a43d37, #df8a42);
}

.meter-chip.fame .meter i {
  background: linear-gradient(90deg, #695aa6, #40a1a4);
}

.time-chip {
  gap: 6px;
  min-width: 106px;
  padding: 5px 8px;
}

.time-chip strong {
  font-size: 14px;
  font-weight: 950;
}

.resource-chip img,
.meter-chip img,
.time-chip img,
.action-chip img,
.rail-button img,
.panel-title img,
.region-stats img {
  width: 19px;
  height: 19px;
  object-fit: contain;
  flex: 0 0 auto;
}

.top-actions {
  position: fixed;
  top: 8px;
  right: 12px;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  background: rgba(246, 248, 241, 0.58);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.zoom-value {
  display: grid;
  place-items: center;
  min-width: 52px;
  min-height: 31px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 9px;
  background: var(--glass-strong);
  box-shadow: 0 10px 26px rgba(17, 26, 21, 0.16);
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  backdrop-filter: blur(12px);
}

.day-progress-hud {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 8;
  width: min(420px, calc(100vw - 560px));
  min-width: 340px;
  padding: 8px 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 16px;
  background: rgba(246, 248, 241, 0.78);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
  pointer-events: none;
}

.semester-day-label {
  margin-bottom: 24px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  text-align: center;
  transform: translateY(-4px);
}

.day-progress-track {
  position: relative;
  height: 28px;
  border: 1px solid rgba(31, 41, 35, 0.18);
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.26)),
    rgba(31, 41, 35, 0.1);
  overflow: visible;
}

.day-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(48, 124, 98, 0.72), rgba(208, 155, 43, 0.72));
  transition: width 180ms linear;
}

.timeline-marker {
  position: absolute;
  top: -21px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.timeline-marker::after {
  content: "";
  position: absolute;
  top: 18px;
  left: 50%;
  width: 2px;
  height: 28px;
  border-radius: 999px;
  background: rgba(31, 41, 35, 0.44);
}

.marker-lunch {
  left: 20%;
}

.marker-after {
  left: 50%;
}

.timeline-label {
  position: absolute;
  top: 50%;
  z-index: 1;
  color: rgba(31, 41, 35, 0.62);
  font-size: 11px;
  font-weight: 950;
  transform: translate(-50%, -50%);
}

.label-day {
  left: 25%;
}

.label-night {
  left: 75%;
}

.action-chip {
  position: relative;
  justify-content: center;
  width: 34px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: var(--glass-strong);
  cursor: pointer;
}

.action-chip::after {
  content: attr(data-label);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  translate: -50% 0;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 9px;
  background: rgba(252, 253, 247, 0.96);
  box-shadow: 0 10px 24px rgba(17, 26, 21, 0.18);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transform: translateY(-4px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.action-chip:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.speed-control {
  --speed-index: 1;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 34px);
  align-items: center;
  min-height: 31px;
  padding: 5px 6px 4px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 9px;
  background: var(--glass-strong);
  box-shadow: 0 10px 26px rgba(17, 26, 21, 0.16);
  backdrop-filter: blur(12px);
}

.speed-control > span {
  position: absolute;
  top: 9px;
  bottom: 7px;
  width: 1px;
  background: rgba(31, 41, 35, 0.2);
}

.speed-control > span:nth-of-type(1) {
  left: 40px;
}

.speed-control > span:nth-of-type(2) {
  left: 74px;
}

.speed-control > span:nth-of-type(3) {
  left: 108px;
}

.speed-option {
  position: relative;
  z-index: 2;
  min-width: 0;
  min-height: 22px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 950;
}

.speed-option.active {
  color: var(--ink);
}

.speed-pointer {
  position: absolute;
  z-index: 1;
  left: 13px;
  bottom: -12px;
  width: 18px;
  height: 18px;
  object-fit: contain;
  pointer-events: none;
  transform: translateX(calc(var(--speed-index) * 34px));
  transition: transform 1s ease;
}

body.game-active:not(.time-paused) #gameSettings img {
  animation: gear-spin 4.8s linear infinite;
}

@keyframes gear-spin {
  to {
    transform: rotate(360deg);
  }
}

.left-rail {
  position: fixed;
  left: 18px;
  top: 106px;
  z-index: 9;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background: rgba(247, 249, 243, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.rail-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.52);
  cursor: pointer;
}

.rail-button:hover,
.rail-button.active {
  border-color: rgba(40, 95, 78, 0.46);
  background: #eef5eb;
}

.rail-button::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  translate: 0 -50%;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 10px;
  background: rgba(252, 253, 247, 0.96);
  box-shadow: 0 10px 24px rgba(17, 26, 21, 0.18);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transform: translateX(-4px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.rail-button:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.map-stage {
  z-index: 1;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    #cbd3ca;
  background-size: 34px 34px;
}

.map-stage::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(235, 241, 230, 0.38), transparent 14%, transparent 80%, rgba(235, 241, 230, 0.2)),
    linear-gradient(0deg, rgba(255, 255, 255, 0.18), transparent 24%, transparent 76%, rgba(21, 28, 24, 0.1));
}

.map-stage::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.08) 1px,
    transparent 1px,
    transparent 7px
  );
  mix-blend-mode: soft-light;
}

.map-viewport {
  z-index: 1;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.map-viewport.dragging {
  cursor: grabbing;
}

.map-content {
  position: absolute;
  left: 0;
  top: 0;
  width: 1988px;
  height: 791px;
  transform-origin: 0 0;
  will-change: transform;
  user-select: none;
}

#campusMap,
#campusMapAlt,
#highlightCanvas {
  position: absolute;
  inset: 0;
  width: 1988px;
  height: 791px;
}

.map-image {
  display: block;
  object-fit: fill;
  opacity: 0;
  filter: saturate(0.98) contrast(1.04);
  transition: opacity 4s ease-in-out;
}

.map-image.active {
  opacity: 1;
}

#highlightCanvas {
  pointer-events: none;
}

.member-marker-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.squad-marker-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.squad-marker-layer[hidden] {
  display: none;
}

.squad-map-marker {
  --marker-scale: 1;
  position: absolute;
  display: flex;
  align-items: center;
  min-width: 138px;
  min-height: 46px;
  padding: 5px 18px 5px 66px;
  border: 2px solid rgba(30, 82, 102, 0.82);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(226, 245, 238, 0.94), rgba(247, 250, 238, 0.92));
  box-shadow: 0 7px 18px rgba(17, 26, 21, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 950;
  pointer-events: auto;
  transform: translate(-34px, -50%) scale(var(--marker-scale));
  transform-origin: left center;
}

.squad-map-marker:hover {
  border-color: rgba(33, 111, 219, 0.9);
  background: linear-gradient(90deg, rgba(207, 232, 245, 0.96), rgba(238, 248, 239, 0.94));
}

.squad-map-marker.acting {
  border-color: rgba(157, 56, 51, 0.86);
  background: linear-gradient(90deg, rgba(255, 235, 229, 0.96), rgba(250, 242, 229, 0.94));
}

.squad-map-marker.acting .squad-map-flag::before,
.squad-map-marker.acting .squad-map-flag::after {
  border-color: rgba(157, 56, 51, 0.92);
  background-color: rgba(255, 243, 238, 0.96);
}

.squad-map-marker.moving {
  min-width: 58px;
  min-height: 58px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  transform: translate(-50%, -50%) scale(var(--marker-scale));
  transform-origin: center;
}

.squad-map-marker.moving .squad-map-name {
  display: none;
}

.squad-map-flag {
  position: absolute;
  left: -4px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 2px solid rgba(30, 82, 102, 0.9);
  border-radius: 999px;
  background: rgba(252, 253, 247, 0.97);
  box-shadow: 0 5px 14px rgba(17, 26, 21, 0.25);
  font-size: 20px;
  isolation: isolate;
  transform: translateY(-50%);
}

.squad-map-flag::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.squad-map-marker.moving .squad-map-flag {
  left: 50%;
  transform: translate(-50%, -50%);
}

.squad-map-marker.status-assembled .squad-map-flag {
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.squad-map-marker.status-assembled .squad-map-flag::before {
  inset: 4px;
  border: 2px solid rgba(30, 82, 102, 0.92);
  border-radius: 10px;
  background: rgba(252, 253, 247, 0.97);
  box-shadow: 0 5px 14px rgba(17, 26, 21, 0.25);
  transform: rotate(45deg);
}

.squad-map-marker.status-assembled.moving .squad-map-flag {
  transform: translate(-50%, -50%);
}

.squad-map-marker.status-assembled .squad-map-flag img {
  position: relative;
  z-index: 2;
}

.squad-map-marker.status-assembled .squad-flag-emoji {
  position: relative;
  z-index: 2;
}

.squad-map-marker.status-hidden .squad-map-flag {
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.squad-map-marker.status-hidden .squad-map-flag::before {
  inset: 5px 3px 2px;
  z-index: 1;
  background: rgba(252, 253, 247, 0.9);
  clip-path: polygon(4% 8%, 96% 8%, 50% 96%);
}

.squad-map-marker.status-hidden .squad-map-flag::after {
  content: "";
  position: absolute;
  inset: 1px 0 -3px;
  z-index: 0;
  background: rgba(30, 82, 102, 0.95);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 5px 9px rgba(17, 26, 21, 0.24));
}

.squad-map-marker.status-hidden .squad-map-flag img {
  position: relative;
  z-index: 2;
  width: 31px;
  height: 31px;
  margin-top: -4px;
}

.squad-map-marker.status-hidden .squad-flag-emoji {
  position: relative;
  z-index: 2;
  margin-top: -5px;
}

.squad-map-flag img {
  position: relative;
  z-index: 2;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.squad-flag-emoji {
  position: relative;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  font-size: 23px;
  line-height: 1;
}

.squad-map-name {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-marker-layer[hidden] {
  display: none;
}

.member-map-marker {
  position: absolute;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(33, 111, 219, 0.78);
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.54), 0 3px 10px rgba(17, 26, 21, 0.3);
  transform: translate(-50%, -50%);
}

.member-map-marker.hidden-squad {
  opacity: 0.34;
  border-color: rgba(30, 82, 102, 0.46);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.24), 0 3px 10px rgba(17, 26, 21, 0.16);
}

.member-map-marker.hidden-squad::after {
  background: rgba(30, 82, 102, 0.66);
}

.member-map-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: inherit;
  background: rgba(33, 111, 219, 0.96);
  transform: translate(-50%, -50%);
}

.headquarters-select-overlay {
  position: fixed;
  inset: 0;
  z-index: 38;
  pointer-events: none;
}

.headquarters-select-overlay[hidden] {
  display: none;
}

.crosshair-line {
  position: absolute;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(31, 41, 35, 0.32), 0 0 20px rgba(33, 111, 219, 0.18);
}

.crosshair-line.horizontal {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
}

.crosshair-line.vertical {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
}

.crosshair-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(31, 41, 35, 0.42), 0 0 22px rgba(33, 111, 219, 0.32);
  transform: translate(-50%, -50%);
}

.headquarters-hint {
  position: fixed;
  right: 22px;
  top: 158px;
  display: grid;
  gap: 8px;
  width: 250px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  background: rgba(252, 253, 247, 0.94);
  box-shadow: var(--shadow);
  color: var(--ink);
  backdrop-filter: blur(14px);
}

.headquarters-hint strong {
  font-size: 15px;
  font-weight: 950;
}

.headquarters-hint span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
}

.headquarters-select-overlay.invalid .headquarters-hint {
  border-color: rgba(157, 56, 51, 0.42);
  animation: headquarters-invalid 260ms ease;
}

.headquarters-select-overlay.invalid .headquarters-hint span {
  color: var(--red);
}

@keyframes headquarters-invalid {
  0%,
  100% {
    transform: translateX(0);
  }
  35% {
    transform: translateX(-7px);
  }
  70% {
    transform: translateX(5px);
  }
}

.hover-card {
  position: fixed;
  z-index: 11;
  max-width: 220px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  background: rgba(252, 253, 247, 0.96);
  box-shadow: 0 12px 24px rgba(21, 28, 24, 0.2);
  pointer-events: none;
}

.hover-card strong,
.hover-card span {
  display: block;
}

.hover-card strong {
  font-size: 15px;
}

.hover-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.region-popover {
  position: fixed;
  right: 22px;
  top: 82px;
  z-index: 9;
  width: min(360px, calc(100vw - 120px));
}

.region-member-panel {
  position: fixed;
  right: 396px;
  top: 170px;
  z-index: 10;
  width: 300px;
}

.squad-info-panel {
  position: fixed;
  right: 22px;
  top: 260px;
  z-index: 11;
  width: min(330px, calc(100vw - 120px));
}

.squad-info-panel[hidden] {
  display: none;
}

.squad-member-panel {
  position: fixed;
  right: 22px;
  top: 548px;
  z-index: 12;
  width: min(330px, calc(100vw - 120px));
}

.squad-member-panel[hidden] {
  display: none;
}

.squad-info-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.squad-info-title > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.squad-info-edit {
  padding: 7px 10px;
  border: 1px solid rgba(40, 95, 78, 0.24);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--green);
  cursor: pointer;
  font-size: 11px;
  font-weight: 950;
}

.squad-info-edit:hover {
  background: rgba(226, 238, 229, 0.9);
}

.squad-info-head {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.squad-info-flag {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 2px solid rgba(30, 82, 102, 0.78);
  border-radius: 999px;
  background: rgba(252, 253, 247, 0.94);
  font-size: 20px;
}

.squad-info-flag img {
  width: 35px;
  height: 35px;
  object-fit: contain;
}

.squad-info-head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.squad-info-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.squad-status-button {
  margin-top: 6px;
  padding: 6px 9px;
  border: 1px solid rgba(40, 95, 78, 0.2);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 950;
}

.squad-status-button:hover {
  background: rgba(226, 238, 229, 0.9);
  color: var(--green);
}

.squad-status-button:disabled {
  cursor: default;
  opacity: 0.62;
  filter: grayscale(0.5);
}

.squad-status-button:disabled:hover {
  background: rgba(255, 255, 255, 0.64);
  color: var(--muted);
}

.squad-status-menu {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 7px;
  border: 1px solid rgba(31, 41, 35, 0.12);
  border-radius: 12px;
  background: rgba(252, 253, 247, 0.96);
  box-shadow: 0 12px 24px rgba(21, 28, 24, 0.16);
}

.squad-status-menu[hidden] {
  display: none;
}

.squad-status-menu button {
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 950;
  text-align: left;
}

.squad-status-menu button:hover:not(:disabled) {
  border-color: rgba(40, 95, 78, 0.24);
  background: rgba(226, 238, 229, 0.9);
}

.squad-status-menu button:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.64;
}

.squad-info-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0 0;
}

.squad-info-stats div {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.6);
}

.squad-info-stats dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.squad-info-stats dd {
  margin: 5px 0 0;
  font-size: 16px;
  font-weight: 950;
}

.squad-info-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 28px;
  padding: 3px 9px;
  border: 1px solid rgba(40, 95, 78, 0.18);
  border-radius: 9px;
  background: rgba(226, 238, 229, 0.82);
  color: var(--ink);
  cursor: pointer;
  font-size: 16px;
  font-weight: 950;
}

.squad-info-count:hover {
  border-color: rgba(40, 95, 78, 0.38);
  background: rgba(210, 230, 216, 0.96);
}

.squad-info-members {
  display: grid;
  gap: 6px;
  max-height: 158px;
  margin-top: 10px;
  overflow-y: auto;
  padding-right: 3px;
}

.squad-info-members[hidden] {
  display: none;
}

.squad-info-member-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid rgba(31, 41, 35, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  text-align: left;
}

.squad-info-member-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
}

.squad-info-member-row:hover {
  background: rgba(226, 238, 229, 0.92);
}

.squad-info-member-row.missing {
  opacity: 0.58;
}

.squad-info-move {
  width: 100%;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(40, 95, 78, 0.22);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(232, 241, 235, 0.96), rgba(191, 218, 205, 0.92));
  color: var(--green);
  cursor: pointer;
  font-size: 16px;
  font-weight: 950;
}

.squad-info-move:hover {
  background: linear-gradient(135deg, rgba(242, 248, 243, 0.98), rgba(172, 207, 191, 0.96));
}

.region-member-panel[hidden] {
  display: none;
}

.recruit-panel {
  position: fixed;
  left: 92px;
  top: 106px;
  z-index: 10;
  display: grid;
  grid-template-columns: 46px 300px;
  max-height: min(560px, calc(100vh - 132px));
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.members-panel {
  position: fixed;
  left: 92px;
  top: 106px;
  z-index: 10;
  display: grid;
  grid-template-columns: 300px 300px;
  gap: 10px;
  width: auto;
  max-height: min(420px, calc(100vh - 132px));
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.mail-panel {
  position: fixed;
  left: 92px;
  top: 106px;
  z-index: 10;
  width: 360px;
  max-height: min(600px, calc(100vh - 132px));
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.squad-panel {
  position: fixed;
  left: 92px;
  top: 106px;
  z-index: 10;
  width: min(620px, calc(100vw - 130px));
  max-height: min(640px, calc(100vh - 132px));
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.recruit-panel[hidden],
.members-panel[hidden],
.mail-panel[hidden],
.squad-panel[hidden],
.student-detail-panel[hidden] {
  display: none;
}

.recruit-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 16px 0 0 16px;
  background: rgba(247, 249, 243, 0.82);
  backdrop-filter: blur(14px);
}

.grade-tab {
  width: 30px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  cursor: pointer;
  font-weight: 950;
}

.grade-tab:hover,
.grade-tab.active {
  border-color: rgba(40, 95, 78, 0.42);
  background: #eef5eb;
}

.recruit-list-wrap {
  min-height: 360px;
  max-height: min(560px, calc(100vh - 132px));
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-left: 0;
  border-radius: 0 16px 16px 0;
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.members-list-wrap {
  min-height: 170px;
  max-height: min(420px, calc(100vh - 132px));
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 16px;
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.empty-member-list {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(31, 41, 35, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.mail-list-wrap {
  min-height: 220px;
  max-height: min(600px, calc(100vh - 132px));
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 16px;
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.squad-list-wrap {
  min-height: 360px;
  max-height: min(640px, calc(100vh - 132px));
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 16px;
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.squad-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  max-height: calc(min(640px, 100vh - 132px) - 62px);
  overflow-y: auto;
  padding-right: 4px;
}

.squad-empty {
  display: grid;
  place-items: center;
  min-height: 270px;
  gap: 12px;
  text-align: center;
}

.squad-empty p {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 950;
}

.squad-empty button,
.squad-create-small,
.create-squad-confirm {
  min-height: 42px;
  border: 1px solid rgba(40, 95, 78, 0.28);
  border-radius: 12px;
  background: rgba(40, 95, 78, 0.16);
  color: var(--green);
  cursor: pointer;
  font-weight: 950;
}

.squad-card {
  display: grid;
  grid-template-columns: 46px 1fr 220px;
  gap: 11px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(31, 41, 35, 0.12);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.62);
}

.squad-card.acting {
  border-color: rgba(157, 56, 51, 0.38);
  background: rgba(255, 244, 241, 0.72);
}

.squad-card h3,
.squad-card p {
  margin: 0;
}

.squad-card h3 {
  font-size: 17px;
}

.squad-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.squad-card-meters {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.squad-action-progress {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.squad-action-progress span {
  color: var(--red);
  font-size: 12px;
  font-weight: 950;
}

.squad-action-progress i {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(157, 56, 51, 0.14);
}

.squad-action-progress b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(157, 56, 51, 0.86), rgba(208, 155, 43, 0.82));
}

.squad-mini-meter {
  position: relative;
  overflow: hidden;
  height: 18px;
  border: 1px solid rgba(31, 41, 35, 0.12);
  border-radius: 999px;
  background: rgba(31, 41, 35, 0.08);
}

.squad-mini-meter span {
  position: relative;
  z-index: 1;
  display: block;
  padding: 1px 8px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 950;
}

.squad-mini-meter i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: rgba(40, 95, 78, 0.28);
}

.squad-mini-meter.pressure i {
  background: rgba(157, 56, 51, 0.24);
}

.squad-card-abilities {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.squad-card-abilities span {
  padding: 7px;
  border: 1px solid rgba(31, 41, 35, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
}

.squad-card-flag {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(31, 41, 35, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 24px;
}

.squad-card-flag img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.squad-create-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(21, 28, 24, 0.24);
  backdrop-filter: blur(5px);
}

.squad-create-modal[hidden] {
  display: none;
}

.squad-create-card {
  width: min(1120px, calc(100vw - 44px));
  height: min(720px, calc(100vh - 44px));
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  background: rgba(252, 253, 247, 0.97);
  box-shadow: 0 24px 64px rgba(17, 26, 21, 0.3);
}

.squad-create-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.squad-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(31, 41, 35, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 22px;
  font-weight: 950;
}

.squad-create-grid {
  display: grid;
  grid-template-columns: 300px 1fr 330px;
  gap: 12px;
  height: calc(100% - 50px);
  min-height: 0;
}

.squad-info-column,
.squad-roster-column,
.squad-pick-column {
  min-height: 0;
  height: 100%;
  padding: 12px;
  border: 1px solid rgba(31, 41, 35, 0.12);
  border-radius: 14px;
  background: rgba(247, 249, 243, 0.72);
  overflow-y: auto;
}

.squad-identity {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 10px;
  align-items: stretch;
}

.squad-flag-button {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border: 1px solid rgba(31, 41, 35, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 42px;
}

.squad-flag-button img {
  width: 62px;
  height: 62px;
  object-fit: contain;
}

.squad-name-field {
  display: grid;
  gap: 8px;
  align-content: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.squad-name-field input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(31, 41, 35, 0.14);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-size: 16px;
  font-weight: 950;
  padding: 0 10px;
}

.squad-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0 12px;
}

.squad-stat-card {
  display: grid;
  align-items: center;
  min-height: 54px;
  padding: 9px;
  border: 1px solid rgba(31, 41, 35, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.6);
}

.squad-stat-card img {
  width: 19px;
  height: 19px;
  object-fit: contain;
}

.squad-stat-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.squad-stat-card dd {
  margin: 0;
  font-size: 20px;
  font-weight: 950;
}

.squad-stat-card.value-stat {
  grid-template-columns: 22px 1fr auto;
  gap: 6px;
}

.squad-stat-card.meter-stat {
  grid-column: 1 / -1;
  grid-template-columns: 22px 58px 1fr 42px;
  gap: 7px;
}

.squad-stat-meter {
  overflow: hidden;
  height: 8px;
  border: 1px solid rgba(31, 41, 35, 0.14);
  border-radius: 999px;
  background: rgba(31, 41, 35, 0.08);
}

.squad-stat-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(48, 124, 98, 0.78), rgba(134, 185, 93, 0.78));
}

.squad-stat-card.pressure .squad-stat-meter i {
  background: linear-gradient(90deg, rgba(157, 56, 51, 0.76), rgba(208, 155, 43, 0.76));
}

.create-squad-confirm,
.relocate-squad-button {
  position: relative;
  width: 100%;
}

.relocate-squad-button {
  min-height: 42px;
  margin-top: 8px;
  border: 1px solid rgba(30, 82, 102, 0.24);
  border-radius: 12px;
  background: rgba(30, 82, 102, 0.15);
  color: rgba(30, 82, 102, 0.96);
  cursor: pointer;
  font-weight: 950;
}

.relocate-squad-button:hover {
  border-color: rgba(30, 82, 102, 0.42);
  background: rgba(30, 82, 102, 0.22);
}

.relocate-squad-button[hidden] {
  display: none;
}

.create-squad-confirm.invalid {
  border-color: rgba(31, 41, 35, 0.12);
  background: rgba(31, 41, 35, 0.1);
  color: rgba(31, 41, 35, 0.38);
  cursor: not-allowed;
}

.create-squad-confirm.invalid::after {
  content: attr(data-requirements);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 80;
  min-width: 190px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  background: rgba(252, 253, 247, 0.98);
  box-shadow: 0 16px 34px rgba(17, 26, 21, 0.22);
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  line-height: 1.65;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translate(-50%, 6px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
  white-space: pre-line;
}

.create-squad-confirm.invalid:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.draft-squad-members,
.squad-candidate-list {
  display: grid;
  gap: 8px;
  margin-top: 11px;
}

.draft-empty {
  margin: 0;
  padding: 12px;
  border: 1px dashed rgba(31, 41, 35, 0.18);
  border-radius: 12px;
  color: var(--muted);
  font-weight: 900;
}

.draft-member-row,
.squad-candidate-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid rgba(31, 41, 35, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
}

.draft-member-row strong,
.squad-candidate-row strong {
  font-size: 13px;
}

.draft-member-row select {
  min-height: 30px;
  border: 1px solid rgba(31, 41, 35, 0.14);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.78);
  font-weight: 900;
}

.squad-candidate-row {
  cursor: pointer;
  text-align: left;
}

.squad-candidate-row.selected {
  border-color: rgba(40, 95, 78, 0.46);
  background: rgba(40, 95, 78, 0.14);
}

.squad-candidate-row.blocked {
  border-color: rgba(157, 56, 51, 0.28);
  background: rgba(157, 56, 51, 0.1);
}

.draft-member-row.missing,
.squad-candidate-row.blocked,
.student-row.missing {
  filter: grayscale(0.85);
  opacity: 0.58;
}

.draft-member-row.missing select {
  cursor: not-allowed;
}

.squad-candidate-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.squad-candidate-detail {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(31, 41, 35, 0.12);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.66);
}

.candidate-info-popup {
  position: fixed;
  z-index: 70;
  width: min(320px, calc(100vw - 40px));
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 16px;
  background: rgba(252, 253, 247, 0.98);
  box-shadow: 0 22px 54px rgba(17, 26, 21, 0.28);
}

.candidate-info-popup[hidden] {
  display: none;
}

.candidate-info-popup h3,
.candidate-info-popup p {
  margin: 0;
}

.candidate-info-popup h3 {
  font-size: 19px;
  line-height: 1.15;
}

.candidate-meta-card {
  margin-top: 10px;
  padding: 8px 9px;
  border: 1px solid rgba(31, 41, 35, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.candidate-meter-stack {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.candidate-meter-card {
  display: grid;
  grid-template-columns: 20px 48px 1fr 40px;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid rgba(31, 41, 35, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.62);
}

.candidate-meter-card img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.candidate-meter-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.candidate-meter-card i {
  overflow: hidden;
  height: 8px;
  border: 1px solid rgba(31, 41, 35, 0.14);
  border-radius: 999px;
  background: rgba(31, 41, 35, 0.08);
}

.candidate-meter-card b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(48, 124, 98, 0.78), rgba(134, 185, 93, 0.78));
}

.candidate-meter-card.pressure b {
  background: linear-gradient(90deg, rgba(157, 56, 51, 0.76), rgba(208, 155, 43, 0.76));
}

.candidate-meter-card strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  text-align: right;
}

.candidate-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 8px;
}

.candidate-stat-grid div {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border: 1px solid rgba(31, 41, 35, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.62);
}

.candidate-stat-grid img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.candidate-stat-grid span,
.candidate-stat-grid strong {
  display: block;
}

.candidate-stat-grid span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.candidate-stat-grid strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 950;
}

.squad-candidate-detail h3,
.squad-candidate-detail p {
  margin: 0;
}

.squad-candidate-detail p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
}

.candidate-add {
  width: 100%;
  min-height: 36px;
  margin-top: 11px;
  border: 1px solid rgba(40, 95, 78, 0.22);
  border-radius: 11px;
  background: rgba(40, 95, 78, 0.14);
  color: var(--green);
  cursor: pointer;
  font-weight: 950;
}

.candidate-add.selected {
  background: rgba(40, 95, 78, 0.22);
}

.candidate-add.blocked {
  border-color: rgba(157, 56, 51, 0.24);
  background: rgba(157, 56, 51, 0.12);
  color: var(--red);
  cursor: not-allowed;
}

.flag-picker,
.squad-member-context {
  position: fixed;
  z-index: 60;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 12px;
  background: rgba(252, 253, 247, 0.98);
  box-shadow: 0 16px 36px rgba(17, 26, 21, 0.22);
}

.flag-picker[hidden],
.squad-member-context[hidden] {
  display: none;
}

.flag-picker {
  grid-template-columns: repeat(5, auto);
}

.flag-picker button,
.squad-member-context button {
  min-height: 32px;
  border: 1px solid rgba(31, 41, 35, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-weight: 950;
}

.recruit-list {
  display: grid;
  gap: 8px;
  max-height: calc(min(560px, 100vh - 132px) - 54px);
  margin-top: 11px;
  overflow-y: auto;
  padding-right: 4px;
}

.student-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(31, 41, 35, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.student-row:hover,
.student-row.active {
  border-color: rgba(40, 95, 78, 0.42);
  background: #eef5eb;
}

.student-row.joined {
  background: rgba(209, 229, 204, 0.72);
}

.student-row.missing {
  border-color: rgba(31, 41, 35, 0.18);
  background: rgba(230, 232, 226, 0.74);
}

.student-row img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.student-row strong,
.student-row span {
  display: block;
}

.student-row strong {
  font-size: 13px;
  line-height: 1.15;
}

.student-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.student-row em {
  color: var(--green);
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
}

.student-detail-panel {
  position: fixed;
  left: 448px;
  top: 106px;
  z-index: 11;
  width: 315px;
  max-height: calc(100vh - 128px);
  overflow-y: auto;
}

.student-detail-panel.missing::after {
  content: "MISSING";
  position: absolute;
  left: 34px;
  top: 118px;
  z-index: 8;
  padding: 4px 12px;
  border: 3px solid rgba(174, 32, 32, 0.88);
  border-radius: 6px;
  color: rgba(174, 32, 32, 0.9);
  font-size: 38px;
  font-weight: 950;
  letter-spacing: 2px;
  pointer-events: none;
  transform: rotate(-45deg);
}

.members-panel:not([hidden]) ~ .student-detail-panel {
  left: 720px;
}

.student-detail-panel .panel-title {
  cursor: grab;
  user-select: none;
}

.student-detail-panel.dragging .panel-title {
  cursor: grabbing;
}

.student-detail-panel h2 {
  margin: 14px 0 12px;
  font-size: 24px;
  letter-spacing: 0;
}

.student-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.student-detail-grid div {
  position: relative;
  padding: 8px;
  border: 1px solid rgba(31, 41, 35, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.student-detail-grid dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.student-detail-grid dd {
  margin: 5px 0 0;
  font-size: 14px;
  font-weight: 950;
}

.student-detail-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  z-index: 6;
  width: max-content;
  max-width: 180px;
  padding: 7px 9px;
  border: 1px solid rgba(31, 41, 35, 0.16);
  border-radius: 10px;
  background: rgba(252, 253, 247, 0.98);
  box-shadow: 0 10px 24px rgba(17, 26, 21, 0.16);
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 5px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  white-space: pre-line;
}

.student-detail-hover-card:hover .student-detail-tip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.student-abilities {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.student-abilities span {
  padding: 8px;
  border-radius: 12px;
  background: rgba(40, 95, 78, 0.1);
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
}

.position-panel {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(31, 41, 35, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.52);
}

.position-panel[hidden] {
  display: none;
}

.position-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}

.position-option {
  min-height: 32px;
  border: 1px solid rgba(31, 41, 35, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 950;
}

.position-option.active {
  border-color: rgba(40, 95, 78, 0.46);
  background: rgba(40, 95, 78, 0.14);
  color: var(--green);
}

.position-option:disabled {
  background: rgba(31, 41, 35, 0.12);
  color: rgba(31, 41, 35, 0.42);
  cursor: not-allowed;
}

.position-locked {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.student-actions {
  display: grid;
  grid-template-columns: 1fr 4fr;
  gap: 8px;
  margin-top: 12px;
}

.student-actions.member-mode {
  grid-template-columns: 1fr;
}

.student-action {
  min-height: 36px;
  border: 1px solid rgba(31, 41, 35, 0.14);
  border-radius: 12px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 950;
}

.student-action.bribe {
  background: rgba(208, 155, 43, 0.22);
}

.student-action.invite {
  background: rgba(40, 95, 78, 0.16);
}

.student-action.leave {
  background: rgba(157, 56, 51, 0.16);
  color: var(--red);
}

.student-action:hover:not(:disabled) {
  border-color: rgba(40, 95, 78, 0.42);
  background: #eef5eb;
}

.student-action:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(21, 28, 24, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  backdrop-filter: blur(4px);
}

.confirm-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-card {
  width: min(430px, calc(100vw - 48px));
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  background: rgba(252, 253, 247, 0.97);
  box-shadow: 0 24px 64px rgba(17, 26, 21, 0.28);
  transform: translateY(10px) scale(0.98);
  transition: transform 160ms ease;
}

.confirm-modal.open .confirm-card {
  transform: translateY(0) scale(1);
}

.confirm-card p {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.55;
}

.action-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 41;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(21, 28, 24, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  backdrop-filter: blur(4px);
}

.action-confirm-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.action-confirm-modal[hidden] {
  display: none;
}

.action-confirm-card {
  width: min(560px, calc(100vw - 48px));
  max-height: min(680px, calc(100vh - 72px));
  overflow-y: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  background: rgba(252, 253, 247, 0.97);
  box-shadow: 0 24px 64px rgba(17, 26, 21, 0.28);
  transform: translateY(10px) scale(0.98);
  transition: transform 160ms ease;
}

.action-confirm-modal.open .action-confirm-card {
  transform: translateY(0) scale(1);
}

.ending-screen {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(rgba(15, 20, 18, 0.48), rgba(15, 20, 18, 0.64)),
    rgba(15, 20, 18, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 360ms ease;
  backdrop-filter: blur(7px);
}

.ending-screen.open {
  opacity: 1;
  pointer-events: auto;
}

.ending-screen[hidden] {
  display: none;
}

.ending-card {
  width: min(520px, calc(100vw - 56px));
  padding: 32px 34px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  background: rgba(250, 252, 246, 0.94);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(4, 9, 7, 0.38);
  text-align: center;
  transform: translateY(14px) scale(0.98);
  transition: transform 360ms ease;
}

.ending-screen.open .ending-card {
  transform: translateY(0) scale(1);
}

.ending-card p {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 15px;
  font-weight: 950;
  letter-spacing: 0.18em;
}

.ending-card h2 {
  margin: 0;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.05;
}

.ending-card span {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.7;
}

.action-confirm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.action-confirm-head h2 {
  margin: 0;
  font-size: 25px;
}

.action-confirm-head button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(31, 41, 35, 0.12);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.68);
  cursor: pointer;
  font-size: 20px;
  font-weight: 950;
}

.action-confirm-card p {
  margin: 12px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.action-squad-list {
  display: grid;
  gap: 8px;
}

.action-squad-row {
  display: grid;
  grid-template-columns: 42px 1fr 110px 92px;
  gap: 9px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(40, 95, 78, 0.18);
  border-radius: 12px;
  background: rgba(226, 238, 229, 0.78);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.action-squad-row:hover:not(:disabled) {
  background: rgba(210, 230, 216, 0.96);
}

.action-squad-row.disabled {
  cursor: default;
  opacity: 0.44;
  filter: grayscale(0.8);
}

.action-squad-row .squad-card-flag {
  width: 36px;
  height: 36px;
}

.action-squad-row .squad-card-flag img {
  width: 25px;
  height: 25px;
}

.action-squad-row strong,
.action-squad-row span,
.action-squad-row em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-squad-row span {
  color: var(--red);
  font-size: 12px;
  font-weight: 950;
}

.action-squad-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.phone-emphasis {
  color: var(--green);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.confirm-note {
  color: var(--muted);
  font-size: 13px;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.confirm-actions button,
.mail-actions button {
  min-height: 36px;
  border: 1px solid rgba(31, 41, 35, 0.14);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 950;
}

.confirm-cancel,
.mail-reject {
  background: rgba(157, 56, 51, 0.14);
  color: var(--red);
}

.confirm-accept,
.mail-accept {
  background: rgba(40, 95, 78, 0.15);
  color: var(--green);
}

.mail-list {
  display: grid;
  gap: 10px;
  max-height: calc(min(600px, 100vh - 132px) - 54px);
  margin-top: 11px;
  overflow-y: auto;
  padding-right: 4px;
}

.mail-card,
.empty-mail {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(31, 41, 35, 0.12);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.62);
}

.mail-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  letter-spacing: 0;
}

.mail-card.handled {
  opacity: 0.72;
}

.mail-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
  white-space: pre-line;
}

.mail-status {
  display: inline-flex;
  margin-top: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(31, 41, 35, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
}

.mail-status.accepted {
  background: rgba(40, 95, 78, 0.14);
  color: var(--green);
}

.mail-status.rejected {
  background: rgba(157, 56, 51, 0.12);
  color: var(--red);
}

.mail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 11px;
}

.empty-mail {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.panel-card,
.event-log {
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 16px;
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel-card {
  padding: 15px;
}

.panel-title {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.selected-region h2 {
  margin: 15px 0 8px;
  font-size: 30px;
  letter-spacing: 0;
}

.selected-region p {
  min-height: 34px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.region-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 15px 0 0;
}

.region-stats div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.region-stats dt {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.region-stats dd {
  margin: 8px 0 0;
  font-size: 21px;
  font-weight: 900;
}

.region-members-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.region-members-button:disabled {
  cursor: default;
  opacity: 0.62;
}

.region-actions {
  margin-top: 12px;
}

.region-actions-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(31, 41, 35, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--ink);
  cursor: pointer;
  font-weight: 950;
}

.region-actions-toggle img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  transition: transform 180ms ease;
}

.region-actions-toggle.expanded img {
  transform: rotate(90deg);
}

.region-action-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 9px;
  padding-left: 24px;
}

.region-action-list[hidden] {
  display: none;
}

.region-action-button {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(40, 95, 78, 0.18);
  border-radius: 11px;
  background: rgba(246, 248, 244, 0.72);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.region-action-button:hover:not(:disabled) {
  background: rgba(221, 235, 224, 0.94);
  border-color: rgba(40, 95, 78, 0.3);
}

.region-action-button:disabled {
  cursor: default;
  opacity: 0.46;
  filter: grayscale(0.8);
}

.region-members-button:not(:disabled):hover {
  color: var(--green);
}

.region-member-list {
  display: grid;
  gap: 7px;
  height: 260px;
  margin-top: 12px;
  overflow-y: auto;
  padding-right: 4px;
}

.region-member-list p {
  margin: 0;
  padding: 9px 10px;
  border: 1px dashed rgba(31, 41, 35, 0.16);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.region-member-row {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(31, 41, 35, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.region-member-row:hover {
  border-color: rgba(40, 95, 78, 0.42);
  background: #eef5eb;
}

.region-member-row strong {
  font-size: 12px;
  font-weight: 950;
}

.region-member-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.event-log {
  position: fixed;
  right: 22px;
  bottom: 18px;
  z-index: 8;
  width: min(430px, calc(100vw - 120px));
  max-height: 190px;
  padding: 12px 14px;
  overflow: hidden;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.event-log.collapsed {
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(0.96);
}

.collapse-log {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 24px;
  border: 1px solid rgba(31, 41, 35, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  cursor: pointer;
}

.collapse-log img,
.expand-log img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.expand-log {
  position: fixed;
  right: 22px;
  bottom: 18px;
  z-index: 8;
  display: grid;
  place-items: center;
  width: 78px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  background: rgba(252, 253, 247, 0.94);
  box-shadow: 0 10px 24px rgba(17, 26, 21, 0.18);
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.expand-log[hidden] {
  display: none;
}

.quick-dock {
  position: fixed;
  right: 28px;
  bottom: 32px;
  z-index: 90;
  width: 58px;
  height: 58px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    width 1500ms cubic-bezier(0.2, 0.88, 0.22, 1),
    opacity 220ms ease,
    transform 220ms ease;
}

body.menu-active .quick-dock {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

body.settings-open .quick-dock {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.quick-dock.open {
  width: 270px;
}

.quick-dock-panel {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 48px);
  align-items: center;
  gap: 10px;
  min-width: 270px;
  padding: 6px 68px 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background: rgba(252, 253, 247, 0.92);
  box-shadow: 0 18px 42px rgba(17, 26, 21, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateX(10px) scaleX(0.18);
  transform-origin: right center;
  transition:
    opacity 1500ms ease,
    transform 1500ms cubic-bezier(0.2, 0.88, 0.22, 1);
  backdrop-filter: blur(14px);
}

.quick-dock.open .quick-dock-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scaleX(1);
}

.quick-dock-toggle,
.quick-dock-item {
  display: grid;
  place-items: center;
  border: 1px solid rgba(31, 41, 35, 0.16);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
}

.quick-dock-toggle {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 4;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  box-shadow: 0 14px 34px rgba(17, 26, 21, 0.24);
  transition:
    transform 220ms ease,
    background 220ms ease;
}

.quick-dock.open .quick-dock-toggle img {
  transform: rotate(180deg);
}

.quick-dock.pop .quick-dock-toggle {
  animation: quick-dock-pop 420ms cubic-bezier(0.2, 1.4, 0.28, 1);
}

.quick-dock-item {
  position: relative;
  z-index: 2;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  opacity: 0;
  transform: translateX(18px) scale(0.86);
  transition:
    opacity 1500ms ease,
    transform 1500ms cubic-bezier(0.2, 0.88, 0.22, 1),
    background 180ms ease;
}

.quick-dock.open .quick-dock-item {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.quick-dock-item:hover,
.quick-dock-toggle:hover {
  background: rgba(231, 240, 229, 0.96);
}

.quick-dock-toggle img {
  position: relative;
  z-index: 5;
  width: 24px;
  height: 24px;
  object-fit: contain;
  transition: transform 1500ms cubic-bezier(0.2, 0.88, 0.22, 1);
}

.quick-dock-item img {
  width: 27px;
  height: 27px;
  object-fit: contain;
}

.quick-dock-item::after {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  z-index: 6;
  min-width: max-content;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(31, 41, 35, 0.86);
  color: #f7f8f1;
  content: attr(data-label);
  font-size: 12px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px) scale(0.94);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
  white-space: nowrap;
}

.quick-dock-item:hover::after {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.global-version-badge {
  position: fixed;
  right: 4px;
  bottom: 2px;
  z-index: 88;
  pointer-events: none;
  color: rgba(245, 248, 242, 0.82);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.72),
    0 0 8px rgba(0, 0, 0, 0.36);
}

body.game-active .global-version-badge,
body.faction-active .global-version-badge {
  color: rgba(237, 243, 232, 0.72);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.wiki-overlay {
  position: fixed;
  inset: 0;
  z-index: 121;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 26%, rgba(126, 164, 129, 0.16), transparent 40%),
    rgba(7, 11, 9, 0.66);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  backdrop-filter: blur(11px);
}

.wiki-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.wiki-overlay[hidden] {
  display: none;
}

.wiki-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1120px, 74vw);
  height: min(760px, 76vh);
  overflow: hidden;
  border: 1px solid rgba(197, 224, 199, 0.34);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(20, 29, 24, 0.96), rgba(35, 45, 37, 0.86)),
    rgba(16, 22, 19, 0.92);
  box-shadow:
    0 30px 100px rgba(0, 0, 0, 0.44),
    0 0 44px rgba(134, 184, 140, 0.18);
  color: #edf3e8;
  transform: translateY(12px) scale(0.98);
  transition: transform 220ms ease;
}

.wiki-overlay.open .wiki-modal {
  transform: translateY(0) scale(1);
}

.wiki-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px 14px 26px;
  border-bottom: 1px solid rgba(237, 243, 232, 0.12);
}

.wiki-modal-header span {
  display: block;
  color: rgba(197, 224, 199, 0.68);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.22em;
}

.wiki-modal-header h2 {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.1;
}

.wiki-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wiki-fullscreen-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(237, 243, 232, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #edf3e8;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.wiki-fullscreen-link:hover {
  background: rgba(142, 190, 147, 0.22);
  transform: translateY(-1px);
}

.wiki-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(237, 243, 232, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #edf3e8;
  cursor: pointer;
  font-size: 24px;
  font-weight: 850;
}

.wiki-close:hover {
  background: rgba(142, 190, 147, 0.22);
}

.wiki-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
}

@media (max-width: 820px) {
  .wiki-modal {
    width: 92vw;
    height: 82vh;
  }

  .wiki-modal-header {
    padding: 16px;
  }

  .wiki-modal-header h2 {
    font-size: 24px;
  }

  .wiki-fullscreen-link {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }
}

@keyframes quick-dock-pop {
  0% {
    transform: scale(1);
  }

  42% {
    transform: scale(1.18);
  }

  68% {
    transform: scale(0.92);
  }

  100% {
    transform: scale(1);
  }
}

.update-log-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 30%, rgba(75, 107, 83, 0.18), transparent 38%),
    rgba(8, 12, 10, 0.62);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  backdrop-filter: blur(10px);
}

.update-log-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.update-log-overlay[hidden] {
  display: none;
}

.update-log-modal {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 70vw;
  max-width: 1100px;
  height: 70vh;
  overflow: hidden;
  border: 1px solid rgba(190, 224, 194, 0.34);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(21, 30, 25, 0.94), rgba(34, 44, 36, 0.82)),
    rgba(16, 22, 19, 0.9);
  box-shadow:
    0 28px 100px rgba(0, 0, 0, 0.42),
    0 0 42px rgba(120, 172, 123, 0.16);
  color: #edf3e8;
  transform: translateY(12px) scale(0.98);
  transition: transform 220ms ease;
}

.update-log-overlay.open .update-log-modal {
  transform: translateY(0) scale(1);
}

.update-log-close {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(237, 243, 232, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #edf3e8;
  cursor: pointer;
  font-size: 24px;
  font-weight: 850;
}

.update-log-close:hover {
  background: rgba(142, 190, 147, 0.22);
}

.update-log-header {
  padding: 22px 28px 14px;
  border-bottom: 1px solid rgba(237, 243, 232, 0.12);
}

.update-log-header span {
  display: block;
  color: rgba(197, 224, 199, 0.68);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.24em;
}

.update-log-header h2 {
  margin: 5px 0 0;
  font-size: 30px;
  line-height: 1.1;
}

.update-log-content {
  min-height: 0;
  overflow: hidden;
}

.update-log-message {
  display: grid;
  place-items: center;
  min-height: 320px;
  color: rgba(237, 243, 232, 0.78);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.update-log-message.error,
.update-log-fallback {
  color: rgba(255, 214, 160, 0.94);
}

.update-log-fallback {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 214, 160, 0.22);
  border-radius: 14px;
  background: rgba(255, 214, 160, 0.08);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.update-log-layout {
  display: grid;
  grid-template-columns: minmax(220px, 28%) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.update-log-rail {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 18px 24px 24px;
  border-right: 1px solid rgba(237, 243, 232, 0.12);
  scrollbar-width: none;
}

.update-log-main {
  min-height: 0;
  overflow-y: auto;
  padding: 22px 28px 30px;
  scrollbar-width: none;
}

.update-log-rail::-webkit-scrollbar,
.update-log-main::-webkit-scrollbar {
  display: none;
}

.rocket-node {
  position: relative;
  display: grid;
  justify-items: center;
  margin-bottom: 0;
  padding-bottom: 24px;
}

.rocket-node::after {
  position: absolute;
  bottom: 0;
  left: calc(50% - 1px);
  width: 2px;
  height: 24px;
  background: rgba(237, 243, 232, 0.28);
  content: "";
}

.rocket-node img,
.rocket-fallback {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  object-fit: contain;
  border: 1px solid rgba(237, 243, 232, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.rocket-fallback {
  font-size: 24px;
}

.update-timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
}

.timeline-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(84px, 1fr) 26px minmax(92px, 1fr);
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 68px;
  padding: 10px 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.timeline-row::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 1px);
  width: 2px;
  background: linear-gradient(rgba(237, 243, 232, 0.08), rgba(237, 243, 232, 0.32), rgba(237, 243, 232, 0.08));
  content: "";
}

.timeline-row:first-child::before {
  top: 50%;
}

.update-timeline.connected-start .timeline-row:first-child::before {
  top: 0;
}

.timeline-row:last-child::before {
  bottom: 50%;
}

.timeline-date,
.timeline-count,
.timeline-time,
.timeline-title {
  position: relative;
  z-index: 1;
  align-self: center;
  min-width: 0;
  overflow-wrap: anywhere;
}

.timeline-date,
.timeline-time {
  color: rgba(237, 243, 232, 0.82);
  font-size: 13px;
  font-weight: 900;
}

.timeline-count,
.timeline-title {
  color: rgba(237, 243, 232, 0.62);
  font-size: 13px;
  font-weight: 850;
}

.timeline-dot {
  position: relative;
  z-index: 2;
  align-self: center;
  justify-self: center;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(237, 243, 232, 0.74);
  border-radius: 50%;
  background: #1f2823;
  box-shadow: 0 0 0 5px rgba(21, 30, 25, 0.96);
}

.timeline-row.latest .timeline-dot,
.timeline-row.active .timeline-dot {
  border-color: #ccefcf;
  background: #70b778;
  box-shadow:
    0 0 0 5px rgba(21, 30, 25, 0.96),
    0 0 18px rgba(112, 183, 120, 0.72);
}

.timeline-row:hover,
.timeline-row.active {
  transform: translateX(4px);
}

.timeline-row:hover .timeline-count,
.timeline-row:hover .timeline-title,
.timeline-row.active .timeline-count,
.timeline-row.active .timeline-title {
  color: #eaf6e4;
}

.update-panel-eyebrow {
  margin: 0 0 8px;
  color: rgba(197, 224, 199, 0.72);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.18em;
}

.update-panel-title {
  margin: 0 0 16px;
  font-size: clamp(24px, 3vw, 42px);
  line-height: 1.12;
}

.update-panel-copy {
  max-width: 720px;
  margin: 0 0 20px;
  color: rgba(237, 243, 232, 0.68);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.8;
}

.update-detail-list,
.update-section-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.update-detail-list li,
.update-section {
  border: 1px solid rgba(237, 243, 232, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.update-detail-list li {
  padding: 13px 15px;
  color: rgba(237, 243, 232, 0.84);
  font-weight: 800;
  line-height: 1.7;
}

.update-section {
  padding: 15px;
}

.update-section h3 {
  margin: 0 0 10px;
  font-size: 17px;
}

.update-section ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
}

.update-section li {
  color: rgba(237, 243, 232, 0.78);
  line-height: 1.65;
}

@media (max-width: 820px) {
  .update-log-modal {
    width: 90vw;
    height: 80vh;
  }

  .update-log-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .update-log-rail {
    max-height: 34vh;
    border-right: 0;
    border-bottom: 1px solid rgba(237, 243, 232, 0.12);
  }
}

.event-log ol {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.event-log li {
  min-width: 0;
  padding: 8px 9px;
  border-left: 3px solid var(--green);
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.event-log time {
  margin-right: 8px;
  color: var(--ink);
  font-weight: 900;
}

@media (max-width: 980px) {
  .topbar {
    left: 8px;
    right: 12px;
  }

  .hud-stack {
    overflow-x: auto;
    max-width: calc(100vw - 24px);
  }

  .hud-row {
    width: max-content;
  }

  .region-popover {
    top: auto;
    bottom: 212px;
    right: 12px;
  }

  .top-actions {
    top: 92px;
  }

  .day-progress-hud {
    width: min(520px, calc(100vw - 32px));
    min-width: 0;
    bottom: 12px;
  }
}

@media (max-width: 720px) {
  .topbar {
    left: 10px;
    top: 10px;
  }

  .left-rail {
    left: 10px;
    top: auto;
    bottom: 10px;
    flex-direction: row;
  }

  .map-toolbar {
    display: none;
  }

  .event-log,
  .region-popover {
    display: none;
  }
}
