:root {
  color-scheme: dark;
  --bg: #030704;
  --text: #eff8ef;
  --muted: #a5b3a7;
  --line: rgba(178, 255, 192, 0.2);
  --green: #76ff94;
  --green-2: #1bbf6c;
  --amber: #e4cd68;
  --red: #ff604f;
  --cyan: #56d7e8;
  --panel: rgba(4, 15, 9, 0.74);
  --panel-strong: rgba(3, 10, 6, 0.9);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
a {
  color: inherit;
  font: inherit;
}

a {
  text-decoration: none;
}

.shell {
  position: relative;
  min-height: 100svh;
  overflow: clip;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: clamp(1rem, 2vw, 1.5rem);
  background:
    radial-gradient(circle at 78% 45%, rgba(118, 255, 148, 0.14), transparent 24rem),
    radial-gradient(circle at 34% 62%, rgba(86, 215, 232, 0.06), transparent 27rem),
    linear-gradient(145deg, rgba(10, 24, 15, 0.86), rgba(2, 5, 3, 0.98));
}

#tactical-canvas {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
}

.shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(118, 255, 148, 0.048) 1px, transparent 1px),
    linear-gradient(90deg, rgba(118, 255, 148, 0.036) 1px, transparent 1px);
  background-size: 3.5rem 3.5rem;
  mask-image: radial-gradient(circle at 72% 52%, black 0%, transparent 76%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.8rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.shell[data-mode="active"] .topbar {
  opacity: 1;
  pointer-events: auto;
}

.exit-link,
.nav-button,
.screen-button,
.login-button,
.fight-button,
.more-button {
  border: 1px solid var(--line);
  background: rgba(7, 24, 13, 0.62);
  min-height: 2.45rem;
  padding: 0.72rem 0.9rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-button,
.screen-button,
.login-button,
.fight-button,
.more-button {
  cursor: pointer;
}

.exit-link,
.screen-nav {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.exit-link:hover,
.exit-link:focus-visible,
.nav-button:hover,
.nav-button:focus-visible,
.screen-button:hover,
.screen-button:focus-visible,
.screen-button.is-active,
.login-button:hover,
.login-button:focus-visible,
.fight-button:hover,
.fight-button:focus-visible,
.more-button:hover,
.more-button:focus-visible {
  border-color: rgba(118, 255, 148, 0.78);
  color: var(--text);
  box-shadow: inset 0 0 1.35rem rgba(118, 255, 148, 0.13), 0 0 1.6rem rgba(118, 255, 148, 0.1);
}

.entry {
  display: grid;
  place-items: center;
  min-height: calc(100svh - 5rem);
  transition: opacity 260ms ease, transform 260ms ease;
}

.shell[data-mode="active"] .entry {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
}

.login-button {
  min-width: min(26rem, calc(100vw - 2rem));
  min-height: 4.4rem;
  background:
    linear-gradient(90deg, rgba(118, 255, 148, 0.14), rgba(228, 205, 104, 0.12)),
    rgba(4, 15, 9, 0.74);
  color: var(--green);
  font-size: clamp(0.95rem, 2vw, 1.25rem);
  font-weight: 950;
  backdrop-filter: blur(0.8rem);
}

.screen-stage {
  position: absolute;
  inset: clamp(4.8rem, 8vh, 6rem) clamp(1rem, 3vw, 3rem) clamp(1rem, 3vw, 2rem);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.75rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(1rem) scale(0.98);
  transition: opacity 260ms ease, transform 260ms ease;
}

.shell[data-mode="active"] .screen-stage {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.screen-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}

.screen-button {
  min-width: 8.2rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  backdrop-filter: blur(0.8rem);
}

.content-screen {
  width: min(78rem, 100%);
  min-height: min(68svh, 48rem);
  margin: 0 auto;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(118, 255, 148, 0.12), transparent 36%),
    var(--panel);
  backdrop-filter: blur(0.95rem);
  box-shadow: 0 0 4rem rgba(0, 0, 0, 0.36);
  display: grid;
  grid-template-rows: auto 1fr;
}

.content-screen__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.content-screen__body {
  min-height: 0;
  padding: clamp(1rem, 2vw, 1.5rem);
  overflow: auto;
}

.screen-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(18rem, 0.72fr);
  gap: 1rem;
  height: 100%;
}

.screen-layout--wide {
  grid-template-columns: minmax(0, 1fr);
}

.copy-stack {
  display: grid;
  align-content: start;
  gap: 1rem;
}

.copy-stack h1,
.copy-stack h2,
.copy-stack h3,
p {
  margin-top: 0;
}

.copy-stack h1 {
  margin-bottom: 0;
  font-size: clamp(3rem, 8vw, 7.8rem);
  line-height: 0.84;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.copy-stack h2 {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 4vw, 3.2rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.copy-stack p,
.feed li,
.data-table td {
  color: #d0ddd2;
  line-height: 1.55;
}

.inline-code {
  color: var(--green);
  font-weight: 900;
}

.profile-preview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.9rem;
  border: 1px solid var(--line);
  padding: 0.9rem;
  background: rgba(5, 16, 9, 0.72);
}

.profile-preview p {
  margin: 0.35rem 0 0;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 3.8rem;
  aspect-ratio: 1;
  border: 1px solid rgba(118, 255, 148, 0.5);
  background:
    linear-gradient(135deg, rgba(118, 255, 148, 0.2), rgba(3, 10, 6, 0.88)),
    var(--panel-strong);
  color: var(--green);
  font-size: 1.15rem;
  font-weight: 950;
}

.more-button {
  min-width: 2.65rem;
  padding-inline: 0.6rem;
  color: var(--green);
  font-weight: 950;
  line-height: 1;
}

.image-panel {
  position: relative;
  min-height: 17rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.image-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.95) contrast(1.22) sepia(0.55) hue-rotate(70deg) saturate(1.45) brightness(0.72);
  opacity: 0.72;
}

.image-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(118, 255, 148, 0.13) 0 1px, transparent 1px 6px),
    linear-gradient(135deg, rgba(118, 255, 148, 0.22), rgba(3, 10, 6, 0.32));
  mix-blend-mode: screen;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.stat {
  min-height: 5rem;
  padding: 0.8rem;
  background: var(--panel-strong);
}

.stat span,
.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 0.35rem;
  color: var(--green);
  font-size: clamp(1.3rem, 3vw, 2.1rem);
}

.feed {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feed li {
  border-left: 2px solid rgba(118, 255, 148, 0.68);
  padding: 0.2rem 0 0.2rem 0.75rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.85rem;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--green);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.fight-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--line);
  padding: 1rem;
  background: rgba(5, 16, 9, 0.72);
}

.fight-result {
  display: block;
  margin-top: 0.25rem;
  color: var(--amber);
  font-size: clamp(1.1rem, 2.4vw, 2rem);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.fight-button {
  flex: 0 0 auto;
  border-color: rgba(228, 205, 104, 0.72);
  background: rgba(80, 66, 20, 0.38);
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 900;
}

@media (max-width: 860px) {
  .shell {
    background:
      radial-gradient(circle at 58% 30%, rgba(118, 255, 148, 0.14), transparent 17rem),
      linear-gradient(145deg, rgba(10, 24, 15, 0.86), rgba(2, 5, 3, 0.98));
  }

  .screen-stage {
    inset: 4.8rem 0.85rem 0.85rem;
  }

  .content-screen {
    min-height: auto;
  }

  .screen-layout {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .topbar {
    align-items: flex-start;
  }

  .screen-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .exit-link,
  .nav-button,
  .screen-button,
  .fight-button,
  .more-button {
    min-height: 2.25rem;
    padding: 0.62rem 0.7rem;
    font-size: 0.68rem;
  }

  .screen-button {
    flex: 1 1 7rem;
  }

  .copy-stack h1 {
    font-size: clamp(2.8rem, 15vw, 4.8rem);
  }

  .profile-preview {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .more-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .fight-row {
    align-items: stretch;
    flex-direction: column;
  }

  .fight-button {
    width: 100%;
  }
}
