.im-page {
  --im-lime: #a8ff60;
  --im-error: #ff4f7b;
  --im-cyan: #42e8e0;
  --im-panel: rgba(6, 23, 44, 0.94);
  --im-mono: "Fira Code", "JetBrains Mono", Consolas, ui-monospace, monospace;
  background: #071525;
}

.im-main {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 9%, rgba(0, 201, 167, 0.13), transparent 27rem),
    radial-gradient(circle at 8% 38%, rgba(0, 180, 216, 0.08), transparent 24rem),
    #071525;
}

.im-page {
  scrollbar-color: var(--teal) #071525;
}

.im-page #backToTop {
  display: none !important;
}

.im-page::-webkit-scrollbar {
  width: 10px;
}

.im-page::-webkit-scrollbar-track {
  background: #071525;
}

.im-page::-webkit-scrollbar-thumb {
  border: 2px solid #071525;
  border-radius: 10px;
  background: var(--teal);
}

.im-main::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(66, 232, 224, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(66, 232, 224, 0.09) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.im-main section,
.im-main .container {
  position: relative;
  z-index: 1;
}

.im-hero {
  padding: 156px 24px 76px;
  border-bottom: 1px solid rgba(66, 232, 224, 0.15);
}

.im-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr);
  gap: clamp(32px, 6vw, 78px);
  align-items: end;
}

.im-kicker,
.im-card-label {
  color: var(--teal);
  font-family: var(--im-mono);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.15em;
  line-height: 1.45;
  text-transform: uppercase;
}

.im-hero h1 {
  max-width: 12ch;
  margin: 14px 0 24px;
  color: #fff;
  font-size: clamp(52px, 7.4vw, 96px);
  letter-spacing: -0.055em;
  line-height: 0.92;
}

.im-hero h1 span {
  color: var(--im-cyan);
  text-shadow: 0 0 34px rgba(66, 232, 224, 0.2);
}

.im-lead {
  max-width: 660px;
  color: rgba(232, 240, 248, 0.82);
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.62;
}

.im-play-link {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-height: 48px;
  margin-top: 24px;
  padding: 12px 18px;
  border: 1px solid var(--teal);
  border-radius: 4px;
  color: #04121f;
  background: var(--teal);
  font-family: var(--im-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 180ms ease, background 180ms ease;
}

.im-play-link:hover,
.im-play-link:focus-visible {
  color: #04121f;
  background: var(--im-lime);
  transform: translateY(-2px);
}

.im-play-link span {
  font-size: 18px;
  line-height: 1;
}

.im-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 30px;
}

.im-badges span {
  padding: 0;
  color: rgba(232, 240, 248, 0.7);
  font-family: var(--im-mono);
  font-size: 10px;
  letter-spacing: 0.07em;
}

.im-badges span::before {
  content: "// ";
  color: var(--teal);
}

.im-mission-card,
.im-report-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(66, 232, 224, 0.22);
  border-top-color: rgba(66, 232, 224, 0.62);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(15, 37, 64, 0.94), rgba(6, 23, 44, 0.96));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.24);
}

.im-mission-card {
  padding: 28px;
}

.im-mission-card::after,
.im-report-card::after {
  content: "//";
  position: absolute;
  right: 18px;
  bottom: 2px;
  color: rgba(66, 232, 224, 0.07);
  font-family: var(--im-mono);
  font-size: 78px;
  font-weight: 800;
  line-height: 1;
}

.im-mission-card h2 {
  margin: 12px 0 14px;
  color: #fff;
  font-family: var(--im-mono);
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: -0.04em;
}

.im-mission-card p {
  color: rgba(232, 240, 248, 0.7);
  line-height: 1.7;
}

.im-mission-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 26px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.08);
}

.im-mission-meta div {
  padding: 13px 10px;
  background: #07172c;
  text-align: center;
}

.im-mission-meta dt {
  color: var(--muted);
  font-family: var(--im-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.im-mission-meta dd {
  margin-top: 4px;
  color: var(--im-lime);
  font-family: var(--im-mono);
  font-size: 15px;
  font-weight: 700;
}

.im-console {
  padding: 72px 24px 78px;
  background: rgba(4, 14, 28, 0.74);
}

.im-console__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.im-console__header h2 {
  margin: 8px 0 0;
  color: #fff;
  font-family: var(--im-mono);
  font-size: clamp(18px, 2vw, 25px);
  letter-spacing: -0.025em;
}

.im-system-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(127, 147, 168, 0.3);
  color: var(--muted);
  background: rgba(7, 21, 37, 0.86);
  font-family: var(--im-mono);
  font-size: 11px;
  letter-spacing: 0.07em;
}

.im-system-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 13px currentColor;
}

.im-system-status[data-state="online"],
.im-system-status[data-state="complete"] {
  color: var(--im-lime);
  border-color: rgba(168, 255, 96, 0.35);
}

.im-system-status[data-state="failed"] {
  color: var(--im-error);
  border-color: rgba(255, 79, 123, 0.4);
}

.im-game-shell {
  position: relative;
  scroll-margin-top: 100px;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(66, 232, 224, 0.48);
  border-radius: 5px;
  background: #030b1c;
  box-shadow: 0 0 0 7px rgba(66, 232, 224, 0.025), 0 34px 90px rgba(0, 0, 0, 0.42);
  touch-action: none;
  overscroll-behavior: none;
}

.im-game-shell::before,
.im-game-shell::after {
  content: "";
  position: absolute;
  z-index: 3;
  width: 58px;
  height: 58px;
  pointer-events: none;
}

.im-game-shell::before {
  top: 9px;
  left: 9px;
  border-top: 2px solid var(--im-lime);
  border-left: 2px solid var(--im-lime);
}

.im-game-shell::after {
  right: 9px;
  bottom: 9px;
  border-right: 2px solid var(--im-lime);
  border-bottom: 2px solid var(--im-lime);
}

.im-game-frame {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #030b1c;
  touch-action: none;
  overscroll-behavior: none;
}

.im-game-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--im-cyan);
  background: #030b1c;
  font-family: var(--im-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  transition: opacity 240ms ease, visibility 240ms ease;
}

.im-game-loading.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.im-game-loading__mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(66, 232, 224, 0.25);
  border-top-color: var(--im-cyan);
  border-radius: 50%;
  animation: im-spin 900ms linear infinite;
}

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

.im-control-brief {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(66, 232, 224, 0.15);
}

.im-control-brief p {
  max-width: 820px;
  color: rgba(232, 240, 248, 0.7);
  font-size: 13px;
  line-height: 1.65;
}

.im-control-brief p span {
  display: block;
  margin-bottom: 4px;
  color: var(--teal);
  font-family: var(--im-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.im-rotate-hint {
  display: none;
  color: var(--im-lime) !important;
  font-family: var(--im-mono);
}

.im-debrief {
  padding: 84px 24px 92px;
}

.im-debrief__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(390px, 1.28fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}

.im-debrief__intro h2 {
  max-width: 13ch;
  margin: 14px 0 18px;
  color: #fff;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
}

.im-debrief__intro p {
  color: rgba(232, 240, 248, 0.68);
  line-height: 1.75;
}

.im-report-card {
  min-height: 370px;
  padding: 30px;
  transition: border-color 220ms ease, box-shadow 220ms ease;
}

.im-report-card.is-unlocked {
  border-color: rgba(168, 255, 96, 0.42);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.3), 0 0 40px rgba(168, 255, 96, 0.05);
}

.im-report-card__scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background: repeating-linear-gradient(to bottom, transparent 0 5px, rgba(66, 232, 224, 0.08) 6px);
}

.im-report-lock {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 260px;
  text-align: center;
}

.im-report-lock > span {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border: 1px solid rgba(66, 232, 224, 0.32);
  border-radius: 50%;
  color: rgba(66, 232, 224, 0.58);
  font-family: var(--im-mono);
  font-size: 18px;
}

.im-report-lock p {
  max-width: 380px;
  margin-top: 18px;
  color: rgba(232, 240, 248, 0.55);
}

.im-report-content {
  position: relative;
  z-index: 1;
}

.im-report-content h3 {
  max-width: 18ch;
  margin: 16px 0 14px;
  color: #fff;
  font-size: clamp(25px, 3.2vw, 38px);
  line-height: 1.14;
}

.im-report-content > p {
  max-width: 640px;
  color: rgba(232, 240, 248, 0.72);
  line-height: 1.72;
}

.im-score {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin: 24px 0 18px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--im-mono);
}

.im-score span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.13em;
}

.im-score strong {
  color: var(--im-lime);
  font-size: 24px;
}

.im-service-pattern span,
.im-service-pattern strong {
  display: block;
}

.im-service-pattern span {
  color: var(--teal);
  font-family: var(--im-mono);
  font-size: 10px;
  letter-spacing: 0.13em;
}

.im-service-pattern strong {
  margin-top: 6px;
  color: #fff;
  font-size: 18px;
}

.im-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.im-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.im-btn:hover,
.im-btn:focus-visible {
  transform: translateY(-2px);
}

.im-btn--primary {
  color: #04121f;
  border-color: var(--teal);
  background: var(--teal);
}

.im-btn--outline {
  color: var(--im-cyan);
  border-color: rgba(66, 232, 224, 0.34);
  background: transparent;
}

.im-related-link {
  display: inline-block;
  margin-top: 18px;
  color: rgba(232, 240, 248, 0.62);
  font-family: var(--im-mono);
  font-size: 11px;
  text-decoration: none;
}

.im-related-link:hover,
.im-related-link:focus-visible {
  color: var(--im-cyan);
}

.im-disclaimer {
  margin-top: 28px;
  color: var(--muted);
  font-family: var(--im-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.im-noscript {
  margin-top: 12px;
  color: var(--im-error);
}

@media (max-width: 1040px) {
  .im-page .mobile-lang-header .lang-sw {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
  }
  .im-hero__grid,
  .im-debrief__grid {
    grid-template-columns: 1fr;
  }
  .im-mission-card {
    max-width: 680px;
  }
  .im-debrief__intro h2 {
    max-width: 18ch;
  }
}

@media (max-width: 768px) {
  .im-hero,
  .im-console,
  .im-debrief {
    padding-inline: 16px !important;
  }
  .im-hero {
    padding-top: 118px !important;
    padding-bottom: 56px !important;
  }
  .im-console,
  .im-debrief {
    padding-top: 58px !important;
    padding-bottom: 62px !important;
  }
  .im-hero h1 {
    font-size: clamp(44px, 15vw, 68px) !important;
  }
  .im-console__header,
  .im-control-brief {
    align-items: flex-start;
    flex-direction: column;
  }
  .im-system-status {
    align-self: stretch;
  }
  .im-report-card {
    min-height: 330px;
    padding: 24px;
  }
}

@media (orientation: landscape) and (max-height: 600px) and (max-width: 1100px) {
  .im-page .header {
    position: absolute;
  }
  .im-console {
    padding-block: 36px 42px !important;
  }
  .im-game-shell,
  .im-control-brief {
    width: 100%;
    max-width: calc((100vh - 16px) * 16 / 9);
    max-width: calc((100svh - 16px) * 16 / 9);
    margin-inline: auto;
  }
  .im-game-shell {
    scroll-margin-top: 8px;
  }
}

@media (orientation: portrait) and (max-width: 900px) {
  .im-rotate-hint { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .im-game-loading__mark { animation-duration: 1.8s; }
  .im-game-loading,
  .im-report-card,
  .im-btn { transition: none; }
}
