/*
 * Space Tower Defense – home page (index.html).
 * Builds on the tokens and components of css/styles.css.
 */

/* ------------------------------------------------------------ helpers */

/* Without JS nothing must stay invisible. */
html:not(.js) [data-reveal] {
  opacity: 1;
  transform: none;
}

.section {
  position: relative;
  padding: clamp(72px, 10vw, 128px) 0 0;
}

.section__head {
  max-width: 760px;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.section__head--center {
  margin-inline: auto;
  text-align: center;
}
.section__title {
  font-size: var(--fs-xl);
  text-wrap: balance;
}
.section__lead {
  color: var(--color-text-muted);
  font-size: var(--fs-lg);
  line-height: 1.55;
  margin: 0;
}
.subhead {
  margin: clamp(48px, 7vw, 80px) 0 24px;
  font-size: var(--fs-lg);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.container--narrow {
  max-width: 860px;
}
.eyebrow--alien {
  color: var(--color-alien);
}

.glass {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(22, 34, 58, 0.72), rgba(10, 15, 26, 0.72));
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.icon-btn:hover {
  border-color: var(--color-primary);
  background: rgba(63, 184, 255, 0.12);
}

.btn__icon {
  flex: none;
}

.ticks {
  display: grid;
  gap: 8px;
  margin: 0 0 1em;
  padding: 0;
  list-style: none;
}
.ticks li {
  position: relative;
  padding-left: 28px;
  color: #c9d4e8;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.38em;
  width: 14px;
  height: 8px;
  border-left: 2px solid var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
  transform: rotate(-45deg);
}

/* --------------------------------------------------------------- hero */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  margin-top: calc(-1 * var(--header-h));
  padding: calc(var(--header-h) + clamp(24px, 5vw, 56px)) 0 clamp(64px, 8vw, 96px);
  overflow: hidden;
}

.hero__sky {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.hero__stars {
  position: absolute;
  inset: -8% 0;
  background: #02040a url("../assets/img/stars.jpg") center / cover no-repeat;
  opacity: 0.85;
  will-change: transform;
}
@media (max-width: 760px) {
  .hero__stars {
    background-image: url("../assets/img/stars-mobile.jpg");
  }
}
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero__glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 75% 45%, rgba(63, 184, 255, 0.18), transparent 70%),
    radial-gradient(40% 40% at 15% 85%, rgba(125, 255, 107, 0.08), transparent 70%),
    linear-gradient(180deg, rgba(5, 7, 13, 0.55) 0%, rgba(5, 7, 13, 0) 30%, rgba(5, 7, 13, 0) 65%, var(--color-bg) 100%);
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
}

.hero__eyebrow {
  margin-bottom: 1.2rem;
}

.hero__title {
  margin: 0 0 0.25em;
  font-size: clamp(2.25rem, 0.9rem + 6.2vw, 5.4rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 0 32px rgba(63, 184, 255, 0.35);
}
.hero__title-line {
  display: block;
}
.hero__title-line--accent {
  color: var(--color-primary);
  background: linear-gradient(100deg, #9fe0ff 0%, var(--color-primary) 45%, #1477ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 18px rgba(63, 184, 255, 0.45));
}

.hero__claim {
  margin: 0 0 0.9rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 0.9rem + 1.1vw, 1.7rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text);
}
.hero__lead {
  max-width: 36rem;
  color: #c3cfe4;
  font-size: var(--fs-md);
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 1.6rem 0 1.4rem;
}

.hero__badges {
  margin-top: 0.4rem;
}

.hero__status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1.2rem 0 0;
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}
.status-dot {
  position: relative;
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-warn);
  box-shadow: 0 0 10px var(--color-warn);
}
.status-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--color-warn);
  animation: ping 2.4s var(--ease-out) infinite;
}
@keyframes ping {
  from { transform: scale(0.6); opacity: 1; }
  to { transform: scale(2.2); opacity: 0; }
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: rgba(10, 16, 28, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-alien);
  box-shadow: 0 0 8px var(--color-alien);
}

.hero__art {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 560px;
}
.hero__art-halo {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(63, 184, 255, 0.45), rgba(63, 184, 255, 0) 70%);
  filter: blur(30px);
  animation: halo 6s ease-in-out infinite alternate;
}
.hero__keyart {
  position: relative;
  width: 100%;
  height: auto;
  border-radius: 15%;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 30px rgba(63, 184, 255, 0.25));
  animation: float 9s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-0.4deg); }
  50% { transform: translateY(-12px) rotate(0.4deg); }
}
@keyframes halo {
  from { opacity: 0.55; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1.05); }
}

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 18px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 56px;
  margin-left: -22px;
  border-radius: 22px;
}
.hero__scroll-mouse {
  position: relative;
  width: 24px;
  height: 38px;
  border: 2px solid rgba(231, 238, 251, 0.5);
  border-radius: 12px;
}
.hero__scroll-mouse::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 7px;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--color-primary);
  animation: wheel 1.8s ease-in-out infinite;
}
@keyframes wheel {
  0% { transform: translateY(0); opacity: 1; }
  80% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

@media (max-width: 959px) {
  .hero {
    min-height: 0;
  }
  .hero__inner {
    grid-template-columns: 1fr;
  }
  .hero__art {
    max-width: min(360px, 78%);
    order: -1;
    margin-bottom: 4px;
  }
  .hero__scroll {
    display: none;
  }
}
@media (max-height: 640px) {
  .hero__scroll {
    display: none;
  }
}
@media (max-width: 480px) {
  .hero__ctas .btn {
    flex: 1 1 100%;
  }
  .hero__badges .store-badge {
    flex: 1 1 150px;
    min-width: 0;
  }
}

/* -------------------------------------------------------------- stats */

.stats {
  position: relative;
  border-block: 1px solid var(--color-border);
  background: linear-gradient(90deg, rgba(63, 184, 255, 0.04), rgba(63, 184, 255, 0.09), rgba(63, 184, 255, 0.04));
}
.stats__list {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: clamp(22px, 3vw, 34px) 0;
  list-style: none;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6px 4px;
}
.stat + .stat {
  border-left: 1px solid var(--color-border);
}
.stat__value {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 1.3rem + 2vw, 2.9rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-primary);
  text-shadow: 0 0 22px var(--color-primary-glow);
  font-variant-numeric: tabular-nums;
}
.stat__label {
  margin-top: 4px;
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  line-height: 1.3;
}
@media (max-width: 900px) {
  .stats__list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    row-gap: 18px;
  }
  .stat:nth-child(5) {
    border-left: 0;
  }
}
@media (max-width: 520px) {
  .stats__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat:nth-child(odd) {
    border-left: 0;
  }
  .stat:nth-child(5) {
    border-left: 0;
  }
  .stat:last-child {
    grid-column: 1 / -1;
  }
}

/* -------------------------------------------------------------- story */

.timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 17px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-danger), var(--color-text-muted) 30%, var(--color-primary) 65%, var(--color-alien));
  opacity: 0.6;
}
.timeline__item {
  position: relative;
  padding-top: 52px;
}
.timeline__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 3px solid var(--dot, var(--color-danger));
  box-shadow: 0 0 14px var(--dot, var(--color-danger));
}
.timeline__item:nth-child(2) {
  --dot: #8fa0bd;
}
.timeline__item--now {
  --dot: var(--color-primary);
}
.timeline__item--alien {
  --dot: var(--color-alien);
}
.timeline__year {
  display: inline-block;
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--dot, var(--color-danger));
}
.timeline__title {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 0.4em;
}
.timeline__item p {
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  margin: 0;
}
@media (max-width: 900px) {
  .timeline {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-left: 34px;
  }
  .timeline::before {
    top: 0;
    bottom: 0;
    left: 7px;
    right: auto;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, var(--color-danger), var(--color-text-muted) 30%, var(--color-primary) 65%, var(--color-alien));
  }
  .timeline__item {
    padding-top: 0;
  }
  .timeline__item::before {
    left: -34px;
    top: 6px;
  }
}

.story__twist {
  max-width: 820px;
  margin: clamp(48px, 7vw, 80px) auto 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 0.9rem + 1vw, 1.55rem);
  line-height: 1.5;
  color: #d5def0;
}
.story__twist strong {
  color: var(--color-alien);
  text-shadow: 0 0 18px var(--color-alien-glow);
}
.story__twist em {
  display: block;
  margin-top: 0.4em;
  font-style: normal;
  color: var(--color-alien);
}

/* quotes */
.quotes {
  position: relative;
  max-width: 880px;
  margin: clamp(40px, 6vw, 64px) auto 0;
  padding: clamp(28px, 5vw, 48px) clamp(20px, 5vw, 56px) clamp(20px, 3vw, 28px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(80% 120% at 50% 0%, rgba(63, 184, 255, 0.12), transparent 70%),
    rgba(10, 15, 26, 0.7);
  text-align: center;
}
.quotes__mark {
  width: 44px;
  height: auto;
  margin: 0 auto 12px;
  color: var(--color-primary);
  opacity: 0.7;
}
.quotes__list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.quote {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out), visibility 0.6s;
}
.quote.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
}
html:not(.js) .quote {
  grid-area: auto;
  opacity: 1;
  visibility: visible;
  transform: none;
  margin-bottom: 18px;
}
.quote blockquote {
  margin: 0;
}
.quote p {
  margin: 0 0 0.6em;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 0.95rem + 1.1vw, 1.75rem);
  font-weight: 600;
  line-height: 1.35;
  text-wrap: balance;
}
.quote cite {
  font-style: normal;
  font-size: var(--fs-sm);
  color: var(--color-primary);
  letter-spacing: 0.06em;
}
.quote cite::before {
  content: "— ";
}
.quotes__controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
}
.quotes__controls[hidden] {
  display: none;
}
.quotes__dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.quotes__dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.quotes__dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(231, 238, 251, 0.3);
  transition: background 0.2s, transform 0.2s;
}
.quotes__dot[aria-current="true"]::before {
  background: var(--color-primary);
  transform: scale(1.35);
  box-shadow: 0 0 8px var(--color-primary);
}
[data-quotes-toggle] .icon-play {
  display: none;
}
[data-quotes-toggle][aria-pressed="true"] .icon-play {
  display: block;
}
[data-quotes-toggle][aria-pressed="true"] .icon-pause {
  display: none;
}
@media (max-width: 420px) {
  .quotes__dot {
    width: 22px;
  }
}

/* cast */
.cast {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cast__card {
  --accent: var(--color-primary);
  position: relative;
  padding: 22px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(22, 34, 58, 0.75), rgba(10, 15, 26, 0.75));
  transition: border-color 0.3s, transform 0.3s var(--ease-out);
}
.cast__card:hover {
  border-color: var(--accent);
}
.cast__card--apex {
  border-color: rgba(63, 184, 255, 0.5);
  box-shadow: 0 0 40px -16px var(--color-primary-glow);
}
.cast__card--alien {
  --accent: var(--color-alien);
}
.cast__sigil {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06), transparent 70%);
  box-shadow: 0 0 22px -6px var(--accent);
}
.cast__sigil svg {
  width: 30px;
  height: 30px;
}
.cast__name {
  font-size: var(--fs-md);
  margin-bottom: 0.2em;
}
.cast__role {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8em;
}
.cast__text {
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  margin: 0;
}
@media (max-width: 1100px) {
  .cast {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .cast {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cast__card--apex {
    grid-column: 1 / -1;
  }
}
@media (max-width: 480px) {
  .cast {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------------------- features */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.feature {
  position: relative;
  padding: 26px 24px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(22, 34, 58, 0.7), rgba(10, 15, 26, 0.7));
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s var(--ease-out), box-shadow 0.3s;
}
.feature::after {
  content: "";
  position: absolute;
  inset: auto -30% -60% auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(63, 184, 255, 0.16), transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
}
.feature:hover {
  border-color: var(--color-border-strong);
  box-shadow: 0 18px 40px -24px rgba(63, 184, 255, 0.6);
}
.feature:hover::after {
  opacity: 1;
}
.feature--wide {
  grid-column: span 2;
}
.feature__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  border-radius: 12px;
  color: var(--color-primary);
  background: rgba(63, 184, 255, 0.1);
  border: 1px solid rgba(63, 184, 255, 0.25);
}
.feature__icon svg {
  width: 26px;
  height: 26px;
}
.feature__title {
  font-size: var(--fs-md);
  margin-bottom: 0.5em;
}
.feature p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
}
@media (max-width: 1000px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .feature--wide {
    grid-column: auto;
  }
}

.tech {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 24px;
  padding: 18px 22px;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius);
}
.tech__title {
  margin: 0;
  font-size: var(--fs-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-primary);
}
.tech__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tech__list li {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: var(--fs-xs);
  color: #c9d4e8;
}

/* ------------------------------------------------------------- towers */

.tower-picker {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(70% 90% at 25% 60%, rgba(63, 184, 255, 0.10), transparent 70%),
    linear-gradient(170deg, rgba(16, 26, 46, 0.8), rgba(8, 12, 22, 0.85));
  overflow: hidden;
}
.tower-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--color-border);
}
html:not(.js) .tower-tabs {
  display: none;
}
.tower-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 14px 6px 12px;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font: 600 var(--fs-sm) / 1.2 var(--font-display);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.tower-tab + .tower-tab {
  border-left: 1px solid var(--color-border);
}
.tower-tab img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: grayscale(0.6) brightness(0.8);
  transition: filter 0.3s, transform 0.3s var(--ease-out);
}
.tower-tab::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--color-primary);
  box-shadow: 0 0 12px var(--color-primary);
  transform: scaleX(0);
  transition: transform 0.3s var(--ease-out);
}
.tower-tab:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.03);
}
.tower-tab:hover img {
  filter: none;
}
.tower-tab[aria-selected="true"] {
  color: var(--color-text);
  background: rgba(63, 184, 255, 0.07);
}
.tower-tab[aria-selected="true"] img {
  filter: drop-shadow(0 0 10px rgba(63, 184, 255, 0.5));
  transform: translateY(-2px) scale(1.06);
}
.tower-tab[aria-selected="true"]::after {
  transform: scaleX(1);
}
.tower-tab:focus-visible {
  outline-offset: -4px;
}

.tower-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  padding: clamp(20px, 4vw, 44px);
}
.tower-panel[hidden] {
  display: none;
}
html:not(.js) .tower-panel + .tower-panel {
  border-top: 1px solid var(--color-border);
}
.tower-panel:focus-visible {
  outline-offset: -6px;
}
.tower-panel__stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tower-panel__ring {
  position: absolute;
  left: 50%;
  top: 72%;
  width: 78%;
  aspect-ratio: 3 / 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(63, 184, 255, 0.45);
  background: radial-gradient(closest-side, rgba(63, 184, 255, 0.25), transparent);
  box-shadow: 0 0 40px rgba(63, 184, 255, 0.25), inset 0 0 30px rgba(63, 184, 255, 0.25);
}
.tower-panel__img {
  position: relative;
  width: min(100%, 400px);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.7));
  transition: opacity 0.25s;
}
.tower-panel__img.is-swapping {
  opacity: 0.2;
}
.tower-levels {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}
.tower-levels:empty {
  display: none;
}
.tower-levels__label {
  margin-right: 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.tower-level {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text-muted);
  font: 700 var(--fs-md) / 1 var(--font-display);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.tower-level:hover {
  color: var(--color-text);
  border-color: var(--color-primary);
}
.tower-level[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-strong));
  border-color: transparent;
  color: #00111f;
  box-shadow: 0 0 18px -2px var(--color-primary-glow);
}
.tower-level--path::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-warn);
  box-shadow: 0 0 6px var(--color-warn);
}

.tower-panel__tag {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-primary);
}
.tower-panel__name {
  font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.6rem);
  margin-bottom: 0.35em;
}
.avail {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.avail--start {
  color: var(--color-primary);
  background: rgba(63, 184, 255, 0.1);
  border: 1px solid rgba(63, 184, 255, 0.35);
}
.avail--research {
  color: var(--color-warn);
  background: rgba(255, 181, 71, 0.1);
  border: 1px solid rgba(255, 181, 71, 0.35);
}
.tower-panel__text {
  color: #c9d4e8;
}
.paths {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}
.paths__label {
  margin: 0 0 0.7rem;
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}
.paths__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.path {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid rgba(63, 184, 255, 0.4);
  background: rgba(63, 184, 255, 0.08);
}
.path small {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}
.path strong {
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  color: var(--color-primary);
}
.path--b {
  border-color: rgba(255, 181, 71, 0.45);
  background: rgba(255, 181, 71, 0.08);
}
.path--b strong {
  color: var(--color-warn);
}

@media (max-width: 860px) {
  .tower-panel {
    grid-template-columns: 1fr;
  }
  .tower-panel__img {
    width: min(100%, 300px);
  }
}
@media (max-width: 560px) {
  .tower-tab {
    padding: 10px 2px;
  }
  .tower-tab img {
    width: 52px;
    height: 52px;
  }
  .tower-tab span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

.power {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  margin-top: 20px;
  padding: 18px clamp(18px, 3vw, 32px);
  border: 1px solid rgba(255, 181, 71, 0.3);
  border-radius: var(--radius);
  background: linear-gradient(100deg, rgba(255, 181, 71, 0.08), rgba(10, 15, 26, 0.6) 60%);
}
.power__img {
  flex: none;
  width: clamp(96px, 16vw, 150px);
  height: auto;
  filter: drop-shadow(0 0 18px rgba(255, 181, 71, 0.3));
}
.power__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-lg);
  margin-bottom: 0.4em;
  color: var(--color-warn);
}
.power__title svg {
  flex: none;
}
.power__body p {
  margin: 0;
  color: #c9d4e8;
}
@media (max-width: 480px) {
  .power {
    flex-direction: column;
    text-align: center;
  }
  .power__title {
    justify-content: center;
  }
}

/* ------------------------------------------------------------ planets */

.planet {
  --d: 150px;
  --halo: rgba(160, 180, 210, 0.35);
  --atmo: rgba(255, 255, 255, 0.12);
  --spin: 80s;
  position: relative;
  width: var(--d);
  height: var(--d);
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  background: #1a1d24;
  box-shadow: 0 0 50px -8px var(--halo);
}
.planet::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 400%;
  height: 100%;
  background-repeat: repeat-x;
  background-size: 50% 100%;
  animation: planet-spin var(--spin) linear infinite;
}
.planet::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.16), transparent 42%),
    radial-gradient(circle at 38% 36%, transparent 48%, rgba(0, 0, 0, 0.55) 74%, rgba(0, 0, 0, 0.9) 100%);
  box-shadow:
    inset -14px -10px 30px rgba(0, 0, 0, 0.75),
    inset 3px 3px 10px rgba(255, 255, 255, 0.1),
    inset 0 0 8px 1px var(--atmo);
}
@keyframes planet-spin {
  to { transform: translateX(-50%); }
}
.planet--moon::before { background-image: url("../assets/img/planets/moon.jpg"); }
.planet--mars::before { background-image: url("../assets/img/planets/mars.jpg"); }
.planet--europa::before { background-image: url("../assets/img/planets/europa.jpg"); }
.planet--venus::before { background-image: url("../assets/img/planets/venus.jpg"); }
.planet--earth::before { background-image: url("../assets/img/planets/earth.jpg"); }
.planet--thalmera::before { background-image: url("../assets/img/planets/thalmera.jpg"); }
.planet--jupiter::before { background-image: url("../assets/img/planets/jupiter.jpg"); }
.planet--saturn::before { background-image: url("../assets/img/planets/saturn.jpg"); }

.planet--moon { --halo: rgba(200, 210, 230, 0.3); }
.planet--mars { --halo: rgba(255, 110, 60, 0.4); --atmo: rgba(255, 140, 90, 0.35); --spin: 70s; }
.planet--europa { --halo: rgba(150, 210, 255, 0.4); --atmo: rgba(190, 230, 255, 0.3); --spin: 90s; }
.planet--venus { --halo: rgba(255, 200, 90, 0.45); --atmo: rgba(255, 210, 120, 0.55); --spin: 140s; }
.planet--earth { --halo: rgba(80, 170, 255, 0.5); --atmo: rgba(120, 200, 255, 0.7); --spin: 60s; }
.planet--thalmera { --halo: rgba(125, 255, 107, 0.4); --atmo: rgba(160, 255, 140, 0.45); --spin: 75s; }
.planet--jupiter { --halo: rgba(230, 180, 130, 0.35); --atmo: rgba(255, 220, 180, 0.3); --spin: 45s; }
.planet--saturn { --halo: rgba(230, 200, 140, 0.35); --atmo: rgba(255, 230, 180, 0.3); --spin: 55s; }

/* ------------------------------------------------------------- worlds */

.acts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.act {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(16, 24, 40, 0.85), rgba(8, 12, 22, 0.85));
  overflow: hidden;
  transition: border-color 0.3s, transform 0.4s var(--ease-out);
}
.act:hover {
  border-color: var(--color-border-strong);
}
.act__visual {
  position: relative;
  height: 200px;
  border-bottom: 1px solid var(--color-border);
  background: #070b14;
}
.act__shot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out), filter 0.4s;
  filter: saturate(1.05) brightness(0.9);
}
.act:hover .act__shot {
  transform: scale(1.05);
  filter: saturate(1.1) brightness(1);
}
.act__visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 12, 22, 0) 45%, rgba(8, 12, 22, 0.92));
  pointer-events: none;
}
.act__planet.planet {
  --d: 84px;
  position: absolute;
  right: 16px;
  bottom: -30px;
  z-index: 2;
  outline: 3px solid rgba(8, 12, 22, 0.9);
}
.act__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px 22px 22px;
}
.act__body > .act__num,
.act__body > .act__title {
  padding-right: 92px;
}
.act__num {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-primary);
}
.act__roman {
  letter-spacing: 0.1em;
}
.act__title {
  font-size: var(--fs-lg);
  margin-bottom: 0.3em;
  overflow-wrap: anywhere;
}
.act__place {
  margin-bottom: 0.8em;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.act__text {
  color: #c9d4e8;
  font-size: var(--fs-sm);
}
.act__unlock {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: auto 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--color-border);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}
.act__unlock svg {
  flex: none;
  color: var(--color-warn);
}
.act__unlock--open svg {
  color: var(--color-alien);
}
.act--thalmera {
  border-color: rgba(125, 255, 107, 0.3);
}
.act--thalmera .act__num {
  color: var(--color-alien);
}
@media (max-width: 1000px) {
  .acts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .acts {
    grid-template-columns: 1fr;
  }
  .act__visual {
    height: 180px;
  }
}

/* harvest ships */
.harvest {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  margin-top: clamp(40px, 6vw, 64px);
  padding: clamp(22px, 4vw, 44px);
  border: 1px solid rgba(125, 255, 107, 0.22);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(60% 80% at 85% 50%, rgba(125, 255, 107, 0.09), transparent 70%),
    rgba(10, 15, 26, 0.75);
}
.harvest__title {
  font-size: var(--fs-xl);
}
.harvest__copy > p {
  color: #c9d4e8;
}
.harvest__steps {
  display: grid;
  gap: 10px;
  margin: 1.2rem 0;
  padding: 0;
  list-style: none;
}
.harvest__steps li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: #c9d4e8;
}
.harvest__wave {
  flex: none;
  min-width: 88px;
  padding: 2px 10px;
  border-radius: 6px;
  border: 1px solid rgba(125, 255, 107, 0.35);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  color: var(--color-alien);
}
.harvest__wave--win {
  border-color: var(--color-primary);
  color: #00111f;
  background: var(--color-primary);
}
.harvest__steps strong {
  color: var(--color-text);
}
.harvest__endless {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(63, 184, 255, 0.07);
  border-left: 3px solid var(--color-primary);
  font-size: var(--fs-sm);
  color: #c9d4e8;
}
.harvest__endless strong {
  color: var(--color-primary);
}
.harvest__visual {
  position: relative;
  margin: 0 0 22px;
}
.harvest__img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid rgba(125, 255, 107, 0.25);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9), 0 0 40px -20px var(--color-alien-glow);
}
.harvest__track {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -2px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--color-alien), var(--color-primary));
}
.harvest__tick {
  position: absolute;
  left: var(--at);
  top: 50%;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 2px solid var(--color-alien);
  font: 700 0.72rem / 1 var(--font-display);
  color: var(--color-alien);
}
.harvest__tick--win {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 14px var(--color-primary-glow);
}
@media (max-width: 860px) {
  .harvest {
    grid-template-columns: 1fr;
  }
  .harvest__visual {
    order: -1;
  }
}

/* solar system */
.sol {
  display: flex;
  align-items: center;
  gap: clamp(20px, 5vw, 56px);
  margin-top: 20px;
  padding: clamp(20px, 4vw, 36px) clamp(20px, 4vw, 44px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(10, 15, 26, 0.7) url("../assets/img/stars-mobile.jpg") center / cover;
  background-blend-mode: multiply;
}
.sol__visual {
  position: relative;
  flex: 0 0 52%;
  min-width: 0;
}
.sol__copy {
  flex: 1 1 0;
  min-width: 0;
}
.sol__img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--color-border-strong);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9);
}
.saturn {
  position: absolute;
  left: -46px;
  top: -40px;
  width: 200px;
  height: 140px;
  display: grid;
  place-items: center;
  transform: scale(0.75);
  pointer-events: none;
}
.saturn__body {
  --d: 104px;
  grid-area: 1 / 1;
  z-index: 1;
}
.saturn__ring {
  grid-area: 1 / 1;
  width: 230px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(closest-side,
    transparent 56%,
    rgba(200, 180, 140, 0.55) 60%,
    rgba(235, 215, 170, 0.85) 68%,
    rgba(150, 130, 100, 0.35) 74%,
    rgba(225, 205, 160, 0.8) 80%,
    rgba(190, 170, 130, 0.5) 92%,
    transparent 100%);
  transform: rotate(-16deg);
}
.saturn__ring--back {
  z-index: 0;
}
.saturn__ring--front {
  z-index: 2;
  clip-path: inset(50% 0 0 0);
}
.sol__title {
  font-size: var(--fs-lg);
  margin-bottom: 0.4em;
}
.sol__copy p {
  margin: 0;
  color: #c9d4e8;
}
@media (max-width: 640px) {
  .sol {
    flex-direction: column;
    text-align: center;
  }
  .sol__visual {
    flex-basis: auto;
    width: 100%;
  }
  .saturn {
    display: none;
  }
}

/* ------------------------------------------------------------ enemies */

.enemies::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(60% 40% at 50% 30%, rgba(125, 255, 107, 0.06), transparent 70%);
  pointer-events: none;
}
.enemies .section__title {
  text-shadow: 0 0 30px rgba(125, 255, 107, 0.15);
}
.enemy-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.enemy {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 14px;
  border: 1px solid rgba(125, 255, 107, 0.16);
  border-radius: var(--radius-sm);
  background: linear-gradient(100deg, rgba(125, 255, 107, 0.06), rgba(10, 15, 26, 0.7) 70%);
  transition: border-color 0.25s, background 0.25s;
}
.enemy:hover {
  border-color: rgba(125, 255, 107, 0.5);
}
.enemy__num {
  font: 700 var(--fs-xs) / 1 var(--font-display);
  color: rgba(125, 255, 107, 0.6);
}
.enemy__icon {
  flex: none;
  width: 26px;
  height: 26px;
  color: var(--color-alien);
  filter: drop-shadow(0 0 6px var(--color-alien-glow));
}
.enemy__name {
  font-weight: 600;
  line-height: 1.25;
}
.enemy__note {
  font-weight: 400;
  font-size: var(--fs-xs);
  color: var(--color-alien);
}
.enemy--boss {
  border-color: rgba(255, 90, 95, 0.4);
  background: linear-gradient(100deg, rgba(255, 90, 95, 0.12), rgba(10, 15, 26, 0.7) 70%);
}
.enemy--boss .enemy__icon {
  color: var(--color-danger);
  filter: drop-shadow(0 0 6px rgba(255, 90, 95, 0.6));
}
@media (max-width: 1000px) {
  .enemy-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .enemy-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 400px) {
  .enemy {
    gap: 8px;
    padding: 10px;
  }
  .enemy__num {
    display: none;
  }
}

.elite {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: center;
  margin-top: 20px;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid rgba(125, 255, 107, 0.3);
  border-radius: var(--radius-lg);
  background: radial-gradient(80% 120% at 0% 0%, rgba(125, 255, 107, 0.1), transparent 60%), rgba(10, 15, 26, 0.7);
}
.elite__title {
  font-size: var(--fs-lg);
  color: var(--color-alien);
  margin-bottom: 0.4em;
}
.elite__copy p {
  margin: 0;
  color: #c9d4e8;
}
.elite__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.elite__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(125, 255, 107, 0.4);
  background: rgba(125, 255, 107, 0.07);
  font-weight: 600;
}
.elite__item svg {
  width: 20px;
  height: 20px;
  color: var(--color-alien);
}
@media (max-width: 760px) {
  .elite {
    grid-template-columns: 1fr;
  }
}

/* -------------------------------------------------------------- modes */

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.mode {
  position: relative;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, rgba(22, 34, 58, 0.75), rgba(10, 15, 26, 0.8));
}
.mode p {
  color: #c9d4e8;
}
.mode__tag {
  display: inline-block;
  margin-bottom: 12px;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(63, 184, 255, 0.12);
  border: 1px solid rgba(63, 184, 255, 0.35);
  color: var(--color-primary);
  font: 700 var(--fs-xs) / 1.4 var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.mode__tag--hot {
  background: rgba(255, 90, 95, 0.12);
  border-color: rgba(255, 90, 95, 0.45);
  color: #ff8a8e;
}
.mode__title {
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem);
  margin-bottom: 0.4em;
}
.mode .ticks {
  margin-bottom: 0;
}
.mode--duel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  border-color: rgba(255, 90, 95, 0.3);
  background:
    radial-gradient(70% 90% at 100% 50%, rgba(255, 90, 95, 0.08), transparent 70%),
    linear-gradient(165deg, rgba(22, 34, 58, 0.75), rgba(10, 15, 26, 0.8));
}
.mode--duel .ticks li::before {
  border-color: #ff8a8e;
}

.triangle {
  margin: 0;
}
.triangle figcaption {
  margin-bottom: 14px;
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  text-align: center;
}
.triangle__title {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  letter-spacing: 0.06em;
  color: var(--color-text);
  margin-bottom: 4px;
}
.triangle__graphic {
  position: relative;
  height: 290px;
  max-width: 440px;
  margin-inline: auto;
}
.triangle__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: rgba(255, 138, 142, 0.6);
}
.triangle__node {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: min(48%, 200px);
  padding: 10px 12px;
  border: 1px solid rgba(255, 138, 142, 0.45);
  border-radius: var(--radius-sm);
  background: rgba(14, 18, 30, 0.95);
  text-align: center;
  box-shadow: 0 0 22px -8px rgba(255, 90, 95, 0.6);
}
.triangle__node strong {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
}
.triangle__node span {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  line-height: 1.35;
}
.triangle__node--top {
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}
.triangle__node--left {
  left: 0;
  bottom: 0;
}
.triangle__node--right {
  right: 0;
  bottom: 0;
}
.modes__account {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 24px 0 0;
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  text-align: center;
}
.modes__account svg {
  flex: none;
  color: var(--color-primary);
}
@media (max-width: 860px) {
  .mode-grid {
    grid-template-columns: 1fr;
  }
  .mode--duel {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 400px) {
  .triangle__graphic {
    height: 270px;
  }
  .triangle__node {
    padding: 8px;
  }
}

/* ----------------------------------------------------------- research */

.research__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.research-card {
  position: relative;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, rgba(22, 34, 58, 0.75), rgba(10, 15, 26, 0.8));
  overflow: hidden;
}
.research-card p {
  color: #c9d4e8;
}
.research-card__title {
  font-size: var(--fs-lg);
  margin-bottom: 0.8em;
}
.research-tabs {
  display: grid;
  gap: 12px;
  margin: 0;
}
.research-tabs > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
}
.research-tabs dt {
  font: 700 var(--fs-sm) / 1.2 var(--font-display);
  letter-spacing: 0.1em;
  color: var(--color-primary);
}
.research-tabs dd {
  margin: 0;
  font-size: var(--fs-sm);
  color: #c9d4e8;
}
.mods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mod {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(63, 184, 255, 0.22);
  background: rgba(63, 184, 255, 0.06);
}
.mod strong {
  font: 700 0.78rem / 1.3 var(--font-display);
  letter-spacing: 0.08em;
  color: var(--color-primary);
  overflow-wrap: anywhere;
}
.mod span {
  font-size: var(--fs-sm);
  color: #c9d4e8;
}
.ranks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}
.rank {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font: 700 var(--fs-xs) / 1.2 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.rank img {
  width: 100%;
  max-width: 96px;
  height: auto;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.6));
  transition: transform 0.4s var(--ease-out);
}
.rank:hover img {
  transform: translateY(-4px) scale(1.04);
}
.rank--bronze { color: #e0a070; }
.rank--silver { color: #d4dbe6; }
.rank--gold { color: #ffd166; }
.rank--platinum { color: #9fe8ff; }
.research-card--isoc {
  border-color: rgba(125, 255, 107, 0.25);
  background: linear-gradient(165deg, rgba(10, 30, 18, 0.75), rgba(8, 12, 22, 0.85));
}
.isoc__badge {
  position: absolute;
  right: 18px;
  top: 16px;
  font: 900 2.6rem / 1 var(--font-display);
  letter-spacing: 0.1em;
  color: rgba(125, 255, 107, 0.08);
}
.isoc__terminal {
  margin: 1rem 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(125, 255, 107, 0.2);
  font: 0.78rem / 1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--color-alien) !important;
  overflow-wrap: anywhere;
}
.isoc__cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  margin-left: 4px;
  vertical-align: -2px;
  background: var(--color-alien);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}
@media (max-width: 860px) {
  .research__grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 440px) {
  .research-tabs > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .mods {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------ gallery */

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gallery__item {
  margin: 0;
}
.gallery__btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-solid);
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 16 / 10;
}
.gallery__btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out), filter 0.3s;
}
.gallery__btn:hover img {
  transform: scale(1.04);
  filter: brightness(1.08);
}
.gallery__btn--tall {
  aspect-ratio: 9 / 16;
}
.gallery__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 14px 10px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.8));
  font-size: var(--fs-xs);
  font-weight: 600;
  color: #fff;
  text-align: left;
}

.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
}
.lightbox::backdrop {
  background: rgba(2, 4, 9, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.lightbox__inner {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 64px 64px 24px;
  touch-action: pan-y;
}
.lightbox__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
}
.lightbox__img {
  max-width: 100%;
  max-height: calc(100dvh - 150px);
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
}
.lightbox__caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin-top: 14px;
  font-size: var(--fs-sm);
  text-align: center;
}
.lightbox__counter {
  color: var(--color-text-muted);
}
.lightbox__btn {
  position: absolute;
  background: rgba(10, 15, 26, 0.7);
}
.lightbox__btn--close {
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
}
.lightbox__btn--prev,
.lightbox__btn--next {
  top: 50%;
  margin-top: -22px;
}
.lightbox__btn--prev {
  left: 12px;
}
.lightbox__btn--next {
  right: 12px;
}
.lightbox[data-single] .lightbox__btn--prev,
.lightbox[data-single] .lightbox__btn--next {
  display: none;
}
@media (max-width: 640px) {
  .lightbox__inner {
    padding: 64px 12px 84px;
  }
  .lightbox__btn--prev,
  .lightbox__btn--next {
    top: auto;
    bottom: max(18px, env(safe-area-inset-bottom));
    margin-top: 0;
  }
  .lightbox__btn--prev {
    left: calc(50% - 56px);
  }
  .lightbox__btn--next {
    right: calc(50% - 56px);
  }
}

/* ----------------------------------------------------------- download */

.download__panel {
  position: relative;
  isolation: isolate;
  padding: clamp(28px, 6vw, 72px);
  border: 1px solid var(--color-border-strong);
  border-radius: calc(var(--radius-lg) + 6px);
  background:
    radial-gradient(70% 100% at 0% 0%, rgba(63, 184, 255, 0.16), transparent 60%),
    linear-gradient(160deg, #0c1528, #070a12);
  overflow: hidden;
  box-shadow: 0 0 80px -30px var(--color-primary-glow);
}
.download__bg {
  position: absolute;
  right: -4%;
  top: 50%;
  z-index: -1;
  width: min(62%, 640px);
  height: auto;
  transform: translateY(-50%);
  opacity: 0.6;
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
}
.download__panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}
.download__body {
  max-width: 600px;
}
.phones {
  position: relative;
  order: 2;
  justify-self: center;
  width: min(100%, 330px);
  aspect-ratio: 330 / 420;
}
.phone {
  position: absolute;
  width: 58%;
  padding: 7px;
  border-radius: 30px;
  background: linear-gradient(145deg, #2a3242, #0b0f18);
  border: 1px solid rgba(160, 190, 230, 0.25);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9), 0 0 40px -16px var(--color-primary-glow);
}
.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 23px;
}
.phone--back {
  left: 0;
  top: 0;
  transform: rotate(-7deg);
  opacity: 0.85;
}
.phone--front {
  right: 0;
  bottom: 0;
  transform: rotate(5deg);
}
.download__title {
  font-size: var(--fs-2xl);
  margin-bottom: 0.3em;
  text-shadow: 0 0 30px rgba(63, 184, 255, 0.35);
}
.download__text {
  color: #c9d4e8;
  font-size: var(--fs-md);
}
.download__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 1.6rem;
  padding: 0;
  list-style: none;
}
.download__facts li {
  position: relative;
  padding-left: 22px;
  font-weight: 600;
  font-size: var(--fs-sm);
}
.download__facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--color-alien);
  border-bottom: 2px solid var(--color-alien);
  transform: rotate(-45deg);
}
.download__badges {
  margin-bottom: 1.8rem;
}
.download__beta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}
.download__note {
  flex: 1 1 220px;
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}
@media (max-width: 860px) {
  .download__panel {
    grid-template-columns: 1fr;
  }
  .phones {
    order: -1;
    width: min(100%, 280px);
  }
}
@media (max-width: 760px) {
  .download__bg {
    right: 50%;
    top: -10%;
    width: 130%;
    max-width: none;
    transform: translateX(50%);
    opacity: 0.22;
  }
}
@media (max-width: 480px) {
  .download__beta .btn {
    width: 100%;
  }
  .download__badges .store-badge {
    flex: 1 1 150px;
    min-width: 0;
  }
}

/* ---------------------------------------------------------------- faq */

.faq__list {
  display: grid;
  gap: 10px;
}
.faq__item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: rgba(16, 24, 40, 0.6);
  transition: border-color 0.2s, background 0.2s;
}
.faq__item[open] {
  border-color: var(--color-border-strong);
  background: rgba(16, 24, 40, 0.85);
}
.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 14px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq__item summary::-webkit-details-marker {
  display: none;
}
.faq__item summary:focus-visible {
  outline-offset: -2px;
  border-radius: var(--radius);
}
.faq__icon {
  position: relative;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--color-border-strong);
}
.faq__icon::before,
.faq__icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  margin: -1px 0 0 -6px;
  border-radius: 2px;
  background: var(--color-primary);
  transition: transform 0.25s var(--ease-out);
}
.faq__icon::after {
  transform: rotate(90deg);
}
.faq__item[open] .faq__icon::after {
  transform: rotate(0deg);
}
.faq__answer {
  padding: 0 20px 18px;
  color: #c9d4e8;
}
.faq__answer p {
  margin: 0;
}

/* ---------------------------------------------------------- motion off */

@media (prefers-reduced-motion: reduce) {
  .hero__keyart,
  .hero__art-halo,
  .planet::before,
  .status-dot::after,
  .hero__scroll-mouse::after,
  .isoc__cursor {
    animation: none !important;
  }
  .hero__stars {
    transform: none !important;
  }
}

/* ------------------------------------------------- cinematic screenshots */

.shot {
  position: relative;
  margin: 0 0 clamp(24px, 4vw, 40px);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #070b14;
  box-shadow: 0 30px 80px -40px rgba(63, 184, 255, 0.5);
}
.shot img {
  width: 100%;
  height: auto;
  aspect-ratio: 1920 / 896;
  object-fit: cover;
}
.shot__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 40px 20px 14px;
  background: linear-gradient(180deg, transparent, rgba(3, 5, 10, 0.85));
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #fff;
}
.shot--alien {
  border-color: rgba(125, 255, 107, 0.3);
  box-shadow: 0 30px 80px -40px var(--color-alien-glow);
}
@media (max-width: 560px) {
  .shot img {
    aspect-ratio: 4 / 3;
  }
  .shot__cap {
    position: static;
    padding: 10px 14px;
    background: rgba(10, 15, 26, 0.9);
  }
}

/* ------------------------------------------------- compact small screens */

@media (max-width: 560px) {
  .section__lead {
    font-size: var(--fs-md);
  }
  .hero__badges .store-badge__big {
    font-size: 1rem;
    white-space: nowrap;
  }
  .feature,
  .cast__card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 16px;
    align-items: start;
    padding: 18px;
  }
  .feature > :not(.feature__icon),
  .cast__card > :not(.cast__sigil) {
    grid-column: 2;
  }
  .feature__icon,
  .cast__sigil {
    grid-row: 1 / span 3;
    width: 48px;
    height: 48px;
    margin: 0;
  }
  .act__visual {
    height: 150px;
  }
  .act__planet.planet {
    --d: 70px;
  }
}

/* Long German compounds (e.g. "Belagerungspanzer") must never overflow. */
.enemy__name,
.act__title,
.cast__name,
.feature__title,
.timeline__title,
.tower-panel__name,
.section__title {
  min-width: 0;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* Act titles are short code names ("LUNAR DAWN") – wrap at spaces only. */
.act__title {
  -webkit-hyphens: manual;
  hyphens: manual;
}

@media (max-width: 560px) {
  .gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .gallery__btn {
    border-radius: var(--radius-sm);
  }
  .gallery__cap {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}
