:root {
  --ink: #17231d;
  --green: #2f6848;
  --green-dark: #214a34;
  --cream: #f5f0e5;
  --paper: #fffdf7;
  --yellow: #f3c75f;
  --orange: #e58d4a;
  --blue: #7db5c9;
  --red: #e04a5f;
  --muted: #69736c;
  --white: #ffffff;
  --border: #dedfd8;
  --accent-bg: #edf0e8;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: inherit;
}

/* Header */

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: transparent;
  border-bottom: none;
}

.site-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
    color: white;
    text-decoration: none;
    font-size: 21px;
    font-weight: 900;
    letter-spacing: -.5px;
}

.lang-switch {
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  overflow: hidden;
  background: transparent;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.625rem 1.0625rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.lang-btn:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.1);
}

.lang-btn.is-active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Hero */

.hero {
  position: relative;
  min-height: 720px;
  display: flex;
  align-items: center;
  background: url('/public/media/hero-forest.jpg') center/cover no-repeat;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(20, 46, 32, 0.92), rgba(33, 74, 52, 0.72) 55%, rgba(33, 74, 52, 0.4));
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: -90px;
  height: 170px;
  background: var(--cream);
  border-radius: 50% 50% 0 0 / 35% 35% 0 0;
  z-index: 1;
}

.hero-content {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 130px 28px 160px;
  position: relative;
  z-index: 2;
}

.badge {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f7d984;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 22px;
}

.hero h1 {
  font-size: clamp(55px, 8vw, 94px);
  color: white;
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -5px;
  margin: 22px 0 20px;
  max-width: 900px;
}

.hero-subtitle {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.87);
  margin: 0 0 32px;
  max-width: 650px;
  line-height: 1.55;
  font-weight: 400;
}

.hero-cta {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 55px;
  padding: 0 24px;
  border-radius: 14px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 800;
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
}

.btn-primary {
  background: var(--yellow);
  color: #33260b;
  box-shadow: 0 9px 25px rgba(0, 0, 0, 0.18);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 13px 30px rgba(0, 0, 0, 0.25);
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-secondary-light {
  background: transparent;
  color: var(--green-dark);
  border: 2px solid var(--green);
}

.btn-secondary-light:hover {
  background: var(--accent-bg);
}

.hero-note {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  font-weight: 400;
}

/* Sections */

section h2 {
  font-size: clamp(38px, 5vw, 57px);
  color: var(--ink);
  font-weight: 900;
  letter-spacing: -2.5px;
  margin: 12px 0;
  line-height: 1;
}

.locations {
  max-width: 1080px;
  margin: 0 auto;
  padding: 100px 28px;
  background: var(--paper);
}

.locations h2 {
  text-align: center;
}

.locations-subtitle {
  text-align: center;
  color: var(--muted);
  margin-top: 0.5rem;
  font-size: 1.125rem;
  margin-bottom: 0;
}

.location-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.location-card {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  padding: 28px;
  border-radius: 24px;
  background: url('/public/media/hero-forest.jpg') center/cover no-repeat;
  display: flex;
  align-items: flex-end;
  border: none;
  text-decoration: none;
  transition: transform 0.2s ease;
}

a.location-card:hover {
  transform: translateY(-4px);
}

.location-card.is-disabled {
  cursor: default;
}

.location-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 46, 32, 0) 35%, rgba(20, 46, 32, 0.85) 100%);
}

.location-card h3 {
  position: relative;
  z-index: 1;
  color: white;
  font-size: 27px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.8px;
  line-height: 1.2;
}

/* Location detail page */

.location-hero {
  position: relative;
  min-height: 340px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.location-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 46, 32, 0.15), rgba(20, 46, 32, 0.85));
}

.location-hero-content {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
  padding: 100px 28px 36px;
}

.back-link {
  display: inline-block;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9375rem;
  margin-bottom: 14px;
}

.back-link:hover {
  color: white;
}

.location-hero h1 {
  color: white;
  font-size: clamp(32px, 6vw, 48px);
  font-weight: 900;
  letter-spacing: -1.5px;
  margin: 0;
}

.location-detail {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 28px 80px;
}

.location-description {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

.location-map {
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.location-map iframe {
  width: 100%;
  height: 360px;
  border: 0;
  display: block;
}


/* Final CTA */

.final-cta {
  max-width: 700px;
  margin: auto;
  padding: 110px 28px;
  text-align: center;
  background: transparent;
  border: none;
  box-shadow: none;
}

.final-cta h2 {
  font-size: clamp(40px, 6vw, 65px);
  color: var(--ink);
  margin: 12px 0 18px;
  font-weight: 900;
  letter-spacing: -3px;
  line-height: 1;
}

.final-cta p {
  font-size: 18px;
  color: var(--muted);
  max-width: 560px;
  margin: auto auto 30px;
  line-height: 1.6;
}

/* Footer */

.site-footer {
  padding: 30px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: #7b837d;
  font-size: 13px;
  background: var(--cream);
}

/* Larger screens */

@media (max-width: 750px) {
  .site-header-inner {
    padding: 18px 20px;
  }

  .lang-switch {
    font-size: 0.75rem;
  }

  .hero {
    min-height: 680px;
  }

  .hero-content {
    padding: 120px 22px 140px;
  }

  .hero h1 {
    font-size: 58px;
    letter-spacing: -3px;
  }

  .hero-subtitle {
    font-size: 17px;
  }

  .locations {
    padding: 75px 22px;
  }

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

  .final-cta {
    padding: 80px 22px;
  }
}

@media (min-width: 640px) {
  .location-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .location-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Quest task page */

.quest-body {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 22px 80px;
}

.quest-panel {
  display: none;
}

.quest-panel.on {
  display: block;
}

.quest-panel h1 {
  font-size: clamp(26px, 6vw, 34px);
  color: var(--green-dark);
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 14px;
}

.quest-panel h2 {
  font-size: 22px;
  color: var(--green-dark);
  font-weight: 800;
  margin-bottom: 6px;
}

.quest-panel p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 14px;
}

.quest-task-box {
  background: rgba(243, 199, 95, 0.18);
  border-left: 4px solid var(--yellow);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 20px 0 28px;
  color: var(--ink);
  line-height: 1.6;
}

.quest-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quest-status {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 14px;
}

.quest-board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  aspect-ratio: 1;
  background: var(--ink);
  padding: 3px;
  border-radius: 14px;
}

.quest-tile {
  position: relative;
  aspect-ratio: 1;
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  background-size: 700% 700%;
  background-repeat: no-repeat;
  padding: 0;
  transition: transform 0.15s;
}

.quest-tile:focus-visible {
  outline: 3px solid var(--blue);
  z-index: 1;
}

.quest-tile.ok {
  border-color: var(--green);
}

.quest-tile.bad {
  border-color: var(--red);
}

.quest-tile.hole {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

.quest-tile.cross::before,
.quest-tile.cross::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 15%;
  width: 3px;
  height: 70%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6);
}

.quest-tile.cross::before {
  transform: translateX(-50%) rotate(45deg);
}

.quest-tile.cross::after {
  transform: translateX(-50%) rotate(-45deg);
}

.quest-tile:active:not(.hole) {
  transform: scale(.94);
}

.quest-board.solved .quest-tile {
  border-color: var(--green);
  animation: quest-ripple .8s ease-out both;
  animation-delay: calc(var(--d) * 40ms);
}

.quest-board.solved .quest-tile.hole {
  background-position: var(--pos);
}

@keyframes quest-ripple {
  40% {
    transform: scale(1.1);
    box-shadow: 0 0 14px var(--green);
  }
}

@keyframes quest-pulse-ok {
  0% { transform: scale(1); }
  35% { transform: scale(1.18); box-shadow: 0 0 12px rgba(47, 104, 72, .6); }
  100% { transform: scale(1); }
}

@keyframes quest-pulse-bad {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.quest-tile.pulse-ok {
  animation: quest-pulse-ok .4s ease;
}

.quest-tile.pulse-bad {
  animation: quest-pulse-bad .4s ease;
}

.quest-hud {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.quest-hud .btn {
  font-size: 15px;
  padding: 12px 16px;
}

.quest-map-img {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 16px;
  display: block;
  margin: 16px 0;
}

.quest-tip {
  font-size: 15px;
}

.quest-error {
  color: var(--red);
  font-size: 15px;
  margin-top: 10px;
  display: none;
}

.quest-error.on {
  display: block;
}

/* Bust hunt */

.quest-target-card {
  background: var(--paper);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin: 20px 0;
}

.quest-target-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--green-dark);
  font-size: 20px;
  margin-bottom: 8px;
}

.quest-target-name {
  flex: 1;
}

.quest-icon-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  line-height: 1;
}

.quest-target-card p {
  color: var(--muted);
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
}

.quest-progress {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 4px;
}

.quest-photo-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
}

.quest-feedback {
  margin-top: 16px;
  font-weight: 700;
  min-height: 22px;
}

.quest-feedback.is-good {
  color: var(--green);
}

.quest-feedback.is-warn {
  color: var(--orange);
}

.quest-feedback.is-bad {
  color: var(--red);
}

.quest-model-status {
  color: var(--muted);
  font-size: 13px;
  margin-top: 10px;
}

/* AR camera stage */

.quest-camera-stage {
  position: fixed;
  inset: 0;
  display: none;
  background: var(--ink);
  z-index: 60;
}

.quest-camera-stage.on {
  display: block;
}

.quest-camera-stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quest-camera-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.quest-camera-hint {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  pointer-events: none;
}

.quest-camera-hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(20px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 0 20px;
}

.quest-camera-hud .btn {
  background: rgba(23, 35, 29, 0.55);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  width: auto;
  padding: 12px 20px;
}

/* Quiz */

.quest-quiz-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 20px 0 10px;
}

.quest-quiz-option {
  font: inherit;
  font-size: 22px;
  font-weight: 800;
  padding: 20px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.1s, border-color 0.2s, background 0.2s;
}

.quest-quiz-option:hover:not(:disabled) {
  border-color: var(--green);
}

.quest-quiz-option:active:not(:disabled) {
  transform: scale(0.96);
}

.quest-quiz-option:disabled {
  opacity: 0.5;
  cursor: default;
}

.quest-quiz-option.correct {
  border-color: var(--green);
  background: var(--accent-bg);
  animation: quest-pulse-ok 0.5s ease;
}

.quest-quiz-option.wrong {
  border-color: var(--red);
  animation: quest-pulse-bad 0.4s ease;
}

.quest-quiz-message {
  min-height: 20px;
  font-weight: 700;
  color: var(--red);
}

.quest-quiz-message.is-cooldown {
  color: var(--muted);
}

@media (min-width: 420px) {
  .quest-quiz-options {
    grid-template-columns: repeat(3, 1fr);
  }
}

.quest-done {
  position: fixed;
  inset: 0;
  background: rgba(250, 246, 236, 0.97);
  display: none;
  place-items: center;
  text-align: center;
  padding: 24px;
  z-index: 50;
}

.quest-done.on {
  display: grid;
}

.quest-done-badge {
  width: 140px;
  height: 140px;
  margin: 0 auto 18px;
}

.quest-done-badge circle.ring {
  stroke: var(--green);
  stroke-width: 8;
  fill: none;
  stroke-dasharray: 440;
  stroke-dashoffset: 440;
  animation: quest-draw .9s ease-out forwards;
}

.quest-done-badge path.tick {
  stroke: var(--green);
  stroke-width: 10;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  animation: quest-draw .5s ease-out .8s forwards;
}

@keyframes quest-draw {
  to { stroke-dashoffset: 0; }
}

.quest-done h2 {
  font-size: 30px;
  color: var(--green-dark);
  opacity: 0;
  animation: quest-rise .5s 1.1s forwards;
}

.quest-done p {
  color: var(--muted);
  opacity: 0;
  animation: quest-rise .5s 1.4s forwards;
}

.quest-done .btn {
  max-width: 280px;
  opacity: 0;
  animation: quest-rise .5s 1.8s forwards;
}

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

.quest-confetti {
  position: fixed;
  top: -12px;
  width: 10px;
  height: 16px;
  opacity: .95;
  animation: quest-fall linear forwards;
}

@keyframes quest-fall {
  to { transform: translateY(110vh) rotate(720deg); }
}

@media (prefers-reduced-motion: reduce) {
  .quest-tile,
  .btn {
    transition: none;
  }
  .quest-confetti,
  .quest-board.solved .quest-tile,
  .quest-tile.pulse-ok,
  .quest-tile.pulse-bad,
  .quest-quiz-option.correct,
  .quest-quiz-option.wrong {
    animation: none;
  }
}
