.lan-page {
  min-height: 100dvh;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.lan-header {
  padding: calc(18px + env(safe-area-inset-top)) clamp(18px, 4vw, 40px) 10px;
}

.lan-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.lan-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: #fffaf0;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(17, 35, 29, .08);
}

.lan-title {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 8vw, 4rem);
  line-height: .95;
  color: #ff3f1f;
}

.lan-subtitle {
  margin: 0 0 10px;
  max-width: 38ch;
  color: var(--muted);
  font-size: 1.02rem;
}

.lan-intro {
  margin: 0;
  max-width: 42ch;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.45;
}

.lan-intro strong {
  color: var(--ink);
  font-weight: 700;
}

.lan-layout {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 24px) 32px;
}

.lan-panel {
  background: #fffdf8;
  border: 1px solid rgba(220, 229, 222, .9);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 20px 18px 22px;
}

.lan-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.lan-mode-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.lan-difficulty {
  width: fit-content;
  flex: 0 0 auto;
}

.lan-prompt-hint {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: .95rem;
}

.lan-prompt h2 strong {
  color: var(--spruce-dark);
}

.lan-map-wrap .lan-path.is-clickable {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: none) and (pointer: coarse) {
  .lan-map-wrap .lan-path.is-clickable:not(.is-disabled) {
    stroke: rgba(13, 95, 75, .001);
    stroke-width: 18;
    paint-order: stroke fill markers;
  }

  .lan-map-wrap .lan-path.is-clickable:not(.is-disabled):active {
    fill: #3d8a74;
  }
}

.lan-map-wrap .lan-path.is-disabled {
  pointer-events: none;
  opacity: .34;
}

.lan-map-wrap .lan-path.is-option {
  fill: #c8ddd2;
  opacity: 1;
}

.lan-map-wrap .lan-path.is-wrong-pick {
  fill: #b94a34;
  opacity: 1;
}

.lan-map-wrap .lan-path.is-clickable:not(.is-disabled):hover {
  fill: #3d8a74;
}

.lan-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lan-reset-btn {
  min-height: 40px;
  padding: 0 14px;
  font-size: .88rem;
  box-shadow: none;
  flex-shrink: 0;
}

.lan-score {
  margin: 0;
  font-weight: 750;
  color: var(--rail);
}

.lan-difficulty {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: #efe9df;
}

.lan-diff-btn {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: .92rem;
}

.lan-diff-btn.is-active {
  background: var(--spruce);
  color: #fff;
  box-shadow: 0 8px 18px rgba(13, 95, 75, .22);
}

.lan-map-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0;
  margin-bottom: 18px;
  touch-action: manipulation;
  line-height: 0;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.lan-map-card.is-correct {
  animation: lan-flash-mint .55s ease;
}

.lan-map-card.is-wrong {
  animation: lan-flash-coral .55s ease;
}

@keyframes lan-flash-mint {
  0%, 100% { box-shadow: 0 0 0 0 rgba(13, 95, 75, 0); }
  50% { box-shadow: 0 0 0 4px rgba(13, 95, 75, .28); }
}

@keyframes lan-flash-coral {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 108, 77, 0); }
  50% { box-shadow: 0 0 0 4px rgba(239, 108, 77, .32); }
}

.lan-map-wrap {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  line-height: 0;
}

.lan-map-wrap svg {
  display: block;
  width: 100%;
  height: auto;
}

.lan-map-wrap .lan-path {
  cursor: default;
}

.lan-map-wrap .lan-path.is-dimmed {
  fill: #e7ebe8;
  opacity: .72;
}

.lan-map-wrap .lan-path.is-played {
  fill: #dfe8e2;
  stroke: rgba(13, 95, 75, .22);
  stroke-width: .35;
}

.lan-map-wrap .lan-path.is-dimmed.is-played {
  fill: #dce5df;
  opacity: .82;
}

.lan-map-wrap .lan-path.is-target {
  fill: var(--spruce);
  opacity: 1;
}

.lan-map-wrap .lan-path.is-reveal {
  fill: var(--coral);
  opacity: 1;
}

.lan-prompt h2 {
  margin: 0 0 16px;
  font-size: 1.2rem;
  color: var(--rail);
}

.lan-answer-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lan-answer-block > [hidden] {
  display: none !important;
}

.lan-answers[hidden],
.lan-hard-form[hidden] {
  display: none !important;
}

.lan-choices {
  display: grid;
  gap: 10px;
  margin: 0;
}

.lan-choice {
  width: 100%;
  justify-content: flex-start;
  min-height: 48px;
  margin: 0;
  padding: 12px 18px;
  text-align: left;
  font-size: 1rem;
  box-shadow: none;
}

.lan-choice:not(:disabled):hover {
  box-shadow: 0 8px 18px rgba(13, 95, 75, .18);
}

.lan-choice.is-correct-pick {
  background: var(--spruce-dark);
}

.lan-choice.is-wrong-pick {
  background: #b94a34;
}

.lan-hard-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin: 0;
}

.lan-hard-form input {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}

.lan-hard-form input:focus {
  outline: 2px solid rgba(13, 95, 75, .28);
  outline-offset: 2px;
}

.lan-hard-form button {
  min-height: 48px;
  margin: 0;
  padding-inline: 20px;
  align-self: center;
  box-shadow: none;
}

.lan-hard-form button:not(:disabled):hover {
  box-shadow: 0 8px 18px rgba(13, 95, 75, .18);
}

.lan-feedback {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 650;
}

.lan-feedback[hidden] {
  display: none !important;
}

.lan-feedback.is-correct {
  background: var(--mint);
  color: var(--spruce-dark);
}

.lan-feedback.is-wrong {
  background: #ffe8e1;
  color: #8f3b28;
}

.lan-feedback.is-perfect {
  background: #efe9df;
  color: var(--ink);
}

.lan-perfect-lead {
  margin: 0;
  font-weight: 750;
}

.lan-perfect-copy {
  margin: .5rem 0 0;
}

.lan-mail-link {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: .15em;
}

.lan-round-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .92rem;
}

.lan-next-round-btn {
  width: 100%;
  min-height: 48px;
  margin: 0;
  box-shadow: none;
}

.lan-reset-prompt {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #efe9df;
  border: 1px solid rgba(17, 35, 29, .08);
}

.lan-reset-prompt-title {
  margin: 0 0 4px;
  font-weight: 750;
  color: var(--rail);
}

.lan-reset-prompt-desc {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .95rem;
}

.lan-reset-prompt-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lan-confirm-reset,
.lan-cancel-reset {
  width: 100%;
  min-height: 44px;
  margin: 0;
  box-shadow: none;
}

.lan-loading {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
}

.lan-diff-btn:disabled,
.lan-reset-btn:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.lan-actions {
  margin: 0;
}

.lan-actions:has(.lan-next-btn[hidden]) {
  display: none;
}

.lan-actions button {
  width: 100%;
  margin: 0;
  box-shadow: none;
}

@media (min-width: 640px) {
  .lan-layout {
    max-width: 640px;
  }

  .lan-map-wrap {
    max-width: 360px;
  }

  .lan-reset-prompt-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .lan-confirm-reset,
  .lan-cancel-reset {
    width: auto;
  }
}
