@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,800&family=DM+Sans:wght@400;500;700;800&display=swap');

:root {
  --canvas: #F5F1E7;
  --canvas-alt: #EFE9DB;
  --ink: #22201C;
  --forest: #2E5141;
  --forest-light: #3C5C4E;
  --coral: #C8512E;
  --mustard: #F0C24B;
  --rule: #D6D1C4;
  --radius: 4px;
  --radius-lg: 8px;
  --shadow-hard: 3px 3px 0 0 rgba(34,32,28,.20);
  --shadow-hard-lg: 4px 4px 0 0 rgba(34,32,28,.14);
  --f-display: 'Bricolage Grotesque', sans-serif;
  --f-body: 'DM Sans', sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--f-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 13%, rgba(255, 90, 54, 0.13) 0 72px, transparent 73px),
    radial-gradient(circle at 90% 7%, rgba(255, 201, 64, 0.24) 0 90px, transparent 91px),
    linear-gradient(90deg, rgba(26, 26, 26, 0.035) 1px, transparent 1px),
    linear-gradient(var(--canvas), var(--canvas));
  background-size: auto, auto, 48px 48px, auto;
}
button { font: inherit; }
a { color: inherit; }

.tr-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.75rem);
}

.tr-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--ink);
  margin-bottom: clamp(1.25rem, 3vw, 2.5rem);
}

.tr-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.tr-mark {
  position: relative;
  width: 38px;
  height: 38px;
  flex: none;
  border: 2px solid var(--ink);
  background:
    linear-gradient(90deg, transparent 48%, var(--ink) 48% 52%, transparent 52%),
    linear-gradient(transparent 48%, var(--ink) 48% 52%, transparent 52%),
    var(--mustard);
  box-shadow: var(--shadow-hard);
  transform: rotate(-6deg);
}
.tr-mark::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  right: -7px;
  bottom: -7px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--coral);
}

.tr-brand h1,
.tr-title,
.tr-card h2,
.tr-target-card h2,
.tr-reward h2 {
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.04;
  margin: 0;
}

.tr-brand h1 { font-size: clamp(1.45rem, 4vw, 2rem); }
.tr-brand p,
.tr-kicker {
  margin: 0;
  color: var(--forest);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tr-link,
.tr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--canvas);
  color: var(--ink);
  font-weight: 800;
  line-height: 1;
  min-height: 44px;
  padding: 0.78rem 1rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-hard);
  transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.tr-link:hover,
.tr-btn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-hard-lg); }
.tr-link:focus-visible,
.tr-btn:focus-visible,
.tr-choice:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.tr-btn--primary { background: var(--coral); color: var(--ink); }
.tr-btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.tr-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.42fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: stretch;
  margin-bottom: 1.5rem;
}

.tr-title {
  font-size: clamp(2.45rem, 6vw, 4.5rem);
  max-width: 10ch;
}
.tr-title span { background-image: linear-gradient(transparent 65%, var(--mustard) 65%); padding: 0 4px; }
.tr-lede {
  color: #444;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 500;
  line-height: 1.65;
  max-width: 54ch;
  margin: 1.25rem 0 0;
}

.tr-outpost-map {
  position: relative;
  min-height: 232px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--canvas-alt);
  box-shadow: var(--shadow-hard-lg);
  overflow: hidden;
}
.tr-outpost-map::before {
  content: '';
  position: absolute;
  inset: 18px;
  background:
    linear-gradient(90deg, rgba(26, 26, 26, 0.13) 1px, transparent 1px),
    linear-gradient(180deg, rgba(26, 26, 26, 0.13) 1px, transparent 1px);
  background-size: 38px 38px;
}
.tr-outpost-map b {
  position: absolute;
  left: 22px;
  top: 22px;
  z-index: 2;
  max-width: 13ch;
  font-family: var(--f-display);
  font-size: 1.55rem;
  line-height: 1;
}
.tr-map-plot {
  position: absolute;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard);
  z-index: 1;
}
.tr-map-plot--forest { width: 112px; height: 74px; right: 30px; top: 30px; background: var(--forest); transform: rotate(5deg); }
.tr-map-plot--mustard { width: 96px; height: 92px; left: 38px; bottom: 32px; background: var(--mustard); transform: rotate(-8deg); }
.tr-map-plot--coral { width: 76px; height: 76px; right: 74px; bottom: 40px; border-radius: 50%; background: var(--coral); }
.tr-map-path {
  position: absolute;
  left: 34px;
  right: 28px;
  bottom: 88px;
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 18px, transparent 18px 30px);
  transform: rotate(-11deg);
  z-index: 2;
}
.tr-map-stamp {
  position: absolute;
  right: 26px;
  bottom: 24px;
  z-index: 3;
  background: var(--mustard);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard);
  padding: 0.45rem 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  transform: rotate(-5deg);
}

.tr-progress-wrap {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.tr-progress-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tr-progress {
  height: 18px;
  border: 2px solid var(--ink);
  background: var(--canvas-alt);
  border-radius: 999px;
  overflow: hidden;
}
.tr-progress span {
  display: block;
  height: 100%;
  width: var(--pct, 0%);
  background: linear-gradient(90deg, var(--coral), var(--mustard));
}

.tr-card {
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--canvas);
  box-shadow: var(--shadow-hard-lg);
  padding: clamp(1rem, 3vw, 2rem);
}
.tr-card h2 { font-size: clamp(1.6rem, 4vw, 2.45rem); margin-bottom: 0.75rem; }
.tr-card p { margin: 0; color: #444; font-weight: 500; }

.tr-play-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.38fr) minmax(0, 0.62fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: start;
}

.tr-target-card,
.tr-work-card {
  display: grid;
  gap: 1rem;
  align-content: start;
}
.tr-target-card h2 { font-size: clamp(2rem, 5vw, 3.4rem); }

.tr-facts {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}
.tr-facts div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: baseline;
  border-top: 2px solid var(--rule);
  padding-top: 0.75rem;
}
.tr-facts dt {
  color: var(--forest);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}
.tr-facts dd { margin: 0; color: #444; font-weight: 700; }

.tr-instruction {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.tr-mini-label {
  color: var(--forest);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.tr-count-pill {
  flex: none;
  border: 2px solid var(--ink);
  background: var(--mustard);
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  font-weight: 900;
  box-shadow: 3px 3px 0 0 rgba(34,32,28,.20);
}

.tr-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}
.tr-choice {
  min-height: 64px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--canvas-alt);
  color: var(--ink);
  box-shadow: var(--shadow-hard);
  cursor: pointer;
  font-weight: 900;
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  transition: transform 0.12s ease-in-out, box-shadow 0.12s ease-in-out, background 0.12s ease-in-out;
}
.tr-choice:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-hard-lg); }
.tr-choice.is-selected {
  background: var(--forest);
  color: var(--canvas);
}
.tr-choice.is-correct {
  background: var(--mustard);
  color: var(--ink);
}
.tr-choice.is-extra {
  background: var(--canvas);
  color: var(--ink);
  background-image: repeating-linear-gradient(-45deg, transparent 0 9px, rgba(255, 90, 54, 0.22) 9px 18px);
}

.tr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

.tr-feedback,
.tr-success {
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-hard);
}
.tr-feedback { background: #fff7df; }
.tr-success { background: #e7f0e9; }
.tr-feedback h3,
.tr-success strong {
  display: block;
  margin: 0 0 0.35rem;
  font-family: var(--f-display);
  font-size: 1.35rem;
  line-height: 1.05;
}
.tr-feedback p,
.tr-success p { margin: 0; color: #333; font-weight: 600; line-height: 1.55; }

.tr-reward {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 1.25rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--canvas-alt);
  box-shadow: var(--shadow-hard-lg);
  padding: clamp(1.5rem, 5vw, 4rem);
}
.tr-reward h2 { font-size: clamp(2.5rem, 8vw, 5rem); }
.tr-reward p {
  max-width: 52ch;
  margin: 0 auto;
  color: #444;
  font-weight: 600;
  line-height: 1.65;
}
.tr-reward-map {
  width: min(320px, 80vw);
  aspect-ratio: 1.45;
  border: 2px solid var(--ink);
  background:
    linear-gradient(90deg, rgba(26,26,26,.13) 1px, transparent 1px),
    linear-gradient(rgba(26,26,26,.13) 1px, transparent 1px),
    radial-gradient(circle at 30% 45%, var(--forest) 0 32px, transparent 33px),
    radial-gradient(circle at 68% 55%, var(--mustard) 0 42px, transparent 43px),
    var(--canvas);
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
  box-shadow: var(--shadow-hard-lg);
}

@media (max-width: 820px) {
  .tr-topbar,
  .tr-instruction {
    align-items: flex-start;
    flex-direction: column;
  }
  .tr-hero,
  .tr-play-grid {
    grid-template-columns: 1fr;
  }
  .tr-outpost-map { min-height: 190px; }
  .tr-choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tr-actions .tr-btn,
  .tr-link { width: 100%; }
}

@media (max-width: 460px) {
  .tr-shell { padding: 1rem; }
  .tr-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
  .tr-choice { min-height: 58px; }
  .tr-progress-row { align-items: flex-start; flex-direction: column; }
  .tr-map-plot--forest { right: 18px; }
  .tr-map-plot--coral { right: 42px; }
}

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

.tr-token {
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
  min-width: 4.5rem;
  min-height: 4.5rem;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--mustard);
  box-shadow: var(--shadow-hard);
  font-family: var(--f-display);
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 900;
}
.tr-token--shape { background: #fffaf0; }
.tr-token--blue { --shape-fill: #6CA6D9; }
.tr-token--red { --shape-fill: var(--coral); }
.tr-token--green { --shape-fill: var(--forest); }
.tr-token--gold { --shape-fill: var(--mustard); }
.tr-shape { display: block; width: 3rem; height: 3rem; background: var(--shape-fill); border: 3px solid var(--ink); }
.tr-shape--circle { border-radius: 999px; }
.tr-shape--square { border-radius: 5px; }
.tr-shape--rectangle { width: 3.5rem; height: 2.25rem; border-radius: 5px; }
.tr-shape--triangle { width: 0; height: 0; background: transparent; border-left: 1.8rem solid transparent; border-right: 1.8rem solid transparent; border-bottom: 3.2rem solid var(--shape-fill); filter: drop-shadow(0 0 0 var(--ink)); position: relative; }
.tr-shape--triangle::after { content: ''; position: absolute; left: -2.15rem; top: 0.15rem; width: 0; height: 0; border-left: 2.15rem solid transparent; border-right: 2.15rem solid transparent; border-bottom: 3.8rem solid var(--ink); z-index: -1; }

.tr-venn-wrap { display: grid; gap: 0.7rem; justify-items: center; }
.tr-venn {
  position: relative;
  width: min(100%, 520px);
  min-height: 310px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: #fffaf0;
  box-shadow: var(--shadow-hard);
  overflow: hidden;
}
.tr-circle { position: absolute; top: 42px; width: 230px; height: 230px; border: 9px solid; border-radius: 999px; opacity: 0.9; pointer-events: none; }
.tr-circle--a { left: 68px; border-color: var(--forest); background: rgba(45, 74, 62, 0.08); }
.tr-circle--b { right: 68px; border-color: var(--coral); background: rgba(255, 90, 54, 0.08); }
.tr-region {
  position: absolute;
  min-width: 86px;
  min-height: 52px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--canvas);
  color: var(--ink);
  box-shadow: 3px 3px 0 rgba(34,32,28,.20);
  font: 900 0.92rem/1 var(--f-display);
  cursor: pointer;
  z-index: 2;
}
.tr-region[aria-disabled="true"] { cursor: default; opacity: 0.72; }
.tr-region--only-a { left: 70px; top: 132px; }
.tr-region--both { left: 50%; top: 132px; transform: translateX(-50%); background: var(--mustard); }
.tr-region--only-b { right: 70px; top: 132px; }
.tr-region--outside { left: 50%; bottom: 18px; transform: translateX(-50%); }
.tr-region:hover:not([aria-disabled="true"]), .tr-choice:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 rgba(34,32,28,.20); }
.tr-region--both:hover:not([aria-disabled="true"]), .tr-region--outside:hover:not([aria-disabled="true"]) { transform: translateX(-50%) translate(-1px, -1px); }
.tr-region:focus-visible, .tr-choice:focus-visible, .tr-btn:focus-visible, .tr-link:focus-visible { outline: 4px solid var(--mustard); outline-offset: 3px; }
.tr-region.is-selected, .tr-choice.is-selected { background: var(--forest); color: var(--canvas); }
.tr-region.is-correct, .tr-choice.is-correct { background: var(--mustard); color: var(--ink); }
.tr-region.is-extra, .tr-choice.is-extra { background: #fff; border-style: dashed; }
.tr-ring-label { font-weight: 900; font-size: 0.92rem; text-transform: uppercase; letter-spacing: 0.06em; }
.tr-ring-label--a { color: var(--forest); }
.tr-ring-label--b { color: var(--coral); }
.tr-map-note { margin: 0; font-weight: 800; color: var(--muted); }
.tr-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.tr-choice { min-height: 54px; border: 3px solid var(--ink); border-radius: var(--radius); background: var(--canvas-alt); box-shadow: var(--shadow-hard); font: 900 1rem/1 var(--f-display); cursor: pointer; }
.tr-map-card { position: relative; min-height: 220px; }
.tr-map-ring { position: absolute; width: 116px; height: 116px; border: 8px solid; border-radius: 999px; top: 48px; opacity: 0.9; }
.tr-map-ring--a { left: calc(50% - 105px); border-color: var(--forest); }
.tr-map-ring--b { right: calc(50% - 105px); border-color: var(--coral); }
.tr-map-pin { position: absolute; left: 50%; top: 102px; width: 22px; height: 22px; border: 3px solid var(--ink); border-radius: 999px; background: var(--mustard); transform: translateX(-50%); z-index: 2; }
.tr-reward-map { position: relative; width: min(340px, 100%); height: 190px; margin: 0 auto; border: 3px solid var(--ink); border-radius: var(--radius); background: radial-gradient(circle at 42% 50%, rgba(46,81,65,0.18) 0 33%, transparent 34%), radial-gradient(circle at 58% 50%, rgba(200,81,46,0.18) 0 33%, transparent 34%), #fffaf0; box-shadow: var(--shadow-hard); }

@media (max-width: 640px) {
  .tr-venn { min-height: 280px; }
  .tr-circle { width: 185px; height: 185px; top: 42px; }
  .tr-circle--a { left: 20px; }
  .tr-circle--b { right: 20px; }
  .tr-region { min-width: 74px; min-height: 50px; font-size: 0.8rem; }
  .tr-region--only-a { left: 22px; top: 118px; }
  .tr-region--both { top: 118px; }
  .tr-region--only-b { right: 22px; top: 118px; }
  .tr-choice-grid { grid-template-columns: 1fr; }
}
