/* ==========================================================================
   screens.css - full-screen DOM overlays: boot, fatal, menus, results
   ========================================================================== */

.screen-root {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

/* Generic screen: a full-bleed flex container that centers a panel. */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  background:
    radial-gradient(1200px 700px at 50% 20%, rgba(56, 189, 248, 0.07), transparent 70%),
    linear-gradient(180deg, rgba(5, 7, 13, 0.92), rgba(5, 7, 13, 0.97));
  backdrop-filter: blur(3px);
  overflow: auto;
  animation: screenIn var(--t-med) both;
}

.screen--hidden {
  display: none !important;
}

/* Screens that sit over live 3D but must not block the canvas. */
.screen--passive {
  pointer-events: none;
  background: none;
  backdrop-filter: none;
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- panels */

.panel {
  width: min(1000px, 94vw);
  background: var(--bg-glass);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 26px 30px 24px;
}

.panel--wide { width: min(1240px, 96vw); }
.panel--narrow { width: min(560px, 92vw); }

.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.panel__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.panel__title small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-top: 4px;
}

.panel__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* --------------------------------------------------------------- buttons */

.btn {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--bg-raise);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 9px 18px;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}

.btn:hover:not(:disabled) {
  background: #1d2b4a;
  border-color: var(--line-glow);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.btn--primary {
  background: linear-gradient(180deg, #0ea5e9, #0369a1);
  border-color: #38bdf8;
  color: #04121f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.28);
}

.btn--primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #38bdf8, #0284c7);
}

.btn--danger {
  background: linear-gradient(180deg, #dc2626, #991b1b);
  border-color: #f87171;
  color: #fff;
}

.btn--ghost {
  background: transparent;
}

.btn--sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* ----------------------------------------------------------------- boot */

.boot {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-void);
  transition: opacity 420ms ease;
}

.boot--hidden {
  opacity: 0;
  pointer-events: none;
}

.boot__inner {
  width: min(520px, 86vw);
  text-align: center;
}

.boot__title {
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: 0.24em;
  color: var(--accent);
  text-shadow: var(--hud-glow);
}

.boot__sub {
  margin-top: 10px;
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.boot__bar {
  margin: 22px 0 10px;
  height: 3px;
  background: var(--bg-panel-2);
  border-radius: 2px;
  overflow: hidden;
}

.boot__bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: var(--hud-glow);
  transition: width 220ms ease;
}

.boot__status {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
}

/* ---------------------------------------------------------------- fatal */

.fatal {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-void);
}

.fatal--hidden { display: none; }

.fatal__panel {
  width: min(640px, 92vw);
  border: 1px solid var(--crit);
  border-radius: var(--r-lg);
  background: var(--bg-panel);
  padding: 28px 32px;
  box-shadow: 0 0 60px rgba(239, 68, 68, 0.18);
}

.fatal__title {
  margin: 0 0 12px;
  font-size: 20px;
  color: var(--crit);
}

.fatal__reason {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--warn);
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  word-break: break-word;
}

.fatal__tips {
  margin: 16px 0 22px;
  padding-left: 20px;
  color: var(--ink-dim);
  font-size: 13px;
}

.fatal__tips li { margin: 6px 0; }

.fatal__tips code {
  font-family: var(--font-mono);
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--accent);
}

/* ------------------------------------------------------------ main menu */

.menu {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 26px;
  align-items: start;
}

@media (max-width: 860px) {
  .menu { grid-template-columns: 1fr; }
}

.menu__brand h1 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 30px;
  letter-spacing: 0.14em;
  color: var(--ink);
  text-shadow: var(--hud-glow);
}

.menu__brand p {
  color: var(--ink-faint);
  font-size: 13px;
  margin: 10px 0 0;
  max-width: 46ch;
}

.menu__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mission-card {
  text-align: left;
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}

.mission-card:hover {
  border-color: var(--line-glow);
  background: var(--bg-raise);
}

.mission-card--active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.28);
}

.mission-card__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.mission-card__name {
  font-weight: 600;
  font-size: 14px;
}

.mission-card__tier {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid currentColor;
}

.mission-card__desc {
  color: var(--ink-dim);
  font-size: 12px;
  margin-top: 6px;
}

.mission-card__goals {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
}

.mission-card__goals b {
  color: var(--accent);
  font-weight: 600;
}

/* -------------------------------------------------------------- results */

.result__grade {
  font-family: var(--font-mono);
  font-size: 40px;
  letter-spacing: 0.1em;
  margin: 4px 0 2px;
}

.result__grade-sub {
  color: var(--ink-dim);
  font-size: 13px;
  margin-bottom: 18px;
}

.result__rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.result-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  font-size: 13px;
}

.result-row__k { color: var(--ink-dim); }

.result-row__v {
  font-family: var(--font-mono);
  font-weight: 600;
}

.result__objectives {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.objective {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  background: var(--bg-panel-2);
  border-left: 3px solid var(--ink-ghost);
}

.objective--done { border-left-color: var(--good); }
.objective--failed { border-left-color: var(--bad); }

.objective__mark {
  font-family: var(--font-mono);
  width: 16px;
  text-align: center;
}

.objective--done .objective__mark { color: var(--good); }
.objective--failed .objective__mark { color: var(--bad); }

.objective__why {
  margin-left: auto;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ---------------------------------------------------------- announcement */

.notice-bar {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  pointer-events: none;
  background: var(--bg-glass);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--warn);
  border-radius: var(--r-md);
  padding: 10px 18px;
  font-size: 13px;
  color: var(--ink);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 260ms ease;
  max-width: 70vw;
}

.notice-bar--show { opacity: 1; }
.notice-bar--good { border-left-color: var(--good); }
.notice-bar--bad { border-left-color: var(--bad); }
