@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600&family=Unica+One&family=IBM+Plex+Mono:wght@400;600&display=swap');

:root {
  --bg: #050913;
  --bg-alt: #0b1324;
  --card: #121b33;
  --accent: #e054b9;
  --accent-2: #1de5d1;
  --warning: #ff9f43;
  --success: #2ef2b2;
  --text: #fbfbff;
  --muted: #94a3b8;
  --danger: #ff6b6b;
  --border: rgba(255, 255, 255, 0.08);
  --gridlines: rgba(29, 229, 209, 0.12);
  --scanline: rgba(5, 9, 19, 0.45);
  --neo-border: rgba(255, 255, 255, 0.15);
  --panel-glow: 0 35px 80px rgba(2, 4, 12, 0.8);
  --noise: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"%3E%3Crect width="100" height="100" fill="none"/%3E%3Cg fill="rgba(255,255,255,0.015)"%3E%3Ccircle cx="3" cy="8" r="1"/%3E%3Ccircle cx="23" cy="18" r="1"/%3E%3Ccircle cx="55" cy="60" r="1"/%3E%3Ccircle cx="28" cy="78" r="1"/%3E%3Ccircle cx="88" cy="48" r="1"/%3E%3C/g%3E%3C/svg%3E');
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(29, 144, 245, 0.25), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', 'IBM Plex Mono', 'Unica One', sans-serif;
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background: repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 2px,
      rgba(255, 255, 255, 0.015) 2px,
      rgba(255, 255, 255, 0.015) 4px
    ),
    var(--noise);
  opacity: 0.45;
}

body::after {
  background: linear-gradient(180deg, transparent 0%, rgba(5, 9, 19, 0.6) 65%, rgba(5, 9, 19, 0.95) 100%);
  mix-blend-mode: screen;
  opacity: 0.7;
}

.site-header {
  padding: 2rem clamp(1.5rem, 4vw, 4rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.site-brand {
  display: flex;
  max-width: 40ch;
  flex-direction: row;
  align-items: center;
  height: 100%;
}

.site-brand-text {
  margin-left: 1rem;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  background: var(--card);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
}

.brand-tagline {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.subtitle {
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.site-nav {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.82rem;
  position: relative;
  padding: 0.25rem 0.4rem;
  transition: color 0.2s ease;
}

.site-nav a::after {
  content: '';
  position: absolute;
  inset: auto 0 -0.35rem;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  opacity: 1;
}

.site-nav .cta {
  border: 2px solid var(--accent-2);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
}

.logout-form {
  margin: 0;
  display: inline-flex;
  /* border: 1px solid red; */
}

.logout-button {
  border-color: rgba(29, 229, 209, 0.55);
  color: var(--accent-2);
  padding: 0.45rem 1rem;
  border: 1px;
  border-radius: 16px;
  background-color: var(--card);
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
}

.logout-button:hover,
.logout-button:focus-visible {
  border-color: var(--accent-2);
  color: var(--text);
  background-color: var(--bg-alt);
}

.user-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-chip {
  background: rgba(29, 229, 209, 0.08);
  border: 1px solid rgba(29, 229, 209, 0.35);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--accent-2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.btn.tiny {
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
}

.container {
  padding: 0 clamp(1.5rem, 5vw, 5rem) 4rem;
  position: relative;
  z-index: 1;
}

.container::before {
  content: '';
  position: absolute;
  inset: 1rem clamp(1.5rem, 5vw, 5rem) 0;
  border-radius: 1.5rem;
  background-image:
    linear-gradient(transparent calc(100% - 1px), var(--gridlines) 1px),
    linear-gradient(90deg, transparent calc(100% - 1px), var(--gridlines) 1px);
  background-size: 100% 72px, 72px 100%;
  opacity: 0.35;
  z-index: -1;
  pointer-events: none;
  filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.55));
}

.home-page {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(240px, 320px);
  gap: 2rem;
  background: linear-gradient(135deg, rgba(29, 229, 209, 0.12), rgba(224, 84, 185, 0.08));
  border: 1px solid var(--neo-border);
  border-radius: 1.75rem;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  box-shadow: var(--panel-glow);
}

.hero-copy h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0.35rem 0 0.75rem;
}

.hero-copy p {
  max-width: 60ch;
  color: var(--muted);
}

.hero-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-status {
  background: rgba(5, 9, 19, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  padding: 1.25rem;
}

.hero-status h3 {
  margin-top: 0;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: var(--muted);
}

.hero-status ul {
  padding: 0;
  margin: 1rem 0 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero-status li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.hero-status li:last-child {
  border-bottom: none;
}

.hero-status span {
  color: var(--muted);
  font-size: 0.85rem;
}

.hero-status strong {
  font-size: 1.5rem;
  letter-spacing: 0.12em;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(240px, 2fr);
  gap: 2rem;
}

.portal-panel,
.news-panel {
  background: rgba(5, 9, 19, 0.7);
  border: 1px solid var(--neo-border);
  border-radius: 1.75rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--panel-glow);
}

.portal-panel header,
.news-panel header {
  margin-bottom: 1.25rem;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.portal-card {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 1.25rem;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.01);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 180px;
}

.portal-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.portal-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}

.portal-meta svg {
  width: 32px;
  height: 32px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  opacity: 0.65;
}

.portal-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 90px;
}

.portal-metric strong {
  font-size: 1.35rem;
  line-height: 1;
}

.portal-metric span {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.portal-tag {
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.portal-card p {
  color: var(--muted);
  margin: 0;
}

.news-feed {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.news-feed li {
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.01);
}

.news-feed h3 {
  margin: 0.5rem 0 0.35rem;
}

.news-feed p {
  margin: 0;
  color: var(--muted);
}

.news-pill {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.news-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.news-metric {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.9rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: rgba(255, 255, 255, 0.02);
}

.news-metric span {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.news-metric strong {
  font-size: 1.35rem;
}

.news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.news-pin {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.news-actions {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.5rem;
}

.intel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.intel-panel {
  border: 1px solid var(--neo-border);
  border-radius: 1.25rem;
  padding: 1.5rem;
  background: rgba(5, 9, 19, 0.75);
  box-shadow: var(--panel-glow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mission-overview__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.85rem;
}

.mission-overview__stats div,
.archive-digest__stats > div,
.archive-digest__types div,
.pulse-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.9rem;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.mission-overview__stats span,
.archive-digest__stats span,
.archive-digest__types span,
.pulse-card span {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.mission-overview__stats strong,
.archive-digest__stats strong,
.archive-digest__types strong,
.pulse-card strong {
  font-size: 1.4rem;
  letter-spacing: 0.08em;
}

.mission-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mission-list li {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
}

.mission-list__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.mission-list__header h3 {
  margin: 0 0 0.2rem;
}

.mission-list dl {
  margin: 0.75rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}

.mission-list dt {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.mission-list dd {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
}

.archive-digest__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  align-items: stretch;
}

.archive-digest__types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem;
}

.archive-digest__list ul {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.archive-digest__list li {
  border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
  padding-bottom: 0.65rem;
}

.archive-digest__list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.archive-type-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.5rem;
}

.system-pulse {
  margin: 2.5rem 0 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.pulse-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: linear-gradient(140deg, rgba(29, 229, 209, 0.1), rgba(224, 84, 185, 0.08));
}

.tarot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 2rem 0 1rem;
}

.tarot-actions form {
  display: inline-flex;
}

.tarot-form {
  margin-top: 1.5rem;
}

.tarot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
}

.tarot-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 320px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.tarot-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.tarot-number {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(29, 229, 209, 0.08);
  border: 1px solid rgba(29, 229, 209, 0.35);
  display: grid;
  place-items: center;
  font-family: 'Unica One', sans-serif;
  font-size: 1.25rem;
  color: var(--accent-2);
}

.tarot-bonus {
  padding: 0.75rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.tarot-choices {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: auto;
}

.tarot-choice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.015);
}

.tarot-choice input {
  margin-top: 0.2rem;
}

.manual-hand-form .tarot-card {
  min-height: 250px;
}

.manual-hand-form .tarot-choice.manual {
  margin-top: 1rem;
}

@media (max-width: 720px) {
  .tarot-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .tarot-card {
    min-height: auto;
  }
}

@media (max-width: 960px) {
  .home-hero {
    grid-template-columns: 1fr;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  .portal-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

.page-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.code-inline {
  font-family: 'IBM Plex Mono', monospace;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.4rem;
  border-radius: 0.4rem;
}

.hautfait-generator-page {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.generator-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 1.5rem;
}

.generator-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.generator-form input,
.generator-form textarea {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 9, 19, 0.5);
  padding: 0.75rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.95rem;
  color: var(--text);
}

.generator-form textarea {
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.generator-errors {
  border: 1px solid var(--danger);
  background: rgba(255, 107, 107, 0.08);
  color: var(--danger);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

.code-preview header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.code-output {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 9, 19, 0.6);
  color: var(--accent-2);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
  padding: 1rem;
  resize: none;
  min-height: 360px;
}

@media (max-width: 960px) {
  .generator-layout {
    grid-template-columns: 1fr;
  }
}

.missions-page,
.missions-new-page,
.mission-show-page {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.mission-card {
  border: 1px solid var(--neo-border);
  border-radius: 1.2rem;
  padding: 1.5rem;
  background: linear-gradient(140deg, rgba(29, 229, 209, 0.08), rgba(5, 9, 19, 0.85));
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--panel-glow);
}

.mission-card__meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mission-pill {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.mission-pill--status {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.mission-pill--priority {
  border-color: var(--accent);
  color: var(--accent);
}

.mission-objective {
  color: var(--muted);
  margin: 0;
}

.mission-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.mission-stats li {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.8rem;
  padding: 0.6rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mission-stats span {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.mission-stats strong {
  font-size: 1.2rem;
}

.mission-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: rgba(5, 9, 19, 0.65);
  border: 1px solid var(--neo-border);
  border-radius: 1.2rem;
  padding: 1.5rem;
}

.mission-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--muted);
}

.mission-form input,
.mission-form select,
.mission-form textarea {
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 9, 19, 0.5);
  color: var(--text);
  padding: 0.65rem 0.8rem;
  font-family: 'IBM Plex Mono', monospace;
}

.mission-form textarea {
  resize: vertical;
}

.mission-form .form-actions {
  margin-top: 0.5rem;
}

.link-back {
  color: var(--accent-2);
  text-decoration: none;
  font-size: 0.9rem;
}

.mission-card__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mission-card__actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.mission-card__actions form {
  margin: 0;
}

.mission-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  padding: 1.5rem;
  border-radius: 1.5rem;
  border: 1px solid var(--neo-border);
  background: linear-gradient(135deg, rgba(224, 84, 185, 0.08), rgba(5, 9, 19, 0.85));
}

.mission-pills {
  display: flex;
  gap: 0.5rem;
}

.mission-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.mission-meta li {
  border: 1px dashed var(--border);
  border-radius: 0.8rem;
  padding: 0.75rem 1rem;
  min-width: 140px;
}

.mission-meta span {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.mission-meta strong {
  font-size: 1.1rem;
}

.mission-briefing,
.mission-notes,
.mission-linker,
.mission-archives {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  padding: 1.5rem;
  background: rgba(5, 9, 19, 0.7);
}

.mission-linker form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mission-linker select {
  border-radius: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 9, 19, 0.5);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-family: 'IBM Plex Mono', monospace;
}

.mission-linker .btn {
  align-self: flex-start;
}

.archive-mission {
  margin: 0;
  font-size: 0.85rem;
}

.mission-archives .archive-item {
  background: rgba(255, 255, 255, 0.03);
}

.mission-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: -0.5rem 0 1rem;
}

.mission-actions form {
  margin: 0;
}

@media (max-width: 720px) {
  .mission-hero {
    flex-direction: column;
  }

  .mission-meta {
    flex-direction: column;
  }
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.page-actions form {
  margin: 0;
}

.page-header h1 {
  margin-bottom: 0.25rem;
}

.eyebrow {
  letter-spacing: 0.4em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: none;
  text-decoration: none;
  padding: 0.6rem 1.3rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: 'IBM Plex Mono', monospace;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--bg);
}

.btn.ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}

.btn.danger {
  background: var(--danger);
  color: var(--bg);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.02), rgba(13, 24, 46, 0.9));
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--neo-border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--panel-glow);
  isolation: isolate;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(29, 229, 209, 0.08);
  opacity: 0.6;
  pointer-events: none;
  mix-blend-mode: screen;
}

.card header h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.card header a {
  color: var(--text);
  text-decoration: none;
}

.badge {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
}

.badge.ghost {
  border: 1px solid var(--border);
  background: transparent;
}

.card dl {
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.card dt {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.card dd {
  margin: 0;
}

.card footer {
  margin-top: auto;
}

.enemy-meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.enemy-card dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
}

.enemy-card dl div {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.75rem;
  border-radius: 0.6rem;
}

.multi-stat {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.multi-stat span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
}

/* Armor builder cards */
.stacked-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.capacity-card,
.faq-card,
.variant-card {
  border-radius: 1.25rem;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  background: rgba(5, 9, 19, 0.75);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.capacity-card {
  border-color: rgba(29, 229, 209, 0.45);
  background: linear-gradient(135deg, rgba(29, 229, 209, 0.18), rgba(5, 9, 19, 0.85));
}

.faq-card {
  border-color: rgba(224, 84, 185, 0.4);
  background: linear-gradient(135deg, rgba(224, 84, 185, 0.2), rgba(5, 9, 19, 0.85));
}

.variant-card {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(5, 9, 19, 0.6);
}

.capacity-card__header,
.faq-card__header,
.variant-card header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.capacity-card__header h3 {
  margin: 0.2rem 0 0;
}

.faq-card__header h4 {
  margin: 0;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.capacity-grid,
.variant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.variant-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.faq-card label,
.capacity-grid label,
.variant-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.faq-card input,
.faq-card textarea,
.capacity-grid input,
.capacity-grid textarea,
.variant-grid input,
.variant-grid textarea {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 9, 19, 0.6);
  padding: 0.65rem;
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  resize: vertical;
}

.collapsible-card.is-collapsed {
  border-color: rgba(255, 255, 255, 0.2);
  opacity: 0.85;
}

.collapsible-card .collapsible-body {
  margin-top: 1rem;
}

.collapsible-card.is-collapsed .collapsible-body {
  display: none;
}

/* Armor show layout */
.armor-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.armor-icon {
  width: 72px;
  height: 72px;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(5, 9, 19, 0.6);
  padding: 0.5rem;
  object-fit: contain;
}

.armor-subline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.stat-chip-row {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stat-chip-row li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.9rem;
  background: rgba(5, 9, 19, 0.65);
}

.stat-chip__label {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--muted);
}

.tech-profile {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.tech-profile__block {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
}

.tech-profile__block:first-child {
  border-top: none;
  padding-top: 0;
}

.tech-profile__block .eyebrow {
  margin-bottom: 0.5rem;
}

.tech-profile__collapse {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.9rem;
  padding: 0;
  background: rgba(255, 255, 255, 0.02);
}

.tech-profile__collapse + .tech-profile__block {
  border-top: none;
  padding-top: 0;
}

.tech-collapse__toggle {
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.tech-collapse__toggle .eyebrow {
  margin: 0;
}

.tech-collapse__icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.tech-collapse__body {
  padding: 0 1rem 1rem;
}

.slots-panel {
  margin-top: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.slots-grid div {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: rgba(5, 9, 19, 0.55);
}

.slots-grid span {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.slots-grid strong {
  font-size: 1.4rem;
  font-weight: 700;
}

.overdrive-panel {
  margin-top: 1.25rem;
}

.pill-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.pill-list li {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.04);
}

.collapsible-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 3rem;
}

.collapsible-panel {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  background: rgba(5, 9, 19, 0.55);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(5, 9, 19, 0.45);
}

.panel-toggle {
  width: 100%;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.85rem;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.panel-toggle__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.panel-body {
  padding: 1.25rem;
}

.collapsible-panel.is-collapsed .panel-toggle {
  background: rgba(255, 255, 255, 0.04);
}

.collapsible-panel.is-collapsed .panel-body {
  display: none;
}

.nested-panel {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(5, 9, 19, 0.35);
}

.nested-panel .panel-toggle {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
}

.depth-2 {
  border-style: dashed;
}


.capacity-section,
.faq-section {
  margin-top: 3rem;
}

.capacity-entry {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 25px 60px rgba(5, 9, 19, 0.55);
}

.capacity-entry__header {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.capacity-entry h3 {
  margin: 0.25rem 0 0;
}

.capacity-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  margin: 0;
}

.capacity-meta div {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.6rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
}

.capacity-meta dt {
  margin: 0;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.capacity-meta dd {
  margin: 0.2rem 0 0;
  font-size: 1rem;
  font-weight: 600;
}

.capacity-effects {
  margin-top: 0.9rem;
}

.capacity-effects p {
  margin: 0 0 0.35rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--muted);
}

.capacity-effects ul {
  list-style: disc;
  margin: 0.5rem 0 0 1.5rem;
  padding: 0;
}

.variant-list {
  margin-top: 1.25rem;
}

.variant-entry {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.015);
}

.variant-entry h4 {
  margin: 0 0 0.5rem;
}

.faq-item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(5, 9, 19, 0.55);
}

.faq-item h3 {
  margin: 0 0 0.5rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.evolution-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.evolution-grid div {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.85rem;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.02);
}


.field-with-confidence .field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.confidence-indicator {
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.confidence-indicator:hover {
  transform: scale(1.05);
}

.confidence-indicator:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.stat-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.85rem;
  border: 2px solid var(--border);
  font-weight: 700;
}

.stat-indicator.known {
  border-color: var(--success);
  color: var(--success);
}

.stat-indicator.confident {
  border-color: var(--warning);
  color: var(--warning);
}

.stat-indicator.unknown {
  border-color: var(--danger);
  color: var(--danger);
}

.confidence-indicator[data-state='known'] {
  border-color: var(--success);
  color: var(--success);
}

.confidence-indicator[data-state='trusted'] {
  border-color: var(--warning);
  color: var(--warning);
}

.confidence-indicator[data-state='unknown'] {
  border-color: var(--danger);
  color: var(--danger);
}

.confidence-line {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  margin: 0.4rem 0 0;
}

.confidence-line .stat-indicator {
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--card);
  border-radius: 1rem;
  border: 1px solid var(--border);
}

.form-card {
  background: var(--card);
  border-radius: 1rem;
  padding: 2rem;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.motivation-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.motivation-card label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 0.9rem;
}

.motivation-card textarea {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 9, 19, 0.5);
  padding: 0.75rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.95rem;
  color: var(--text);
  resize: vertical;
}

.motivation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 2rem;
  padding-bottom: 4rem;
  height: calc(100%-66px);
}

.login-card {
  width: min(1300px, 100%);
  height: 100%;
  background: var(--card);
  /* background-color: red; */
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 1.5rem 3rem;
  box-shadow: 0 30px 80px rgba(5, 9, 19, 0.65);
  animation: fadeUp 0.6s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

.login-card header {
  margin-bottom: 1.5rem;
}

.login-card .subtitle {
  color: var(--muted);
  margin: 0.4rem 0 0;
}

.login-form fieldset {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  margin: 0 0 1.5rem;
  /* background-color: red; */
}

.login-form legend {
  padding: 0 0.5rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  /* background-color: yellow; */
}

.profile-selector {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  /* background-color: red; */
}

.profile-inputs {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.profile-strip {
  display: flex;
  /* gap: 0.75rem; */
  padding: 1rem;
  border: 1px solid var(--neo-border);
  border-radius: 1.5rem;
  background: rgba(5, 9, 19, 0.6);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02), 0 20px 50px rgba(0, 0, 0, 0.5);
  align-items: stretch;
  --profile-frame-height: clamp(240px, 48vh, 360px);
  min-height: var(--profile-frame-height);
}

.profile-frame {
  flex: 1;
  min-width: 0;
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: flex 0.35s ease, transform 0.35s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  height: var(--profile-frame-height);
}

.profile-frame img {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
  transform-origin: center;
  transition: transform 0.45s ease, filter 0.45s ease;
}

.profile-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(5, 9, 19, 0.85));
}

.profile-frame:hover {
  flex: 1.2;
  transform: translateY(-6px);
  border-color: var(--accent-2);
}

.profile-frame:hover img {
  /* transform: scale(1.08); */
  filter: saturate(1.15) contrast(1.1);
}

.profile-frame.selected {
  flex: 1.3;
  border-color: var(--accent-2);
  box-shadow: 0 0 28px rgba(29, 229, 209, 0.35);
}

.profile-frame.selected img {
  transform: scale(1.05);
  filter: saturate(1.2) contrast(1.2);
}

.profile-roles {
  display: flex;
  gap: 0.15rem;
  border-radius: 1rem;
  background: rgba(18, 27, 51, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.profile-role {
  flex: 1;
  text-align: center;
  padding: 0.85rem 0.5rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.profile-role span {
  pointer-events: none;
}

.profile-role.active {
  color: var(--text);
  background: linear-gradient(120deg, rgba(29, 229, 209, 0.2), rgba(5, 9, 19, 0.95));
  box-shadow: inset 0 0 0 1px rgba(29, 229, 209, 0.5);
}

.password-popup-hint {
  margin: 0;
  padding: 0.5rem 1rem;
  border-radius: 0.8rem;
  border: 1px dashed var(--neo-border);
  background: rgba(5, 9, 19, 0.5);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.password-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 9, 19, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 999;
  backdrop-filter: blur(8px);
}

.password-overlay.active {
  display: flex;
}

body.modal-open {
  overflow: hidden;
}

.password-modal {
  width: min(460px, 100%);
  border: 1px solid var(--neo-border);
  border-radius: 1.25rem;
  padding: 1.75rem;
  background: rgba(5, 9, 19, 0.92);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.65);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.password-modal header {
  margin-bottom: 0.5rem;
}

.password-modal label span {
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
}

@media (max-width: 1080px) {
  .profile-strip {
    flex-direction: column;
    --profile-frame-height: clamp(220px, 55vw, 360px);
    min-height: 0;
  }

  .profile-frame,
  .profile-frame:hover,
  .profile-frame.selected {
    flex: 1;
  }

  .profile-role {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    padding: 0.6rem 0.4rem;
  }
}

@media (max-width: 600px) {
  .profile-strip {
    padding: 0.75rem;
    --profile-frame-height: clamp(200px, 65vw, 320px);
  }
}

.access-btn {
  width: 100%;
  font-size: 1.05rem;
  padding: 0.9rem 1.5rem;
}

.alert {
  border: 1px solid rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.08);
  border-radius: 0.8rem;
  padding: 0.9rem 1.2rem;
  margin-bottom: 1.2rem;
}

.alert p {
  margin: 0;
  color: var(--danger);
  font-weight: 600;
}

@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

label {
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.inline-checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.inline-checkbox input {
  width: auto;
}

input,
textarea,
select {
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.75rem 1rem;
  background: var(--bg-alt);
  color: var(--text);
  font-family: inherit;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text) 50%),
    linear-gradient(135deg, var(--text) 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 8px 8px, 8px 8px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.two-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.range-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto minmax(100px, 1fr);
  gap: 0.4rem;
  align-items: center;
}

.range-row input {
  width: 100%;
}

.range-sep {
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 520px) {
  .range-row {
    grid-template-columns: 1fr;
  }

  .range-sep {
    text-align: center;
  }
}

.aspect-breakdown {
  margin: 1.5rem 0;
}

.aspect-breakdown h3 {
  margin: 0 0 0.75rem;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
}

.aspect-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.aspect-breakdown-grid label {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0.8rem;
  padding: 0.75rem;
}

.aspects-section {
  margin-top: 2.5rem;
}

.aspects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.aspect-card {
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.armor-grid .armor-card {
  position: relative;
}

.armor-card__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.armor-card__icon {
  width: 64px;
  height: 64px;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  object-fit: contain;
  background: rgba(5, 9, 19, 0.6);
  padding: 0.35rem;
}

.armor-card__title {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.armor-card__title h2 {
  margin: 0;
}

.armor-card__capacities {
  margin-top: 1.25rem;
}

.armor-card__capacities ul {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.armor-card__capacities li {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.armor-card__placeholder {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.armor-stats,
.armor-specs {
  display: grid;
  flex-direction: row;
  grid-template-columns: repeat(auto-fit, 30%);
  align-content: center;
  justify-content: center;
}

.armor-stats div,
.armor-specs div {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0.6rem;
  display: flex;
  align-content: center;
  justify-content: center;
  flex-direction: row;
  gap: 0.5rem;
  /* background-color: red; */
}


/* .armor-stats dt,
.armor-specs dt {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
} */

.armor-hero {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(260px, 1fr);
  gap: 2rem;
  margin-bottom: 2.5rem;
  align-items: stretch;
}

.armor-hero > * {
  min-width: 0;
}

@media (max-width: 960px) {
  .armor-hero {
    grid-template-columns: 1fr;
  }
}

.armor-image {
  border-radius: 1rem;
  display: flex;
  align-items: stretch;
  padding: 0;
}

.armor-carousel {
  position: relative;
  width: 100%;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--panel-glow);
  aspect-ratio: 16 / 9;
  min-height: clamp(260px, 36vw, 420px);
}

.carousel-viewport {
  width: 100%;
  height: 100%;
}

.carousel-track {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  position: relative;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  animation: fadeIn 0.35s ease;
}

.carousel-slide.is-active {
  display: block;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(5, 9, 19, 0.65);
  color: var(--text);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  z-index: 2;
}

.carousel-control span {
  font-size: 1.5rem;
  line-height: 1;
}

.carousel-control.prev {
  left: 1rem;
}

.carousel-control.next {
  right: 1rem;
}

.carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  display: inline-flex;
  gap: 0.4rem;
  z-index: 2;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.carousel-dot.is-active {
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.armor-stats dd,
.armor-specs dd,
.armor-stats dt,
.armor-specs dt {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.armor-image img {
  width: 100%;
  border-radius: 0.8rem;
}

.armor-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.armor-panels article,
.meta-armor-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
}

.meta-armor-card .armor-specs {
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.detail-grid article {
  background: var(--card);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.enemy-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
}

.stat-grid dt {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-grid dd {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.05em;
}

.range-pill {
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  font-family: 'IBM Plex Mono', monospace;
}

.tag-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-list li {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
}

.aspect-chip-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem;
}

.aspect-chip-list li {
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  padding: 0.65rem 0.9rem;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.aspect-value {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.dice-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.dice-summary h2 {
  margin-bottom: 0.25rem;
}

.dice-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.dice-pill {
  display: inline-flex;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
}

.dice-pill.even {
  background: rgba(29, 229, 209, 0.15);
}

.dice-pill.odd {
  background: rgba(224, 84, 185, 0.2);
}

.tab-nav {
  display: inline-flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--neo-border);
  background: rgba(5, 9, 19, 0.8);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
}

.tab {
  padding: 0.5rem 1.4rem;
  text-decoration: none;
  color: var(--muted);
  border-radius: 999px;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  font: inherit;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.75rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.tab.active {
  border-color: var(--accent-2);
  background: linear-gradient(120deg, rgba(29, 229, 209, 0.15), rgba(5, 9, 19, 0.6));
  color: var(--text);
  box-shadow: 0 0 25px rgba(29, 229, 209, 0.35);
}

.tab-panel {
  display: none;
  margin-top: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1.25rem;
  padding: clamp(1rem, 3vw, 1.75rem);
  background: rgba(5, 9, 19, 0.65);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
}

.tab-panel.active {
  display: block;
}

.aspect-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.aspect-list li {
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.aspect-list strong {
  font-size: 1rem;
}

.muted {
  color: var(--muted);
}

.combat-panel {
  background: var(--card);
  border-radius: 1rem;
  border: 1px solid var(--border);
  padding: 2rem;
}

.combat-panel header {
  margin-bottom: 1.5rem;
}

.combat-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.arsenal-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.arsenal-shell {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.arsenal-tab-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.arsenal-tab {
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: inherit;
}

.arsenal-tab small {
  font-size: 0.8rem;
  color: var(--muted);
}

.arsenal-tab.active {
  border-color: var(--accent-2);
  background: rgba(29, 229, 209, 0.1);
  color: var(--text);
}

.arsenal-panels {
  position: relative;
}

.placeholder-card {
  text-align: center;
  padding: 2rem 1.5rem;
  border-radius: 1rem;
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.archive-layout {
  display: grid;
  grid-template-columns: minmax(200px, 0.8fr) minmax(380px, 1.6fr);
  gap: 1.5rem;
}

@media (max-width: 980px) {
  .archive-layout {
    grid-template-columns: 1fr;
  }
}

.archive-form-card,
.archive-library-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.archive-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.archive-tags-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.tag-suggestions {
  margin-top: 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 0.85rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.tag-suggestions__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.tag-suggestions__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.tag-suggestion {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  background: transparent;
  color: inherit;
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.68rem;
  cursor: pointer;
}

.tag-suggestions__empty {
  margin: 0.6rem 0 0;
  font-size: 0.8rem;
}

.archive-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.archive-filters input,
.archive-filters select {
  flex: 1;
}

.archive-empty {
  border: 1px dashed var(--border);
  border-radius: 0.8rem;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
}

.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.archive-item {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.archive-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  border-top: 1px dashed var(--border);
  padding-top: 0.6rem;
}

.privacy-label {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.privacy-label.shared {
  color: var(--accent-2);
}

.privacy-label.private {
  color: var(--warning);
}

.btn.share-toggle {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  padding: 0.4rem 0.8rem;
}

.archive-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.archive-meta {
  margin: 0;
  font-size: 0.9rem;
}

.archive-summary {
  margin: 0;
  font-weight: 500;
}

.archive-details {
  margin: 0.5rem 0 0;
  line-height: 1.6;
}

.archive-character {
  border-color: rgba(46, 242, 178, 0.5);
  color: var(--success);
}

.archive-location {
  border-color: rgba(224, 84, 185, 0.5);
  color: #e054b9;
}

.archive-event {
  border-color: rgba(255, 159, 67, 0.5);
  color: var(--warning);
}

.archive-faction {
  border-color: rgba(29, 229, 209, 0.5);
  color: var(--accent-2);
}

.archive-artifact {
  border-color: rgba(142, 124, 248, 0.5);
  color: #a698ff;
}

.battlefield-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.battlefield-legend {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.legend-pill {
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid var(--border);
}

.legend-pill.team-ally,
.detail-badge.team-ally,
.unit-dot.team-ally {
  border-color: rgba(46, 242, 178, 0.6);
  color: var(--success);
}

.legend-pill.team-enemy,
.detail-badge.team-enemy,
.unit-dot.team-enemy {
  border-color: rgba(255, 107, 107, 0.6);
  color: var(--danger);
}

.legend-pill.team-neutral,
.detail-badge.team-neutral,
.unit-dot.team-neutral {
  border-color: rgba(255, 159, 67, 0.6);
  color: var(--warning);
}

.battlefield-wrapper {
  display: grid;
  grid-template-columns: minmax(320px, 1.4fr) minmax(280px, 1fr);
  gap: 1.5rem;
}

@media (max-width: 980px) {
  .battlefield-wrapper {
    grid-template-columns: 1fr;
  }
}

.battlefield-map-card {
  min-height: 540px;
}

.map-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tactical-map {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 1rem;
  min-height: 420px;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  background-color: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.tactical-map:focus {
  outline: 2px solid var(--accent-2);
}

.map-placeholder {
  margin: 2rem auto;
  max-width: 26ch;
  text-align: center;
  color: var(--muted);
  pointer-events: none;
}

.tactical-map.has-units .map-placeholder {
  display: none;
}

.range-controls {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .range-controls {
    grid-template-columns: 1fr;
  }
}

.range-controls label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.range-controls input {
  width: 100%;
}

.battlefield-status {
  margin: 0;
  padding: 0.8rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 9, 19, 0.65);
  font-size: 0.85rem;
  color: var(--muted);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.battlefield-status[data-variant='success'] {
  border-color: rgba(46, 242, 178, 0.45);
  color: var(--success);
}

.battlefield-status[data-variant='error'] {
  border-color: rgba(255, 107, 107, 0.45);
  color: var(--danger);
}

.battlefield-status[data-variant='info'] {
  border-color: rgba(29, 229, 209, 0.45);
  color: var(--accent-2);
}

.map-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map-layer--structures {
  z-index: 1;
}

.map-layer--units {
  z-index: 2;
}

.unit-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.unit-marker .unit-dot {
  pointer-events: auto;
  z-index: 2;
}

.unit-marker .range-ring-stack {
  z-index: 1;
}

.unit-dot-icon {
  font-family: 'Unica One', 'IBM Plex Mono', monospace;
  letter-spacing: 0.2em;
}

.range-ring-stack {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.range-ring {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--ring-size, 80px);
  height: var(--ring-size, 80px);
  border: 1px dashed rgba(29, 229, 209, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: rangeSweep 6s linear infinite;
  animation-delay: var(--ring-delay, 0s);
  opacity: 0.65;
  box-shadow: 0 0 15px rgba(29, 229, 209, 0.25);
}

@keyframes rangeSweep {
  0% {
    opacity: 0.15;
  }
  20% {
    opacity: 0.65;
  }
  100% {
    opacity: 0.2;
  }
}

.unit-dot {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.unit-dot:focus-visible,
.unit-dot.active {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.unit-dot:active {
  cursor: grabbing;
}

.unit-dot.pulse {
  animation: pulse 0.6s ease;
}

.map-structure {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 1px dashed var(--border);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  text-align: center;
  pointer-events: auto;
  cursor: grab;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.map-structure:active {
  cursor: grabbing;
}

.map-structure.active {
  box-shadow: 0 0 0 2px rgba(224, 84, 185, 0.45), 0 20px 45px rgba(0, 0, 0, 0.45);
}

.map-structure--wall {
  background: rgba(224, 84, 185, 0.18);
  border-color: rgba(224, 84, 185, 0.65);
}

.map-structure--structure {
  background: rgba(29, 229, 209, 0.14);
  border-color: rgba(29, 229, 209, 0.5);
}

.map-structure--cover {
  background: rgba(142, 124, 248, 0.18);
  border-color: rgba(142, 124, 248, 0.55);
}

.map-structure--zone {
  background: rgba(255, 159, 67, 0.18);
  border-color: rgba(255, 159, 67, 0.55);
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

.battlefield-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.library-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.structure-roster,
.saved-map-list {
  list-style: none;
  margin: 0;
  margin-top: 0.85rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.structure-row,
.saved-map-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
}

.saved-map-row .roster-actions {
  flex-direction: row;
  align-items: center;
}

.map-management-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.map-management-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.map-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.map-info strong {
  font-size: 1rem;
}

.map-info p {
  margin: 0;
}

.unit-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.unit-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0.6rem;
}

.unit-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.unit-roster {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.roster-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.8rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.roster-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.roster-title {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.detail-badge {
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.roster-position {
  font-size: 0.85rem;
  color: var(--muted);
}

.roster-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.unit-details-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.unit-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.unit-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.unit-stat-grid dt {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.unit-stat-grid dd {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
}

.unit-notes {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0.8rem;
  padding: 0.75rem 1rem;
  margin: 0;
}

.combat-planner {
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) minmax(240px, 1fr);
  gap: 1.5rem;
}

@media (max-width: 920px) {
  .combat-planner {
    grid-template-columns: 1fr;
  }
}

.combat-board,
.combat-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.planner-title {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.grid-info {
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
  color: var(--muted);
}

.helper-note {
  font-size: 0.8rem;
  margin: 0;
}

.battle-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(55px, 1fr));
  gap: 0.4rem;
  padding: 0.75rem;
  border-radius: 1rem;
  border: 1px solid var(--neo-border);
  background: radial-gradient(circle at top, rgba(29, 229, 209, 0.12), transparent 60%), rgba(2, 5, 15, 0.8);
  box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.45);
}

.grid-cell {
  border: 1px dashed var(--gridlines);
  border-radius: 0.6rem;
  padding: 0.65rem;
  min-height: 64px;
  background: rgba(5, 9, 19, 0.65);
  color: var(--muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.grid-cell:hover {
  border-color: var(--accent-2);
}

.grid-cell.occupied {
  border-style: solid;
  color: var(--text);
}

.grid-cell.team-ally {
  border-color: var(--success);
  background: rgba(46, 242, 178, 0.1);
  box-shadow: 0 0 15px rgba(46, 242, 178, 0.35);
}

.grid-cell.team-enemy {
  border-color: var(--danger);
  background: rgba(255, 107, 107, 0.08);
  box-shadow: 0 0 15px rgba(255, 107, 107, 0.35);
}

.grid-cell.team-neutral {
  border-color: var(--warning);
  background: rgba(255, 159, 67, 0.08);
  box-shadow: 0 0 15px rgba(255, 159, 67, 0.35);
}

.combat-sidebar {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.02);
}

.position-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.roster-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.roster-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}

.roster-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.roster-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.9rem;
}

.roster-item.team-ally {
  border-color: rgba(46, 242, 178, 0.5);
}

.roster-item.team-enemy {
  border-color: rgba(255, 107, 107, 0.5);
}

.roster-item.team-neutral {
  border-color: rgba(255, 159, 67, 0.5);
}

.roster-empty {
  font-size: 0.85rem;
}

.btn.tiny {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.detail-grid dl {
  margin: 0;
  display: grid;
  gap: 1rem;
}

.detail-grid dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.bio {
  white-space: pre-line;
  color: var(--muted);
}

.alert {
  border-radius: 0.8rem;
  padding: 1rem 1.5rem;
  border: 1px solid var(--danger);
  color: var(--danger);
  background: rgba(255, 107, 107, 0.08);
  margin-bottom: 1.5rem;
}

.alert ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.alert.success {
  border-color: var(--accent-2);
  color: var(--accent-2);
  background: rgba(29, 229, 209, 0.08);
}

.alert.warning {
  border-color: #f0ad4e;
  color: #f0ad4e;
  background: rgba(240, 173, 78, 0.12);
}

.stepper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.step {
  border: 1px dashed var(--border);
  border-radius: 0.8rem;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.step.active {
  border-style: solid;
  border-color: var(--accent-2);
  color: var(--text);
  background: rgba(29, 229, 209, 0.1);
}

.aspect-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.aspect-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.35);
}

.aspect-tile header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.aspect-tile h2 {
  margin: 0;
  letter-spacing: 0.18em;
  font-size: 1rem;
}

.trait-grid.fixed {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.trait-grid.fixed li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0.9rem;
  border: 1px dashed var(--border);
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.02);
}

.trait-grid.fixed strong {
  letter-spacing: 0.1em;
  font-size: 0.9rem;
}

.archetype-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.archetype-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
  background: var(--card);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  display: block;
}

.archetype-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-2);
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.35);
}

.archetype-card.selected {
  border-color: var(--accent-2);
  box-shadow: 0 25px 40px rgba(0, 0, 0, 0.45);
}

.archetype-card input[type='radio'] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.archetype-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.archetype-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.archetype-header h2 {
  margin: 0;
  font-size: 1.3rem;
}

.bonus-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.bonus-list li {
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

.choice-panel {
  margin: 1rem 0 2rem;
  padding: 1.5rem;
  border: 1px dashed var(--border);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.summary-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.stat-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.recap-card header {
  margin-bottom: 1rem;
}

.recap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.recap-table th,
.recap-table td {
  text-align: left;
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.recap-table th {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.trait-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.trait-card {
  border: 1px dashed var(--border);
  border-radius: 0.85rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.trait-card h3 {
  margin: 0 0 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.trait-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.trait-card li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.6rem;
  padding: 0.6rem 0.7rem;
  background: rgba(5, 9, 19, 0.35);
}

.trait-card small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.trait-total {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
}

.allocation-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.allocation-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.allocation-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.allocation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
}

.allocation-grid.wide {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.allocation-grid label,
.global-trait-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.allocation-grid input,
.global-trait-grid input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text);
  padding: 0.4rem 0.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
}

.global-trait-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.global-trait-grid section {
  border: 1px dashed var(--border);
  border-radius: 0.85rem;
  padding: 0.9rem;
}

.global-trait-grid h4 {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.field-error {
  margin: 0.5rem 0 0;
  color: var(--danger);
  font-size: 0.85rem;
}

.haut-fait-form {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.haut-fait-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.haut-fait-card {
  position: relative;
  gap: 1rem;
}

.haut-fait-card.card-disabled {
  opacity: 0.55;
}

.haut-fait-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-end;
}

.choice-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.25rem 0.85rem;
  cursor: pointer;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.choice-pill input {
  accent-color: var(--accent-2);
}

.availability-tag {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
}

.availability-tag.available {
  border-color: rgba(46, 242, 178, 0.5);
  color: var(--success);
}

.availability-tag.unavailable {
  border-color: rgba(255, 107, 107, 0.4);
  color: var(--danger);
}

.restriction-list {
  list-style: none;
  margin: 0;
  margin-top: 0.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.bonus-panel {
  border: 1px dashed var(--border);
  border-radius: 0.85rem;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.02);
}

.trait-allocation-block {
  border: 1px dashed var(--border);
  border-radius: 0.85rem;
  padding: 1rem;
  background: rgba(5, 9, 19, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.haut-fait-card .form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.haut-fait-card select,
.haut-fait-card input[type='text'] {
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0.4rem 0.6rem;
}

.surname-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.surname-field input {
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
