.journey-selection {
  max-width: 1200px;
  margin: auto;
  padding: 50px 30px;
}
.selection-title {
  text-align: center;
  margin-bottom: 30px;
}
.selection-title h1 {
  font: 36px var(--font-text);
  margin: 12px;
}
.selection-title p {
  color: var(--muted);
}
.subject-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 35px;
}
.subject-tabs .active {
  background: #99e458;
  color: #191d1a;
}
.law-deck {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 23px;
}
.law-tile {
  background: linear-gradient(115deg, #d8ddd6, #8e9d93);
  border: 1px solid #617066;
  color: #1d211e;
  min-height: 245px;
  padding: 24px;
  border-radius: 7px;
  box-shadow: 0 9px 24px #00000077;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}
.law-tile:hover {
  transform: translateY(-3px);
  outline: 1px solid #99e458;
  outline-offset: 4px;
}
.law-code {
  font: 13px var(--font-text);
  letter-spacing: 2px;
  border: 1px solid #5b6960;
  padding: 6px 12px;
}
.law-tile strong {
  font: 22px var(--font-text);
}
.law-tile > span:not(.law-code) {
  font-size: 12px;
}
.law-tile small {
  margin-top: auto;
  font: 14px var(--font-text);
  width: 100%;
}
.law-tile small b {
  float: right;
}
.law-progress {
  display: block;
  width: 100%;
  height: 3px;
  background: #74857a;
}
.law-progress i {
  display: block;
  height: 3px;
  background: #303732;
}
.source-note {
  font-size: 12px;
  color: var(--muted);
  max-width: 760px;
  margin: 30px auto;
  text-align: center;
  line-height: 1.6;
}
.journey-game {
  height: calc(100dvh - 120px);
  min-height: 680px;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 35% 10%, #24292588, transparent 65%), #090a0a;
  position: relative;
}
.journey-top {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 15px 28px;
  border-bottom: 1px solid #37403a55;
}
.journey-top h1 {
  font: 22px var(--font-text);
  margin: 5px 0;
}
.journey-score {
  margin-left: auto;
  text-align: right;
  flex-shrink: 0;
}
.journey-score strong {
  display: block;
  font: 27px var(--font-text);
  color: #99e458;
}
.journey-score strong small {
  font-size: 17px;
  color: #616f66;
}
.journey-score > span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #7b8c80;
}
.map-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 10px 28px;
  color: #788a7e;
  font-size: 11px;
  letter-spacing: 1px;
}
.map-tools > div {
  display: flex;
  gap: 7px;
}
.legal-viewport {
  overflow: auto;
  flex: 1;
  min-height: 365px;
  cursor: grab;
  scrollbar-color: #627167 #131514;
  overscroll-behavior: contain;
  position: relative;
}
.legal-viewport.dragging {
  cursor: grabbing;
}
.legal-canvas {
  position: relative;
  display: flex;
  width: max-content;
  min-width: 100%;
  padding: 0 max(45px, calc(50vw - 520px));
  height: 440px;
  gap: 52px;
}
.legal-canvas:before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 220px;
  height: 3px;
  background: linear-gradient(90deg, #222724, #90e14a 20%, #99e457 85%, #333a35);
  box-shadow: 0 0 10px #8ce04390;
}
.legal-column {
  width: 216px;
  flex: 0 0 216px;
  position: relative;
  padding-top: 14px;
}
.section-plaque {
  height: 39px;
  overflow: hidden;
  font: 10px/1.5 var(--font-text);
  text-transform: uppercase;
  text-align: center;
  padding: 6px;
  background: #7e8f8377;
  color: #bfc8bb;
  border-radius: 3px;
  max-width: 190px;
  margin: 0 auto 35px;
}
.article-slot {
  height: 111px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.article-slot:after {
  content: '';
  position: absolute;
  height: 28px;
  width: 1px;
  background: #66b81e;
  top: 100%;
  left: 50%;
}
.legal-card {
  background: linear-gradient(120deg, #d8ddd5, #b5beb0);
  color: #222724;
  border: 1px solid #6c7d72;
  border-radius: 6px;
  padding: 13px 15px;
  box-shadow: 0 4px 15px #00000077;
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 180px;
  max-height: 112px;
  min-height: 90px;
  overflow: visible;
  width: 216px;
}
.legal-card strong {
  font: 700 14px var(--font-text);
  text-transform: uppercase;
}
.legal-card > span {
  font: 11px/1.35 var(--font-text);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.legal-card:hover {
  outline: 1px solid #99e458;
  outline-offset: 3px;
}
.current .legal-card {
  border-color: #99e458;
}
.legal-marker {
  position: absolute;
  top: 211px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font: bold 12px var(--font-text);
  border: 1px solid #647469;
  background: #252b27;
  padding: 3px 15px;
  border-radius: 4px;
  color: #99e458;
  z-index: 2;
}
.sealed {
  display: grid;
  place-items: center;
  width: 49px;
  height: 49px;
  border: 1px dashed #8ce042;
  border-radius: 50%;
  font: 32px var(--font-text);
  color: #99e458;
  box-shadow: 0 0 30px #85de3722;
}
.legal-branches {
  position: relative;
  margin-top: 41px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 8px;
}
.legal-branches:before {
  content: '';
  position: absolute;
  left: 50%;
  width: 1px;
  top: -18px;
  bottom: 15px;
  background: #4d5951;
}
.child-card {
  max-height: 68px;
  min-height: 50px;
  width: 187px;
  padding: 8px 12px;
  gap: 4px;
}
.child-card strong {
  font-size: 11px;
}
.child-card > span {
  font-size: 10px;
  -webkit-line-clamp: 2;
}
.mistake-badge {
  position: absolute;
  right: -9px;
  top: -10px;
  background: #ae4434;
  border: 1px solid #d16c58;
  border-radius: 50%;
  font: normal 10px Arial;
  color: #ffffff;
  padding: 5px;
  min-width: 23px;
}
.pending-branch {
  position: relative;
  text-align: center;
  background: #0e100f;
  padding: 4px 12px;
  color: #97e354;
}
.pending-branch > span {
  display: block;
  border: 1px dashed #59675e;
  border-radius: 50%;
  margin: 0 auto 4px;
  width: 25px;
  height: 25px;
  line-height: 23px;
}
.pending-branch small {
  font: 11px var(--font-text);
}
.stack-tab {
  background: #7e8f83;
  color: #1f2421;
  border: 1px solid #58655c;
  border-radius: 3px;
  padding: 5px;
  z-index: 1;
  font: 10px var(--font-text);
}
.curve {
  position: absolute;
  left: -160px;
  top: 185px;
  width: 268px;
  height: 47px;
  pointer-events: none;
}
.curve path {
  fill: none;
  stroke: #606f65;
  stroke-width: 0.8;
}
.journey-horizon {
  width: 170px;
  align-self: flex-start;
  margin-top: 200px;
  color: #4d5851;
  font-size: 9px;
  letter-spacing: 2px;
  padding-left: 20px;
}
.literal-dock {
  background: linear-gradient(130deg, #dadfd8, #89998e);
  color: #1a1e1b;
  border: 1px solid #7c8e82;
  border-radius: 8px;
  padding: 16px 22px;
  margin: 12px auto 8px;
  width: min(790px, calc(100% - 32px));
  box-shadow: 0 6px 30px #00000099;
  max-height: 310px;
  overflow: auto;
}
.literal-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 10px var(--font-text);
  letter-spacing: 0.7px;
}
.quiz-tag {
  display: inline-block;
  background: #39413b;
  color: #dce1da;
  font: 700 11px var(--font-text);
  padding: 3px 9px;
  border-radius: 3px;
  white-space: nowrap;
}
.literal-prompt {
  font: 15px/1.5 var(--font-text);
  margin: 12px 0;
}
.literal-options {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.literal-options label {
  cursor: pointer;
  border: 1px solid #718277;
  border-radius: 5px;
  padding: 9px 13px;
  background: linear-gradient(#99e458, #b0baab);
  font: 13px var(--font-text);
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 38px;
}
.literal-options label:has(input:checked) {
  background: #728378;
  border-color: #39413c;
}
.literal-options input {
  accent-color: #3c453f;
}
.literal-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.literal-actions label {
  font-size: 11px;
}
.literal-actions .primary {
  padding: 8px 15px;
  font-size: 12px;
  background: #77d823;
}
.text-button {
  border: 0;
  border-bottom: 1px dotted #434d47;
  background: transparent;
  color: #2d332f;
  font: 12px var(--font-text);
  padding: 5px;
  cursor: pointer;
}
.literal-error {
  font-size: 12px;
  color: #852e22;
  margin: 7px 0 0;
}
.literal-error:empty {
  display: none;
}
.literal-origin {
  display: block;
  font-size: 9px;
  color: #3f4842;
  margin-top: 8px;
}
.revealed-feedback h2 {
  font: 20px var(--font-text);
  margin: 10px 0;
}
.revealed-feedback p {
  font: 14px/1.55 var(--font-text);
  max-height: 115px;
  overflow: auto;
}
.journey-bottom {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 7px 28px;
  color: #5f6d64;
  font-size: 10px;
}
.journey-bottom a {
  color: #798a7f;
}
.device-text {
  white-space: pre-wrap;
  font: 18px/1.8 var(--font-text);
  background: #c2cabe;
  color: #1a1e1c;
  padding: 24px;
  border-radius: 5px;
  max-height: 55vh;
  overflow: auto;
}
.open-index {
  display: grid;
  gap: 9px;
}
.historical-note {
  font-size: 12px;
  border-left: 3px solid #66b81e;
  padding: 8px;
  background: #84948a44;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.in-journey footer {
  display: none;
}
button:focus-visible,
input:focus-visible,
.legal-viewport:focus-visible {
  outline: 2px solid #99e458;
  outline-offset: 3px;
}
@media (max-width: 850px) {
  .journey-game {
    height: auto;
    min-height: calc(100dvh - 125px);
  }
  .legal-viewport {
    height: 400px;
    flex: none;
  }
  .journey-top {
    padding: 12px 16px;
    gap: 12px;
  }
  .journey-top h1 {
    font-size: 18px;
  }
  .journey-top .eyebrow {
    font-size: 9px;
  }
  .journey-score strong {
    font-size: 22px;
  }
  .journey-score > span {
    font-size: 8px;
  }
  .law-deck {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .journey-bottom {
    padding: 10px 15px;
    flex-wrap: wrap;
  }
  .literal-dock {
    max-height: none;
  }
  .map-tools {
    padding: 10px 15px;
  }
  .map-tools > span {
    max-width: 40%;
  }
}
@media (max-width: 520px) {
  .journey-selection {
    padding: 30px 17px;
  }
  .selection-title h1 {
    font-size: 27px;
  }
  .law-deck {
    grid-template-columns: 1fr;
  }
  .law-tile {
    min-height: 210px;
  }
  .journey-top {
    flex-wrap: wrap;
  }
  .journey-top > div:nth-child(2) {
    flex: 1;
    min-width: 180px;
  }
  .journey-score {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 0;
  }
  .journey-score strong {
    font-size: 18px;
  }
  .map-tools {
    flex-wrap: wrap;
    gap: 8px;
  }
  .map-tools > span {
    max-width: none;
    width: 100%;
  }
  .legal-viewport {
    height: 395px;
  }
  .legal-canvas {
    padding: 0 60px;
  }
  .literal-dock {
    padding: 15px;
  }
  .literal-actions {
    flex-wrap: wrap;
  }
  .literal-actions .primary {
    margin-left: auto;
  }
  .literal-prompt {
    font-size: 14px;
  }
  .literal-options label {
    font-size: 12px;
  }
  .journey-bottom {
    font-size: 9px;
  }
  .subject-tabs button {
    width: 100%;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .legal-card {
    animation: unfold 0.35s ease-out;
  }
  @keyframes unfold {
    from {
      opacity: 0.2;
      transform: translateY(9px) scale(0.95);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

/* Respostas por toque na trilha */
.answer-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 10px;
}
.trail-tap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 1vw, 14px);
  margin: 12px 0;
}
.literal-dock .answer-options.tap.trail-tap .answer-option {
  min-height: clamp(58px, 7vh, 88px);
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #3f5a2a;
  background: linear-gradient(#1b2a15, #121b0f);
  color: #e6f5d6;
  font-size: clamp(16px, 1.3vw, 22px);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 0 #2c4020;
  transition:
    transform 0.08s,
    border-color 0.15s;
}
.literal-dock .answer-options.tap.trail-tap .answer-option small {
  font-size: 12px;
  font-weight: 400;
  color: #9db88a;
}
.literal-dock .answer-options.tap.trail-tap .answer-option:hover:not(:disabled) {
  border-color: var(--accent);
}
.literal-dock .answer-options.tap.trail-tap .answer-option:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #2c4020;
}
.literal-dock .answer-options.tap.trail-tap .answer-option.flash-right {
  background: #2f5a1a;
  border-color: #7ed957;
}
.literal-dock .answer-options.tap.trail-tap .answer-option.flash-wrong {
  background: #7a2a24;
  border-color: #e5534b;
}
@media (max-width: 520px) {
  .trail-tap {
    grid-template-columns: 1fr;
  }
}
