:root {
  --ink: #0f1b2d;
  --ink-soft: #3d4f5f;
  --paper: #eef4f6;
  --mist: #d4e4e8;
  --leaf: #1a8a7a;
  --leaf-deep: #0d2b4a;
  --sun: #e8a317;
  --coral: #c45c3a;
  --line: rgba(13, 43, 74, 0.12);
  --shadow: 0 24px 60px rgba(13, 43, 74, 0.14);
  --radius: 18px;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
}

body {
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: -20% -10% auto;
  height: 70vh;
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(26, 138, 122, 0.2), transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 10%, rgba(13, 43, 74, 0.14), transparent 55%),
    radial-gradient(ellipse 40% 35% at 60% 60%, rgba(26, 138, 122, 0.08), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.topo-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(20, 32, 26, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 32, 26, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black, transparent);
  pointer-events: none;
  z-index: 0;
}

.screen {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.screen.active {
  display: flex;
}

#screen-home {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  text-align: center;
  animation: rise 0.7s ease both;
  overflow-y: auto;
}

.site-header {
  max-width: 36rem;
  width: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  padding: 1.5rem 1.25rem 2rem;
  box-sizing: border-box;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--leaf);
}

.brand {
  margin: 0;
  line-height: 0;
}

.brand-logo {
  display: block;
  width: min(360px, 82vw);
  height: auto;
  margin: 0 auto;
  animation: rise 0.7s ease both;
}

.tagline {
  display: none;
}

.field-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  width: min(520px, 100%);
  margin: 0 auto;
}

@media (max-height: 640px) {
  .site-header {
    gap: 0.85rem;
    padding: 1rem 1.1rem 1.25rem;
  }

  .brand-logo {
    width: min(280px, 72vw);
  }
}

.field-card {
  appearance: none;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 16px;
  padding: 1.35rem 1.25rem;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow);
}

.field-card:hover {
  transform: translateY(-3px);
  border-color: var(--leaf);
}

.field-icon {
  display: block;
  font-size: 1.4rem;
  color: var(--leaf);
  margin-bottom: 0.5rem;
}

.field-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
  color: var(--leaf-deep);
}

.field-card span:last-child {
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.35;
}

.home-admin {
  margin-top: 1.25rem;
  font-size: 0.9rem;
}

.home-admin a {
  color: var(--leaf);
  font-weight: 600;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
  width: min(520px, 100%);
  margin: 0.15rem auto 0;
}

.home-action-btn {
  appearance: none;
  flex: 1 1 170px;
  border: none;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #1e6bb8, #3a9be0);
  box-shadow: 0 8px 22px rgba(30, 107, 184, 0.32);
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.home-action-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 10px 26px rgba(30, 107, 184, 0.4);
}

.home-action-alt {
  background: linear-gradient(135deg, #0d4a7a, #1e78c2);
}

.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 43, 74, 0.45);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: min(92vh, 720px);
  overflow-y: auto;
  padding: 1.35rem 1.25rem 1.25rem;
  border-radius: 18px;
  background: #f7fbf8;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(13, 43, 74, 0.28);
}

.modal-card h2 {
  margin: 0 2rem 0.35rem 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--leaf-deep);
}

.modal-lead {
  margin: 0 0 0.9rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  appearance: none;
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
}

.modal-tabs {
  margin-top: 0;
}

.feedback-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.member-field-wrap-area .member-field-icon {
  display: none;
}

.member-textarea {
  min-height: 110px;
  resize: vertical;
  padding: 0.9rem 1rem !important;
  line-height: 1.45;
  font-weight: 500;
}

.feedback-note {
  margin: 0.15rem 0 0.65rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

@media (max-width: 480px) {
  .feedback-row {
    grid-template-columns: 1fr;
  }
}

.seo-band {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
  border-top: 1px solid var(--line);
  text-align: left;
}

.seo-title {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  color: var(--leaf-deep);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.seo-title-sm {
  margin-top: 2rem;
  font-size: 1.2rem;
}

.seo-lead {
  margin: 0 0 1.75rem;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.seo-lead strong {
  color: var(--ink);
  font-weight: 700;
}

.seo-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 720px) {
  .seo-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

.seo-grid article h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--leaf-deep);
}

.seo-grid article p,
.seo-faq-body p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.seo-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink-soft);
  line-height: 1.7;
  font-size: 0.95rem;
}

.seo-faq {
  margin-top: 2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  padding: 0.85rem 1rem;
}

.seo-faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--leaf-deep);
  list-style: none;
}

.seo-faq summary::-webkit-details-marker {
  display: none;
}

.seo-faq-body {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.seo-faq-body h3 {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.95rem;
  color: var(--ink);
}

.seo-faq-body h3:first-child {
  margin-top: 0;
}

.seo-footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

.seo-footer p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.seo-footer-meta {
  margin-top: 0.5rem !important;
  font-size: 0.8rem !important;
}

.seo-footer a {
  color: var(--leaf);
  font-weight: 600;
  text-decoration: none;
}

.topic-card {
  position: relative;
}

.topic-swatch {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.empty-hint {
  color: var(--ink-soft);
  line-height: 1.5;
}

.empty-hint a {
  color: var(--leaf);
  font-weight: 600;
}

.map-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--leaf-deep);
  pointer-events: none;
}

@media (max-width: 560px) {
  .field-pick {
    grid-template-columns: 1fr;
  }
}

.home-preview {
  position: relative;
  margin-top: 3rem;
  width: min(520px, 90vw);
  height: 160px;
  border-radius: 999px;
  background:
    linear-gradient(120deg, rgba(31, 107, 74, 0.15), rgba(232, 163, 23, 0.12)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cpath d='M0 40 Q20 20 40 40 T80 40' fill='none' stroke='%231f6b4a' stroke-opacity='0.15' stroke-width='2'/%3E%3C/svg%3E");
  border: 1px solid var(--line);
  overflow: hidden;
}

.preview-pin {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 6px rgba(196, 92, 58, 0.25);
  animation: pulse 2.4s ease-in-out infinite;
}

.preview-pin.p1 { top: 42%; left: 22%; animation-delay: 0s; }
.preview-pin.p2 { top: 28%; left: 55%; background: var(--leaf); box-shadow: 0 0 0 6px rgba(31, 107, 74, 0.25); animation-delay: 0.4s; }
.preview-pin.p3 { top: 58%; left: 72%; background: var(--sun); box-shadow: 0 0 0 6px rgba(232, 163, 23, 0.25); animation-delay: 0.8s; }

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--leaf-deep);
  color: #f3faf5;
}

.btn-primary:hover {
  background: var(--leaf);
}

.btn-ghost {
  background: transparent;
  color: var(--leaf-deep);
  border: 1.5px solid var(--line);
}

.btn-ghost:hover {
  border-color: var(--leaf);
  color: var(--leaf);
}

.btn-back {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  margin-bottom: 1.25rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}

.btn-back:hover {
  color: var(--leaf);
}

#screen-topics,
#screen-done {
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.panel {
  width: min(920px, 100%);
  padding: 2rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  animation: rise 0.5s ease both;
}

.panel-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--leaf-deep);
}

.panel-desc {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.topics-head {
  display: block;
  margin-bottom: 1rem;
}

.topics-head-text {
  min-width: 0;
}

.topics-head .panel-title {
  margin-bottom: 0.35rem;
}

.topic-search-wrap {
  position: relative;
  display: block;
  margin: 0 0 1.5rem;
  padding: 0.35rem;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(26, 138, 122, 0.18), rgba(13, 43, 74, 0.08));
  box-shadow: 0 12px 30px rgba(13, 43, 74, 0.08);
}

.topic-search-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 11px;
  background: var(--leaf);
  color: #fff;
  pointer-events: none;
  box-shadow: 0 6px 14px rgba(26, 138, 122, 0.35);
}

.topic-search {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  background: #fff;
  border-radius: 13px;
  padding: 1.05rem 1.15rem 1.05rem 3.7rem;
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
  outline: none;
  box-shadow: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.topic-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 14px;
  width: 14px;
  margin-right: 0.1rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a8a7a' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / contain no-repeat;
  cursor: pointer;
  opacity: 0.7;
}

.topic-search::placeholder {
  color: #8a9aa5;
  font-weight: 500;
}

.topic-search:hover {
  border-color: rgba(26, 138, 122, 0.25);
}

.topic-search:focus {
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px rgba(26, 138, 122, 0.15);
}

.topic-search-wrap:focus-within {
  background: linear-gradient(135deg, rgba(26, 138, 122, 0.28), rgba(13, 43, 74, 0.12));
}

.topic-search-wrap:focus-within .topic-search-icon {
  background: var(--leaf-deep);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.topic-card {
  appearance: none;
  text-align: left;
  border: 1px solid var(--line);
  background: #f7fbf8;
  border-radius: 14px;
  padding: 1.2rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.topic-card:hover {
  border-color: var(--leaf);
  background: #fff;
  transform: translateY(-2px);
}

.topic-card .count {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sun);
}

.topic-card h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}

.topic-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

#screen-game {
  padding: 0;
}

.game-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  width: 100%;
  min-height: 100vh;
}

.game-sidebar {
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.88);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 2;
  max-height: 100vh;
  overflow-y: auto;
}

.topic-label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--leaf);
}

.quest-card {
  padding: 1.1rem 1.2rem;
  border-radius: 14px;
  background: linear-gradient(145deg, #0d2b4a, #1a8a7a);
  color: #eef7f1;
  animation: questIn 0.45s ease both;
}

.quest-kicker {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 0.35rem;
}

.quest-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.quest-hint {
  margin: 0.55rem 0 0;
  font-size: 0.9rem;
  opacity: 0.85;
  line-height: 1.4;
}

.hint-box {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1.5px dashed color-mix(in srgb, var(--leaf) 45%, var(--line));
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  background: color-mix(in srgb, var(--leaf) 8%, #fff);
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.hint-box:hover:not(:disabled) {
  border-color: var(--leaf);
  background: color-mix(in srgb, var(--leaf) 14%, #fff);
}

.hint-box:active:not(:disabled) {
  transform: scale(0.99);
}

.hint-box:disabled {
  opacity: 0.55;
  cursor: default;
}

.hint-box-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--leaf);
  margin-bottom: 0.3rem;
}

.hint-box-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--leaf-deep);
  line-height: 1.35;
  word-break: break-word;
}

.hint-box.is-revealed .hint-box-value {
  letter-spacing: 0.18em;
  color: var(--ink);
}

.progress-block {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--mist);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--leaf), var(--sun));
  border-radius: inherit;
  transition: width 0.35s ease;
}

.type-panel {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
  min-height: 0;
}

.type-panel[hidden],
.name-list-wrap[hidden] {
  display: none !important;
}

.type-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.type-form input {
  flex: 1;
  min-width: 140px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}

.type-form input:focus {
  outline: 2px solid var(--leaf);
  border-color: var(--leaf);
}

.type-form .btn {
  padding: 0.75rem 1.1rem;
}

.found-answers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: 160px;
  overflow-y: auto;
}

.found-answers li {
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: #e5f3eb;
  border: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--leaf-deep);
}

.province-label-wrap {
  background: transparent !important;
  border: none !important;
}

.province-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid color-mix(in srgb, var(--pin, #1a8a7a) 55%, #fff);
  color: var(--leaf-deep, #0d2b4a);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(13, 43, 74, 0.12);
  pointer-events: none;
}

.province-label.admin-map-label,
.admin-map-label {
  font-size: 0.8rem;
  pointer-events: none;
}

.map-pin.label-pin {
  width: auto;
  min-width: 36px;
  height: auto;
  min-height: 36px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}

.map-pin .pin-label {
  font-size: 0.78rem;
  white-space: nowrap;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.name-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  overflow-y: auto;
  max-height: min(48vh, 420px);
  padding-right: 0.25rem;
}

.name-chip {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1.5px solid var(--line);
  background: #f7fbf8;
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.name-chip.area-chip:not(.matched):hover {
  border-color: var(--leaf);
  background: #fff;
}

.name-chip:hover:not(:disabled) {
  border-color: var(--leaf);
  background: #fff;
}

.name-chip.selected {
  border-color: var(--leaf);
  background: #e5f3eb;
  box-shadow: inset 3px 0 0 var(--leaf);
}

.name-chip.matched {
  opacity: 0.45;
  text-decoration: line-through;
  cursor: default;
  background: var(--mist);
}

.feedback {
  min-height: 1.4em;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.feedback.far { color: var(--coral); }
.feedback.close { color: var(--sun); }
.feedback.hit { color: var(--leaf); }

.map-wrap {
  position: relative;
  min-height: 100vh;
}

#map {
  position: absolute;
  inset: 0;
  background: #c5d5cb;
}

.map-hint {
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: rgba(20, 32, 26, 0.82);
  color: #f3faf5;
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.map-hint.hide {
  opacity: 0;
}

.done-panel {
  text-align: center;
  max-width: 640px;
  width: min(640px, 100%);
}

.done-stats {
  margin: 1.25rem 0 0.5rem;
  text-align: left;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.stats-cta h3,
.stats-head h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--leaf-deep);
}

.stats-cta p,
.stats-explain {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.stats-explain {
  margin: 0.75rem 0 1rem;
}

.stats-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.member-tabs {
  display: flex;
  gap: 0.4rem;
  margin: 0.9rem 0 0.75rem;
}

.member-tab {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-soft);
}

.member-tab.on {
  border-color: var(--leaf);
  background: color-mix(in srgb, var(--leaf) 12%, #fff);
  color: var(--leaf-deep);
}

.member-form .field {
  margin-bottom: 0.65rem;
}

.member-form .btn {
  width: 100%;
  margin-top: 0.25rem;
}

.member-field-wrap {
  position: relative;
  display: block;
  margin: 0 0 0.7rem;
  padding: 0.3rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(26, 138, 122, 0.18), rgba(13, 43, 74, 0.08));
  box-shadow: 0 8px 22px rgba(13, 43, 74, 0.07);
}

.member-field-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0 0.35rem;
  border-radius: 10px;
  background: var(--leaf);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(26, 138, 122, 0.3);
}

.member-field {
  width: 100%;
  appearance: none;
  border: 1px solid transparent;
  background: #fff;
  border-radius: 11px;
  padding: 0.95rem 1rem 0.95rem 3.4rem;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.member-field::placeholder {
  color: #8a9aa5;
  font-weight: 500;
}

.member-field:focus {
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px rgba(26, 138, 122, 0.15);
}

.member-field-wrap:focus-within {
  background: linear-gradient(135deg, rgba(26, 138, 122, 0.28), rgba(13, 43, 74, 0.12));
}

.member-submit {
  width: 100%;
  margin-top: 0.15rem;
}

.member-msg {
  margin: 0.65rem 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  min-height: 1.2em;
}

.member-msg.err { color: var(--coral); }
.member-msg.ok { color: var(--leaf); }

.stats-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.stat-card {
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: #f4faf6;
  border: 1px solid rgba(26, 138, 122, 0.18);
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.25rem;
}

.stat-card strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--leaf-deep);
}

.stat-card.trend-up strong { color: var(--leaf); }
.stat-card.trend-down strong { color: var(--coral); }

.stats-rates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  background: #f4faf6;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.stats-rates strong {
  color: var(--leaf-deep);
  font-weight: 700;
}

.stats-chart-wrap,
.stats-table-wrap {
  margin-top: 1rem;
}

.stats-chart {
  width: 100%;
  height: 160px;
  border-radius: 12px;
  background: #f7fbf8;
  border: 1px solid var(--line);
  overflow: hidden;
}

.stats-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.stats-table-wrap {
  overflow-x: auto;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.stats-table th,
.stats-table td {
  padding: 0.45rem 0.4rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.stats-table th {
  color: var(--ink-soft);
  font-weight: 700;
}

.stats-table tr.perfect td {
  color: var(--leaf);
  font-weight: 600;
}

.done-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.1rem;
}

.leaflet-container {
  font-family: var(--font-body);
}

.leaflet-div-icon {
  background: transparent;
  border: none;
}

.map-pin {
  width: 36px;
  height: 36px;
  border: 2.5px solid #fff;
  border-radius: 50%;
  background: var(--pin, var(--leaf-deep));
  color: #f3faf5;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 61, 44, 0.35);
  transition: transform 0.15s ease, background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.map-pin.colored {
  background: var(--pin);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--pin) 45%, transparent);
}

.map-pin:hover {
  transform: scale(1.12);
  filter: brightness(1.08);
}

.map-pin.wrong {
  background: var(--coral) !important;
  animation: shake 0.4s ease;
}

.map-pin.revealed {
  background: var(--pin);
  cursor: default;
  animation: popIn 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.pin-check {
  font-size: 1rem;
  font-weight: 800;
}

.leaflet-popup-content-wrapper {
  border-radius: 12px;
  font-family: var(--font-body);
}

.leaflet-popup-content {
  margin: 0.75rem 0.9rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.leaflet-popup-content strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.75; }
}

@keyframes questIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.2); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@media (max-width: 860px) {
  .game-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .game-sidebar {
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .map-wrap {
    min-height: 55vh;
    height: 55vh;
  }

  .name-list {
    max-height: 180px;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .name-chip {
    width: auto;
    flex: 1 1 auto;
    min-width: calc(50% - 0.3rem);
  }
}
