/* ==========================================================================
   DETECTIVE OS — terminal forense noir
   Ardósia escura, âmbar envelhecido como destaque, carmesim só para alertas.
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg: #0d1114;
  --bg-2: #12181c;
  --surface: #172026;
  --surface-2: #1d272e;
  --surface-3: #25313a;
  --line: #2c3a43;
  --line-strong: #435460;
  --text: #e1e4e1;
  --text-dim: #a8b2b5;
  --text-faint: #8695a0;

  --amber: #d6a44e;
  --amber-bright: #edc479;
  --amber-dim: #a17a36;
  --amber-ink: #1f1608;
  --amber-glow: rgba(214, 164, 78, 0.16);
  --amber-glow-strong: rgba(214, 164, 78, 0.3);

  --crimson: #b8303f;
  --crimson-bright: #ec6274;
  --crimson-bg: rgba(184, 48, 63, 0.14);

  --paper: #e4d9bf;
  --paper-2: #d4c49e;
  --paper-edge: #b9a678;
  --ink: #2a2318;
  --ink-dim: #574b38;
  --stamp: #7f4f1d;

  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 4px;
  --radius-lg: 8px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.35);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --hud-h: 60px;
  --tabs-h: 52px;
  --nav-h: 64px;
  --gutter: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -10%, #1b252b 0%, transparent 60%),
    radial-gradient(ellipse 80% 60% at 100% 100%, #141b20 0%, transparent 70%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: 0.01em;
}

p {
  margin: 0 0 0.9em;
}

a {
  color: var(--amber-bright);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--amber-bright);
  outline-offset: 2px;
}

::selection {
  background: var(--amber);
  color: var(--amber-ink);
}

[hidden] {
  display: none !important;
}

[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible {
  outline: none;
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 2000;
  padding: 10px 14px;
  background: var(--amber);
  color: var(--amber-ink);
  font-family: var(--font-mono);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--sm {
  width: 16px;
  height: 16px;
}

.icon--lg {
  width: 28px;
  height: 28px;
}

.noscript {
  margin: 40px auto;
  max-width: 480px;
  padding: 16px;
  border: 1px solid var(--crimson);
  font-family: var(--font-mono);
}

/* ---------- Efeitos de tela ---------- */

.fx-scanlines,
.fx-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 900;
}

.fx-scanlines {
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px);
  opacity: 0.55;
  animation: flicker 7s infinite;
}

.fx-vignette {
  background: radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, 0.55) 100%);
}

@keyframes flicker {
  0%,
  100% {
    opacity: 0.55;
  }
  48% {
    opacity: 0.55;
  }
  50% {
    opacity: 0.42;
  }
  52% {
    opacity: 0.58;
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes stamp-in {
  0% {
    opacity: 0;
    transform: rotate(-8deg) scale(1.8);
  }
  60% {
    opacity: 0.9;
    transform: rotate(-8deg) scale(0.95);
  }
  100% {
    opacity: 0.85;
    transform: rotate(-8deg) scale(1);
  }
}

@keyframes pulse-amber {
  0% {
    box-shadow: 0 0 0 0 var(--amber-glow-strong);
  }
  100% {
    box-shadow: 0 0 0 12px transparent;
  }
}

/* ---------- Botões ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.2;
  transition:
    border-color 0.15s,
    background-color 0.15s,
    color 0.15s,
    transform 0.1s;
}

.btn:hover:not(:disabled) {
  border-color: var(--amber);
  color: var(--amber-bright);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--amber-ink);
}

.btn--primary:hover:not(:disabled) {
  background: var(--amber-bright);
  border-color: var(--amber-bright);
  color: var(--amber-ink);
}

.btn--danger {
  border-color: var(--crimson);
  color: var(--crimson-bright);
  background: transparent;
}

.btn--danger:hover:not(:disabled) {
  background: var(--crimson-bg);
  border-color: var(--crimson-bright);
  color: var(--crimson-bright);
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
}

.btn--block {
  width: 100%;
}

.btn--sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.74rem;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-dim);
  transition:
    color 0.15s,
    border-color 0.15s,
    background 0.15s;
}

.icon-btn:hover {
  color: var(--amber-bright);
  border-color: var(--line-strong);
}

.icon-btn[aria-pressed="true"] {
  color: var(--amber-bright);
  background: var(--amber-glow);
}

.icon-btn--debug {
  color: var(--crimson-bright);
}

/* ---------- Superfícies ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--gutter);
}

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
}

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

.mono {
  font-family: var(--font-mono);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}

.tag--amber {
  border-color: var(--amber-dim);
  color: var(--amber-bright);
}

.tag--alert {
  border-color: var(--crimson);
  color: var(--crimson-bright);
}

.cost {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--amber-bright);
  white-space: nowrap;
}

.cost small {
  font-size: 0.68em;
  letter-spacing: 0.08em;
  color: var(--amber-dim);
}

/* Papel de dossiê */
.paper {
  position: relative;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 18%, rgba(120, 90, 40, 0.1) 0 6%, transparent 22%),
    radial-gradient(circle at 88% 82%, rgba(120, 90, 40, 0.12) 0 4%, transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.05)),
    repeating-linear-gradient(0deg, rgba(90, 70, 40, 0.035) 0 1px, transparent 1px 26px);
  border: 1px solid var(--paper-edge);
  border-radius: 2px;
  box-shadow:
    inset 0 0 40px rgba(110, 80, 30, 0.18),
    var(--shadow-soft);
}

.paper a {
  color: var(--stamp);
}

.stamp {
  display: inline-block;
  padding: 3px 10px;
  border: 3px double currentColor;
  border-radius: 3px;
  color: var(--stamp);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.85;
  transform: rotate(-8deg);
  pointer-events: none;
  user-select: none;
}

.stamp--corner {
  position: absolute;
  top: 14px;
  right: 14px;
}

.stamp--animate {
  animation: stamp-in 0.45s var(--ease) both;
}

/* ---------- Layout geral ---------- */

.app {
  min-height: 100vh;
  min-height: 100dvh;
}

.screen {
  animation: rise 0.35s var(--ease) both;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Tela inicial ---------- */

.home {
  padding: 40px 0 64px;
}

.brand {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.brand__logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand__mark {
  width: clamp(38px, 10vw, 52px);
  height: clamp(38px, 10vw, 52px);
  color: var(--amber);
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.55rem, 7.6vw, 3.4rem);
  letter-spacing: 0.08em;
  color: var(--text);
}

.brand h1 span {
  color: var(--amber);
}

.brand__sub {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.boot {
  margin: 0 0 28px;
  padding: 14px 16px;
  min-height: 7.6em;
  background: #080b0d;
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber-dim);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--amber);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.home__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.continue-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
  padding: 14px 16px;
  border: 1px solid var(--amber-dim);
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--amber-glow), transparent);
}

.continue-card p {
  margin: 0;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 28px 20px;
}

.case-card {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-top: 22px;
  padding: 22px 18px 18px;
}

.case-card__tab {
  position: absolute;
  top: -24px;
  left: -1px;
  height: 24px;
  padding: 3px 14px 0;
  background: var(--paper-2);
  border: 1px solid var(--paper-edge);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
}

.case-card h3 {
  margin: 10px 0 4px;
  font-size: 1.45rem;
}

.case-card .stamp--corner {
  top: 10px;
  right: 12px;
  font-size: 0.64rem;
  padding: 2px 8px;
}

.case-card__place {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-dim);
  margin-bottom: 12px;
}

.case-card__teaser {
  flex: 1;
  font-family: var(--font-serif);
  font-size: 1.02rem;
}

.case-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 4px 0 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(42, 35, 24, 0.35);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-dim);
}

.case-card__meta strong {
  color: var(--ink);
}

.case-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-card .btn {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(42, 35, 24, 0.45);
  color: var(--ink);
}

.case-card .btn:hover:not(:disabled) {
  border-color: var(--ink);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
}

.case-card .btn--primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.case-card .btn--primary:hover:not(:disabled) {
  background: #3d3323;
  color: #fff7e2;
}

.difficulty {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.difficulty__bars {
  display: inline-flex;
  gap: 2px;
}

.difficulty__bars i {
  width: 6px;
  height: 12px;
  border: 1px solid currentColor;
}

.difficulty__bars i.on {
  background: currentColor;
}

.home-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--text-dim);
}

.home-summary p {
  margin: 0;
}

.home-summary strong {
  color: var(--amber-bright);
}

.home-summary__bar {
  flex: 1 1 160px;
  max-width: 320px;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
}

.home-summary__bar span {
  display: block;
  height: 100%;
  background: var(--amber);
}

.home-filters {
  display: grid;
  gap: 10px;
  margin-bottom: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.filter-group__label {
  min-width: 92px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
}

.filter-group__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.theme-section {
  margin-top: 34px;
}

.theme-section__head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin-bottom: 4px;
  padding-right: 52px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.theme-section__head h2 {
  margin: 0;
  font-size: 1.6rem;
}

.theme-section__head p {
  flex: 1 1 260px;
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* Botão de abrir/fechar a seção: o texto é o título do tema, mas a área clicável (::after)
   cobre o cabeçalho inteiro, e a seta fica alinhada à direita. */
.theme-toggle {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.theme-toggle::after {
  content: '';
  position: absolute;
  inset: -6px -8px 0;
  border-radius: var(--radius);
}

.theme-toggle:hover {
  color: var(--amber-bright);
}

.theme-toggle:focus-visible {
  outline: none;
}

.theme-toggle:focus-visible::after {
  outline: 2px solid var(--amber-bright);
  outline-offset: 2px;
}

.theme-toggle__icon {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--amber);
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.theme-toggle__icon .icon {
  transition: transform 0.2s ease;
}

.theme-toggle:hover .theme-toggle__icon,
.theme-toggle:focus-visible .theme-toggle__icon {
  border-color: var(--amber);
  background: var(--surface-2);
  color: var(--amber-bright);
}

.theme-toggle[aria-expanded='false'] .theme-toggle__icon .icon {
  transform: rotate(-90deg);
}

.case-grid.is-opening {
  animation: rise 0.25s ease-out;
}

.home-sections .empty .btn {
  margin-top: 8px;
}

.home__footer {
  margin-top: 40px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-faint);
}

/* ---------- HUD ---------- */

.hud {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--hud-h);
  padding: 0 8px;
  background: rgba(13, 17, 20, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

.hud__case {
  flex: 1;
  min-width: 0;
  line-height: 1.15;
}

.hud__case .eyebrow {
  font-size: 0.64rem;
}

.hud__title {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
}

.points {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--amber-dim);
  border-radius: var(--radius);
  background: var(--amber-glow);
  font-family: var(--font-mono);
  color: var(--amber-bright);
  transition: background-color 0.3s;
}

.points__label {
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: var(--amber);
}

.points__value {
  font-size: 1.25rem;
  font-weight: 700;
  min-width: 2ch;
  text-align: right;
}

.points__total {
  font-size: 0.78rem;
  color: var(--amber-dim);
}

.points__bar {
  width: 54px;
  height: 4px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 2px;
  overflow: hidden;
}

.points__bar span {
  display: block;
  height: 100%;
  background: var(--amber);
  transition: width 0.4s var(--ease);
}

.points.is-spent {
  animation: pulse-amber 0.6s ease-out;
}

.points.is-penalty {
  border-color: var(--crimson);
  background: var(--crimson-bg);
  color: var(--crimson-bright);
}

.hud__actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.popover {
  position: absolute;
  top: calc(var(--hud-h) - 4px);
  right: 8px;
  z-index: 60;
  width: min(300px, calc(100vw - 16px));
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.popover[hidden] {
  display: none;
}

.popover h2 {
  font-size: 1rem;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field label,
.field .field__label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--amber);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--amber);
}

/* ---------- Abas ---------- */

.tabs {
  position: sticky;
  top: var(--hud-h);
  z-index: 40;
  display: flex;
  gap: 2px;
  height: var(--tabs-h);
  padding: 0 8px;
  background: rgba(18, 24, 28, 0.96);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

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

.tab[aria-selected="true"] {
  color: var(--amber-bright);
}

.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 2px;
  background: var(--amber);
}

.tab__badge {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 0.66rem;
  line-height: 18px;
  text-align: center;
}

.game-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--gutter);
  padding-bottom: 48px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.5rem;
}

.section-head p {
  margin: 0;
  color: var(--text-dim);
}

@media (max-width: 719px) {
  :root {
    --hud-h: 56px;
  }

  .tabs {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-h) + var(--safe-bottom));
    padding: 0 0 var(--safe-bottom);
    border-top: 1px solid var(--line);
    border-bottom: 0;
    overflow: visible;
  }

  .tab {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 0 2px;
    font-size: 0.62rem;
    letter-spacing: 0.04em;
  }

  .tab .icon {
    width: 22px;
    height: 22px;
  }

  .tab[aria-selected="true"]::after {
    top: 0;
    bottom: auto;
  }

  .tab__badge {
    position: absolute;
    top: 6px;
    left: calc(50% + 6px);
    font-size: 0.6rem;
  }

  .game-main {
    padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 32px);
  }

  .hud__case .eyebrow,
  .points__bar,
  .points__label {
    display: none;
  }

  .hud__title {
    font-size: 0.95rem;
  }

  .points {
    padding: 4px 8px;
    gap: 4px;
  }

  .icon-btn {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 400px) {
  .hud {
    gap: 2px;
    padding: 0 4px;
  }

  .icon-btn {
    width: 36px;
  }

  .hud__btn-rain {
    display: none;
  }
}

/* ---------- Dossiê / briefing ---------- */

.dossier {
  max-width: 820px;
  margin: 24px auto 48px;
  padding: 36px clamp(18px, 5vw, 48px) 32px;
}

.dossier h1 {
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  margin: 6px 0 4px;
  padding-right: 120px;
}

.dossier__meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-dim);
  margin-bottom: 18px;
}

.dossier__victim {
  margin: 0 0 18px;
  padding: 10px 14px;
  border-left: 3px solid var(--stamp);
  background: rgba(127, 79, 29, 0.08);
  font-family: var(--font-mono);
  font-size: 0.86rem;
}

.dossier__text {
  white-space: pre-line;
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.7;
  min-height: 12em;
}

.dossier__text p {
  margin-bottom: 1em;
}

.dossier__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.dossier .btn {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(42, 35, 24, 0.45);
  color: var(--ink);
}

.dossier .btn--primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.dossier .btn--primary:hover:not(:disabled) {
  background: #3d3323;
  color: #fff7e2;
}

@media (max-width: 520px) {
  .dossier h1 {
    padding-right: 0;
    margin-top: 40px;
  }
}

/* ---------- Planta ---------- */

.map-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}

.plan {
  margin: 0;
  padding: 12px;
  background:
    linear-gradient(rgba(214, 164, 78, 0.035) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(214, 164, 78, 0.035) 1px, transparent 1px) 0 0 / 24px 24px,
    #0f161a;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.plan svg {
  display: block;
  width: 100%;
  height: auto;
  touch-action: manipulation;
}

.plan figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--line-strong);
}

.legend i.l-visited {
  border-color: var(--amber-dim);
  background: repeating-linear-gradient(45deg, var(--amber-glow-strong) 0 2px, transparent 2px 5px);
}

.legend i.l-crime {
  border-color: var(--amber-bright);
  border-style: dashed;
}

.room {
  cursor: pointer;
}

.room__shape {
  fill: rgba(29, 39, 46, 0.92);
  stroke: var(--line-strong);
  stroke-width: 3;
  transition:
    fill 0.2s,
    stroke 0.2s;
}

.room__hatch {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.room.is-visited .room__shape {
  stroke: var(--amber-dim);
}

.room.is-visited .room__hatch {
  opacity: 1;
}

.room.is-crime .room__shape {
  stroke-dasharray: 14 8;
  stroke: var(--amber);
}

.room:hover .room__shape {
  fill: rgba(52, 46, 32, 0.95);
  stroke: var(--amber);
}

.room:focus-visible .room__shape,
.room.is-selected .room__shape {
  fill: rgba(64, 52, 30, 0.95);
  stroke: var(--amber-bright);
  stroke-width: 5;
  stroke-dasharray: none;
}

.room__label {
  fill: var(--text);
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 600;
  pointer-events: none;
}

.room__meta {
  fill: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.room__crime {
  fill: var(--amber-bright);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  pointer-events: none;
}

.room__badge {
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.room.is-visited .room__badge {
  opacity: 1;
}

.room__badge circle {
  fill: var(--amber);
}

.room__badge path {
  fill: none;
  stroke: var(--amber-ink);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plan__wall {
  fill: none;
  stroke: #57666f;
  stroke-width: 8;
}

.room-panel {
  min-width: 0;
}

.room-panel__empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 220px;
  text-align: center;
  color: var(--text-dim);
}

.room-panel__empty .icon {
  width: 40px;
  height: 40px;
  color: var(--amber-dim);
}

@media (min-width: 960px) {
  .map-layout {
    grid-template-columns: minmax(0, 1.55fr) minmax(330px, 1fr);
    align-items: start;
  }

  .room-panel {
    position: sticky;
    top: calc(var(--hud-h) + var(--tabs-h) + 16px);
    max-height: calc(100dvh - var(--hud-h) - var(--tabs-h) - 32px);
    overflow: auto;
  }
}

.room-detail h3 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.room-detail__desc {
  color: var(--text-dim);
}

.subhead {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 8px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
}

.subhead::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.occupants {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.occupants li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.92rem;
}

.occupants strong {
  display: block;
  color: var(--text);
}

.traces {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.traces li {
  position: relative;
  padding-left: 18px;
  font-size: 0.94rem;
}

.trace-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

.traces li::before {
  content: "›";
  position: absolute;
  left: 2px;
  color: var(--amber);
  font-weight: 700;
}

/* ---------- Cartões de item (pistas / depoimentos) ---------- */

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

.item-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.item-card__icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--amber);
}

.item-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
}

.item-card__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.item-card__teaser {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.item-card__foot {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.item-card__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-faint);
}

.item-card.is-owned {
  border-left-color: var(--amber);
}

.item-card.is-owned .item-card__status {
  color: var(--amber);
}

.item-card.is-locked .item-card__icon {
  color: var(--text-faint);
}

.item-card.is-poor .item-card__status {
  color: var(--crimson-bright);
}

/* ---------- Suspeitos ---------- */

.suspects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 16px;
}

.suspect-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.suspect-card.status-principal {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber-dim) inset;
}

.suspect-card.status-descartado {
  opacity: 0.78;
}

.suspect-card__head {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 14px;
  align-items: center;
}

.portrait {
  width: 84px;
  height: 100px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: #0b0f12;
}

.status-descartado .portrait {
  filter: grayscale(1) brightness(0.7);
}

.suspect-card h3 {
  margin: 0;
  font-size: 1.3rem;
}

.suspect-card__role {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--amber);
  letter-spacing: 0.04em;
}

.suspect-card__profile {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-dim);
}

.quote {
  margin: 0;
  padding: 10px 14px;
  border-left: 3px solid var(--amber-dim);
  background: rgba(0, 0, 0, 0.22);
  font-family: var(--font-serif);
  font-size: 1rem;
  font-style: italic;
  line-height: 1.6;
}

.quote--deep {
  border-left-color: var(--amber);
  background: var(--amber-glow);
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.segmented legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.segmented label {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: pointer;
}

.segmented label + label {
  border-left: 1px solid var(--line-strong);
}

.segmented input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.segmented label:has(input:checked) {
  background: var(--amber);
  color: var(--amber-ink);
}

.segmented label:has(input:checked).is-descartado {
  background: var(--surface-3);
  color: var(--text);
}

.segmented label:has(input:focus-visible) {
  outline: 2px solid var(--amber-bright);
  outline-offset: -2px;
}

fieldset.segmented {
  margin: 0;
  padding: 0;
  min-width: 0;
}

/* ---------- Arquivo ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chip[aria-pressed="true"] {
  border-color: var(--amber);
  background: var(--amber-glow);
  color: var(--amber-bright);
}

.chip__count {
  color: var(--text-faint);
}

.evidence-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.evidence-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: left;
  transition: border-color 0.15s;
}

.evidence-item:hover {
  border-color: var(--amber-dim);
}

.evidence-item__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--amber);
}

.evidence-item__title {
  display: block;
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.3;
}

.evidence-item__sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.evidence-item__new {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--amber-bright);
  letter-spacing: 0.1em;
}

.empty {
  padding: 28px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--text-dim);
}

.progress-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.progress-line strong {
  color: var(--amber-bright);
}

/* ---------- Laudo (diálogo) ---------- */

.report {
  padding: 26px clamp(14px, 4vw, 30px) 22px;
}

.report__kind {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stamp);
}

.report h3 {
  margin: 4px 0 14px;
  font-size: 1.4rem;
  padding-right: 130px;
}

.report__text {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(0.74rem, 2.6vw, 0.88rem);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
  min-height: 3em;
}

.report__text--prose {
  font-family: var(--font-serif);
  font-size: 1.06rem;
  line-height: 1.7;
  font-style: italic;
}

.is-typing::after {
  content: "▌";
  margin-left: 1px;
  color: var(--stamp);
  animation: blink 0.9s steps(2) infinite;
}

.report__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px dashed rgba(42, 35, 24, 0.35);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-dim);
}

@media (max-width: 520px) {
  .report h3 {
    padding-right: 0;
    margin-top: 36px;
  }
}

/* ---------- Diálogos ---------- */

dialog.dialog {
  width: min(720px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

dialog.dialog[open] {
  display: flex;
  flex-direction: column;
  animation: rise 0.25s var(--ease) both;
}

dialog.dialog::backdrop {
  background: rgba(4, 6, 8, 0.74);
}

.dialog--narrow {
  width: min(460px, calc(100vw - 24px)) !important;
}

.dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  border-bottom: 1px solid var(--line);
}

.dialog__title {
  margin: 0;
  font-size: 1.1rem;
}

.dialog__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  overscroll-behavior: contain;
}

.dialog__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.dialog--alert .dialog__head {
  border-bottom-color: var(--crimson);
}

.dialog--alert .dialog__title {
  color: var(--crimson-bright);
}

@media (max-width: 959px) {
  dialog.dialog--sheet {
    width: 100vw;
    max-height: 88dvh;
    margin: auto 0 0;
    border-radius: 14px 14px 0 0;
    border-bottom: 0;
    padding-bottom: var(--safe-bottom);
  }

  dialog.dialog--sheet[open] {
    animation: sheet-up 0.3s var(--ease) both;
  }

  .dialog--sheet .dialog__head::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    width: 40px;
    height: 4px;
    margin-left: -20px;
    border-radius: 2px;
    background: var(--line-strong);
  }
}

@keyframes sheet-up {
  from {
    transform: translateY(40%);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.confirm-text {
  margin: 0;
  font-size: 1rem;
}

.confirm-text strong {
  color: var(--amber-bright);
}

.help-list {
  margin: 0;
  padding-left: 20px;
}

.help-list li {
  margin-bottom: 8px;
}

/* ---------- Quadro de dedução ---------- */

.board-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1080px) {
  .board-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }
}

.board-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.board-hint {
  flex: 1 1 220px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-faint);
}

.board-hint.is-active {
  color: var(--amber-bright);
}

.board-viewport {
  position: relative;
  height: min(72dvh, 760px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background-color: #2a2219;
  background-image:
    radial-gradient(rgba(0, 0, 0, 0.25) 1px, transparent 1.4px),
    radial-gradient(rgba(255, 220, 160, 0.05) 1px, transparent 1.4px);
  background-size:
    7px 7px,
    11px 11px;
  background-position:
    0 0,
    3px 4px;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.6);
  overscroll-behavior: contain;
}

.board-canvas {
  position: relative;
}

.board-links {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.board-link {
  stroke: var(--amber);
  stroke-width: 2.5;
  stroke-linecap: round;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6));
  pointer-events: none;
}

.board-link-hit {
  stroke: transparent;
  stroke-width: 18;
  cursor: pointer;
}

.board-link-hit:hover + .board-link,
.board-link.is-hover {
  stroke: var(--amber-bright);
  stroke-width: 4;
}

.board-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 196px;
  min-height: 112px;
  padding: 18px 12px 10px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  transition: box-shadow 0.15s;
}

.board-card::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f4d38f, var(--amber-dim));
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5);
}

.board-card.is-dragging {
  cursor: grabbing;
  z-index: 100000 !important;
  box-shadow:
    0 18px 30px rgba(0, 0, 0, 0.55),
    inset 0 0 40px rgba(110, 80, 30, 0.18);
}

.board-card.is-link-source {
  outline: 3px dashed var(--amber-bright);
  outline-offset: 3px;
}

.board-card:focus-visible {
  outline: 3px solid var(--amber-bright);
  outline-offset: 3px;
}

.board-card__kind {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.board-card__title {
  display: block;
  margin: 2px 0 2px;
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.2;
}

.board-card__sub {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-dim);
}

.board-card__tools {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.board-card__tools button {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(42, 35, 24, 0.4);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.35);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.board-card__tools button:hover {
  background: rgba(255, 255, 255, 0.6);
}

.board-card--suspect {
  background-color: #efe4c8;
}

.board-card--traces {
  width: 160px;
  min-height: 96px;
  padding: 16px 10px 8px;
  background-color: #ddd3bb;
  border-style: dashed;
}

.board-card--traces .board-card__title {
  font-size: 0.9rem;
}

.board-empty {
  position: absolute;
  top: 200px;
  left: 40px;
  z-index: 1;
  width: min(520px, calc(100% - 80px));
  padding: 16px 18px;
  border: 1px dashed var(--amber-dim);
  border-radius: var(--radius-lg);
  background: rgba(13, 17, 20, 0.88);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.board-empty strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--amber-bright);
}

.board-empty p {
  font-size: 0.92rem;
  color: var(--text-dim);
}

.board-card .stamp {
  position: absolute;
  top: 12px;
  right: 8px;
  font-size: 0.58rem;
  padding: 1px 6px;
  border-width: 2px;
}

.board-card.status-descartado {
  filter: grayscale(0.9) brightness(0.78);
}

.board-card.status-principal {
  box-shadow:
    0 0 0 3px var(--amber),
    var(--shadow-soft);
}

.board-side {
  display: grid;
  gap: 16px;
}

.links-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
}

.links-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0 4px 10px;
  border-left: 2px solid var(--amber-dim);
}

.notes textarea {
  width: 100%;
  min-height: 220px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(180deg, transparent 0 25px, rgba(214, 164, 78, 0.08) 25px 26px),
    #12191d;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 26px;
  resize: vertical;
}

.notes textarea:focus-visible {
  border-color: var(--amber);
  outline: none;
}

.notes__status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
}

/* ---------- Terminal de acusação ---------- */

.terminal {
  max-width: 980px;
  margin: 0 auto;
  border: 1px solid var(--amber-dim);
  border-radius: var(--radius-lg);
  background: #070a0b;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(214, 164, 78, 0.08),
    inset 0 0 80px rgba(214, 164, 78, 0.04);
  overflow: hidden;
}

.terminal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid #2a2418;
  background: #0d0f10;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--amber-dim);
  text-transform: uppercase;
}

.terminal__screen {
  padding: clamp(14px, 3vw, 26px);
  font-family: var(--font-mono);
  color: var(--amber);
}

.terminal__screen h2 {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 3.4vw, 1.3rem);
  letter-spacing: 0.08em;
  color: var(--amber-bright);
  text-transform: uppercase;
}

.terminal__screen h2::after {
  content: "_";
  animation: blink 1s steps(2) infinite;
}

.terminal__intro {
  color: #c9b48a;
  font-size: 0.86rem;
}

.terminal__log {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
}

.terminal__log li {
  padding: 6px 0;
  border-bottom: 1px dashed #2a2418;
}

.terminal__log .is-denied {
  color: var(--crimson-bright);
}

.accuse-field {
  margin: 0 0 22px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.accuse-field legend {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber-bright);
}

.accuse-field legend span {
  color: var(--amber-dim);
}

.options {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.options--long {
  grid-template-columns: minmax(0, 1fr);
}

.option {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid #2f2a1d;
  border-radius: var(--radius);
  background: #0c0f10;
  color: #d9ccb0;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  line-height: 1.45;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.option:hover {
  border-color: var(--amber-dim);
}

.option input {
  margin: 3px 0 0;
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--amber);
}

.option:has(input:checked) {
  border-color: var(--amber);
  background: rgba(214, 164, 78, 0.1);
  color: var(--text);
}

.option:has(input:focus-visible) {
  outline: 2px solid var(--amber-bright);
  outline-offset: 2px;
}

.terminal__submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}

.terminal__submit p {
  margin: 0;
  flex: 1 1 240px;
  font-size: 0.78rem;
  color: #9d8b66;
}

.verdict {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--amber);
  border-radius: var(--radius);
  font-family: var(--font-mono);
}

.verdict strong {
  display: block;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
}

.verdict p {
  margin: 6px 0 0;
  font-size: 0.86rem;
}

.verdict--denied {
  border-color: var(--crimson);
  background: var(--crimson-bg);
  color: var(--crimson-bright);
}

.verdict--granted {
  background: var(--amber-glow);
  color: var(--amber-bright);
}

/* ---------- Reconstituição ---------- */

.cinema {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 50% 40%, #1a2126 0%, #050708 75%);
  color: var(--text);
  overflow: auto;
}

.cinema::before,
.cinema::after {
  content: "";
  position: sticky;
  left: 0;
  right: 0;
  flex: none;
  height: clamp(18px, 7vh, 64px);
  background: #000;
  z-index: 2;
}

.cinema::before {
  top: 0;
}

.cinema::after {
  bottom: 0;
}

.cinema__frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 24px var(--gutter);
}

.cinema__count {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.cinema__time {
  margin: 6px 0 4px;
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 10vw, 4.6rem);
  line-height: 1;
  color: var(--amber);
}

.cinema__title {
  font-size: clamp(1.3rem, 4.5vw, 2rem);
  margin-bottom: 14px;
}

.cinema__text {
  min-height: 7.5em;
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 3.6vw, 1.3rem);
  line-height: 1.7;
  color: #d4d0c4;
}

.cinema__step {
  animation: rise 0.5s var(--ease) both;
}

.cinema__dots {
  display: flex;
  gap: 6px;
  margin: 18px 0;
}

.cinema__dots i {
  width: 22px;
  height: 3px;
  background: var(--line-strong);
}

.cinema__dots i.on {
  background: var(--amber);
}

.cinema__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Resultado ---------- */

.result {
  max-width: 900px;
  margin: 24px auto 64px;
  padding: 0 var(--gutter);
}

.result__card {
  position: relative;
  padding: 32px clamp(18px, 5vw, 44px);
  text-align: center;
}

.result__card .stamp--corner {
  font-size: 0.9rem;
}

.emblem {
  width: 120px;
  height: 140px;
  margin: 8px auto 4px;
  display: block;
}

.emblem__shield {
  fill: #2a2318;
  stroke: var(--stamp);
  stroke-width: 4;
}

.emblem__star {
  fill: #5d4c31;
}

.emblem__star.on {
  fill: var(--amber-bright);
}

.result__rank {
  margin: 4px 0 4px;
  font-size: clamp(1.6rem, 6vw, 2.3rem);
}

.result__motto {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-dim);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 22px 0;
  text-align: left;
}

.stats div {
  padding: 10px 12px;
  border: 1px solid rgba(42, 35, 24, 0.3);
  background: rgba(255, 255, 255, 0.25);
}

.stats dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.stats dd {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
}

.solution-box {
  margin-top: 18px;
  text-align: left;
}

.solution-box dl {
  margin: 0;
  display: grid;
  gap: 10px;
}

.solution-box dt {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stamp);
}

.paper .eyebrow {
  color: var(--stamp);
}

.solution-box dd {
  margin: 0;
}

.result__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.result__card .btn {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(42, 35, 24, 0.45);
  color: var(--ink);
}

.result__card .btn--primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.result__card .btn--primary:hover:not(:disabled) {
  background: #3d3323;
  color: #fff7e2;
}

/* ---------- Debug ---------- */

.debug-box {
  border: 1px dashed var(--crimson);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

.debug-box dt {
  color: var(--crimson-bright);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  margin-top: 10px;
}

.debug-box dd {
  margin: 2px 0 0;
}

/* ---------- Movimento reduzido ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .fx-scanlines {
    animation: none;
  }

  .is-typing::after {
    display: none;
  }
}
