:root {
  color-scheme: light;
  --ink: #172436;
  --ink-soft: #364152;
  --muted: #657181;
  --line: #d8e0dc;
  --line-strong: #c7d2cc;
  --surface: #ffffff;
  --surface-soft: #f6f8f6;
  --surface-tint: #eef6f0;
  --green: #3d9a4b;
  --green-dark: #247235;
  --green-deep: #1d5f2d;
  --gold: #c6bd49;
  --red: #c45b4f;
  --blue: #386fb2;
  --bg: #f8faf8;
  --row: #eef3f0;
  --shadow: 0 14px 32px rgba(23, 36, 54, 0.07);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(36, 114, 53, 0.26);
  outline-offset: 3px;
}

.game-shell {
  width: min(100% - 2rem, 920px);
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.85rem;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 8px;
  background: var(--green-dark);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  flex: 0 0 2.35rem;
}

.brand-copy {
  display: grid;
  gap: 0.14rem;
  min-width: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  color: var(--ink);
  font-size: clamp(1.02rem, 2vw, 1.16rem);
  font-weight: 780;
  line-height: 1.15;
}

.brand-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}

h2 {
  font-size: 1rem;
  line-height: 1.2;
}

.top-actions {
  display: flex;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.icon-button,
.close-button {
  display: inline-grid;
  place-items: center;
  border: 0;
  cursor: pointer;
}

.icon-button {
  width: 2.45rem;
  height: 2.45rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(23, 36, 54, 0.05);
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.text-button {
  white-space: nowrap;
  font-weight: 900;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-tint);
  transform: translateY(-1px);
}

.clue-stage {
  padding: 1.2rem 0 1rem;
}

.clue-content {
  min-width: 0;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.section-heading {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.section-title {
  color: var(--green-dark);
  font-size: 1.02rem;
  font-weight: 850;
  letter-spacing: 0;
}

.section-note {
  margin: 0.2rem auto 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.35;
}

.map-panel {
  margin-top: 1rem;
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(23, 36, 54, 0.04);
}

.turkey-map {
  display: block;
  width: 100%;
  height: auto;
}

.province-shape,
.map-outline {
  fill: #edf3ef;
  stroke: #ffffff;
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
  transition: fill 160ms ease, filter 160ms ease, stroke 160ms ease;
}

.province-shape {
  filter: drop-shadow(0 1px 0 rgba(23, 36, 54, 0.04));
}

.province-shape.guessed {
  stroke: #172436;
  stroke-width: 1.25;
  filter: drop-shadow(0 5px 8px rgba(23, 36, 54, 0.18));
}

.province-shape.correct {
  stroke: #1f7a36;
  stroke-width: 1.8;
}

.map-label {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 4px;
}

.clues {
  display: grid;
  gap: 0.6rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: clue;
}

.clues li {
  counter-increment: clue;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.45;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 4.4rem;
  padding: 0.78rem;
}

.clues li::before {
  content: counter(clue);
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--surface-tint);
  color: var(--green-dark);
  font-weight: 900;
  align-self: center;
}

.guess-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 0.75rem;
  margin-top: 0.45rem;
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  width: 100%;
  height: 3.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  outline: 0;
  padding: 0 1.6rem;
  font-size: 1rem;
  font-weight: 720;
  box-shadow: 0 6px 20px rgba(23, 36, 54, 0.04);
}

.input-wrap input::placeholder {
  color: #8d949d;
  text-transform: uppercase;
}

.input-wrap input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(61, 154, 75, 0.1);
}

.suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.45rem);
  left: 1rem;
  right: 1rem;
  max-height: 18rem;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 0.35rem;
}

.suggestion-option {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0.7rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 0.55rem 0.65rem;
  text-align: left;
  font-weight: 760;
}

.suggestion-option:hover,
.suggestion-option.active {
  background: var(--surface-tint);
}

.primary-button {
  min-height: 3.85rem;
  border: 0;
  border-radius: 999px;
  background: var(--green-dark);
  color: #ffffff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 850;
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--green-deep);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(36, 114, 53, 0.18);
}

.primary-button:disabled {
  cursor: default;
  opacity: 0.62;
  transform: none;
}

.status-message {
  min-height: 1.7rem;
  margin: 0.75rem 0 0;
  color: var(--green-dark);
  text-align: center;
  font-size: 0.95rem;
  font-weight: 760;
  line-height: 1.35;
}

.status-message.error {
  color: var(--red);
}

.share-actions {
  display: flex;
  justify-content: center;
  margin-top: 0.85rem;
}

.share-button {
  min-height: 2.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--green-dark);
  cursor: pointer;
  font-size: 0.96rem;
  font-weight: 850;
  padding: 0 1.4rem;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.share-button:hover,
.share-button:focus-visible {
  border-color: var(--green);
  background: var(--surface-tint);
  transform: translateY(-1px);
}

.share-button:disabled {
  cursor: default;
  opacity: 0.62;
  transform: none;
}

.results {
  margin-top: 1.35rem;
  overflow: hidden;
  border-radius: 0;
  box-shadow: none;
}

.results-heading {
  margin-bottom: 0.8rem;
}

.results-heading .section-note {
  font-size: 0.86rem;
  font-weight: 650;
}

.result-header,
.guess-row {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(112px, 0.7fr) 86px;
  align-items: center;
  column-gap: 0;
}

.result-header {
  border-radius: 8px 8px 0 0;
  background: #203047;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.result-header > span,
.guess-row > span {
  padding: 0.8rem 1rem;
}

.guess-row {
  min-height: 3.8rem;
  background: var(--row);
  border-top: 4px solid #ffffff;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 730;
}

.guess-row.correct {
  background: #bce3c4;
}

.city-cell {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.city-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 1.65rem;
  border-radius: 4px;
  background: #d83933;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  padding-top: 0.03rem;
  flex: 0 0 2.1rem;
}

.distance-cell,
.direction-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 4px solid #ffffff;
  text-align: center;
}

.direction-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--blue);
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}

.win-mark {
  color: var(--green-dark);
}

dialog {
  width: min(100% - 2rem, 440px);
  border: 0;
  border-radius: 8px;
  padding: 1.4rem;
  color: var(--ink);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(23, 36, 54, 0.32);
}

.close-button {
  position: absolute;
  right: 0.8rem;
  top: 0.7rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--surface-tint);
  color: var(--ink);
  font-size: 1.35rem;
}

#dialogContent h3 {
  margin: 0 2rem 0.8rem 0;
  font-size: 1.45rem;
}

#dialogContent p {
  margin: 0.7rem 0;
  color: #344255;
  line-height: 1.5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 680px) {
  .game-shell {
    width: min(100% - 1rem, 920px);
    padding-top: 1.2rem;
  }

  .topbar {
    align-items: flex-start;
  }

  .top-actions {
    gap: 0.4rem;
  }

  .icon-button {
    min-width: 2.55rem;
    height: 2.65rem;
    padding: 0 0.65rem;
    font-size: 0.82rem;
  }

  .clue-stage {
    padding-top: 1rem;
  }

  .map-panel {
    padding: 0.95rem 0.75rem 0.75rem;
  }

  .guess-form {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .input-wrap input {
    min-height: 3.75rem;
    height: 3.75rem;
  }

  .result-header,
  .guess-row {
    grid-template-columns: minmax(0, 1.25fr) 96px 64px;
  }

  .result-header > span,
  .guess-row > span {
    padding: 0.75rem 0.65rem;
  }

  .guess-row {
    font-size: 0.98rem;
  }

  .city-cell {
    gap: 0.45rem;
  }
}
