:root {
  --ink: #1f2a22;
  --muted: #4d5b52;
  --cream: #f6f0e4;
  --paper: #fffaf2;
  --terracotta: #c05621;
  --gold: #c0882a;
  --forest: #2f5d3a;
  --forest-dark: #1e3d28;
  --sky: #6aa8c4;
  --shadow: 0 16px 40px rgba(31, 42, 34, 0.12);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Vazirmatn, Tahoma, sans-serif;
  color: var(--ink);
  background: #e9dfc8;
  line-height: 1.8;
}

.bg-mountains {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(232, 223, 200, 0.72), rgba(233, 223, 200, 0.92)),
    url("images/hero-mountains.jpg") center top / cover no-repeat;
}

.site-header, main, footer {
  width: min(1100px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 0 10px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: right;
}

.logo-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--forest);
  color: #fff;
  font-weight: 800;
  font-size: 22px;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text small {
  color: var(--muted);
  font-size: 12px;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
}

.site-link,
.city-site a,
footer a {
  color: var(--forest-dark);
  font-weight: 700;
  text-decoration: none;
}

.site-link:hover,
.city-site a:hover,
footer a:hover {
  color: var(--terracotta);
  text-decoration: underline;
}

.city-site {
  margin: 8px 0 0;
  font-weight: 700;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--terracotta);
}

.view {
  display: none;
  padding-bottom: 48px;
}

.view.active {
  display: block;
}

.hero {
  padding: 28px 0 8px;
}

.eyebrow {
  margin: 0;
  color: var(--terracotta);
  font-weight: 700;
}

h1, h2 {
  margin: 6px 0;
  line-height: 1.4;
}

h1 {
  font-size: clamp(28px, 5vw, 46px);
}

.lead {
  max-width: 680px;
  color: var(--muted);
}

.hero-photo {
  position: relative;
  margin: 8px 0 18px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-photo img {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.hero-photo span {
  position: absolute;
  right: 14px;
  bottom: 12px;
  background: rgba(20, 40, 28, 0.72);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
}

.photo-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.photo-strip figure {
  margin: 0;
  background: var(--paper);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(31, 42, 34, 0.08);
}

.photo-strip img {
  display: block;
  width: 100%;
  height: 88px;
  object-fit: cover;
}

.photo-strip figcaption {
  font-size: 12px;
  text-align: center;
  padding: 6px 4px 8px;
  color: var(--muted);
}

.card-photo {
  width: calc(100% + 44px);
  margin: -22px -22px 8px;
  height: 150px;
  object-fit: cover;
  border-radius: 22px 22px 0 0;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 20px;
}

.game-card, .panel {
  background: var(--paper);
  border: 1px solid rgba(47, 93, 58, 0.12);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.game-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.card-badge {
  width: fit-content;
  background: #efe3c8;
  color: var(--forest-dark);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
}

.game-card ul {
  margin: 0;
  padding-right: 18px;
  color: var(--muted);
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  margin-top: auto;
  background: var(--forest);
  color: #fff;
}

.btn-primary:hover {
  background: var(--forest-dark);
}

.btn-ghost {
  background: #efe8d8;
  color: var(--ink);
}

.panel {
  padding: 20px;
  margin-top: 12px;
}

.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.stats {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.progress-bar {
  height: 8px;
  background: #efe8d8;
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 18px;
}

#quizBar {
  height: 100%;
  width: 8%;
  background: linear-gradient(90deg, var(--forest), var(--gold));
  transition: width 0.3s ease;
}

.quiz-photo,
.place-photo,
.card-photo,
.hero-photo img,
.photo-strip img {
  background: #d7c9a8;
}

.quiz-photo {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 14px;
  display: block;
}

.question {
  font-size: 22px;
  margin: 0 0 16px;
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  text-align: right;
  background: #f3ecdc;
  border: 2px solid transparent;
  padding: 12px 14px;
  border-radius: 14px;
  font: inherit;
  cursor: pointer;
}

.option.correct {
  border-color: #2f855a;
  background: #e4f3e8;
}

.option.wrong {
  border-color: #c53030;
  background: #fde8e8;
}

.explain {
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  background: #eef6ea;
}

.found-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  min-height: 0;
  margin-top: 12px;
}

.found-strip figure {
  margin: 0;
  width: 92px;
  flex: 0 0 92px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(31, 42, 34, 0.1);
}

.found-strip img {
  display: block;
  width: 92px;
  height: 64px;
  object-fit: cover;
}

.found-strip figcaption {
  font-size: 11px;
  text-align: center;
  padding: 4px 4px 6px;
  color: var(--forest-dark);
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.mem-card {
  min-height: 180px;
  cursor: pointer;
  border: 3px solid transparent;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #fff4de;
}

.mem-card.open-photo {
  padding: 0;
  background: #cbb88a;
}

.mem-card.open-photo img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #cbb88a;
}

.mem-card.open-name {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  text-align: center;
  font: inherit;
  font-weight: 800;
  color: var(--ink);
}

.mem-card.open-name small {
  font-weight: 500;
  color: var(--muted);
}

.mem-card.selected {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(192, 86, 33, 0.25);
}

.mem-card.matched {
  border-color: #2f855a;
  opacity: 0.88;
}

.mem-card.matched.open-name {
  background: #e4f3e8;
}

.hint {
  color: var(--muted);
  margin: 8px 0 0;
}

.map-wrap {
  position: relative;
  margin-top: 12px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(47, 93, 58, 0.15);
}

#cityMap {
  width: 100%;
  height: auto;
  display: block;
}

.map-credit {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0;
}

.map-pins {
  position: absolute;
  inset: 0;
}

.pin {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 42px;
  height: 42px;
  padding: 0 8px;
  border-radius: 999px;
  border: 3px solid #fff;
  background: #9ca3af;
  color: #fff;
  font-weight: 800;
  cursor: not-allowed;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
  font-size: 13px;
}

.pin.open {
  background: var(--terracotta);
  cursor: pointer;
}

.pin.done {
  background: var(--forest);
  cursor: pointer;
}

.modal, .result {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  background: #fff4de;
}

.place-photo {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 14px;
  margin: 0 0 12px;
  display: block;
}

.hidden {
  display: none !important;
}

.result h3 {
  margin-top: 0;
}

footer {
  padding: 8px 0 28px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 860px) {
  .game-grid,
  .memory-board {
    grid-template-columns: 1fr 1fr;
  }

  .photo-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-photo img {
    height: 180px;
  }

  .header-meta span:not(.dot):not(:last-child) {
    display: none;
  }
}

@media (max-width: 560px) {
  .game-grid,
  .memory-board {
    grid-template-columns: 1fr;
  }

  .question {
    font-size: 18px;
  }
}
