:root {
  --void: #0a0a0f;
  --panel: #111115;
  --panel-deep: #07070a;
  --text: #e8a020;
  --muted: #8a8a9a;
  --accent: #8b1a1a;
  --copper: #3a2010;
  --button: #17171d;
  --button-hot: #241817;
  --paper: #d8c7a0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--void);
}

body {
  color: var(--text);
  font-family: "Courier New", Courier, monospace;
  font-size: 18px;
  line-height: 1.45;
  letter-spacing: 0;
}

button {
  font: inherit;
}

.app {
  width: 100vw;
  height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(ellipse at center, rgba(120, 40, 20, 0.12), transparent 58%),
    var(--void);
}

.library-shell {
  display: grid;
  align-content: center;
  gap: 22px;
  width: min(1120px, calc(100vw - 28px));
  height: 100svh;
  margin: 0 auto;
  padding: 18px 0;
}

.library-header h1 {
  margin: 0 0 10px;
  color: var(--paper);
  font-size: clamp(32px, 6vw, 68px);
  line-height: 0.95;
  text-transform: uppercase;
}

.library-header p {
  max-width: 780px;
  margin: 0;
  color: #d8c7a0;
}

.creator-shell {
  display: grid;
  align-items: center;
  width: min(980px, calc(100vw - 28px));
  height: 100svh;
  margin: 0 auto;
  padding: 18px 0;
}

.creator-card {
  display: grid;
  gap: 18px;
  max-height: calc(100svh - 36px);
  overflow: auto;
  border: 1px solid var(--copper);
  background:
    linear-gradient(180deg, rgba(139, 26, 26, 0.12), transparent 45%),
    #07070a;
  padding: clamp(18px, 4vw, 42px);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.55);
}

.creator-card h1 {
  margin: 0;
  color: var(--paper);
  font-size: clamp(34px, 5vw, 62px);
  line-height: 0.95;
  text-transform: uppercase;
}

.creator-copy {
  display: grid;
  gap: 14px;
  color: #e6dfcf;
  font-size: clamp(16px, 2vw, 21px);
}

.creator-copy p {
  margin: 0;
}

.creator-actions {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.creator-nav-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
  width: min(100%, 760px);
}

.creator-actions a,
.creator-nav-actions a {
  text-decoration: none;
}

.paypal-donate {
  display: grid;
  align-items: center;
  justify-content: center;
  justify-items: center;
  min-height: 46px;
  width: min(100%, 420px);
  margin: 0 auto;
  border: 0;
  background: transparent;
  padding: 0;
}

.paypal-donate input[type="image"] {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 0;
}

.paypal-donate img {
  justify-self: center;
}

.source-page {
  overflow: auto;
}

.source-shell {
  display: grid;
  gap: 18px;
  width: min(1180px, calc(100vw - 28px));
  min-height: 100svh;
  margin: 0 auto;
  padding: 18px 0 32px;
}

.source-hero,
.source-panel {
  border: 1px solid var(--copper);
  background:
    linear-gradient(180deg, rgba(139, 26, 26, 0.1), transparent 44%),
    #07070a;
  padding: clamp(16px, 3vw, 30px);
}

.source-hero h1,
.source-panel h2 {
  margin: 0;
  color: var(--paper);
  line-height: 1;
  text-transform: uppercase;
}

.source-hero h1 {
  font-size: clamp(38px, 6vw, 76px);
}

.source-panel h2 {
  font-size: clamp(24px, 3vw, 38px);
}

.source-hero p,
.source-panel p {
  max-width: 860px;
  margin: 12px 0 0;
  color: #e6dfcf;
}

.source-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  max-width: 560px;
  margin-top: 18px;
}

.source-actions a,
.source-panel a.action {
  text-decoration: none;
}

.source-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.video-panel {
  grid-row: span 2;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 16px;
  border: 1px solid rgba(232, 160, 32, 0.42);
  background: #000;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.source-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.source-list a {
  color: var(--text);
}

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

.episode-card {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--copper);
  background: #07070a;
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.55);
}

.episode-poster {
  position: relative;
  min-height: 330px;
  background: #000;
}

.episode-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
}

.episode-poster span {
  position: absolute;
  left: 14px;
  bottom: 14px;
  border: 1px solid rgba(232, 160, 32, 0.7);
  background: rgba(0, 0, 0, 0.7);
  color: var(--text);
  padding: 6px 9px;
  font-size: 13px;
  text-transform: uppercase;
}

.episode-body {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: clamp(18px, 3vw, 34px);
}

.episode-body h2 {
  margin: 0;
  color: var(--paper);
  font-size: clamp(28px, 4vw, 50px);
  line-height: 1;
  text-transform: uppercase;
}

.episode-body p {
  margin: 0;
  color: #d8c7a0;
}

.episode-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.episode-progress {
  height: 12px;
  border: 1px solid var(--copper);
  background: #020203;
  overflow: hidden;
}

.episode-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #704018, var(--text), var(--accent));
}

.game-shell {
  position: relative;
  display: grid;
  grid-template-rows: 60fr 40fr;
  width: min(1200px, 100vw);
  height: 100svh;
  margin: 0 auto;
  border-left: 1px solid rgba(58, 32, 16, 0.9);
  border-right: 1px solid rgba(58, 32, 16, 0.9);
  background: #050507;
}

.scene-viewport {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-bottom: 2px solid var(--copper);
  background: #000;
}

.scene-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scene-hud {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: rgba(232, 160, 32, 0.86);
  font-size: 13px;
  text-transform: uppercase;
  text-shadow: 0 2px 0 #000;
}

.interaction-console {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 0;
  padding: clamp(14px, 2vw, 22px);
  background:
    linear-gradient(180deg, rgba(139, 26, 26, 0.12), transparent 42%),
    var(--panel-deep);
  border-top: 1px solid rgba(232, 160, 32, 0.24);
  box-shadow: inset 0 14px 44px rgba(0, 0, 0, 0.72);
}

.console-middle,
.console-bottom {
  min-height: 0;
}

.console-middle {
  overflow: hidden;
}

.console-bottom {
  display: grid;
  gap: 10px;
  align-self: end;
}

.console-header,
.console-footer {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.console-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.interaction-console h1 {
  margin: 0;
  color: var(--paper);
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(232, 160, 32, 0.14);
}

.console-text {
  height: 100%;
  min-height: 0;
  max-height: none;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  color: #e6dfcf;
  font-size: clamp(16px, 1.85vw, 22px);
}

.console-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.board-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  min-height: 0;
  overflow: auto;
  align-content: start;
}

.review-actions {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
}

.review-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: auto;
}

.review-row {
  border-left: 3px solid rgba(232, 160, 32, 0.65);
  background: rgba(255, 255, 255, 0.035);
  padding: 9px 11px;
  color: #d8c7a0;
}

.review-row.wrong {
  border-left-color: var(--accent);
}

.review-row.correct {
  border-left-color: #97c98d;
}

.review-row span {
  color: var(--text);
  font-size: 11px;
  text-transform: uppercase;
}

.review-row strong {
  display: block;
  color: var(--paper);
  font-size: 14px;
}

.review-row p,
.review-row small {
  display: block;
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.25;
}

.action {
  min-height: 46px;
  border: 1px solid rgba(232, 160, 32, 0.78);
  background: var(--button);
  color: var(--text);
  padding: 11px 14px;
  text-align: left;
  cursor: pointer;
}

.action:disabled {
  cursor: not-allowed;
  border-color: rgba(138, 138, 154, 0.35);
  color: rgba(216, 199, 160, 0.42);
  background: #0d0d10;
}

.action:hover,
.action:focus-visible {
  outline: none;
  background: var(--button-hot);
  border-color: #f0c060;
  color: #f0c060;
}

.action.primary {
  background: #20140f;
  text-align: center;
  text-transform: uppercase;
}

.choice-action {
  text-transform: none;
}

.evidence-card {
  display: grid;
  gap: 5px;
  min-height: 104px;
  border: 1px solid rgba(232, 160, 32, 0.46);
  background: rgba(255, 255, 255, 0.035);
  color: #e6dfcf;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.evidence-card span {
  color: var(--text);
  font-size: 11px;
  text-transform: uppercase;
}

.evidence-card strong {
  color: var(--paper);
  font-size: 16px;
  line-height: 1.1;
}

.evidence-card small {
  color: #c8bda8;
  font-size: 13px;
  line-height: 1.25;
}

.evidence-card.active,
.evidence-card:hover,
.evidence-card:focus-visible {
  outline: none;
  border-color: #f0c060;
  background: rgba(232, 160, 32, 0.1);
}

.case-status {
  width: min(240px, 32vw);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  text-align: right;
}

.case-status span,
.case-status strong {
  display: block;
}

.case-status strong {
  margin-top: 3px;
  color: var(--paper);
  font-weight: normal;
}

.evidence-slip {
  border-left: 3px solid var(--accent);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
}

.evidence-slip span {
  display: block;
  color: var(--text);
  font-size: 13px;
  text-transform: uppercase;
}

.evidence-slip p {
  margin: 4px 0 0;
  color: #d6cab8;
  font-size: 15px;
}

.console-footer {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.boot-error {
  padding: 32px;
  color: var(--paper);
}

@media (max-width: 760px) {
  body {
    font-size: 15px;
  }

  .game-shell {
    width: 100vw;
    grid-template-rows: 52fr 48fr;
  }

  .library-shell {
    align-content: start;
    width: min(100%, calc(100vw - 12px));
    padding: 10px 0;
    overflow: auto;
  }

  .episode-card {
    grid-template-columns: 1fr;
  }

  .creator-nav-actions {
    grid-template-columns: 1fr;
    width: 100%;
  }

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

  .episode-poster {
    min-height: 220px;
  }

  .episode-body {
    padding: 14px;
  }

  .scene-hud {
    left: 10px;
    right: 10px;
    top: 8px;
    font-size: 11px;
  }

  .interaction-console {
    gap: 8px;
    padding: 10px;
  }

  .console-header {
    display: grid;
    gap: 8px;
  }

  .case-status {
    width: 100%;
    text-align: left;
  }

  .interaction-console h1 {
    font-size: 22px;
  }

  .console-text {
    font-size: 15px;
  }

  .console-actions {
    grid-template-columns: 1fr;
    gap: 7px;
  }

.board-actions {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .action {
    min-height: 44px;
    padding: 10px 12px;
  }

  .evidence-card {
    min-height: 88px;
    padding: 9px;
  }

  .evidence-card strong {
    font-size: 14px;
  }

  .evidence-card small {
    font-size: 12px;
  }
}

@media (max-width: 420px) {
  .console-footer,
  .scene-hud,
  .episode-meta {
    font-size: 10px;
  }

  .interaction-console h1 {
    font-size: 20px;
  }

  .console-text {
    font-size: 14px;
  }

  .board-actions {
    grid-template-columns: 1fr;
  }
}
