:root {
  --paper: #ffffff;
  --mist: #f8f5ef;
  --sidebar-bg: linear-gradient(180deg, #2d1b0e 0%, #3a2415 100%);
  --sidebar-surface: rgba(255, 241, 214, 0.08);
  --line: rgba(180, 137, 52, 0.25);
  --ink: #3f2a0e;
  --muted: #7a6a52;
  --teal: #d4940a;
  --teal-dark: #8b6914;
  --coral: #e85d3a;
  --sun: #f5bc44;
  --leaf: #5cb85c;
  --panel: rgba(255, 251, 242, 0.95);
  --focus: #f5a623;
  --shadow-sm: 0 2px 6px rgba(86, 65, 24, 0.08);
  --shadow-md: 0 8px 20px rgba(86, 65, 24, 0.12);
  --shadow-lg: 0 18px 45px rgba(86, 65, 24, 0.18);
  --sidebar-w: 290px;
  --radius: 16px;
  --min-touch: 44px;
  --card-bg: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,251,242,0.95));
  --card-border: rgba(255, 241, 214, 0.9);
  --gold-glow: 0 0 0 1px rgba(245,193,74,0.45), 0 0 0 6px rgba(255,224,138,0.15), 0 18px 35px rgba(210,157,24,0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.75), transparent 28%),
    linear-gradient(180deg, #cdeeff 0%, #eaf6de 50%, #f8ead1 100%);
  color: var(--ink);
  font-family: "Pretendard Variable", "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

::selection {
  background: rgba(245, 188, 68, 0.35);
  color: #3f2a0e;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.sidebar-owl {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  object-fit: contain;
  padding: 2px;
  border: 2px solid rgba(245,188,68,0.72);
  border-radius: 50%;
  background-color: #fff4ca;
  box-shadow: 0 0 0 3px rgba(65, 37, 12, 0.45), 0 0 16px rgba(245,188,68,0.36);
}

/* ── Custom scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(45, 27, 14, 0.08);
}

::-webkit-scrollbar-thumb {
  background: rgba(180, 137, 52, 0.3);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(180, 137, 52, 0.5);
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(245, 188, 68, 0.25);
}

.sticky-progress {
  position: fixed;
  top: 10px;
  right: 12px;
  z-index: 50;
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 7px 6px 10px;
  color: #fff5d6;
  background: linear-gradient(135deg, rgba(58, 36, 21, 0.95), rgba(45, 27, 14, 0.95));
  border: 1.5px solid rgba(245, 188, 68, 0.4);
  border-radius: 999px;
  box-shadow: var(--gold-glow);
  font-size: 0.86rem;
  font-weight: 900;
  backdrop-filter: blur(6px);
}

.sticky-progress-track {
  width: 74px;
  height: 9px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 999px;
}

.sticky-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--sun), var(--focus));
  border-radius: inherit;
  transition: width 240ms ease;
}

.sticky-star-status,
.completion-star-stack {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.sticky-star-status {
  margin-left: auto;
  padding-inline: 2px;
}

.sticky-star {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
}

.sticky-star-icon,
.completion-star-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sticky-star.is-empty,
.completion-star.is-empty {
  opacity: 0.24;
  filter: grayscale(1);
}

.sticky-progress .sound-toggle {
  flex: 0 0 auto;
}

.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 3px solid rgba(180, 137, 52, 0.35);
  overflow-y: auto;
  box-shadow: 4px 0 20px rgba(45, 27, 14, 0.3);
}

.sidebar-header {
  padding: 20px 16px 18px;
  background: linear-gradient(135deg, rgba(245,188,68,0.15), rgba(245,188,68,0.05));
  border-bottom: 2px solid rgba(180, 137, 52, 0.3);
}

.sidebar-header .eyebrow {
  color: var(--sun);
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  font-size: 0.82rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow,
.section-kicker {
  margin: 0 0 4px;
  color: var(--teal-dark);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0;
}

.sidebar-header h1 {
  margin: 0 0 10px;
  font-size: 1.4rem;
  line-height: 1.3;
  color: #fff5d6;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
  font-weight: 900;
  word-break: keep-all;
}

.sidebar-header h1 small {
  display: block;
  font-size: 0.95rem;
  color: var(--sun);
  text-shadow: none;
  margin-top: 4px;
  font-weight: 700;
}

.quest-board {
  margin: 10px 0 0;
  padding: 10px 12px;
  background: rgba(255, 241, 214, 0.1);
  border: 2px solid rgba(245, 188, 68, 0.3);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  position: relative;
  text-align: left;
}

.quest-board::before {
  content: "📜 오늘의 임무";
  display: block;
  font-size: 0.82rem;
  color: var(--sun);
  margin-bottom: 6px;
  font-weight: 900;
}

.sidebar-lede {
  margin: 0;
  color: rgba(255, 241, 214, 0.85);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.5;
}

.sidebar-section {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(180, 137, 52, 0.2);
}

.sidebar-section:last-child {
  border-bottom: none;
}

.sidebar-section-title {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 800;
  color: rgba(255, 241, 214, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  min-height: var(--min-touch);
  padding: 10px 12px;
  color: rgba(255, 241, 214, 0.9);
  background: rgba(255, 241, 214, 0.06);
  border: 1.5px solid rgba(180, 137, 52, 0.25);
  border-bottom-width: 3px;
  border-radius: 10px;
  font-weight: 800;
  box-shadow: none;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease, transform 120ms ease;
}

.filter-button::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 50%;
  width: 9px;
  border-top: 2px dotted rgba(180, 137, 52, 0.3);
  transform: translateY(-50%);
}

.filter-button:first-child::before {
  display: none;
}

.filter-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 7px;
  align-items: center;
  min-width: 0;
}

.filter-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: rgba(245, 188, 68, 0.15);
  border: 1px solid rgba(245, 188, 68, 0.25);
  border-radius: 7px;
}

.stage-status {
  justify-self: start;
  padding: 2px 7px;
  color: var(--sun);
  background: rgba(245, 188, 68, 0.12);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.25;
}

.filter-progress-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: rgba(255, 241, 214, 0.7);
  background: rgba(255, 241, 214, 0.08);
  border: 1px solid rgba(180, 137, 52, 0.2);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
}

.filter-button:hover {
  background: rgba(245, 188, 68, 0.12);
  border-color: rgba(245, 188, 68, 0.5);
}

.filter-button:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
}

.filter-button.active {
  color: #3f2a0e;
  background: linear-gradient(180deg, var(--sun), #d4940a);
  font-weight: 900;
  border-color: #8b6914;
  box-shadow: 0 0 12px rgba(245, 188, 68, 0.3), 0 4px 8px rgba(0,0,0,0.2);
}

.filter-button.active .filter-progress-badge {
  color: #3f2a0e;
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
}

.filter-button.active .stage-status {
  color: #3f2a0e;
  background: rgba(255, 255, 255, 0.25);
}

.filter-button.stage-complete {
  background: rgba(92, 184, 92, 0.12);
  border-color: rgba(92, 184, 92, 0.4);
}

.filter-button.stage-complete.active {
  color: #12351d;
  background: linear-gradient(180deg, #8fd66d, #4fa847);
  border-color: #2f7f3b;
}

.filter-button.stage-complete.active .filter-progress-badge,
.filter-button.stage-complete.active .stage-status {
  color: #12351d;
  background: rgba(255, 255, 255, 0.34);
  border-color: rgba(255, 255, 255, 0.24);
}

.filter-button.stage-current {
  border-color: rgba(245, 188, 68, 0.5);
}

.filter-button.stage-locked {
  color: rgba(255, 241, 214, 0.35);
  background: rgba(255, 241, 214, 0.03);
  border-color: rgba(180, 137, 52, 0.12);
}

.filter-button.stage-locked .filter-icon,
.filter-button.stage-locked .filter-progress-badge {
  filter: grayscale(1);
  opacity: 0.5;
}

.filter-button.stage-master {
  background: rgba(245, 188, 68, 0.1);
  border-color: rgba(245, 188, 68, 0.4);
}

.mode-buttons {
  display: flex;
  gap: 6px;
}

.mode-button {
  flex: 1;
  min-height: var(--min-touch);
  padding: 10px 10px;
  color: rgba(255, 241, 214, 0.8);
  background: rgba(255, 241, 214, 0.08);
  border: 2px solid rgba(180, 137, 52, 0.3);
  border-bottom-width: 4px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 0.88rem;
  transition: all 150ms ease;
}

.mode-button:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.mode-button.active {
  color: #3f2a0e;
  background: linear-gradient(180deg, var(--sun), #d4940a);
  border-color: #8b6914;
  box-shadow: 0 0 12px rgba(245, 188, 68, 0.3);
}

.progress-panel {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: #FFFDE7;
  border: 3px solid var(--sun);
  border-radius: 12px;
  margin-bottom: 18px;
}

@media (min-width: 681px) {
  .progress-panel {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    box-shadow: 0 4px 10px rgba(255,195,0,0.15);
  }
  .progress-panel strong {
    font-size: 1.8rem;
  }
  .progress-track {
    flex: 1;
    height: 18px;
  }
}

.progress-label {
  color: var(--teal-dark);
  font-weight: 900;
  font-size: 0.9rem;
}

.progress-panel strong {
  color: var(--teal-dark);
  font-size: 1.5rem;
  line-height: 1;
}

.progress-track {
  width: 100%;
  height: 14px;
  overflow: hidden;
  background: #dfecef;
  border-radius: 12px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--sun), #FF9F1C);
  transition: width 240ms ease;
  border-radius: 12px;
}

.completion-star-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  color: #5d3b12;
  font-size: 0.88rem;
  font-weight: 900;
  text-align: center;
}

.completion-star-label {
  white-space: nowrap;
}

.completion-star {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
}

.completion-star-stack {
  justify-content: center;
  flex-wrap: wrap;
}

.completion-star.is-earned {
  filter: drop-shadow(0 3px 4px rgba(180, 137, 52, 0.28));
}

.settings-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: var(--min-touch);
  padding: 10px 14px;
  color: #3f2a0e;
  background: linear-gradient(180deg, var(--sun), #d4940a);
  border: 2px solid rgba(245, 188, 68, 0.6);
  border-radius: 10px;
  font-weight: 900;
  font-size: 0.92rem;
  transition: all 150ms ease;
  box-shadow: 0 4px 8px rgba(212, 148, 10, 0.2);
}

.settings-button:hover {
  background: linear-gradient(180deg, #f5c84a, var(--sun));
  box-shadow: 0 6px 12px rgba(212, 148, 10, 0.3);
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  color: var(--teal-dark);
  background: var(--paper);
  border: 2px solid var(--line);
  border-bottom-width: 3px;
  border-radius: 50%;
  font-size: 0.95rem;
  font-weight: 900;
  transition: border-color 150ms ease, background 150ms ease, transform 100ms ease;
}

.sound-toggle:hover {
  background: var(--panel);
  border-color: var(--teal);
}

.sound-toggle:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
}

.sidebar-settings-section {
  display: grid;
  gap: 6px;
}

.sidebar-settings-hint {
  margin: 0;
  color: rgba(255, 241, 214, 0.5);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
}

.center-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-width: 0;
}

.center-header {
  padding: 20px 24px 0;
}

.safety-strip {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 18px;
  background: #fff8df;
  border: 2px solid #edc84b;
  border-radius: var(--radius);
}

.safety-strip summary {
  cursor: pointer;
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 900;
  color: var(--teal-dark);
}

.safety-strip ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.safety-strip li {
  padding: 6px 10px;
  background: var(--paper);
  border: 1px solid #e5c33f;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.85rem;
}

.mission-panel {
  margin-bottom: 18px;
}

.mission-board {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(160px, 220px) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  color: #fff8df;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)),
    linear-gradient(120deg, #244b2e, #0f6a5f 54%, #5d3b12);
  border: 3px solid #5a3b18;
  border-bottom-width: 5px;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.18);
}

.mission-board.status-current {
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0)),
    linear-gradient(120deg, #245136, #0c6a60 54%, #4d4318);
}

.mission-board.status-complete {
  color: #123323;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0)),
    linear-gradient(120deg, #dff8c9, #f7e997 52%, #ffffff);
}

.mission-board.status-complete .section-kicker,
.mission-board.status-complete h2,
.mission-board.status-complete p,
.mission-board.status-complete .mission-meter-count {
  color: #123323;
  text-shadow: none;
}

.mission-board.status-next {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0)),
    linear-gradient(120deg, #2f5d80, #246265 54%, #5b4f1a);
}

.mission-actions {
  display: grid;
  gap: 8px;
  justify-items: stretch;
}

.mission-orb {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  background: radial-gradient(circle at 30% 24%, #fff3a6, var(--sun) 54%, #a45e11);
  border: 3px solid #fff6bd;
  border-radius: 18px;
  box-shadow: 0 0 0 3px rgba(75, 45, 15, 0.48), 0 0 18px rgba(255, 195, 0, 0.42);
  font-size: 1.8rem;
}

.mission-region-sprite {
  width: 68px;
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px rgba(43, 31, 18, 0.28));
}

.mission-copy {
  min-width: 0;
}

.mission-copy .section-kicker {
  color: var(--sun);
}

.mission-copy h2 {
  margin: 0 0 4px;
  color: var(--paper);
  font-size: 1.28rem;
  line-height: 1.2;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.32);
}

.mission-copy p {
  margin: 0;
  color: #fff8df;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.4;
}

.mission-next-step {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  width: fit-content;
  margin-top: 8px !important;
  padding: 7px 10px;
  color: #fff8dc !important;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 248, 220, 0.28);
  border-radius: 10px;
}

.mission-next-step strong {
  color: #ffd45f;
}

.mission-meter {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.mission-meter-count {
  justify-self: end;
  color: var(--paper);
  font-weight: 900;
  font-size: 0.88rem;
}

.mission-meter-track {
  height: 16px;
  overflow: hidden;
  background: #2b1f12;
  border: 2px solid #fff2a8;
  border-radius: 999px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.34);
}

.mission-meter-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #a7e348, var(--sun), var(--focus));
  border-radius: inherit;
  transition: width 240ms ease;
}

.mission-toggle {
  min-height: var(--min-touch);
  padding: 9px 14px;
  color: var(--paper);
  background: linear-gradient(180deg, #44c653, #168a35);
  border: 2px solid #e4ffd4;
  border-bottom-width: 4px;
  border-radius: 9px;
  box-shadow: 0 4px 0 rgba(43, 31, 18, 0.35);
  font-size: 0.88rem;
  font-weight: 900;
  white-space: nowrap;
}

.mission-secondary-action {
  min-height: 36px;
  padding: 7px 10px;
  color: #244b2e;
  background: #fff8df;
  border: 2px solid rgba(36, 75, 46, 0.35);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.mission-toggle:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
  box-shadow: 0 2px 0 rgba(43, 31, 18, 0.35);
}

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

.result-count {
  font-weight: 900;
  color: var(--teal-dark);
  font-size: 1.1rem;
}

.search-field {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-field .search-icon {
  position: absolute;
  left: 14px;
  pointer-events: none;
  color: var(--muted);
  font-size: 1.2rem;
}

.search-field input {
  width: 100%;
  min-height: var(--min-touch);
  padding: 0 14px 0 42px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.search-field input:focus,
button:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 2px;
}

.result-count {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
}

.catalog-area {
  flex: 1;
  padding: 0 24px 24px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 14px;
}

.animal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 14px;
}

.animal-card {
  position: relative;
  display: grid;
  grid-template-rows: 142px 1fr;
  min-height: 264px;
  padding: 0;
  overflow: hidden;
  text-align: left;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.78);
  transition: transform 250ms cubic-bezier(0.34,1.56,0.64,1), border-color 180ms ease, box-shadow 250ms ease;
}

.animal-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(245, 193, 74, 0.6);
  box-shadow: var(--gold-glow);
}

.animal-card.selected {
  border: 3px solid var(--sun);
  box-shadow: var(--gold-glow);
}

.animal-card.collected {
  border: 2px solid var(--sun);
  background: linear-gradient(180deg, #fffdf5, #fff8e1);
  box-shadow: 0 0 0 3px rgba(245,188,68,0.2), 0 0 18px rgba(245,188,68,0.15);
}

.animal-card.collected.selected {
  border: 3px solid var(--sun);
}

.image-frame {
  display: grid;
  place-items: center;
  height: 142px;
  overflow: hidden;
  color: var(--muted);
  background: linear-gradient(135deg, #e8dcc8, #d4c5a9);
  font-weight: 900;
}

.animal-card img {
  width: 100%;
  height: 142px;
  object-fit: cover;
}

.animal-card-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.animal-name-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: start;
}

.animal-name-row h3 {
  line-height: 1.2;
}

.mini-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  color: var(--teal-dark);
  background: #e2f5f0;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 900;
}

.mini-badge.collected-badge {
  color: #6b5100;
  background: var(--sun);
  box-shadow: 0 0 8px rgba(255, 195, 0, 0.6);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.animal-region-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.region-badge {
  padding: 3px 7px;
  color: #5d4700;
  background: rgba(245, 188, 68, 0.12);
  border: 1px solid rgba(245, 188, 68, 0.3);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
}

.region-badge.primary {
  color: #3f5a0e;
  background: rgba(92, 184, 92, 0.12);
  border-color: rgba(92, 184, 92, 0.35);
}

.region-badge.secondary {
  color: #5d4700;
  background: #fff6cc;
  border-color: #ebcb59;
  border-style: dashed;
}

.detail-region-badges {
  margin-top: -2px;
}

.environment-note {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  color: #5d4700;
  background: #fff9db;
  border: 2px dashed #e5c34c;
  border-radius: 8px;
}

.environment-note strong {
  color: #6b5100;
  font-size: 0.95rem;
}

.environment-note span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.tag {
  padding: 5px 8px;
  color: #5d4700;
  background: rgba(245, 188, 68, 0.08);
  border: 1px solid rgba(245, 188, 68, 0.2);
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 800;
}

.card-point {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

/* ── Animal detail modal ── */
.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(45, 27, 14, 0.82);
  backdrop-filter: blur(4px);
}

.detail-modal[hidden] {
  display: none;
}

.detail-sheet {
  position: relative;
  width: min(520px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: var(--gold-glow);
}

.detail-sheet .close-detail {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 12;
  align-self: flex-start;
  margin: 10px 0 0 10px;
  min-height: var(--min-touch);
  padding: 8px 14px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 8px;
  font-weight: 900;
  font-size: 0.9rem;
}

.close-button {
  min-height: var(--min-touch);
  padding: 8px 14px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 8px;
  font-weight: 900;
  font-size: 0.9rem;
  cursor: pointer;
}

.close-button:hover {
  background: var(--mist);
  border-color: var(--teal);
}

.detail-sheet .close-detail:hover {
  background: var(--mist);
  border-color: var(--teal);
}

.detail-photo {
  display: grid;
  place-items: center;
  min-height: 280px;
  background: linear-gradient(135deg, #e8dcc8, #d4c5a9);
  overflow: hidden;
}

.detail-photo img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.detail-body {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.back-to-catalog {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--min-touch);
  padding: 10px 16px;
  color: var(--paper);
  background: var(--teal);
  border: 2px solid var(--teal);
  border-radius: 8px;
  font-weight: 900;
  font-size: 0.95rem;
  text-decoration: none;
}

.back-to-catalog:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.modal-title-row {
  position: sticky;
  top: -16px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background: var(--card-bg);
  padding: 16px 0;
  margin-top: -16px;
}

.encyclopedia-lede {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
}

.quick-facts h3 {
  margin: 0 0 10px;
  color: var(--teal-dark);
  font-size: 1rem;
}

.quick-facts dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.quick-facts dl div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
}

.quick-facts dt {
  color: var(--teal-dark);
  font-weight: 900;
}

.quick-facts dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.observation-summary {
  margin: 12px 0 14px;
  border: 2px solid rgba(245, 188, 68, 0.45);
  border-radius: 12px;
  background: #fffdf2;
  overflow: hidden;
}

.observation-summary summary {
  min-height: 44px;
  padding: 12px 14px;
  color: var(--teal-dark);
  font-weight: 900;
  cursor: pointer;
}

.observation-summary .quick-facts {
  margin: 0;
  border-width: 2px 0 0;
  border-radius: 0;
}

.observation-checkitem {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin: 10px 0 2px;
  padding: 8px 10px;
  color: #214b2c;
  background: #effaf3;
  border: 2px solid rgba(92, 184, 92, 0.32);
  border-radius: 10px;
  font-weight: 900;
}

.observation-checkitem input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  accent-color: var(--leaf);
}

.detail-quiz-anchor {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  gap: 10px;
  padding: 10px 0;
  background: linear-gradient(to bottom, var(--paper) 78%, rgba(255, 255, 255, 0));
}

.quiz-anchor-button {
  width: 100%;
}

.collected-action-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  color: #5d4700;
  background: linear-gradient(135deg, #fff8d8, #e8f8f0);
  border: 2px solid var(--sun);
  border-bottom-width: 5px;
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(255, 195, 0, 0.16);
}

.collected-action-card strong,
.collected-action-card span {
  display: block;
}

.collected-action-card strong {
  margin-top: 3px;
  color: var(--teal-dark);
  font-size: 1.02rem;
}

.collected-action-card span {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 800;
}

.quiz-replay-button {
  white-space: nowrap;
  color: var(--teal-dark);
  background: var(--paper);
  border: 2px solid #b9dfdc;
  border-radius: 999px;
  padding: 8px 12px;
}

.quiz-complete-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: linear-gradient(135deg, #fff8d8, #f0fbf6);
  border: 3px solid var(--sun);
  border-radius: 16px;
  box-shadow: 0 16px 28px rgba(31, 41, 51, 0.12);
}

.quiz-complete-card h2,
.quiz-complete-card p {
  margin: 0;
}

.quiz-complete-card h2 {
  color: var(--teal-dark);
  font-size: 1.3rem;
}

.quiz-complete-card p:last-child {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 900;
}

.quiz-complete-photo {
  aspect-ratio: 1;
  overflow: hidden;
  border: 3px solid var(--paper);
  border-radius: 14px;
  box-shadow: 0 0 0 3px var(--sun);
}

.quiz-complete-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.encyclopedia-article {
  display: grid;
  gap: 12px;
}

.encyclopedia-section {
  padding: 14px 0;
  background: transparent;
  border-top: 2px solid var(--line);
}

.encyclopedia-section h3 {
  margin-bottom: 7px;
  color: var(--teal-dark);
  font-size: 1.05rem;
}

.encyclopedia-section p {
  margin: 0 0 8px;
}

.primary-button,
.answer-button,
.next-button {
  min-height: var(--min-touch);
  padding: 10px 14px;
  color: #3f2a0e;
  background: linear-gradient(180deg, var(--sun), #d4940a);
  border: 2px solid #8b6914;
  border-bottom-width: 5px;
  border-radius: 12px;
  font-weight: 900;
  box-shadow: 0 4px 8px rgba(212, 148, 10, 0.25);
  transition: transform 100ms ease, border-bottom-width 100ms ease, box-shadow 150ms ease;
}

.primary-button:active,
.answer-button:active,
.next-button:active {
  transform: translateY(3px);
  border-bottom-width: 2px;
}

.answer-button {
  width: 100%;
  color: var(--ink);
  text-align: left;
  background: var(--paper);
  border-color: var(--line);
}

.answer-button.correct {
  border-color: var(--leaf);
  background: #e4f8ec;
}

.answer-button.wrong {
  border-color: var(--coral);
  background: #ffe9e8;
}

.quiz-box {
  display: grid;
  gap: 12px;
}

.quiz-options {
  display: grid;
  gap: 8px;
}

.quiz-retry-panel {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 16px;
  background: #fff7e8;
  border: 2px solid #ffd27f;
  border-radius: 16px;
}

.feedback {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 900;
}

.feedback-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 5px rgba(86, 65, 24, 0.16), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  font-size: 1.35rem;
  font-weight: 1000;
  line-height: 1;
}

.feedback-mark-good {
  background: linear-gradient(180deg, #6bd35a, #27983e);
}

.feedback-mark-retry {
  background: linear-gradient(180deg, #ff6969, #d93434);
}

.feedback.good {
  color: var(--leaf);
}

.feedback.retry {
  color: var(--coral);
}

.hint-highlight {
  background-color: rgba(255, 235, 59, 0.6);
  border-radius: 3px;
  padding: 2px 4px;
  animation: hint-glow 0.5s ease-in-out 2;
}

@keyframes hint-glow {
  0%, 100% {
    background-color: rgba(255, 235, 59, 0.6);
  }
  50% {
    background-color: rgba(255, 235, 59, 0.9);
  }
}

.source-link {
  color: var(--teal-dark);
  font-weight: 900;
}

.source-link-button {
  min-height: var(--min-touch);
  padding: 10px 12px;
  text-align: left;
  background: #f8fdff;
  border: 2px solid var(--line);
  border-radius: 8px;
}

.source-link-button:hover {
  background: var(--panel);
  border-color: var(--teal);
}

.footer-link {
  color: var(--teal-dark);
  font-weight: 900;
}

.modal-scroll-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  opacity: 0;
  animation: scroll-hint 3s ease 0.4s 1;
}

@keyframes scroll-hint {
  0%, 100% { opacity: 0; transform: translateY(-4px); }
  18%, 78% { opacity: 1; transform: translateY(0); }
}

.question-tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px 0;
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
}

.question-tool h3 {
  margin: 0 0 5px;
  color: var(--teal-dark);
  font-size: 1.08rem;
}

.question-tool p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.question-tool-muted {
  grid-template-columns: 1fr;
}

.question-link {
  display: inline-grid;
  place-items: center;
  min-height: var(--min-touch);
  padding: 12px 18px;
  color: var(--paper);
  background: var(--teal);
  border: 2px solid var(--teal);
  border-radius: 8px;
  font-weight: 900;
  font-size: 1rem;
  text-decoration: none;
}

.question-link:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.settings-sheet {
  position: relative;
  width: min(720px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: var(--radius);
}

.settings-body {
  display: grid;
  gap: 18px;
  padding: 32px;
}

.settings-intro {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.settings-warning {
  margin: 0;
  padding: 12px;
  color: var(--ink);
  background: #fff8df;
  border: 2px solid var(--sun);
  border-radius: 8px;
  font-weight: 900;
}

.settings-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 24px;
}

.settings-steps li {
  font-weight: 800;
}

.template-link {
  display: inline-grid;
  place-items: center;
  min-height: 48px;
  padding: 10px 14px;
  color: var(--paper);
  background: var(--teal-dark);
  border: 2px solid var(--teal-dark);
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
}

.settings-form,
.mission-setting-panel,
.teacher-checklist,
.share-link-panel {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 2px solid var(--line);
}

.teacher-checklist h3 {
  margin: 0;
  color: var(--teal-dark);
}

.teacher-checklist ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.2rem;
  color: var(--ink);
  font-weight: 800;
}

.mission-setting-panel h3 {
  margin: 0 0 4px;
  color: var(--teal-dark);
  font-size: 1.12rem;
}

.mission-setting-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.mission-animal-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  background: rgba(255, 251, 242, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mission-animal-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid rgba(180, 137, 52, 0.18);
  border-radius: 8px;
  font-weight: 900;
}

.mission-animal-options input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.share-link-panel[hidden] {
  display: none;
}

.qr-share-box {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.qr-share-box h3 {
  margin-bottom: 6px;
  color: var(--teal-dark);
}

.qr-share-box p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.qr-code {
  display: grid;
  place-items: center;
  width: 180px;
  min-height: 180px;
  padding: 10px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 8px;
}

.qr-code svg {
  width: 100%;
  height: auto;
}

.settings-form label,
.share-link-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

.settings-form input,
.share-link-panel input {
  width: 100%;
  min-height: var(--min-touch);
  padding: 10px 12px;
  color: var(--ink);
  background: #f8fdff;
  border: 2px solid var(--line);
  border-radius: 8px;
}

.field-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 800;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.question-choice-button {
  min-height: var(--min-touch);
  padding: 10px 14px;
  color: var(--ink);
  background: #fff8e8;
  border: 3px solid #e7d8b8;
  border-bottom-width: 5px;
  border-radius: 12px;
  font-weight: 900;
  box-shadow: 0 4px 8px rgba(45, 27, 14, 0.08);
  transition: transform 100ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.question-choice-button:active {
  transform: translateY(3px);
  border-bottom-width: 2px;
}

.question-choice-button.is-on.selected {
  color: #3f2a0e;
  background: linear-gradient(180deg, var(--sun), #d4940a);
  border-color: #8b6914;
  box-shadow: 0 8px 16px rgba(212, 148, 10, 0.28);
}

.question-choice-button.is-off.selected {
  color: #143f3b;
  background: linear-gradient(180deg, #e7f7f2, #b9dfdc);
  border-color: var(--teal);
  box-shadow: 0 8px 16px rgba(15, 111, 104, 0.18);
}

.question-choice-button:not(.selected) {
  opacity: 0.78;
}

.question-choice-button:not(.selected):hover {
  opacity: 1;
  border-color: var(--teal);
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-message {
  min-height: 1.5em;
  margin: 0;
  color: var(--teal-dark);
  font-weight: 900;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(45, 27, 14, 0.82);
}

.modal[hidden] {
  display: none;
}

.game-view {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.game-view.active {
  display: flex;
}

.game-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 22px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.game-header p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.game-score {
  display: grid;
  place-items: center;
  min-height: 94px;
  color: var(--teal-dark);
  background: var(--panel);
  border: 2px solid #b9dcd5;
  border-radius: var(--radius);
  font-size: 1.7rem;
  font-weight: 900;
}

.game-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}

.select-field {
  display: grid;
  gap: 8px;
  min-width: min(100%, 330px);
  font-weight: 900;
}

.select-field select {
  min-height: var(--min-touch);
  padding: 0 12px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-weight: 900;
}

.primary-button.secondary {
  color: var(--ink);
  background: linear-gradient(180deg, #fff8e1, #f5ecd3);
  border-color: rgba(180, 137, 52, 0.3);
  box-shadow: var(--shadow-sm);
}

.game-board {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(240px, 1fr) minmax(240px, 1fr);
  gap: 14px;
  align-items: stretch;
  min-height: 0;
}

.game-source,
.drop-zone {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  min-height: 430px;
  padding: 14px;
  background: rgba(255, 251, 242, 0.85);
  border: 2px solid rgba(180, 137, 52, 0.25);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.drop-zone {
  border-style: dashed;
}

.game-source.drag-over,
.drop-zone.drag-over {
  border-color: var(--sun);
  background: rgba(245, 188, 68, 0.08);
}

.drop-zone.correct-zone {
  border-color: var(--leaf);
  background: #effaf3;
}

.drop-zone.needs-work {
  border-color: var(--coral);
  background: #fff1f0;
}

.game-source p,
.drop-zone p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.token-zone {
  align-content: start;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
  min-height: 190px;
  overflow: auto;
  padding-right: 2px;
}

.game-token {
  display: grid;
  gap: 7px;
  min-height: 106px;
  padding: 8px;
  text-align: left;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: 10px;
  font-weight: 900;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.game-token:hover,
.game-token.selected {
  transform: translateY(-2px);
  border-color: var(--sun);
  box-shadow: 0 4px 12px rgba(245, 188, 68, 0.2);
}

.game-token img {
  width: 100%;
  height: 66px;
  object-fit: cover;
  border-radius: 6px;
  background: #d8eef3;
}

.game-token.correct-token {
  border-color: var(--leaf);
}

.game-token.wrong-token {
  border-color: var(--coral);
}

.game-feedback {
  min-height: 54px;
  margin-top: 14px;
  padding: 14px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 8px;
  font-weight: 900;
}

.game-feedback:empty {
  display: none;
}

.empty-state {
  padding: 28px;
  text-align: center;
  background: var(--paper);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
}

.onboarding-modal,
.reward-modal {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(45, 27, 14, 0.82);
  backdrop-filter: blur(4px);
}

.onboarding-modal[hidden],
.reward-modal[hidden] {
  display: none;
}

.onboarding-card,
.reward-card {
  position: relative;
  width: min(520px, 100%);
  overflow: hidden;
  padding: 26px;
  background: var(--card-bg);
  border: 2px solid var(--sun);
  border-radius: 20px;
  box-shadow: var(--gold-glow);
}

.onboarding-card h2,
.reward-card h2 {
  margin: 0 0 10px;
  color: var(--teal-dark);
  font-size: 1.35rem;
  line-height: 1.25;
}

.onboarding-card p,
.reward-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.onboarding-actions,
.reward-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 22px;
}

.onboarding-demo {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 14px;
  background: #fff8df;
  border: 2px solid var(--sun);
  border-radius: 8px;
}

.onboarding-guide-art {
  display: flex;
  justify-content: center;
  min-height: 118px;
  margin: -4px 0 10px;
}

.onboarding-owl {
  width: min(152px, 42vw);
  height: 118px;
  object-fit: contain;
  filter: drop-shadow(0 12px 14px rgba(86, 65, 24, 0.2));
}

.demo-badge {
  justify-self: start;
  padding: 3px 8px;
  color: #3f2a0e;
  background: var(--sun);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.onboarding-highlight {
  position: relative;
  z-index: 16;
  outline: 5px solid var(--focus);
  outline-offset: 4px;
  box-shadow: 0 0 0 10px rgba(255, 159, 28, 0.22), var(--shadow-lg);
}

.reward-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.reward-burst span {
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--sun);
  clip-path: polygon(50% 0%, 61% 36%, 100% 36%, 69% 58%, 79% 100%, 50% 74%, 21% 100%, 31% 58%, 0% 36%, 39% 36%);
  animation: reward-spark 1.8s ease-in-out infinite;
}

.reward-burst-soft span {
  width: 14px;
  height: 14px;
  opacity: 0.72;
}

.reward-burst-master span {
  width: 22px;
  height: 22px;
  background: #ffd84d;
  filter: drop-shadow(0 0 8px rgba(255, 195, 0, 0.85));
}

.reward-burst span:nth-child(1) { top: 14%; left: 12%; animation-delay: 0s; }
.reward-burst span:nth-child(2) { top: 8%; left: 76%; animation-delay: 0.1s; }
.reward-burst span:nth-child(3) { top: 32%; left: 88%; animation-delay: 0.2s; }
.reward-burst span:nth-child(4) { top: 72%; left: 84%; animation-delay: 0.3s; }
.reward-burst span:nth-child(5) { top: 82%; left: 18%; animation-delay: 0.4s; }
.reward-burst span:nth-child(6) { top: 48%; left: 7%; animation-delay: 0.5s; }
.reward-burst span:nth-child(7) { top: 22%; left: 42%; animation-delay: 0.6s; }
.reward-burst span:nth-child(8) { top: 64%; left: 44%; animation-delay: 0.7s; }
.reward-burst span:nth-child(9) { top: 40%; left: 63%; animation-delay: 0.8s; }
.reward-burst span:nth-child(10) { top: 88%; left: 62%; animation-delay: 0.9s; }

.reward-collage {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.region-reward-hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  text-align: left;
  background: rgba(255, 249, 230, 0.76);
  border: 2px solid rgba(245, 188, 68, 0.42);
  border-radius: 16px;
}

.region-reward-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.region-reward-copy p {
  margin: 0;
  text-align: left;
}

.region-star-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.region-star-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 5px 6px rgba(167, 111, 16, 0.22));
}

.region-star-context {
  color: #5d3b12;
  line-height: 1.55;
}

.reward-meaning-badges {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
  background: rgba(255, 248, 223, 0.78);
  border: 2px solid rgba(245, 188, 68, 0.55);
  border-radius: 14px;
}

.master-reward-chest {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 126px;
  margin-top: 12px;
  pointer-events: none;
}

.master-reward-chest-sprite {
  width: min(230px, 62vw);
  height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 14px 14px rgba(86, 65, 24, 0.26));
}

.reward-meaning-badges span {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #5d3b12;
  font-size: 0.95rem;
  font-weight: 900;
}

.reward-meaning-icon {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 5px 6px rgba(86, 65, 24, 0.18));
}

.reward-owl-cheer {
  position: relative;
  z-index: 1;
  width: min(116px, 32vw);
  height: 92px;
  object-fit: contain;
  margin: 12px auto -4px;
  filter: drop-shadow(0 10px 10px rgba(86, 65, 24, 0.18));
}

.region-reward-owl {
  width: 96px;
  height: 96px;
  margin: 0;
  justify-self: center;
  align-self: end;
}

.reward-collage span {
  padding: 6px 10px;
  color: var(--teal-dark);
  background: #e8f6f3;
  border: 1px solid #b9dcd5;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 900;
}

.reward-card.master-reward-card {
  width: min(620px, 100%);
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 216, 77, 0.34), transparent 42%),
    linear-gradient(180deg, #fffdf3, #fff);
  border-color: #ffc300;
  box-shadow: 0 24px 52px rgba(31, 41, 51, 0.36), 0 0 0 8px rgba(255, 195, 0, 0.14);
}

.reward-card.master-reward-card h2 {
  color: #7a5200;
  font-size: 1.85rem;
}

.master-reward-count {
  display: inline-grid;
  place-items: center;
  min-width: 128px;
  margin: 2px auto 12px !important;
  padding: 8px 18px;
  color: #5e4700 !important;
  background: var(--sun);
  border: 2px solid #9b6b00;
  border-bottom-width: 5px;
  border-radius: 999px;
  font-size: 1.25rem;
  font-weight: 1000 !important;
}

.master-collage {
  justify-content: center;
}

.master-meaning-badges {
  max-width: 420px;
  margin-inline: auto;
}

.master-owl-cheer {
  margin-top: 10px;
}

.master-collage span {
  color: #704f00;
  background: #fff5c7;
  border-color: #f0c94f;
}

@keyframes reward-spark {
  0%, 100% { opacity: 0.35; transform: scale(0.8) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.2) rotate(16deg); }
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 40;
  width: min(520px, calc(100% - 32px));
  padding: 12px 14px;
  color: #fff5d6;
  background: linear-gradient(135deg, #3a2415, #2d1b0e);
  border: 1px solid rgba(245, 188, 68, 0.3);
  border-radius: 12px;
  box-shadow: var(--gold-glow);
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%);
}

.app-toast[hidden] {
  display: none;
}

.footer-note {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: center;
  padding: 20px 24px 32px;
  color: var(--muted);
  text-align: center;
}

.footer-note p {
  margin: 0;
}

.text-button {
  min-height: var(--min-touch);
  padding: 6px 12px;
  color: var(--teal-dark);
  background: transparent;
}

@media (max-width: 1080px) {
  .sticky-progress {
    display: flex;
  }

  .app-layout {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 2px solid var(--line);
    max-height: none;
    overflow-y: visible;
  }

  .sidebar-header {
    text-align: center;
    padding: 18px 16px 14px;
    border-bottom: 3px solid rgba(180, 137, 52, 0.35);
  }

  .sidebar-header h1 {
    font-size: 1.8rem;
    text-shadow: 0 3px 6px rgba(0,0,0,0.4);
  }

  .sidebar-header h1 small {
    font-size: 1.15rem;
  }

  .quest-board {
    margin-top: 10px;
  }

  .sidebar-section {
    padding: 12px 16px;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .filter-button {
    width: auto;
    min-height: 38px;
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  .filter-button::before {
    display: none;
  }

  .filter-main {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .filter-icon {
    width: 26px;
    height: 26px;
  }

  .mode-buttons {
    flex-direction: row;
  }

  .mission-board {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .mission-meter,
  .mission-toggle {
    grid-column: 1 / -1;
  }

  .progress-panel {
    flex-direction: row;
    align-items: center;
  }

  .center-area {
    overflow-y: visible;
  }

  .catalog-area {
    padding: 0 16px 24px;
  }

  .detail-sheet {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }

  .detail-modal {
    padding: 0;
  }

  .game-header {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 10px;
    padding: 14px;
  }

  .game-description {
    display: none;
  }

  .game-view {
    padding: 12px;
    overflow: hidden;
  }

  .game-view.active {
    height: 100dvh;
    min-height: 100dvh;
  }

  .game-controls {
    margin-bottom: 10px;
  }

  .game-board {
    flex: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "pool pool"
      "yes no";
    gap: 10px;
  }

  .game-source,
  .drop-zone {
    min-height: 0;
    padding: 10px;
  }

  .game-source {
    grid-area: pool;
  }

  .drop-zone[data-answer="yes"] {
    grid-area: yes;
  }

  .drop-zone[data-answer="no"] {
    grid-area: no;
  }

  .token-zone {
    min-height: 0;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .game-token {
    min-height: 100px;
    gap: 4px;
    padding: 6px;
    font-size: 0.86rem;
  }

  .game-token img {
    height: 58px;
  }
}

body[data-view="game"] .sticky-progress {
  display: flex;
}

@media (orientation: landscape) and (max-height: 600px) {
  .detail-modal {
    padding: 0;
  }

  .detail-sheet {
    width: min(960px, 100%);
    max-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(220px, 38%) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .detail-sheet .close-detail {
    grid-column: 1 / -1;
    margin: 8px 10px;
  }

  .detail-photo {
    grid-row: 2;
    min-height: 0;
    height: 100%;
  }

  .detail-photo img {
    height: 100%;
    max-height: none;
    object-fit: contain;
  }

  .detail-body {
    grid-row: 2;
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
    padding: 16px;
  }

  .detail-quiz-anchor {
    top: 0;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 16px;
  }

  .sidebar-header h1 {
    font-size: 1.6rem;
  }

  .sidebar-header h1 small {
    font-size: 1.1rem;
  }

  .sidebar-section {
    padding: 10px 14px;
  }

  .center-header {
    padding: 14px 14px 0;
  }

  .mission-board {
    gap: 10px;
    padding: 12px;
  }

  .mission-orb {
    width: 48px;
    height: 48px;
    font-size: 1.45rem;
  }

  .mission-copy h2 {
    font-size: 1.08rem;
  }

  .mission-copy p {
    font-size: 0.84rem;
  }

  .mission-next-step {
    display: flex;
    width: 100%;
  }

  .mission-toggle {
    width: 100%;
  }

  .catalog-area {
    padding: 0 14px 20px;
  }

  .safety-strip {
    grid-template-columns: 1fr;
  }

  .safety-strip summary {
    font-size: 0.95rem;
  }

  .animal-grid {
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  }

  .animal-card {
    grid-template-rows: 128px 1fr;
  }

  .image-frame,
  .animal-card img {
    height: 128px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .result-count {
    text-align: left;
  }

  .game-view {
    padding: 10px;
  }

  .game-header {
    padding: 12px;
    gap: 8px;
  }

  .game-score {
    min-height: 72px;
    font-size: 1.35rem;
  }

  .game-controls {
    gap: 8px;
  }

  .select-field {
    min-width: 100%;
  }

  .game-board {
    gap: 8px;
  }

  .game-source,
  .drop-zone {
    padding: 8px;
  }

  .game-source p,
  .drop-zone p {
    font-size: 0.8rem;
  }

  .token-zone {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
  }

  .game-token {
    min-height: 100px;
    font-size: 0.8rem;
  }

  .game-token img {
    height: 56px;
  }

  .game-feedback {
    min-height: 44px;
    margin-top: 8px;
    padding: 10px;
    font-size: 0.9rem;
  }

  .detail-body {
    padding: 18px 14px;
  }

  .question-tool {
    grid-template-columns: 1fr;
  }

  .question-link {
    width: 100%;
  }

  .collected-action-card,
  .quiz-complete-card {
    grid-template-columns: 1fr;
  }

  .quiz-replay-button {
    justify-self: start;
  }

  .quiz-complete-photo {
    width: 112px;
  }

  .settings-body {
    padding: 24px 18px;
  }

  .settings-actions {
    display: grid;
  }

  .share-actions,
  .qr-share-box {
    grid-template-columns: 1fr;
  }

  .qr-code {
    width: min(100%, 240px);
    min-height: 0;
    justify-self: center;
  }
}

.catch-overlay {
  --catch-ball-size: clamp(72px, 18vw, 88px);
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(45, 27, 14, 0.85);
  opacity: 0;
  transition: opacity 180ms ease;
}

.catch-overlay.active {
  opacity: 1;
}

.catch-stage {
  position: relative;
  width: min(360px, 100%);
  min-height: min(420px, calc(100dvh - 64px));
  display: grid;
  place-items: center;
  overflow: hidden;
}

.catch-animal-shell,
.catch-ball-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.catch-animal-image {
  width: clamp(156px, 42vw, 220px);
  height: clamp(156px, 42vw, 220px);
  object-fit: contain;
  transform: translateY(-44px) scale(1);
  transform-origin: center 68%;
  filter: drop-shadow(0 18px 22px rgba(31, 41, 51, 0.22));
}

.catch-ball-orbit {
  position: relative;
  width: var(--catch-ball-size);
  height: var(--catch-ball-size);
  opacity: 0;
  transform: translate(-124px, 120px) rotate(0deg) scale(0.3);
}

.catch-overlay.active .catch-ball-orbit {
  animation: catch-ball-throw 0.6s cubic-bezier(0.18, 0.88, 0.32, 1.16) forwards;
}

.catch-ball {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: linear-gradient(to bottom, var(--coral) 0 48%, var(--paper) 48% 100%);
  box-shadow: var(--shadow-lg);
}

.catch-ball::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 5px);
  height: 10px;
  background: var(--ink);
}

.catch-ball::after {
  content: "";
  position: absolute;
  inset: 10% 18% 52% 18%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
}

.catch-ball-button {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.44);
}

.catch-flash {
  position: absolute;
  inset: -22%;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.catch-overlay.is-flashing .catch-flash {
  animation: catch-flash 0.3s ease-out forwards;
}

.catch-overlay.is-absorbing .catch-animal-image {
  animation: catch-absorb 0.4s ease-in forwards;
}

.catch-overlay.is-shaking .catch-ball {
  animation: catch-shake 0.9s ease-in-out forwards;
}

.catch-overlay.is-success .catch-ball {
  animation: catch-success 0.5s ease-out forwards;
}

.catch-message {
  position: absolute;
  left: 50%;
  bottom: clamp(20px, 8vw, 36px);
  margin: 0;
  padding: 10px 16px;
  color: var(--paper);
  background: var(--teal);
  border: 2px solid var(--teal-dark);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 12px);
}

.catch-overlay.is-success .catch-message {
  opacity: 1;
  transform: translate(-50%, 0);
  transition: opacity 160ms ease, transform 160ms ease;
}

.catch-sparkles {
  position: absolute;
  inset: -72%;
  pointer-events: none;
}

.catch-sparkles span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  opacity: 0;
  background: var(--sun);
  clip-path: polygon(50% 0%, 61% 36%, 100% 36%, 69% 58%, 79% 100%, 50% 74%, 21% 100%, 31% 58%, 0% 36%, 39% 36%);
  filter: drop-shadow(0 0 6px rgba(255, 195, 0, 0.72));
}

.catch-sparkles span:nth-child(1) {
  --spark-x: -54px;
  --spark-y: -46px;
}

.catch-sparkles span:nth-child(2) {
  --spark-x: 0px;
  --spark-y: -62px;
}

.catch-sparkles span:nth-child(3) {
  --spark-x: 58px;
  --spark-y: -38px;
}

.catch-sparkles span:nth-child(4) {
  --spark-x: -62px;
  --spark-y: 20px;
}

.catch-sparkles span:nth-child(5) {
  --spark-x: 64px;
  --spark-y: 18px;
}

.catch-sparkles span:nth-child(6) {
  --spark-x: 10px;
  --spark-y: 58px;
}

.catch-overlay.is-success .catch-sparkles span {
  animation: catch-sparkle 0.5s ease-out forwards;
}

.catch-overlay.is-success .catch-sparkles span:nth-child(2) {
  animation-delay: 30ms;
}

.catch-overlay.is-success .catch-sparkles span:nth-child(3) {
  animation-delay: 60ms;
}

.catch-overlay.is-success .catch-sparkles span:nth-child(4) {
  animation-delay: 90ms;
}

.catch-overlay.is-success .catch-sparkles span:nth-child(5) {
  animation-delay: 120ms;
}

.catch-overlay.is-success .catch-sparkles span:nth-child(6) {
  animation-delay: 150ms;
}

@keyframes catch-ball-throw {
  0% {
    opacity: 0;
    transform: translate(-124px, 120px) rotate(0deg) scale(0.3);
  }

  38% {
    opacity: 1;
  }

  65% {
    opacity: 1;
    transform: translate(24px, -38px) rotate(250deg) scale(0.92);
  }

  100% {
    opacity: 1;
    transform: translate(0, 0) rotate(360deg) scale(1);
  }
}

@keyframes catch-flash {
  0% {
    opacity: 0;
    transform: scale(0.4);
    background: rgba(255, 255, 255, 0);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }

  35% {
    opacity: 1;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 0 20px rgba(255, 255, 255, 0.28);
  }

  100% {
    opacity: 0;
    transform: scale(1.9);
    background: rgba(255, 255, 255, 0);
    box-shadow: 0 0 0 68px rgba(255, 255, 255, 0);
  }
}

@keyframes catch-absorb {
  0% {
    opacity: 1;
    transform: translateY(-44px) scale(1);
  }

  55% {
    opacity: 1;
    transform: translateY(-12px) scale(0.58);
  }

  100% {
    opacity: 0;
    transform: translateY(18px) scale(0.18);
  }
}

@keyframes catch-shake {
  0%,
  100% {
    transform: rotate(0deg);
  }

  12% {
    transform: rotate(-15deg);
  }

  24% {
    transform: rotate(15deg);
  }

  36% {
    transform: rotate(-15deg);
  }

  48% {
    transform: rotate(15deg);
  }

  60% {
    transform: rotate(-12deg);
  }

  72% {
    transform: rotate(12deg);
  }

  84% {
    transform: rotate(-6deg);
  }
}

@keyframes catch-success {
  0% {
    transform: scale(1);
    box-shadow: var(--shadow-lg);
  }

  50% {
    transform: scale(1.12);
    box-shadow: 0 0 0 8px rgba(255, 195, 0, 0.2), 0 0 28px rgba(255, 195, 0, 0.84);
  }

  100% {
    transform: scale(1);
    box-shadow: var(--shadow-lg);
  }
}

@keyframes catch-sparkle {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.3) rotate(0deg);
  }

  25% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(var(--spark-x), var(--spark-y)) scale(1.1) rotate(28deg);
  }
}

@media (max-width: 680px) {
  .catch-overlay {
    padding: 16px;
  }

  .catch-stage {
    width: min(320px, 100%);
    min-height: min(360px, calc(100dvh - 32px));
  }

  .catch-animal-image {
    width: clamp(136px, 44vw, 190px);
    height: clamp(136px, 44vw, 190px);
    transform: translateY(-32px) scale(1);
  }

  .catch-message {
    bottom: 14px;
    padding: 8px 14px;
    font-size: 0.88rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after,
  .catch-overlay,
  .catch-overlay *,
  .reward-burst span,
  .modal-scroll-hint {
    animation: none !important;
    transition: none !important;
    transition-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

.first-visit-highlight {
  animation: first-visit-pulse 0.8s ease-in-out 3;
}

@keyframes first-visit-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 159, 28, 0); }
  50% { box-shadow: 0 0 0 8px rgba(255, 159, 28, 0.5), 0 0 20px rgba(255, 159, 28, 0.3); }
}

@media (prefers-reduced-motion: reduce) {
  .first-visit-highlight { animation: none; }
}

/* ── Teacher settings banner ── */
.teacher-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--sun), #ffb627);
  color: var(--ink);
  font-weight: 900;
  font-size: 0.92rem;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(255, 195, 0, 0.3);
}

.teacher-banner[hidden] {
  display: none;
}

/* ── QR Code expand modal ── */
.qr-expand-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(45, 27, 14, 0.85);
}

.qr-expand-modal[hidden] {
  display: none;
}

.qr-expand-content {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.qr-expand-content h3 {
  color: var(--teal-dark);
  margin: 0 0 16px;
  font-size: 1.1rem;
}

.qr-expand-content .qr-expand-image {
  width: min(280px, 100%);
  margin: 0 auto 20px;
}

.qr-expand-content .qr-expand-image svg {
  width: 100%;
  height: auto;
}

.qr-expand-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.qr-expand-actions .primary-button {
  font-size: 0.92rem;
}

.qr-expand-close {
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: var(--min-touch);
  min-width: var(--min-touch);
  padding: 8px 14px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 8px;
  font-weight: 900;
  font-size: 0.9rem;
  cursor: pointer;
}

.qr-expand-close:hover {
  background: var(--mist);
  border-color: var(--teal);
}

/* ── Setup guide modal ── */
.guide-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--paper);
  font-weight: 900;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  margin-left: 8px;
  flex-shrink: 0;
  transition: background 150ms ease;
}

.guide-toggle:hover {
  background: var(--teal-dark);
}

.guide-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(45, 27, 14, 0.82);
}

.guide-modal[hidden] {
  display: none;
}

.guide-content {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.guide-content h3 {
  color: var(--teal-dark);
  margin: 0 0 16px;
  font-size: 1.1rem;
}

.guide-content .guide-step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  margin: 0 0 14px;
  align-items: start;
}

.guide-content .guide-step-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--paper);
  font-weight: 900;
  font-size: 0.85rem;
}

.guide-content .guide-step-text {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.5;
}

.guide-content .guide-step-text strong {
  color: var(--teal-dark);
}

.guide-content .guide-img {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  margin: 12px 0;
}

.guide-content .guide-close-row {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

/* ── Question navigate confirmation ── */
.confirm-popup {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(45, 27, 14, 0.82);
}

.confirm-popup[hidden] {
  display: none;
}

.confirm-popup-content {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.confirm-popup-content h3 {
  color: var(--teal-dark);
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.confirm-popup-content p {
  margin: 0 0 20px;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.5;
}

.confirm-popup-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-popup-actions .primary-button {
  font-size: 0.92rem;
}

.confirm-popup-actions .cancel-button {
  min-height: var(--min-touch);
  padding: 10px 14px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 12px;
  font-weight: 900;
  font-size: 0.92rem;
  cursor: pointer;
}

.confirm-popup-actions .cancel-button:hover {
  background: var(--mist);
  border-color: var(--muted);
}

/* ── Category filter icons ── */
.filter-button[data-filter] .filter-icon {
  margin-right: 4px;
  font-size: 1.1em;
}

/* ── Paw print loading animation ── */
@keyframes paw-walk {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.05); }
}

.paw-loading {
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 32px;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.95rem;
}

.paw-loading .paw-prints {
  display: flex;
  gap: 8px;
  font-size: 1.4rem;
}

.paw-loading .paw-prints span {
  display: inline-block;
  animation: paw-walk 1.2s ease-in-out infinite;
}

.paw-loading .paw-prints span:nth-child(2) {
  animation-delay: 0.2s;
}

.paw-loading .paw-prints span:nth-child(3) {
  animation-delay: 0.4s;
}

/* ── Error message styling ── */
.error-message {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 24px;
  color: var(--coral);
  font-weight: 800;
  font-size: 0.95rem;
  text-align: center;
  background: #fff5f5;
  border: 2px solid var(--coral);
  border-radius: var(--radius);
}

.error-message .error-icon {
  font-size: 2rem;
}

/* ── Input with guide button ── */
.input-with-guide {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-with-guide input {
  flex: 1;
}

.settings-form label,
.share-link-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}
