:root {
  --black: #08090a;
  --black-soft: #0f1113;
  --panel: #141619;
  --panel-2: #191c20;
  --cream: #fff2cc;
  --cream-muted: #d9cba9;
  --red: #d8272f;
  --red-bright: #ff3942;
  --red-dark: #7b1015;
  --text: #f5efe1;
  --muted: #99958d;
  --line: rgba(255, 242, 204, 0.13);
  --line-strong: rgba(255, 242, 204, 0.28);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 78% 7%, rgba(216, 39, 47, 0.12), transparent 24rem),
    linear-gradient(180deg, #090a0b 0%, #0c0d0f 55%, #070809 100%);
  color: var(--text);
  font-family: "Inter", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-shell {
  width: min(1500px, 100%);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 86px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  padding: 12px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 10, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand img {
  width: 88px;
  height: 72px;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 4px;
}

.brand-copy strong,
.footer-brand strong {
  font-family: "Archivo Black", sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.eyebrow,
.section-kicker,
.card-heading,
.class-label,
.status-dot,
.level-chip,
.availability,
.corner-label,
.payload-preview span,
.target-display span,
.risk-readout span,
.heist-metrics span {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.eyebrow {
  color: var(--red-bright);
  font-size: 0.67rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #c9c5bd;
}

.nav a {
  position: relative;
  padding: 12px 0;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 5px;
  height: 2px;
  background: var(--red-bright);
  transition: right 180ms ease;
}

.nav a:hover::after {
  right: 0;
}

.ghost-button,
.primary-button,
.secondary-button,
.hire-button {
  border: 0;
  cursor: pointer;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.topbar-auth {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.auth-session {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.auth-session[hidden],
#operative-login[hidden],
#operative-signup[hidden] {
  display: none;
}

.auth-callsign {
  max-width: 180px;
  overflow: hidden;
  color: var(--cream);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.ghost-button {
  padding: 12px 17px;
  color: var(--cream);
  border: 1px solid var(--line-strong);
  background: transparent;
}

.ghost-button:hover,
.secondary-button:hover {
  border-color: var(--cream);
  transform: translateY(-1px);
}

.hero {
  min-height: 760px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(460px, 0.95fr);
  align-items: center;
  gap: 40px;
  padding: 80px clamp(24px, 6vw, 96px) 96px;
  overflow: hidden;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.section-kicker {
  display: inline-flex;
  color: var(--red-bright);
  font-size: 0.75rem;
  font-weight: 600;
}

.hero h1,
.section-heading h2,
.simulation-copy h2 {
  margin: 16px 0 0;
  font-family: "Archivo Black", sans-serif;
  text-transform: uppercase;
  line-height: 0.98;
}

.hero h1 {
  max-width: 780px;
  font-size: clamp(3.6rem, 7vw, 7rem);
  letter-spacing: -0.055em;
}

.hero h1 span {
  color: var(--cream);
  -webkit-text-stroke: 1px var(--cream);
  text-shadow: 5px 5px 0 var(--red-dark);
}

.hero-copy > p {
  max-width: 650px;
  margin: 28px 0 0;
  color: #aaa69e;
  font-size: 1.08rem;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-top: 34px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
}

.primary-button {
  color: #100b08;
  background: var(--cream);
  box-shadow: inset -5px -5px 0 rgba(216, 39, 47, 0.18);
}

.primary-button:hover {
  transform: translateY(-2px);
  background: #fff8df;
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.secondary-button {
  color: var(--cream);
  border: 1px solid var(--line-strong);
  background: transparent;
}

.text-link {
  color: var(--cream-muted);
  font-weight: 700;
}

.text-link span {
  color: var(--red-bright);
}

.hero-stats {
  display: flex;
  gap: 38px;
  margin-top: 58px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.hero-stats div {
  display: grid;
  gap: 6px;
}

.hero-stats strong {
  font-family: "Archivo Black", sans-serif;
  color: var(--cream);
  font-size: 1.55rem;
}

.hero-stats span {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-mark {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 580px;
}

.hero-mark img {
  position: relative;
  z-index: 2;
  width: min(100%, 620px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 30px 36px rgba(0, 0, 0, 0.48));
}

.logo-halo {
  position: absolute;
  width: 540px;
  height: 540px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216,39,47,0.22), rgba(216,39,47,0.04) 52%, transparent 70%);
  filter: blur(2px);
}

.classified-stamp {
  position: absolute;
  z-index: 3;
  right: 2%;
  bottom: 12%;
  padding: 9px 13px;
  color: var(--red-bright);
  border: 2px solid var(--red-bright);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  transform: rotate(-5deg);
  background: rgba(8, 9, 10, 0.78);
}

.panel-section,
.heist-section,
.simulation-section {
  padding: 90px clamp(24px, 6vw, 96px);
  border-top: 1px solid var(--line);
}

.panel-section:nth-of-type(even) {
  background: rgba(255,255,255,0.012);
}

.section-heading {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: end;
  margin-bottom: 42px;
}

.section-heading h2,
.simulation-copy h2 {
  font-size: clamp(2.4rem, 4vw, 4.6rem);
  letter-spacing: -0.04em;
}

.section-heading > p,
.simulation-copy > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.terminal-card,
.operative-card,
.heist-control,
.unity-placeholder {
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(24, 27, 31, 0.95), rgba(13, 15, 17, 0.98));
  box-shadow: var(--shadow);
}

.character-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.45fr);
  gap: 28px;
}

.character-form,
.network-panel,
.crew-panel,
.heist-control {
  border-radius: var(--radius);
}

.character-form {
  padding: 28px;
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  color: var(--cream-muted);
  font-size: 0.75rem;
}

.status-dot,
.availability {
  color: #8bcf91;
  font-size: 0.68rem;
}

.status-dot::before,
.availability::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field,
.search-field {
  display: grid;
  gap: 9px;
}

.field span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.field input,
.field select,
.network-toolbar input,
.network-toolbar select {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--line);
  outline: none;
  background: #0d0f11;
}

.field input,
.field select {
  min-height: 48px;
  padding: 0 14px;
}

.field input:focus,
.field select:focus,
.network-toolbar input:focus,
.network-toolbar select:focus {
  border-color: var(--red-bright);
}

.stat-builder {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.subheading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 15px;
}

.subheading-row h3 {
  margin: 0;
  font-size: 0.95rem;
}

.subheading-row span {
  color: var(--red-bright);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
}

.stat-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 34px 42px;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.stat-mod {
  min-height: 1em;
  color: #d4b45a;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  text-align: right;
}

.stat-mod.is-down {
  color: var(--red-bright);
}

.background-effect {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  line-height: 1.45;
}

.preview-background {
  margin: 0 0 12px;
  color: #cfc6a8;
  font-size: 0.82rem;
}

.stat-row > div {
  display: flex;
  align-items: baseline;
  gap: 11px;
}

.stat-row strong {
  color: var(--cream);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
}

.stat-row span {
  color: var(--muted);
  font-size: 0.78rem;
}

input[type="range"] {
  accent-color: var(--red-bright);
}

.stat-row output {
  color: var(--cream);
  font-family: "Archivo Black", sans-serif;
  font-size: 1rem;
  text-align: right;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.preview-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-radius: var(--radius);
}

.preview-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle at top right, rgba(216,39,47,0.24), transparent 65%);
}

.operative-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.level-chip {
  padding: 7px 9px;
  color: #100d08;
  background: var(--cream);
  font-size: 0.68rem;
  font-weight: 700;
}

.portrait-placeholder {
  width: 150px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 34px auto 28px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 32%, #272b30 0 18%, transparent 19%),
    radial-gradient(circle at 50% 84%, #20242a 0 38%, transparent 39%),
    #0d0f11;
}

.portrait-placeholder span {
  opacity: 0;
}

.class-label {
  color: var(--red-bright);
  font-size: 0.68rem;
  font-weight: 700;
}

.preview-card h3,
.recruit-card h3 {
  margin: 7px 0;
  font-family: "Archivo Black", sans-serif;
  text-transform: uppercase;
}

.preview-card h3 {
  font-size: 1.8rem;
}

.preview-card > p {
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.88rem;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 22px;
}

.mini-stats div {
  padding: 12px;
  text-align: center;
  border: 1px solid var(--line);
  background: #0d0f11;
}

.mini-stats span,
.career-line span {
  display: block;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.mini-stats strong {
  display: block;
  margin-top: 3px;
  color: var(--cream);
}

.career-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.crew-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
}

.network-panel,
.crew-panel {
  padding: 22px;
}

.network-toolbar {
  display: grid;
  grid-template-columns: 1fr 180px 170px;
  gap: 12px;
  margin-bottom: 18px;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field span {
  position: absolute;
  left: 14px;
  color: var(--red-bright);
}

.network-toolbar input,
.network-toolbar select {
  min-height: 44px;
  padding: 0 12px;
}

.search-field input {
  padding-left: 38px;
}

.operative-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.recruit-card {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 120px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #0f1113;
  transition: border-color 160ms ease, transform 160ms ease;
}

.recruit-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.recruit-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: var(--cream);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: "Archivo Black", sans-serif;
  background: #171a1d;
}

.recruit-card h3 {
  font-size: 1.02rem;
}

.recruit-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.hire-button {
  min-width: 64px;
  min-height: 34px;
  color: var(--cream);
  border: 1px solid var(--red-dark);
  background: rgba(216,39,47,0.08);
  font-size: 0.68rem;
}

.hire-button:hover {
  color: white;
  border-color: var(--red-bright);
  background: rgba(216,39,47,0.18);
}

.hire-button[disabled] {
  cursor: default;
  opacity: 0.45;
}

.crew-panel {
  align-self: start;
}

.crew-slots {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.crew-empty,
.crew-member {
  min-height: 67px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
}

.crew-empty > span,
.crew-member > span:first-child {
  color: #5f5d58;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
}

.crew-empty p {
  margin: 0;
  color: #5f5d58;
  font-size: 0.8rem;
}

.crew-member {
  border-style: solid;
  background: #0d0f11;
}

.crew-member strong {
  display: block;
  font-size: 0.86rem;
}

.crew-member small {
  color: var(--red-bright);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
}

.remove-member {
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
}

.crew-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.heist-section {
  background:
    linear-gradient(180deg, rgba(123,16,21,0.09), transparent 38%),
    #0b0c0e;
}

.centered-heading {
  grid-template-columns: 1fr;
  max-width: 850px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.centered-heading p {
  max-width: 620px;
  margin: 0 auto;
}

.heist-control {
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(26px, 5vw, 54px);
}

.target-display {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.target-display span,
.risk-readout span {
  color: var(--muted);
  font-size: 0.7rem;
}

.target-display strong {
  color: var(--cream);
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(2.7rem, 7vw, 5.8rem);
  letter-spacing: -0.045em;
}

.difficulty-slider-wrap {
  margin: 36px auto 0;
}

#difficulty-slider {
  width: 100%;
  height: 8px;
  appearance: none;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(90deg, #403d37 0%, var(--red) 66%, #742026 100%);
}

#difficulty-slider::-webkit-slider-thumb {
  appearance: none;
  width: 30px;
  height: 30px;
  border: 5px solid var(--cream);
  border-radius: 50%;
  background: var(--red-bright);
  box-shadow: 0 0 0 5px rgba(216,39,47,0.16);
  cursor: grab;
}

#difficulty-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 5px solid var(--cream);
  border-radius: 50%;
  background: var(--red-bright);
  cursor: grab;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
}

.risk-readout {
  display: grid;
  justify-items: center;
  margin-top: 36px;
  text-align: center;
}

.risk-readout strong {
  margin-top: 7px;
  color: var(--red-bright);
  font-family: "Archivo Black", sans-serif;
  font-size: 1.6rem;
}

.risk-readout p {
  max-width: 560px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.heist-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 34px;
  border: 1px solid var(--line);
  background: var(--line);
}

.heist-metrics div {
  display: grid;
  gap: 5px;
  padding: 18px;
  text-align: center;
  background: #0e1012;
}

.heist-metrics span {
  color: var(--muted);
  font-size: 0.62rem;
}

.heist-metrics strong {
  color: var(--cream);
  font-size: 1rem;
}

.simulation-section {
  padding-bottom: 110px;
}

.simulation-shell {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 48px;
  align-items: center;
}

.simulation-copy > p {
  margin-top: 24px;
}

.payload-preview {
  margin-top: 26px;
  padding: 14px;
  border-left: 3px solid var(--red);
  background: #0f1113;
}

.payload-preview span {
  display: block;
  color: var(--red-bright);
  font-size: 0.62rem;
}

.payload-preview code {
  display: block;
  margin-top: 8px;
  color: var(--cream-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  white-space: normal;
  word-break: break-word;
}

.launch-button {
  margin-top: 24px;
}

.join-code-line {
  margin: 14px 0 0;
  color: var(--cream);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
}

.join-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.join-row input,
.join-row select {
  min-width: 120px;
  padding: 8px 10px;
  color: var(--text);
  background: var(--black-soft);
  border: 1px solid var(--line);
}

.launch-status {
  margin: 16px 0 0;
  color: var(--cream-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
}

.launch-status.is-error {
  color: var(--red-bright);
}

.heist-results {
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.result-banner {
  font-family: "Archivo Black", sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
}

.result-banner.is-success {
  color: #b7e0b4;
}

.result-banner.is-fail {
  color: var(--red-bright);
}

.heist-results p {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.heist-results ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.heist-results li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
}

.heist-results li span {
  color: var(--cream-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
}

#unity-canvas {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 500px;
  background: #08090a;
}

#unity-canvas:not([hidden]) {
  display: block;
}

.heist-playback {
  position: relative;
  z-index: 2;
  min-height: 500px;
  padding: 28px 24px;
  overflow: auto;
}

.playback-log h4 {
  margin: 18px 0 8px;
  color: var(--cream);
  font-size: 0.9rem;
}

.playback-log p {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.5;
}

.playback-log p.ok {
  color: #b7e0b4;
}

.playback-log p.fail {
  color: var(--red-bright);
}

.unity-placeholder {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  border-radius: var(--radius);
}

.unity-grid {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(255,242,204,0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,242,204,0.12) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.unity-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.unity-center[hidden],
.heist-playback[hidden],
.unity-loading[hidden],
#unity-canvas[hidden] {
  display: none !important;
}

.unity-loading {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  background: rgba(8, 9, 10, 0.88);
  color: var(--cream);
  font-family: "IBM Plex Mono", monospace;
}

.unity-progress-track {
  width: min(70%, 280px);
  height: 10px;
  border: 1px solid var(--cream);
}

#unity-progress-bar {
  width: 0;
  height: 100%;
  background: var(--cream);
}

.unity-icon {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  color: var(--red-bright);
  border: 2px solid var(--red-bright);
  border-radius: 50%;
  font-family: "Archivo Black", sans-serif;
  font-size: 2rem;
}

.unity-center strong {
  margin-top: 16px;
  font-family: "Archivo Black", sans-serif;
  font-size: 1.4rem;
  text-transform: uppercase;
}

.unity-center p {
  margin: 8px 0 0;
  color: var(--muted);
}

.corner-label {
  position: absolute;
  color: var(--muted);
  font-size: 0.6rem;
}

.top-left {
  top: 18px;
  left: 18px;
}

.bottom-right {
  right: 18px;
  bottom: 18px;
}

.unity-fullscreen {
  position: absolute;
  z-index: 6;
  top: 14px;
  right: 14px;
  padding: 8px 12px;
  color: var(--cream);
  background: rgba(8, 9, 10, 0.82);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.unity-fullscreen:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.unity-placeholder:fullscreen,
.unity-placeholder:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  background: #08090a;
}

.unity-placeholder:fullscreen #unity-canvas,
.unity-placeholder:-webkit-full-screen #unity-canvas {
  width: 100%;
  height: 100%;
}

.login-screen {
  width: min(460px, calc(100vw - 32px));
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.login-screen::backdrop {
  background: rgba(8, 9, 10, 0.82);
  backdrop-filter: blur(8px);
}

.login-card {
  padding: 28px;
  border-radius: var(--radius);
}

.login-card h2 {
  margin: 22px 0 0;
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.login-card > p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.login-card .field {
  margin-top: 18px;
}

.login-close {
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--cream);
  border: 1px solid var(--line);
  background: transparent;
  font-family: "Inter", sans-serif;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
  cursor: pointer;
}

.login-close:hover {
  border-color: var(--cream);
}

.login-status {
  min-height: 1.3em;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.login-status.is-error {
  color: var(--red-bright);
}

.auth-switch {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.auth-switch button {
  padding: 0;
  color: var(--cream);
  border: 0;
  background: none;
  font-weight: 700;
  cursor: pointer;
}

.auth-switch button:hover {
  color: var(--red-bright);
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 28px clamp(24px, 6vw, 96px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand img {
  width: 72px;
  height: 60px;
  object-fit: contain;
}

.footer-brand div {
  display: grid;
  gap: 2px;
}

.footer-brand span {
  font-size: 0.65rem;
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 70px;
  }

  .hero-mark {
    min-height: 430px;
  }

  .hero-mark img {
    width: min(82vw, 600px);
  }

  .character-layout,
  .crew-layout,
  .simulation-shell {
    grid-template-columns: 1fr;
  }

  .preview-card,
  .crew-panel {
    max-width: none;
  }

  .crew-panel {
    order: -1;
  }
}

@media (max-width: 780px) {
  .topbar {
    min-height: 72px;
    padding: 9px 18px;
  }

  .brand img {
    width: 68px;
    height: 56px;
  }

  .brand-copy strong {
    font-size: 0.8rem;
  }

  .topbar-auth {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .ghost-button {
    padding: 10px 12px;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
  }

  .auth-callsign {
    max-width: 90px;
  }

  .hero,
  .panel-section,
  .heist-section,
  .simulation-section {
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero {
    min-height: auto;
    padding-top: 60px;
  }

  .hero h1 {
    font-size: clamp(3.2rem, 15vw, 5rem);
  }

  .hero-actions,
  .hero-stats,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-stats {
    gap: 18px;
  }

  .hero-mark {
    min-height: 340px;
  }

  .logo-halo {
    width: 340px;
    height: 340px;
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .field-grid,
  .operative-grid {
    grid-template-columns: 1fr;
  }

  .stat-row {
    grid-template-columns: 95px minmax(0, 1fr) 28px 28px;
    gap: 10px;
  }

  .stat-row span {
    display: none;
  }

  .network-toolbar {
    grid-template-columns: 1fr;
  }

  .recruit-card {
    grid-template-columns: 48px 1fr;
  }

  .hire-button {
    grid-column: 1 / -1;
  }

  .heist-metrics {
    grid-template-columns: 1fr;
  }

  .unity-placeholder {
    min-height: 360px;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
