:root {
  --ink: #141414;
  --panel: #1c1b19;
  --manila: #e8d9b3;
  --manila-dark: #d8c495;
  --zest: #ff7a1a;
  --zest-dim: #c25e12;
  --terminal: #8bffb0;
  --danger: #ff5c5c;
  --paper-text: #2a2418;
  --line: #3a3630;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--manila);
  font-family: "IBM Plex Sans", sans-serif;
  min-height: 100vh;
}
::selection {
  background: var(--zest);
  color: #141414;
}
.hidden {
  display: none !important;
}

/* ---- Barras de rolagem temáticas ---- */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--zest-dim) #1c1b19;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: #1c1b19;
}
::-webkit-scrollbar-thumb {
  background: var(--zest-dim);
  border-radius: 5px;
  border: 2px solid #1c1b19;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--zest);
}
.win-body,
.result-scroll,
details.schema {
  scrollbar-color: #b7a679 #e8d9b3;
}
.win-body::-webkit-scrollbar-track,
.result-scroll::-webkit-scrollbar-track,
details.schema::-webkit-scrollbar-track {
  background: #e8d9b3;
}
.win-body::-webkit-scrollbar-thumb,
.result-scroll::-webkit-scrollbar-thumb,
details.schema::-webkit-scrollbar-thumb {
  background: #b7a679;
  border: 2px solid #e8d9b3;
}
.win-body::-webkit-scrollbar-thumb:hover,
.result-scroll::-webkit-scrollbar-thumb:hover,
details.schema::-webkit-scrollbar-thumb:hover {
  background: #8a7a4a;
}

.stripe-bar {
  height: 10px;
  background: repeating-linear-gradient(
    45deg,
    var(--zest) 0 18px,
    #141414 18px 36px
  );
}

header {
  padding: 14px 28px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
}
.logo-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #221f1c;
  border: 2px solid var(--zest);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex: 0 0 auto;
}
header h1 {
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: clamp(18px, 3.5vw, 28px);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
  color: var(--manila);
  cursor: pointer;
}
header h1 span {
  color: var(--zest);
}
header .subtitle {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: #8a8477;
  letter-spacing: 0.5px;
}

.top-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding-bottom: 14px;
}
.top-nav.hidden {
  display: none;
}
.nav-tab {
  background: transparent;
  color: var(--manila);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 9px 12px;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.3px;
  font-weight: 600;
}
.nav-tab:hover {
  color: var(--zest);
}
.nav-tab.active {
  background: transparent;
  color: var(--zest);
  border-bottom: 2px solid var(--zest);
}
.nav-tab-soon {
  opacity: 0.5;
}

.hud {
  display: flex;
  gap: 12px;
  align-items: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  flex-wrap: wrap;
  padding-bottom: 14px;
}
.hud .pill {
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 3px;
  background: #221f1c;
}
#hudName {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s ease;
}
#hudName:hover {
  text-decoration-color: currentColor;
}
.hud .rank {
  color: var(--zest);
  font-weight: 600;
}
.hud.hidden {
  display: none;
}
.header-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #221f1c;
  border: 1px solid var(--zest-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* ---- Selo de ícone circular, reutilizado em janelas, cards e stats ---- */
.win-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.win-icon,
.icon-inline,
.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
}
.icon-inline {
  margin-right: 4px;
}
.stat-icon {
  width: 42px;
  height: 42px;
  font-size: 19px;
}
.icon-amber {
  background: rgba(202, 161, 90, 0.22);
  border: 1px solid #caa15a;
}
.icon-blue {
  background: rgba(90, 155, 202, 0.22);
  border: 1px solid #5a9bca;
}
.icon-navy {
  background: rgba(90, 110, 202, 0.22);
  border: 1px solid #6a7eca;
}
.icon-red {
  background: rgba(202, 90, 90, 0.22);
  border: 1px solid #ca5a5a;
}
.icon-gold {
  background: rgba(224, 178, 58, 0.22);
  border: 1px solid #e0b23a;
}
.icon-green {
  background: rgba(90, 202, 122, 0.22);
  border: 1px solid #5aca7a;
}

/* ---- Banner de boas-vindas + cards de estatística (Painel da Delegacia) ---- */
.welcome-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px 20px;
  margin-bottom: 18px;
}
.welcome-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #221f1c;
  border: 1px solid var(--zest-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex: 0 0 auto;
}
.welcome-title {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  font-size: 15px;
  color: var(--manila);
}
.welcome-sub {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: #8a8477;
  margin-top: 2px;
}
.dialect-pref {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
}
.dialect-pref label {
  margin: 0;
  font-size: 10px;
  color: #8a8477;
}
.dialect-pref select {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: #221f1c;
  color: var(--manila);
}
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
@media (max-width: 780px) {
  .stat-cards {
    grid-template-columns: 1fr 1fr;
  }
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.stat-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8a8477;
}
.stat-value {
  font-family: "Oswald", sans-serif;
  font-size: 19px;
  color: var(--manila);
  margin-top: 2px;
}
.stat-value b {
  color: var(--zest);
}

.screen {
  display: none;
  opacity: 0;
}
.screen.visible {
  display: block;
  animation: fadeIn 0.25s ease forwards;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.page-title {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  font-size: 22px;
  color: var(--manila);
}
.lead-small {
  color: #c9c2af;
  font-size: 13.5px;
  max-width: 640px;
}

/* ---- LANDING ---- */
.hero {
  padding: 56px 28px 30px;
  max-width: 1180px;
  margin: 0 auto;
}
.hero-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
  text-align: left;
}
@media (max-width: 900px) {
  .hero-split {
    grid-template-columns: 1fr;
    text-align: center;
  }
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: var(--zest);
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--zest-dim);
  padding-bottom: 6px;
  margin-bottom: 16px;
}
.hero h2 {
  font-family: "Oswald", sans-serif;
  font-size: clamp(28px, 5vw, 44px);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 14px;
  line-height: 1.1;
}
.hero h2 em {
  font-style: normal;
  color: var(--zest);
}
.hero p.lead {
  font-size: 15.5px;
  line-height: 1.6;
  color: #c9c2af;
  max-width: 520px;
  margin: 0 0 26px;
}
@media (max-width: 900px) {
  .hero p.lead {
    margin: 0 auto 26px;
  }
}
.hero-media {
  position: relative;
}
.hero-media img {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  border: 1px solid #000;
  display: block;
}
.cta {
  background: var(--zest);
  color: #141414;
  border: none;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 32px;
  border-radius: 3px;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.cta:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.how-it-works {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 28px 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 780px) {
  .how-it-works {
    grid-template-columns: 1fr;
  }
}
.step {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px;
  transition: border-color 0.15s ease;
  position: relative;
}
.step:hover {
  border-color: var(--zest-dim);
}
.step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--zest);
  color: var(--zest);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
}
.step h3 {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  font-size: 16px;
  margin: 8px 0 8px;
}
.step p {
  font-size: 13.5px;
  line-height: 1.55;
  color: #c9c2af;
  margin: 0;
}

.lore-section {
  max-width: 1180px;
  margin: 20px auto;
  padding: 20px 28px 10px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 36px;
  align-items: center;
}
@media (max-width: 900px) {
  .lore-section {
    grid-template-columns: 1fr;
  }
}
.lore-title {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  font-size: clamp(22px, 4vw, 30px);
  margin: 0 0 14px;
  line-height: 1.15;
}
.lore-text p {
  font-size: 14.5px;
  line-height: 1.65;
  color: #c9c2af;
  margin: 0 0 14px;
}
.lore-text p b {
  color: var(--manila);
}
.lore-media img {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid #000;
  display: block;
}

.mode-preview {
  max-width: 1180px;
  margin: 40px auto 40px;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 780px) {
  .mode-preview {
    grid-template-columns: 1fr;
  }
}
.mode-card {
  background: var(--manila);
  color: var(--paper-text);
  border-radius: 4px;
  padding: 22px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
}
.mode-card h3 {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  font-size: 19px;
  margin: 0 0 8px;
}
.mode-card p {
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0 0 10px;
}
.mode-card .tag {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  background: var(--manila-dark);
  padding: 3px 8px;
  border-radius: 2px;
  margin-bottom: 10px;
  color: #5a4f38;
}
.mode-card-photo {
  background-size: cover;
  background-position: center;
  color: var(--manila);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.mode-card-photo .tag {
  background: rgba(232, 217, 179, 0.85);
}
.mode-card-photo h3 {
  color: var(--manila);
}
.mode-card-photo p {
  color: #d9d3c4;
}
.mode-card-photo p b {
  color: var(--zest);
}

.detective-tip {
  max-width: 1180px;
  margin: 0 auto 10px;
  padding: 0 28px;
  display: flex;
  gap: 16px;
  align-items: center;
}
.detective-tip-label {
  flex: 0 0 auto;
  background: #f0dcae;
  color: #4a3f2a;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding: 10px 12px;
  border-radius: 2px;
  line-height: 1.3;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
  transform: rotate(-2deg);
}
.detective-tip p {
  font-size: 13px;
  color: #8a8477;
  font-family: "IBM Plex Mono", monospace;
  margin: 0;
}
.detective-tip code {
  color: var(--zest);
}

.landing-footer {
  text-align: center;
  padding: 30px 0 50px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: #5a4f38;
}

/* ---- AUTENTICAÇÃO ---- */
.login-wrap {
  max-width: 420px;
  margin: 60px auto;
  padding: 0 20px;
}
.auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.auth-tab {
  flex: 1;
  background: var(--manila-dark);
  color: #5a4f38;
  border: none;
  border-radius: 3px;
  padding: 9px;
  cursor: pointer;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  font-size: 12.5px;
  letter-spacing: 0.5px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}
.auth-tab.active {
  background: var(--zest);
  color: #141414;
}
.auth-error {
  color: var(--danger);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  margin-top: 8px;
  min-height: 14px;
}

/* ---- SHARED CARD ---- */
.card,
.win,
.intro-card,
.chapter-card,
.big-mode-card {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  background-blend-mode: multiply;
}
.card {
  background-color: var(--manila);
  color: var(--paper-text);
  border-radius: 2px;
  padding: 22px 24px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
  position: relative;
}
.card + .card {
  margin-top: 18px;
}
.card::before {
  content: attr(data-tab);
  position: absolute;
  top: -14px;
  left: 14px;
  background: var(--manila-dark);
  font-family: "Oswald", sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 2px 2px 0 0;
  color: #4a3f2a;
}
label {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #5a4f38;
  margin: 12px 0 4px;
}
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 10px;
  font-family: "IBM Plex Mono", monospace;
  border: 1px solid #b7a679;
  border-radius: 3px;
  background: #f2e8ce;
  color: #2a2418;
  font-size: 14px;
  transition: border-color 0.15s ease;
}
input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--zest);
}
.fineprint {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  color: #5a4f38;
  margin-top: 10px;
  opacity: 0.85;
}

/* ---- HUB ---- */
.hub-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 30px 28px 50px;
}
.continue-card {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--zest-dim);
  border-radius: 4px;
  padding: 16px 20px;
  margin-bottom: 22px;
}
.continue-progress {
  flex: 1 1 240px;
  min-width: 200px;
}
.continue-progress-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: #8a8477;
  margin-bottom: 6px;
}
.continue-progress-bar {
  height: 10px;
  background: #221f1c;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.continue-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--zest-dim), var(--zest));
  transition: width 0.3s ease;
}
.hub-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.period-tabs {
  display: flex;
  gap: 6px;
}
.period-tab {
  background: var(--manila-dark);
  color: #5a4f38;
  border: none;
  border-radius: 3px;
  padding: 5px 10px;
  font-size: 11px;
  font-family: "IBM Plex Mono", monospace;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}
.period-tab.active {
  background: var(--zest);
  color: #141414;
}
.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--manila-dark);
  color: #4a3f2a;
  border-radius: 3px;
  padding: 5px 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  margin: 0 6px 6px 0;
}
.badge-toast {
  position: fixed;
  bottom: 70px;
  right: 20px;
  z-index: 1000;
  background: #161512;
  color: var(--manila);
  border: 1px solid var(--zest-dim);
  border-radius: 4px;
  padding: 12px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  min-width: 260px;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: badgeSlideIn 0.35s ease forwards;
}
.badge-toast.leaving {
  animation: badgeSlideOut 0.35s ease forwards;
}
.badge-toast .toast-icon {
  font-size: 30px;
  flex: 0 0 auto;
}
.badge-toast .toast-label {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--zest);
  margin-bottom: 3px;
}
.badge-toast .toast-title {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--manila);
}
@keyframes badgeSlideIn {
  from {
    transform: translateX(130%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes badgeSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(130%);
    opacity: 0;
  }
}
.hub-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 18px;
  margin-bottom: 28px;
}
@media (max-width: 780px) {
  .hub-modes {
    grid-template-columns: 1fr;
  }
}
.big-mode-card {
  background-color: var(--manila);
  color: var(--paper-text);
  border-radius: 4px;
  padding: 24px;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease;
  position: relative;
  overflow: hidden;
}
.big-mode-card:hover {
  transform: translateY(-3px);
}
.big-mode-card .tag {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  background: var(--manila-dark);
  padding: 3px 8px;
  border-radius: 2px;
  margin-bottom: 10px;
  color: #5a4f38;
}
.big-mode-card h3 {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  font-size: 21px;
  margin: 0 0 8px;
}
.big-mode-card p {
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0 0 12px;
}
.big-mode-card button {
  width: 100%;
}

/* ---- STORY MAP ---- */
.intro-wrap {
  max-width: 1000px;
  margin: 60px auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 36px;
  align-items: center;
}
@media (max-width: 820px) {
  .intro-wrap {
    grid-template-columns: 1fr;
    margin: 30px auto;
  }
}
.intro-media img,
.intro-media video {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  border: 1px solid #000;
  display: block;
}
.intro-card {
  background-color: var(--manila);
  color: var(--paper-text);
  border-radius: 4px;
  padding: 28px 30px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.35);
  position: relative;
}
.intro-text {
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-line;
  margin: 10px 0 20px;
}

.story-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 28px 50px;
}
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 900px) {
  .chapter-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 780px) {
  .chapter-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 520px) {
  .chapter-grid {
    grid-template-columns: 1fr;
  }
}
.chapter-card {
  background-color: var(--manila);
  color: var(--paper-text);
  border-radius: 4px;
  padding: 16px;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease;
  position: relative;
  overflow: hidden;
}
.chapter-card.active:hover {
  transform: translateY(-2px);
}
.chapter-card.locked {
  background-color: #3a362f;
  color: #7a7566;
  cursor: not-allowed;
  box-shadow: none;
}
.chapter-card.completed {
  background-color: #d3e8d6;
}
.chapter-card-complex.active,
.chapter-card-complex.completed {
  border: 2px solid #b23a3a;
}
.chapter-card-complex .chapter-num {
  color: #b23a3a;
}
.chapter-card-tier3.active,
.chapter-card-tier3.completed {
  border: 2px solid #2e6da4;
}
.chapter-card-tier3 .chapter-num {
  color: #2e6da4;
}
.chapter-section-divider-tier3 {
  border-top-color: #1f4e79;
  border-bottom-color: #1f4e79;
  color: #5b9bd5;
}
.chapter-section-divider {
  grid-column: 1 / -1;
  margin: 14px 0 0;
  padding: 8px 0;
  border-top: 1px dashed #6b3030;
  border-bottom: 1px dashed #6b3030;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 1px;
  color: #e07a7a;
  text-align: center;
}
.chapter-num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
}
.chapter-title {
  font-family: "Oswald", sans-serif;
  font-size: 15.5px;
  margin: 4px 0 6px;
  text-transform: uppercase;
}
.chapter-sub {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}

/* ---- GAME ---- */
.game-nav {
  padding: 12px 28px 0;
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
}

/* ---- DESKTOP / JANELAS ---- */
.desktop {
  position: relative;
  min-height: calc(100vh - 260px);
  margin: 14px 28px 70px;
  background: radial-gradient(
      circle at 15% 10%,
      rgba(255, 122, 26, 0.06),
      transparent 40%
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.015) 0 1px,
      transparent 1px 28px
    );
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.win {
  position: absolute;
  display: flex;
  flex-direction: column;
  background-color: var(--manila);
  color: var(--paper-text);
  border-radius: 4px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
  min-width: 240px;
  min-height: 160px;
  overflow: hidden;
}
.win.minimized {
  display: none;
}
.win.focused {
  box-shadow: 0 0 0 2px var(--zest-dim), 0 6px 0 rgba(0, 0, 0, 0.35);
}
.win-titlebar {
  background: var(--manila-dark);
  color: #4a3f2a;
  padding: 8px 10px 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
  cursor: move;
  user-select: none;
  flex: 0 0 auto;
  border-bottom: 1px solid #b7a679;
}
.win-controls {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
}
.win-btn {
  width: 20px;
  height: 18px;
  padding: 0;
  border-radius: 2px;
  background: #c9b98c;
  color: #4a3f2a;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.win-btn:hover {
  background: var(--zest);
  color: #141414;
}
.win-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 16px 18px;
  position: relative;
}
.win-body #sqlbox,
.win-body .console-sqlbox {
  min-height: 90px;
}
.win-body #notepadArea {
  flex: 1 1 auto;
}
.win-resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  background: linear-gradient(
    135deg,
    transparent 0 40%,
    #6b5a35 40% 55%,
    transparent 55% 60%,
    #6b5a35 60% 75%,
    transparent 75% 80%,
    #6b5a35 80% 95%,
    transparent 95%
  );
}
.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 800;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  background: #100f0e;
}
.taskbar-menu-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 4px;
  background: var(--zest);
  color: #141414;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.taskbar-items {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}
.taskbar-item {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  text-transform: none;
  letter-spacing: 0;
  background: #221f1c;
  color: #8a8477;
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 3px;
  font-weight: 400;
}
.taskbar-item.active {
  color: var(--zest);
  border-color: var(--zest-dim);
}
.taskbar-menu-popup {
  display: none;
  position: fixed;
  left: 16px;
  bottom: 58px;
  z-index: 900;
  background: var(--manila);
  color: var(--paper-text);
  border: 1px solid #b7a679;
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  min-width: 220px;
  padding: 6px;
}
.taskbar-menu-popup.open {
  display: block;
}
.taskbar-menu-popup button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: #2a2418;
  font-family: "IBM Plex Mono", monospace;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  padding: 8px 10px;
  border-radius: 3px;
  font-size: 12.5px;
}
.taskbar-menu-popup button:hover {
  background: var(--manila-dark);
}
#notepadArea {
  width: 100%;
  height: 100%;
  min-height: 120px;
  resize: none;
  background: #fffceb;
  color: #2a2418;
  border: 1px solid #b7a679;
  border-radius: 3px;
  padding: 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  outline: none;
}
@media (max-width: 900px) {
  .desktop {
    min-height: auto;
    border: none;
    background: none;
    padding: 0 28px;
    margin: 12px 0 0;
  }
  .win {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    margin-bottom: 16px;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
  }
  .win-titlebar {
    cursor: default;
  }
  .win-resize-handle {
    display: none;
  }
  .taskbar {
    display: none;
  }
  .taskbar-menu-popup {
    display: none !important;
  }
}

.stamp {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 3px solid var(--danger);
  color: var(--danger);
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
  padding: 3px 9px;
  border-radius: 4px;
  transform: rotate(8deg);
  opacity: 0.85;
}
.stamp.closed {
  border-color: #2e7d46;
  color: #2e7d46;
}
h2.case-title {
  font-family: "Oswald", sans-serif;
  font-size: 19px;
  margin: 6px 0 8px;
  text-transform: uppercase;
  color: #2a2418;
}
.brief-text {
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 10px;
  white-space: pre-line;
}
.brief-meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: #5a4f38;
}
.timer-display {
  font-family: "Oswald", sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #8f2b2b;
  margin: 6px 0;
}
.timer-display.warning {
  color: var(--zest-dim);
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}
.mural-post {
  background: var(--manila-dark);
  border-radius: 3px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.mural-post.pinned {
  border: 2px solid var(--zest-dim);
  background: #f0dcae;
}
.mural-pinned-tag {
  font-family: "Oswald", sans-serif;
  font-size: 10px;
  letter-spacing: 1px;
  color: #7a3e00;
  margin-bottom: 4px;
}
.mural-post-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  font-size: 11.5px;
  color: #4a3f2a;
  margin-bottom: 4px;
}
.mural-post-msg {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: #2a2418;
  line-height: 1.5;
  margin-bottom: 4px;
}
.mural-post-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mural-react-btn {
  background: transparent;
  border: 1px solid #b7a679;
  border-radius: 14px;
  padding: 3px 10px;
  cursor: pointer;
  font-size: 12px;
  color: #4a3f2a;
  transition: background 0.15s ease;
}
.mural-react-btn:hover {
  background: #e8d9b3;
}
.mural-react-btn.active {
  background: var(--zest-dim);
  border-color: var(--zest-dim);
  color: #141414;
}
details.schema summary {
  cursor: pointer;
  font-family: "Oswald", sans-serif;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
  color: #4a3f2a;
}
.schema-table {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  margin: 8px 0;
  padding: 8px 10px;
  background: #dcca9c;
  border-radius: 3px;
}
.schema-table b {
  color: #7a3e00;
}
.dialect-group-label {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.5px;
  color: #5a4f38;
  margin: 12px 0 4px;
}

textarea#sqlbox,
.console-sqlbox {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  background: #0e0e0e;
  color: var(--terminal);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13.5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 12px;
  outline: none;
  transition: border-color 0.15s ease;
}
textarea#sqlbox:focus,
.console-sqlbox:focus {
  border-color: var(--zest);
}
.btnrow {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
button {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 13px;
  background: var(--zest);
  color: #141414;
  border: none;
  border-radius: 3px;
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: filter 0.15s ease, transform 0.1s ease;
}
button.secondary {
  background: var(--manila-dark);
  color: #4a3f2a;
  border: 1px solid #b7a679;
}
button.secondary:hover {
  background: #c9b98c;
}
button.ghost {
  background: transparent;
  color: #5a4f38;
  border: 1px solid #b7a679;
  font-size: 11px;
  padding: 5px 10px;
}
button:hover {
  filter: brightness(1.08);
}
button:active {
  transform: scale(0.98);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
#resultWrap {
  margin-top: 14px;
}
.result-msg {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  padding: 8px 0;
  color: #3a3320;
}
.result-msg.err {
  color: var(--danger);
  font-weight: 600;
}
table.result {
  border-collapse: collapse;
  width: 100%;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
}
table.result th {
  background: #3a2f1c;
  color: var(--manila);
  text-align: left;
  padding: 6px 8px;
  position: sticky;
  top: 0;
}
table.result td {
  padding: 5px 8px;
  border-bottom: 1px solid #cbb98c;
}
table.result tr:nth-child(even) {
  background: #ddcda3;
}
.result-scroll {
  max-height: 260px;
  overflow: auto;
  border: 1px solid #b7a679;
  border-radius: 3px;
}
.querycount {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: #8a8477;
  margin-top: 6px;
}
.accuse-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
select {
  font-family: "IBM Plex Mono", monospace;
  padding: 8px 10px;
  border-radius: 3px;
  border: 1px solid #b7a679;
  background: #f2e8ce;
  color: #2a2418;
  flex: 1;
}
.verdict {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 3px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  animation: fadeIn 0.2s ease;
}
.verdict.win {
  background: #dcefe0;
  border: 1px solid #2e7d46;
  color: #1e5c33;
}
.verdict.lose {
  background: #f7dede;
  border: 1px solid var(--danger);
  color: #8f2b2b;
}
.lb-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
}
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.badge-card {
  border-radius: 4px;
  padding: 14px;
  background: var(--manila-dark);
  text-align: center;
}
.badge-card.locked {
  opacity: 0.45;
  filter: grayscale(1);
}
.badge-card-icon {
  font-size: 26px;
  margin-bottom: 6px;
}
.badge-card-title {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  font-size: 12.5px;
  margin: 2px 0 4px;
  color: #2a2418;
}
.badge-card-desc {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  color: #5a4f38;
  line-height: 1.4;
}
.badge-card-rarity {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  color: #8a7a4a;
  margin-top: 6px;
  border-top: 1px dashed #b7a679;
  padding-top: 5px;
}
.history-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.history-mode-card {
  background: var(--manila-dark);
  border-radius: 4px;
  padding: 12px 14px;
}
.history-mode-card h4 {
  margin: 0 0 6px;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  font-size: 12.5px;
  color: #2a2418;
}
.history-mode-card p {
  margin: 2px 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: #5a4f38;
}
.history-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.lb-name-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s ease;
}
.lb-name-btn:hover {
  text-decoration-color: currentColor;
}
.lb-list li {
  display: flex;
  justify-content: space-between;
  padding: 5px 2px;
  border-bottom: 1px dashed #b7a679;
}
.lb-list li.me {
  background: #f0dcae;
  font-weight: 600;
}
.lb-rank {
  color: #7a3e00;
  width: 20px;
  display: inline-block;
}
.footnote {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  color: #5a4f38;
  margin-top: 10px;
  opacity: 0.8;
}
.loading {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: #8a8477;
  padding: 40px;
  text-align: center;
}
.back-link {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--zest);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
}
