:root {
  --bg: #050b11;
  --bg-soft: #0f1a25;
  --panel: rgba(7, 14, 24, 0.84);
  --panel-border: rgba(174, 220, 255, 0.16);
  --text: #ecf7ff;
  --muted: #8fa7ba;
  --accent: #8ee3ff;
  --danger: #ff6d8d;
  --warning: #ffd88a;
  --grid: rgba(158, 240, 255, 0.045);
  --shadow: 0 16px 44px rgba(0, 0, 0, 0.34);
  --display-font: "Oxanium", "Space Grotesk", sans-serif;
  --body-font: "Space Grotesk", sans-serif;
  --mono-font: "IBM Plex Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--body-font);
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(92, 178, 255, 0.12), transparent 28%),
    radial-gradient(circle at 85% 8%, rgba(255, 88, 114, 0.1), transparent 24%),
    linear-gradient(160deg, #060d14 0%, #04070c 40%, #071018 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.35;
}

.shell {
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr) minmax(210px, 250px);
  gap: 12px;
  width: min(100%, 1920px);
  margin: 0 auto;
  padding: 10px;
}

.hud-panel,
.game-panel,
.side-panel {
  position: relative;
  z-index: 1;
}

.hud-panel {
  grid-column: 1;
}

.game-panel {
  grid-column: 2;
}

.side-panel {
  grid-column: 3;
}

.hud-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.hud-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), transparent 22%),
    radial-gradient(circle at top right, rgba(142, 227, 255, 0.08), transparent 30%);
}

.hud-panel::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  pointer-events: none;
}

.hero-cluster {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-badge,
.frame-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(11, 20, 31, 0.78);
  color: #ddecf8;
  font-family: var(--mono-font);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-badge--accent,
.frame-pill {
  border-color: rgba(158, 240, 255, 0.26);
  background: linear-gradient(180deg, rgba(16, 32, 46, 0.9), rgba(8, 18, 28, 0.84));
  color: #f2faff;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.feature-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(167, 229, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(18, 30, 46, 0.8), rgba(10, 18, 28, 0.76));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.feature-card--wide {
  grid-column: 1 / -1;
}

.feature-card strong {
  display: block;
  font-family: var(--display-font);
  font-size: 1.12rem;
  color: #f3f9ff;
  letter-spacing: 0.02em;
}

.feature-card span {
  display: block;
  margin-top: 3px;
  color: #e6f2fb;
  font-size: 0.96rem;
  font-weight: 600;
}

.feature-card p {
  margin: 8px 0 0;
  color: #b6cad8;
  line-height: 1.45;
  font-size: 0.92rem;
}

.eyebrow,
.status-label,
.instructions p {
  margin: 0;
  font-family: var(--mono-font);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-size: 0.68rem;
}

h1 {
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(1.3rem, 2.4vw, 2.15rem);
  line-height: 0.9;
  max-width: 8ch;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.pitch,
.notes p,
.instructions li {
  margin: 0;
  color: #d8e6ef;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.pitch {
  max-width: 24ch;
  font-size: 0.94rem;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.status-card,
.instructions,
.inventory,
.status-feed {
  border: 1px solid rgba(167, 229, 255, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(18, 30, 46, 0.76), rgba(10, 18, 28, 0.78));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.status-card {
  padding: 8px 10px;
  min-width: 0;
}

.status-card strong {
  display: block;
  margin-top: 6px;
  font-family: var(--display-font);
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.instructions,
.inventory,
.status-feed {
  padding: 10px;
  min-width: 0;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
}

.instructions,
.inventory {
  height: 100%;
}

.info-sidebar {
  display: grid;
  gap: 8px;
  align-content: start;
  position: sticky;
  top: 10px;
}

.instructions ul {
  padding-left: 18px;
  margin: 8px 0 0;
  max-height: 180px;
  overflow: auto;
  scrollbar-width: thin;
}

.inventory p {
  margin: 0;
  font-family: var(--mono-font);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-size: 0.68rem;
}

.inventory ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #d8e6ef;
  min-width: 0;
  max-height: 180px;
  overflow: auto;
  scrollbar-width: thin;
}

.inventory li + li {
  margin-top: 6px;
}

.inventory-heading {
  list-style: none;
  margin-left: -18px;
}

.inventory li strong,
.inventory-title {
  display: block;
  margin-bottom: 3px;
  color: #fff1b8;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.inventory-title--clear {
  color: #9ff3c8;
}

.inventory-copy {
  display: block;
  color: #d8e6ef;
  line-height: 1.35;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.status-feed p {
  margin: 0;
  font-family: var(--mono-font);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-size: 0.68rem;
}

.status-feed strong {
  display: block;
  margin-top: 6px;
  color: #fff1b8;
  font-family: var(--display-font);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.status-feed span {
  display: block;
  margin-top: 2px;
  color: #d8e6ef;
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

kbd {
  font-family: var(--mono-font);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,0.25);
}

.game-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.frame-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 16, 25, 0.66);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.frame-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.frame-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.frame-caption p {
  margin: 0;
  color: #cddce7;
  line-height: 1.3;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.frame-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 7px 11px;
  font-family: var(--mono-font);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.frame-action.is-muted {
  border-color: rgba(255, 109, 141, 0.32);
  background: linear-gradient(180deg, rgba(60, 22, 34, 0.92), rgba(22, 11, 18, 0.92));
  color: #ffd8e1;
}

.screen-frame {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  background:
    radial-gradient(circle at top, rgba(124, 215, 255, 0.05), transparent 30%),
    linear-gradient(180deg, #081018 0%, #020406 100%);
  min-height: min(79vh, 920px);
}

.screen-frame:fullscreen {
  border-radius: 0;
  border: none;
  min-height: 100vh;
}

.screen-frame:fullscreen canvas {
  min-height: 100vh;
  height: 100vh;
}

.screen-frame::before {
  content: "RUNTIME FEED // SUBJECT 42";
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 3;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(8, 16, 24, 0.78);
  border: 1px solid rgba(255,255,255,0.09);
  color: rgba(236, 247, 255, 0.72);
  font-family: var(--mono-font);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
}

.screen-frame::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  pointer-events: none;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: min(79vh, 920px);
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at top, rgba(148, 220, 255, 0.07), transparent 40%),
    linear-gradient(180deg, #122232 0%, #0c1722 55%, #071018 100%);
}

.screen-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.screen-overlay--scanlines {
  background: linear-gradient(
    transparent 0%,
    rgba(255, 255, 255, 0.02) 50%,
    transparent 100%
  );
  background-size: 100% 4px;
  mix-blend-mode: screen;
  opacity: 0.5;
}

.screen-overlay--flash {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.42), transparent 55%);
  opacity: 0;
  transition: opacity 140ms ease-out;
}

.screen-overlay--flash.active {
  opacity: 1;
}

.start-overlay {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at center, rgba(10, 24, 37, 0.38), rgba(4, 8, 12, 0.92)),
    linear-gradient(180deg, rgba(14, 29, 44, 0.2), rgba(3, 6, 10, 0.76));
  opacity: 1;
  transition:
    opacity 220ms ease,
    visibility 220ms ease;
}

.start-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.start-card {
  width: min(100%, 520px);
  padding: 22px 22px 20px;
  border: 1px solid rgba(158, 240, 255, 0.18);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(8, 18, 28, 0.86), rgba(4, 10, 16, 0.8));
  backdrop-filter: blur(10px);
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.start-day,
.start-prompt {
  margin: 0;
  font-family: var(--mono-font);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.start-day {
  color: var(--accent);
  font-size: 0.74rem;
}

.start-card h2 {
  margin: 14px 0 10px;
  font-family: var(--display-font);
  font-size: clamp(1.45rem, 3.4vw, 2.4rem);
  line-height: 0.95;
  overflow-wrap: anywhere;
}

.start-copy {
  margin: 0;
  color: #d7e7ef;
  line-height: 1.45;
  font-size: 0.92rem;
}

.start-prompt {
  margin-top: 20px;
  color: #fff1b8;
  font-size: 0.76rem;
  animation: blinkPrompt 1.2s step-end infinite;
}

@keyframes blinkPrompt {
  0%,
  45% {
    opacity: 1;
  }

  46%,
  100% {
    opacity: 0.28;
  }
}

button {
  appearance: none;
  border: 1px solid rgba(158, 240, 255, 0.24);
  border-radius: 999px;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(26, 46, 63, 0.95), rgba(12, 23, 34, 0.95));
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(158, 240, 255, 0.54);
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 10px;
  }

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

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

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

  .feature-card--wide {
    grid-column: auto;
  }

  .frame-caption {
    flex-direction: column;
    align-items: flex-start;
  }

  .frame-copy {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  .frame-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .frame-caption p {
    white-space: normal;
  }

  .hud-panel {
    grid-column: auto;
    order: 2;
  }

  .game-panel {
    grid-column: auto;
  }

  .side-panel {
    grid-column: auto;
    order: 3;
  }

  .info-sidebar {
    position: static;
  }

  .screen-frame,
  canvas {
    min-height: auto;
    height: auto;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 8px;
  }

  .hud-panel,
  .instructions,
  .inventory,
  .status-feed {
    border-radius: 18px;
  }

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

  .frame-caption {
    padding: 10px;
  }

  .frame-action {
    flex: 1 1 140px;
    justify-content: center;
  }

  .screen-frame::before {
    top: 10px;
    right: 10px;
    font-size: 0.54rem;
    letter-spacing: 0.12em;
  }

  .instructions ul,
  .inventory ul {
    max-height: 140px;
  }
}

@media (max-width: 560px) {
  h1 {
    max-width: none;
  }

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

  .frame-actions {
    gap: 6px;
  }

  .frame-action {
    flex-basis: 100%;
  }

  .frame-pill,
  .hero-badge {
    font-size: 0.6rem;
    letter-spacing: 0.1em;
  }

  .screen-frame::before {
    left: 10px;
    right: auto;
  }

  .start-card {
    padding: 18px 16px;
  }
}
