@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=Titan+One&display=swap');

/* ===== BirdScope game (scoped to .birdscope-app so it never fights the site theme) ===== */

/* On game pages only, hide the site masthead (logo/title/tagline) and footer for a clean game screen.
   The top menu nav stays; the hub card-footer links back to elliescope.github.io. */
body:has(.birdscope-app) .masthead,
body:has(.birdscope-app) .site-footer {
  display: none !important;
}

.birdscope-app {
  --bg-cream: #FFFDF4;
  --wood-dark: #3F2E23;
  --nature-green: #68A357;
  --green-dark: #467936;
  --sun-yellow: #FFD152;
  --sun-dark: #E5A91E;
  --card-white: #FFFFFF;
  --accent-orange: #FF7B54;
  --sky-blue: #64C4ED;
  --sky-soft: #EFF9FF;
  --wood-light: #F4EFE6;
  --border-radius-sketch: 255px 15px 225px 15px / 15px 225px 15px 255px;
  --border-radius-btn: 255px 25px 225px 25px / 25px 225px 25px 255px;

  background-color: var(--bg-cream);
  background-image: radial-gradient(#E8E0C5 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  font-family: 'Fredoka', 'ZCOOL KuaiLe', cursive, sans-serif;
  color: var(--wood-dark);
  padding: 28px 16px 44px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
}

.birdscope-app *,
.birdscope-app *::before,
.birdscope-app *::after {
  box-sizing: border-box;
}

/* ================= Hub: main menu card ================= */

.birdscope-app .screen-container {
  background: var(--card-white);
  width: 100%;
  max-width: 480px;
  padding: 40px 28px;
  border: 4px solid var(--wood-dark);
  border-radius: var(--border-radius-sketch);
  box-shadow: 6px 8px 0px var(--wood-dark);
  text-align: center;
  position: relative;
}

.birdscope-app .washi-tape {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  background: rgba(255, 209, 82, 0.75);
  width: 120px;
  height: 28px;
  border-left: 2px dashed rgba(63, 46, 35, 0.3);
  border-right: 2px dashed rgba(63, 46, 35, 0.3);
  z-index: 2;
}

.birdscope-app .badge {
  display: inline-block;
  background: #E8F5E9;
  border: 2px dashed var(--nature-green);
  color: var(--green-dark);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
  transform: rotate(-1deg);
}

.birdscope-app .game-title {
  font-size: 2.8rem;
  color: var(--wood-dark);
  line-height: 1.1;
  margin: 0 0 6px;
  letter-spacing: 1px;
  text-shadow: 2px 2px 0px #F5E6CC;
}

.birdscope-app .hero-title {
  font-family: 'Titan One', 'Fredoka', cursive;
  font-size: 2.6rem;
  color: var(--wood-dark);
  letter-spacing: 1px;
  text-shadow: 2px 3px 0px var(--sun-yellow);
  margin: 6px 0;
}

.birdscope-app .game-subtitle {
  font-size: 1.15rem;
  color: var(--green-dark);
  margin: 0 0 24px;
  font-weight: 600;
}

.birdscope-app .hero-art-box {
  width: 160px;
  height: 160px;
  margin: 0 auto 28px;
  background: var(--sky-soft);
  border: 3px solid var(--wood-dark);
  border-radius: 50% 60% 45% 55% / 55% 45% 60% 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 4px 4px 0px var(--wood-dark);
  animation: birdscope-wobble 4s ease-in-out infinite;
}

.birdscope-app .hero-bird-emoji {
  font-size: 4.5rem;
  line-height: 1;
  filter: drop-shadow(2px 4px 0px rgba(0, 0, 0, 0.1));
}

.birdscope-app .art-caption {
  font-size: 0.8rem;
  color: #7E97A6;
  margin-top: 4px;
}

.birdscope-app .menu-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.birdscope-app .btn {
  width: 100%;
  padding: 16px 20px;
  font-size: 1.3rem;
  font-family: inherit;
  font-weight: 700;
  border: 3px solid var(--wood-dark);
  border-radius: var(--border-radius-btn);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.2s;
  outline: none;
}

.birdscope-app .btn:hover {
  transform: translateY(-2px);
}

.birdscope-app .btn:active {
  transform: translate(2px, 4px) !important;
  box-shadow: 1px 1px 0px var(--wood-dark) !important;
}

.birdscope-app .btn-primary {
  background-color: var(--nature-green);
  color: #FFFFFF;
  box-shadow: 4px 5px 0px var(--wood-dark);
}

.birdscope-app .btn-primary:hover {
  background-color: var(--green-dark);
  box-shadow: 5px 7px 0px var(--wood-dark);
}

.birdscope-app .btn-secondary {
  background-color: var(--sun-yellow);
  color: var(--wood-dark);
  box-shadow: 4px 5px 0px var(--wood-dark);
}

.birdscope-app .btn-secondary:hover {
  background-color: var(--sun-dark);
  box-shadow: 5px 7px 0px var(--wood-dark);
}

.birdscope-app .btn-outline {
  background-color: #FAFAFA;
  color: var(--wood-dark);
  box-shadow: 3px 4px 0px var(--wood-dark);
  font-size: 1.05rem;
  padding: 13px 18px;
  justify-content: space-between;
}

.birdscope-app .btn-outline:hover {
  background-color: #F0F4F8;
}

.birdscope-app .menu-group > button,
.birdscope-app .menu-group > a,
.birdscope-app .location-picker-btn,
.birdscope-app .btn-primary-quest,
.birdscope-app .btn-secondary-dex {
  width: 100%;
  height: 52px;
  box-sizing: border-box;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.birdscope-app .location-picker-btn {
  justify-content: space-between;
}

.birdscope-app #displayLocationLabel {
  margin-right: 8px;
}

.birdscope-app .location-summary-tag {
  font-size: 0.85rem;
  background: var(--sky-soft);
  border: 1.5px solid var(--sky-blue);
  color: #247599;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.birdscope-app .card-footer {
  margin-top: 18px;
  font-size: 0.85rem;
  color: #8C7A6B;
}

.birdscope-app .author-highlight {
  font-weight: 700;
  color: var(--accent-orange);
  text-decoration: none;
}

/* ================= Hub: filter modal ================= */

.birdscope-app .modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(63, 46, 35, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12px 10px 14px;
  z-index: 100;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.birdscope-app .modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.birdscope-app .modal-card {
  background: #FFFDF8;
  width: 100%;
  max-width: 420px;
  border: 2.5px solid var(--wood-dark);
  border-radius: 16px;
  box-shadow: 4px 6px 0px var(--wood-dark);
  padding: 16px 14px 14px;
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: visible;
}

.birdscope-app .modal-card::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-1deg);
  width: 84px;
  height: 18px;
  background: rgba(242, 207, 102, 0.85);
  border-left: 2px dashed rgba(63, 46, 35, 0.28);
  border-right: 2px dashed rgba(63, 46, 35, 0.28);
  pointer-events: none;
}

.birdscope-app .modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.birdscope-app .modal-close-x {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: 2.5px solid var(--wood-dark);
  border-radius: 50%;
  background: var(--wood-light);
  color: var(--wood-dark);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 2px 2px 0px var(--wood-dark);
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.birdscope-app .modal-close-x:hover {
  background: #FFE8DC;
  transform: scale(1.06);
}

.birdscope-app .modal-close-x:active {
  transform: scale(0.94);
  box-shadow: 1px 1px 0px var(--wood-dark);
}

.birdscope-app .modal-title {
  font-size: 1.8rem;
  margin: 0 0 4px;
  text-align: left;
}

.birdscope-app .modal-sub {
  font-size: 0.9rem;
  color: #7A695C;
  text-align: left;
  margin: 0 0 18px;
}

.birdscope-app .section-label {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  text-align: left;
}

.birdscope-app .prep-section {
  margin-bottom: 18px;
}

.birdscope-app .prep-section-last {
  margin-bottom: 14px;
}

.birdscope-app .hotspot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.birdscope-app .chip {
  background: #F4F1EA;
  border: 2px solid var(--wood-dark);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.birdscope-app .chip:hover {
  background: var(--sky-soft);
  transform: translateY(-1px);
}

.birdscope-app .chip.active {
  background: var(--sky-blue);
  color: #FFFFFF;
  box-shadow: 2px 2px 0px var(--wood-dark);
  transform: translateY(-1px);
}

.birdscope-app .chip-live {
  border-style: dashed;
  border-color: var(--accent-orange);
  background: #FFF7EE;
}

.birdscope-app .chip-live:hover {
  background: #FFEFDD;
}

.birdscope-app .nearby-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 10px;
}

.birdscope-app .nearby-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 2px solid #D9CFC0;
  border-radius: 12px;
  padding: 7px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--wood-dark);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.birdscope-app .nearby-row:hover {
  border-color: var(--accent-orange);
  background: #FFFDF9;
  transform: translateX(2px);
}

.birdscope-app .nearby-row.active {
  border-color: var(--accent-orange);
  background: #FFF3E4;
  box-shadow: 2px 2px 0px var(--wood-dark);
}

.birdscope-app .nearby-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: #7A695C;
  white-space: nowrap;
}

.birdscope-app .nearby-empty {
  height: 32px;
  font-size: 0.76rem;
  color: #6E5D4F;
  padding: 0 4px;
  margin: 5px 0 0;
  text-align: left;
  line-height: 1.35;
  overflow: hidden;
}

.birdscope-app .nearby-empty.status-error {
  height: auto;
  color: #B54522;
  font-weight: 600;
}

.birdscope-app .location-search-row {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 6px;
}

.birdscope-app .btn-near-me {
  white-space: nowrap;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  border: 2px solid #D5C8B8;
  background: #FFFDF4;
  color: #7D6B5D;
  box-shadow: none;
}

.birdscope-app .btn-near-me:hover {
  background: #FFF7EE;
  border-color: var(--wood-dark);
  color: var(--wood-dark);
}

.birdscope-app .btn-near-me.active {
  border: 2.5px dashed var(--accent-orange);
  background: #FFF5F0;
  color: var(--wood-dark);
  font-weight: 700;
  box-shadow: 2px 2px 0px var(--wood-dark);
}

.birdscope-app .search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.birdscope-app .search-input-wrap .sketch-input {
  padding-right: 36px;
  text-overflow: ellipsis;
}

.birdscope-app .btn-search-go {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 6px;
  line-height: 1;
}

.birdscope-app .place-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  max-height: 185px;
  overflow-y: auto;
  background: #FFFDF8;
  border: 2px solid var(--wood-dark);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(63, 46, 35, 0.22);
  z-index: 60;
  padding: 4px;
}

.birdscope-app .place-suggestions[hidden] {
  display: none !important;
}

.birdscope-app .suggestion-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px dashed #E6DEC8;
  border-radius: 0;
  padding: 6px 10px;
  font-family: inherit;
  color: var(--wood-dark);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.birdscope-app .suggestion-row:last-child {
  border-bottom: none;
}

.birdscope-app .suggestion-row:hover {
  background: #FFF3E4;
}

.birdscope-app .place-main {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--wood-dark);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.birdscope-app .place-sub {
  display: block;
  font-size: 0.72rem;
  color: #7D6B5D;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.birdscope-app .time-now-row {
  margin-bottom: 6px;
}

.birdscope-app .time-now-pill {
  width: 100%;
  font-family: inherit;
  padding: 7px 12px;
  font-size: 0.9rem;
}

.birdscope-app .mode-badge {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 5px 10px;
  border-radius: 20px;
  margin: 0 0 10px;
  background: #EBF7EE;
  color: #2E5A31;
  border: 1.5px solid #B7DFC1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.birdscope-app .mode-badge.offline {
  background: #F4F1EA;
  color: #7A695C;
  border-color: #D9CFC0;
}

.birdscope-app .county-select {
  margin-top: 0;
  cursor: pointer;
  padding-right: 32px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.birdscope-app .modal-hint {
  font-size: 0.78rem;
  color: #8A7A6C;
  margin: -10px 0 18px;
  text-align: left;
  transition: opacity 0.15s ease;
}

.birdscope-app .sketch-input {
  width: 100%;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  border: 2px solid var(--wood-dark);
  border-radius: 15px 4px 15px 4px / 4px 15px 4px 15px;
  background: #FFFFFF;
  outline: none;
  color: var(--wood-dark);
  box-shadow: 2px 2px 0px #DDD;
}

.birdscope-app .sketch-input:focus {
  border-color: var(--accent-orange);
  background: #FFFDF9;
}

.birdscope-app .months-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 0;
}

.birdscope-app .month-pill {
  background: #FFFFFF;
  border: 2px solid var(--wood-dark);
  border-radius: 10px;
  padding: 5px 4px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.birdscope-app .month-pill:hover {
  background: #FFF3CD;
}

.birdscope-app .month-pill.active {
  background: var(--sun-yellow);
  box-shadow: 2px 3px 0px var(--wood-dark);
  transform: translateY(-2px);
}

.birdscope-app .modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 0;
}

.birdscope-app .btn-save {
  flex: 2;
  padding: 12px;
  font-size: 1.15rem;
  background: var(--nature-green);
  color: #FFFFFF;
  box-shadow: 3px 4px 0px var(--wood-dark);
}

.birdscope-app .btn-close {
  flex: 1;
  padding: 12px;
  font-size: 1.15rem;
  background: #ECE7DE;
  color: var(--wood-dark);
  box-shadow: 3px 4px 0px var(--wood-dark);
}

/* ================= Quiz card ================= */

.birdscope-app .quiz-loading-card {
  padding: 40px 26px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.birdscope-app .quiz-loading-card[hidden],
.birdscope-app .quiz-card[hidden] {
  display: none !important;
}

.birdscope-app .loading-mascot {
  width: 96px;
  height: 96px;
  margin: 6px auto 16px;
  background: var(--sky-soft);
  border: 3px solid var(--wood-dark);
  border-radius: 50% 60% 45% 55% / 55% 45% 60% 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  box-shadow: 3px 4px 0px var(--wood-dark);
  animation: birdscope-wobble 2.8s ease-in-out infinite;
}

.birdscope-app .loading-title {
  font-size: 1.55rem;
  color: var(--wood-dark);
  margin: 0 0 8px;
}

.birdscope-app .loading-step {
  font-size: 0.95rem;
  color: #5C4B3E;
  margin: 0 0 18px;
  min-height: 1.4em;
  font-weight: 600;
}

.birdscope-app .loading-bar-track {
  width: 100%;
  max-width: 320px;
  height: 18px;
  background: #ECE5D8;
  border: 2.5px solid var(--wood-dark);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.06);
}

.birdscope-app .loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--nature-green), #82C36D);
  border-radius: 9px;
  transition: width 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.birdscope-app .loading-percent {
  margin-top: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green-dark);
}

.birdscope-app .quiz-card {
  background: var(--card-white);
  width: 100%;
  max-width: 460px;
  padding: 18px 18px 20px;
  border: 4px solid var(--wood-dark);
  border-radius: var(--border-radius-sketch);
  box-shadow: 6px 8px 0px var(--wood-dark);
  position: relative;
  text-align: center;
}

.birdscope-app .quiz-card .washi-tape {
  top: -12px;
  transform: translateX(-50%) rotate(1deg);
  width: 110px;
  height: 22px;
  background: rgba(255, 209, 82, 0.85);
}

.birdscope-app .top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

/* ================= Shared notebook canvas & stage ================= */

/* Cream polka-dot desk behind every BirdScope page */
html:has(.birdscope-app),
body:has(.birdscope-app) {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  background-color: #FCF9EE;
  background-image: radial-gradient(#E2DAC8 1.5px, transparent 1.5px);
  background-size: 18px 18px;
}

body:has(.birdscope-app) .page-wrapper,
body:has(.birdscope-app) .page-content {
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
}

/* Empty theme page header would add a phantom gap above the stage */
body:has(.birdscope-app) .page-header {
  display: none;
}

/* Stage shared by Index / Loading / Quiz: top-anchored on phones (< 600px) */
.birdscope-app.birdscope-page-stage {
  background: transparent;
  border-radius: 0;
  min-height: calc(100dvh - 48px);
  padding: 16px 8px 20px;
  box-sizing: border-box;
  justify-content: flex-start;
}

/* BirdDex is a long scroll: keep it top-aligned instead of centered */
.birdscope-app.birdscope-dex-stage {
  justify-content: flex-start;
  padding: 18px 12px 44px;
}

/* Hand-drawn white note sheet shared by Index / Loading / Quiz */
.birdscope-app .notebook-sheet {
  position: relative;
  width: 100%;
  max-width: 430px;
  background: #FFFDF8;
  border: 2.5px solid var(--wood-dark);
  border-radius: 16px;
  box-shadow: 4px 5px 0 var(--wood-dark);
  padding: 16px 14px 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  text-align: center;
}

/* Yellow tape stays on every sheet */
.birdscope-app .notebook-sheet > .washi-tape {
  display: block;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  width: 96px;
  height: 22px;
  border-left: 2px dashed rgba(63, 46, 35, 0.28);
  border-right: 2px dashed rgba(63, 46, 35, 0.28);
  background: rgba(242, 207, 102, 0.85);
}

.birdscope-app .screen-container.notebook-sheet {
  align-items: center;
}

.birdscope-app .screen-container.notebook-sheet .menu-group {
  width: 100%;
}

.birdscope-app .quiz-loading-card.notebook-sheet {
  padding: 34px 20px 30px;
}

/* Quiz sheet: single-column field note */
.birdscope-app .notebook-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 430px;
  text-align: left;
  padding-bottom: 16px;
}

.birdscope-app .notebook-card .top-bar {
  margin-bottom: 0;
}

.birdscope-app .spread-left,
.birdscope-app .spread-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

/* Flatten the inner polaroid frame: keep one clean rounded photo box */
.birdscope-app .notebook-card .polaroid-frame {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin-bottom: 0;
}

.birdscope-app .notebook-card .bird-photo-frame {
  height: clamp(165px, 24dvh, 190px);
}

.birdscope-app .notebook-card .fact-sticky-note {
  margin-top: 0;
}

.birdscope-app .notebook-card .hint-box {
  margin-bottom: 0;
}

.birdscope-app .notebook-card .options-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  gap: 12px;
  margin-bottom: 0;
}

.birdscope-app .notebook-card .bottom-utility {
  padding: 0;
  justify-content: center;
}

.birdscope-app .btn-icon-back {
  background: var(--wood-light);
  border: 2px solid var(--wood-dark);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: transform 0.1s;
  flex-shrink: 0;
}

.birdscope-app .btn-icon-back:active {
  transform: scale(0.9);
}

.birdscope-app .progress-track {
  flex: 1;
  height: 14px;
  background: #ECE5D8;
  border: 2px solid var(--wood-dark);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.birdscope-app .progress-fill {
  height: 100%;
  width: 0%;
  background: var(--nature-green);
  transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.birdscope-app .progress-Count-badge,
.birdscope-app .progress-count-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: #2B5B78;
  background: var(--sky-soft);
  border: 2px solid var(--wood-dark);
  border-radius: 999px;
  padding: 2px 9px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.birdscope-app .streak-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: #9C3A1C;
  background: #FFF0E6;
  border: 2px solid var(--wood-dark);
  border-radius: 999px;
  padding: 2px 9px;
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.birdscope-app .streak-badge[hidden] {
  display: none !important;
}

.birdscope-app .streak-badge.pop-anim {
  animation: streakPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.birdscope-app .streak-badge.best-record-highlight {
  border-color: #FFB300 !important;
  background: #FFF9E6 !important;
  box-shadow: 0 0 8px rgba(255, 179, 0, 0.6), inset 0 0 4px rgba(255, 215, 0, 0.4);
}

@keyframes streakPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.birdscope-app .source-notice-banner,
.birdscope-app .welcome-toast {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 28px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #FFF7E6;
  border: 2px dashed var(--sun-dark);
  color: #6B4C1B;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  z-index: 120;
  box-shadow: 0 4px 12px rgba(63, 46, 35, 0.16);
  transition: opacity 0.38s ease, transform 0.38s ease;
}

.birdscope-app .source-notice-banner.fade-out,
.birdscope-app .welcome-toast.fade-out {
  opacity: 0;
  transform: translate(-50%, -10px);
  pointer-events: none;
}

.birdscope-app .source-notice-banner[hidden] {
  display: none !important;
}

.birdscope-app .source-notice-banner.notice-warn {
  background: #FFF0E6;
  border-color: var(--accent-orange);
  color: #9C3A1C;
}

.birdscope-app .source-notice-banner.notice-info {
  background: var(--sky-soft);
  border-color: #64C4ED;
  color: #245B76;
}

.birdscope-app .source-notice-banner.notice-resume {
  background: #E8F5E9;
  border-color: #4CAF50;
  color: #2E5A31;
}

.birdscope-app .source-notice-close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0 2px;
  line-height: 1.1;
  opacity: 0.75;
  flex-shrink: 0;
}

.birdscope-app .source-notice-close:hover {
  opacity: 1;
}

.birdscope-app .polaroid-frame {
  background: #FFFDF9;
  border: 3px solid var(--wood-dark);
  border-radius: 12px 14px 10px 15px;
  padding: 10px 10px 12px;
  box-shadow: 3px 4px 0px var(--wood-dark);
  margin-bottom: 12px;
  position: relative;
}

.birdscope-app .photo-credit {
  margin: -6px 2px 0;
  font-size: 10.5px;
  line-height: 1.2;
  color: #A39486;
  text-align: right;
  overflow-wrap: anywhere;
}

.birdscope-app .polaroid-img-box {
  width: 100%;
  flex: 1;
  min-height: 165px;
  max-height: 255px;
  background-color: #F4EFE2;
  border: 2px solid #3F2E23;
  border-radius: 10px;
  padding: 6px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.birdscope-app .bird-image-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(22px) saturate(1.3) brightness(0.92);
  transform: scale(1.15);
  z-index: 0;
}

.birdscope-app .bird-image {
  position: relative;
  z-index: 1;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center;
  border-radius: 6px;
  transition: opacity 0.2s ease;
}

.birdscope-app .art-stamp {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--sun-yellow);
  border: 1.5px solid var(--wood-dark);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  transform: rotate(3deg);
  box-shadow: 1px 1px 0px var(--wood-dark);
  z-index: 2;
}

.birdscope-app .fact-sticky-note {
  height: 88px;
  margin-top: 10px;
  padding: 8px 12px;
  background: #EFF9FF;
  border: 2px dashed #82C4E8;
  border-radius: 12px;
  text-align: left;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #355263;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.birdscope-app .fact-sticky-note::-webkit-scrollbar {
  display: none;
}

.birdscope-app .hint-box {
  background: #FFF0E6;
  border: 2px solid var(--accent-orange);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 10px;
  font-size: 0.82rem;
  line-height: 1.3;
  color: #B54522;
  display: none;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  animation: birdscope-bounce-in 0.3s ease;
}

.birdscope-app .options-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.birdscope-app .opt-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 46px;
  padding: 0 12px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 700;
  border: 3px solid var(--wood-dark);
  border-radius: var(--border-radius-btn);
  background-color: #FFFFFF;
  color: var(--wood-dark);
  box-shadow: 3px 4px 0px var(--wood-dark);
  cursor: pointer;
  transition: all 0.12s ease;
  outline: none;
}

/* 英文主名称：恢复大字号，超长时自动微缩或省略，绝不挤压右侧中文 */
.birdscope-app .opt-en {
  flex: 1;
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #3F2E23;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.birdscope-app .opt-en.opt-en-long {
  font-size: 0.88rem;
}

.birdscope-app .opt-en.opt-en-xlong {
  font-size: 0.8rem;
}

/* 中文副名称：小号暖灰色，靠右贴近小绿叶，基线微微下沉 */
.birdscope-app .opt-zh {
  flex-shrink: 0;
  font-size: 0.76rem;
  font-weight: 500;
  color: #8C7A6B;
  white-space: nowrap;
  align-self: baseline;
  margin-top: auto;
  margin-bottom: 11px;
}

.birdscope-app .opt-leaf {
  flex-shrink: 0;
  margin-left: 2px;
  font-size: 0.95rem;
}

.birdscope-app .opt-btn:hover:not(:disabled) {
  background-color: #FFF9E6;
  transform: translateY(-2px);
}

.birdscope-app .opt-btn:active:not(:disabled) {
  transform: translate(2px, 3px);
  box-shadow: 1px 1px 0px var(--wood-dark);
}

.birdscope-app .opt-btn.correct {
  background-color: var(--nature-green) !important;
  color: #FFFFFF !important;
  border-color: var(--green-dark) !important;
  animation: birdscope-pop 0.25s ease;
}

.birdscope-app .opt-btn.wrong {
  background-color: #E0DCD3 !important;
  color: #8C827A !important;
  border-color: #A39B92 !important;
  box-shadow: 1px 1px 0px #8C827A !important;
  cursor: not-allowed;
  animation: birdscope-shake 0.3s ease;
}

.birdscope-app .opt-btn.correct .opt-zh {
  color: rgba(255, 255, 255, 0.92);
}

.birdscope-app .opt-btn.wrong .opt-zh {
  color: #A39B92;
}

.birdscope-app .bottom-utility {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 2px;
}

.birdscope-app .location-footnote {
  font-size: 0.78rem;
  font-weight: 700;
  color: #5C4B3E;
  background: #F6F2E9;
  border: 1.5px solid #D9CFC0;
  border-radius: 999px;
  padding: 3px 12px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* ================= Quiz: checklist settlement modal ================= */

.birdscope-app .checklist-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(63, 46, 35, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12px 10px 14px;
  z-index: 200;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.birdscope-app .checklist-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.birdscope-app .checklist-modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100dvh - 48px);
  background: #FFFDF8;
  border: 2.5px solid var(--wood-dark);
  border-radius: 16px;
  box-shadow: 4px 6px 0px var(--wood-dark);
  padding: 16px 14px 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: visible;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.birdscope-app .checklist-modal-overlay.active .checklist-modal-card {
  transform: translateY(0) scale(1);
}

.birdscope-app .checklist-modal-card > .washi-tape {
  top: -12px;
  width: 96px;
  height: 22px;
  transform: translateX(-50%) rotate(-1.5deg);
}

.birdscope-app .checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  text-align: left;
}

.birdscope-app .checklist-title {
  font-size: 1.38rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--wood-dark);
  margin: 0;
  white-space: nowrap;
}

.birdscope-app .passed-stamp {
  flex-shrink: 0;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #D9534F;
  border: 2px solid #D9534F;
  border-radius: 6px;
  transform: rotate(6deg);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.birdscope-app .checklist-meta-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  font-size: 0.76rem;
  color: #2E5A31;
  background: #EBF7EE;
  border: 1.5px solid #B7DFC1;
  border-radius: 20px;
  margin-bottom: 10px;
}

.birdscope-app .meta-location {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.birdscope-app .meta-count {
  flex-shrink: 0;
  white-space: nowrap;
}

.birdscope-app .checklist-items-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
  margin-bottom: 6px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.birdscope-app .checklist-items-scroll::-webkit-scrollbar {
  display: none;
}

.birdscope-app .checklist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFFFFF;
  border: 2px solid var(--wood-dark);
  border-radius: 12px;
  padding: 7px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.birdscope-app .checklist-row:hover {
  background: #FFFDF0;
  transform: translateY(-1px);
}

.birdscope-app .sketch-checkbox {
  width: 24px;
  height: 24px;
  border: 2px solid var(--wood-dark);
  border-radius: 6px;
  background: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: bold;
  color: var(--nature-green);
  flex-shrink: 0;
}

.birdscope-app .checklist-row.field-spotted .sketch-checkbox {
  background: #E8F5E9;
}

.birdscope-app .checklist-row.field-spotted .row-bird-name {
  text-decoration: line-through;
  color: #9E9389;
}

.birdscope-app .row-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1.5px solid var(--wood-dark);
  object-fit: cover;
  flex-shrink: 0;
}

.birdscope-app .row-info {
  flex: 1;
  text-align: left;
  min-width: 0;
}

.birdscope-app .row-bird-name {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.birdscope-app .row-bird-sci {
  font-size: 0.72rem;
  color: #8C7B6E;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.birdscope-app .row-badge-art {
  font-size: 0.7rem;
  background: var(--sun-yellow);
  border: 1px solid var(--wood-dark);
  border-radius: 8px;
  padding: 1px 6px;
  margin-left: 4px;
}

.birdscope-app .checklist-footer {
  flex-shrink: 0;
}

.birdscope-app .checklist-credit {
  text-align: center;
  font-size: 0.72rem;
  color: #8C7A6B;
  padding: 8px 0 6px;
  border-top: 1.5px dashed #E0D6C5;
  margin: 8px 0 0;
}

.birdscope-app .checklist-actions {
  display: flex;
  gap: 10px;
}

.birdscope-app .btn-act {
  height: 46px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  border: 2.5px solid var(--wood-dark);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  transition: all 0.12s;
}

.birdscope-app .btn-print {
  flex: 1;
  background: var(--sun-yellow);
  color: var(--wood-dark);
  box-shadow: 2px 3px 0px var(--wood-dark);
}

.birdscope-app .btn-print:hover {
  background: #FFC72C;
}

.birdscope-app .btn-continue {
  flex: 1.25;
  background: var(--nature-green);
  color: #FFF;
  box-shadow: 2px 3px 0px var(--wood-dark);
}

.birdscope-app .btn-continue:hover {
  background: var(--green-dark);
}

.birdscope-app .btn-act:active {
  transform: translate(1px, 2px);
  box-shadow: 1px 1px 0px var(--wood-dark);
}

@media (max-width: 599px) and (min-height: 600px) {
  .birdscope-app .checklist-modal-card {
    height: calc(100dvh - 56px);
  }
}

@media (min-width: 600px) {
  .birdscope-app .checklist-modal-overlay {
    align-items: center;
    padding: 24px;
  }
}

/* ================= BirdDex page ================= */

.birdscope-app .dex-header {
  text-align: center;
  width: 100%;
  max-width: 720px;
  padding: 12px 12px 0;
  margin-bottom: 0;
}

/* Back arrow + title on one row, with a symmetric right spacer */
.birdscope-app .dex-top-row {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  width: 100%;
  margin-bottom: 4px;
}

.birdscope-app .dex-top-row .btn-icon-back {
  width: 40px;
  height: 40px;
  text-decoration: none;
  color: var(--wood-dark);
}

.birdscope-app .dex-title {
  grid-column: 2;
  justify-self: center;
  text-align: center;
  font-family: 'Titan One', 'Fredoka', cursive;
  font-size: 1.95rem;
  color: var(--wood-dark);
  letter-spacing: 0.5px;
  text-shadow: 2px 2.5px 0 var(--sun-yellow);
  margin: 0;
  white-space: nowrap;
}

.birdscope-app .dex-sub {
  color: var(--green-dark);
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0 0 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.birdscope-app .dex-stats-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin: 0 0 12px;
}

.birdscope-app .stat-pill {
  padding: 5px 11px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1.5px dashed #6B8E4E;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--wood-dark);
}

.birdscope-app .dex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 720px;
  margin-top: 0;
  padding-top: 2px;
}

.birdscope-app .dex-card {
  background: #FFFDF9;
  border: 3px solid var(--wood-dark);
  border-radius: 18px 8px 18px 8px / 8px 18px 8px 18px;
  padding: 10px;
  text-align: center;
  box-shadow: 4px 5px 0px var(--wood-dark);
  position: relative;
}

.birdscope-app .dex-thumb-box {
  height: 120px;
  overflow: hidden;
  border: 2px solid var(--wood-dark);
  border-radius: 10px;
  background: var(--sky-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.birdscope-app .dex-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.birdscope-app .dex-card.locked .dex-thumb {
  filter: brightness(0) opacity(0.8);
}

/* 1. 英文俗名：保持第一视觉重心 */
.birdscope-app .dex-card-name,
.birdscope-app .stamp-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #3F2E23;
  line-height: 1.25;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.birdscope-app .dex-card.locked .dex-card-name {
  color: #A39B92;
  letter-spacing: 2px;
}

.birdscope-app .dex-card-sub {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  margin-top: 1px;
}

/* 2. 中文名：改为小号暖浅灰，不抢英文主标题的风头 */
.birdscope-app .dex-card-zh,
.birdscope-app .stamp-zh,
.birdscope-app .dex-zh {
  font-size: 0.74rem !important;
  font-weight: 500 !important;
  color: #8C7A6B !important;
  line-height: 1.2;
  margin: 1px 0 2px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.birdscope-app .dex-card.locked .dex-card-zh,
.birdscope-app .dex-card.locked .dex-zh {
  display: none;
}

/* 3. 拉丁学名：淡灰斜体收尾 */
.birdscope-app .dex-card-sci,
.birdscope-app .stamp-sci,
.birdscope-app .dex-sci {
  font-size: 0.68rem;
  font-style: italic;
  color: #A39486;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.birdscope-app .dex-check {
  position: absolute;
  top: -12px;
  right: -10px;
  background: var(--nature-green);
  color: #FFFFFF;
  border: 2px solid var(--wood-dark);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 2px 2px 0px var(--wood-dark);
}

.birdscope-app .dex-card.locked .dex-check {
  display: none;
}

.birdscope-app .dex-card {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.birdscope-app .dex-card:hover {
  transform: translateY(-3px);
  box-shadow: 5px 8px 0px var(--wood-dark);
}

.birdscope-app .dex-card:active {
  transform: translateY(1px);
  box-shadow: 2px 3px 0px var(--wood-dark);
}

.birdscope-app .dex-card:focus-visible {
  outline: 3px solid var(--sun-yellow);
  outline-offset: 3px;
}

.birdscope-app .dex-detail-card {
  max-width: 440px;
  height: auto;
  min-height: 0;
  justify-content: flex-start;
  text-align: center;
  padding-top: 18px;
}

.birdscope-app .dex-detail-card .modal-close-x {
  z-index: 5;
}

.birdscope-app .dex-detail-media {
  position: relative;
  width: 100%;
  height: 300px;
  margin-bottom: 0;
  border: 2.5px solid var(--wood-dark);
  border-radius: 12px;
  background: var(--sky-soft);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.birdscope-app .dex-detail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.birdscope-app .dex-detail-media.locked .dex-detail-img {
  filter: brightness(0) opacity(0.8);
}

.birdscope-app .dex-detail-credit {
  margin: 4px 2px 14px;
  font-size: 10.5px;
  line-height: 1.2;
  color: #A39486;
  text-align: right;
  overflow-wrap: anywhere;
}

.birdscope-app .dex-detail-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 3px;
  font-family: inherit;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--wood-dark);
  background: rgba(255, 253, 248, 0.92);
  border: 2.5px solid var(--wood-dark);
  border-radius: 50%;
  box-shadow: 2px 2px 0px var(--wood-dark);
  cursor: pointer;
  z-index: 2;
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.birdscope-app .dex-detail-nav:hover {
  background: #FFFFFF;
  transform: translateY(-50%) scale(1.08);
}

.birdscope-app .dex-detail-nav:active {
  transform: translateY(-50%) scale(0.94);
  box-shadow: 1px 1px 0px var(--wood-dark);
}

.birdscope-app .dex-detail-prev {
  left: 8px;
}

.birdscope-app .dex-detail-next {
  right: 8px;
}

.birdscope-app .dex-detail-nav[hidden],
.birdscope-app .dex-detail-meta[hidden] {
  display: none !important;
}

.birdscope-app .dex-detail-name {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.15;
  font-weight: 800;
  color: var(--wood-dark);
}

.birdscope-app .dex-detail-zh {
  margin: 5px 0 0;
  font-size: 0.9rem;
  line-height: 1.2;
  font-weight: 600;
  color: #8C7A6B;
}

.birdscope-app .dex-detail-sci {
  margin: 5px 0 0;
  font-size: 0.82rem;
  line-height: 1.2;
  font-style: italic;
  color: #A39486;
}

.birdscope-app .dex-detail-locked {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: #7B6A5C;
}

.birdscope-app .dex-detail-meta {
  margin: 18px 0 0;
  padding: 9px 12px;
  background: #FFF8EC;
  border: 1.5px dashed #D8CDBD;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}

.birdscope-app .dex-detail-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
}

.birdscope-app .dex-detail-meta-row[hidden] {
  display: none !important;
}

.birdscope-app .dex-detail-meta-row dt {
  font-weight: 700;
  color: #8C7A6B;
}

.birdscope-app .dex-detail-meta-row dd {
  margin: 0;
  color: var(--wood-dark);
  text-align: right;
  overflow-wrap: anywhere;
}

.birdscope-app .dex-detail-release {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.birdscope-app .dex-detail-release[hidden],
.birdscope-app .dex-confirm-row[hidden] {
  display: none !important;
}

.birdscope-app .dex-confirm-row {
  width: 100%;
}

.birdscope-app .dex-release-btn {
  width: auto;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--wood-dark);
  background: #ECE7DE;
  border: 3px solid var(--wood-dark);
  border-radius: var(--border-radius-btn);
  box-shadow: 3px 4px 0px var(--wood-dark);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.2s;
}

.birdscope-app .dex-release-btn:hover {
  background: #FFE8DC;
  transform: translateY(-2px);
}

.birdscope-app .dex-release-btn:active {
  transform: translate(2px, 4px);
  box-shadow: 1px 1px 0px var(--wood-dark);
}

.birdscope-app .dex-confirm-text {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--wood-dark);
  text-align: center;
}

.birdscope-app .dex-danger-btn {
  background: #C9563F;
}

.dex-toast {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translate(-50%, 12px);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 24px);
  padding: 7px 11px;
  background: #3F2E23;
  color: #FFFDF8;
  border-radius: 10px;
  box-shadow: 2px 3px 0 rgba(63, 46, 35, 0.3);
  font-size: 0.78rem;
  font-weight: 600;
  z-index: 95;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.dex-toast.active {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.dex-toast[hidden],
.dex-toast-undo[hidden] {
  display: none !important;
}

.dex-toast-text {
  overflow-wrap: anywhere;
}

.dex-toast-undo {
  flex: none;
  padding: 5px 9px;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  color: #3F2E23;
  background: var(--sun-yellow, #F2CF66);
  border: none;
  border-radius: 7px;
  cursor: pointer;
}

@media (max-width: 375px) {
  .birdscope-app .dex-detail-media {
    height: 240px;
  }
}

.birdscope-app .dex-back {
  margin-top: 26px;
}

.birdscope-app .dex-tools {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.birdscope-app .dex-tool-btn {
  flex: 1;
  height: 46px;
  padding: 0 10px;
  font-size: 0.95rem;
  box-shadow: 2px 3px 0px var(--wood-dark);
  justify-content: center;
}

.birdscope-app .dex-tool-status {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--green-dark);
  text-align: center;
}

.birdscope-app .dex-tool-status.error {
  color: #B23A32;
}

.birdscope-app .dex-modal-title {
  margin: 0 0 6px;
  padding-right: 30px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--wood-dark);
  text-align: left;
}

.birdscope-app .dex-modal-hint {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: #7B6A5C;
  text-align: left;
}

.birdscope-app .dex-code {
  width: 100%;
  min-height: 140px;
  max-height: 42dvh;
  box-sizing: border-box;
  resize: vertical;
  padding: 10px;
  margin-bottom: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--wood-dark);
  background: #FFFDF4;
  border: 1.5px solid #D8CDBD;
  border-radius: 10px;
}

.birdscope-app .dex-file-btn {
  width: 100%;
  height: 44px;
  margin-bottom: 10px;
  justify-content: center;
  font-size: 0.9rem;
}

.birdscope-app .modal-card.dex-modal-card {
  justify-content: flex-start;
}

@media (max-width: 599px) {
  .birdscope-app .dex-code {
    font-size: 16px;
  }
}

@media (max-width: 599px) and (min-height: 620px) {
  .birdscope-app .dex-modal-card .dex-code {
    flex: 1 1 auto;
    max-height: none;
  }

  .birdscope-app .dex-modal-card .modal-actions {
    margin-top: auto;
  }
}

/* ================= Animations ================= */

@keyframes birdscope-wobble {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  50% { transform: rotate(2deg) translateY(-5px); }
}

@keyframes birdscope-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px) rotate(-1deg); }
  75% { transform: translateX(6px) rotate(1deg); }
}

@keyframes birdscope-pop {
  0% { transform: scale(0.96); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes birdscope-bounce-in {
  0% { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ================= Print: field trip checklist only ================= */

@media print {
  @page {
    size: auto;
    margin: 12mm;
  }

  .skip-links,
  .navigation-wrapper,
  .masthead,
  .site-footer,
  .visitor-counter,
  .birdscope-app .quiz-loading-card,
  .birdscope-app .quiz-card,
  .birdscope-app .washi-tape,
  .birdscope-app .passed-stamp,
  .birdscope-app .checklist-actions {
    display: none !important;
  }
  .birdscope-app {
    display: block !important;
    min-height: 0 !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    background: #FFF !important;
    padding: 0 !important;
  }
  .birdscope-app .checklist-modal-overlay {
    position: static !important;
    display: block !important;
    background: none !important;
    backdrop-filter: none !important;
    opacity: 1 !important;
    padding: 0 !important;
    pointer-events: auto !important;
  }
  .birdscope-app .checklist-modal-card {
    border: none !important;
    box-shadow: none !important;
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    transform: none !important;
  }
  .birdscope-app .checklist-items-scroll {
    overflow: visible !important;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px 12px !important;
  }
  .birdscope-app .checklist-row {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1.5px solid #3F2E23 !important;
  }
}

/* 1. Phone portrait (< 600px): seamless full-height note sheet */
@media (max-width: 599px) {
  .birdscope-app.birdscope-page-stage:not(.birdscope-dex-stage) {
    min-height: calc(100dvh - 48px);
    padding: 12px 10px 14px;
    justify-content: flex-start;
  }

  /* Every phone height fills the viewport, so no yellow void is left below */
  .birdscope-app .notebook-sheet {
    min-height: calc(100dvh - 74px);
    border-width: 2px;
    border-radius: 14px;
    box-shadow: 3px 4px 0 var(--wood-dark);
    padding: 14px 14px 12px;
    justify-content: space-between;
  }

  .birdscope-app .quiz-loading-card.notebook-sheet {
    justify-content: center;
    padding: 30px 16px 26px;
  }

  /* Photo keeps a fixed height so showing the hint never resizes the bird image */
  .birdscope-app .notebook-card .spread-left {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .birdscope-app .notebook-card .bottom-utility {
    margin-top: auto;
    padding-top: 6px;
  }

  .birdscope-app .notebook-card .polaroid-frame {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0;
  }

  .birdscope-app .notebook-card .bird-photo-frame {
    flex: 0 0 auto;
    height: clamp(190px, 30dvh, 245px);
    min-height: 0;
    max-height: none;
  }

  /* Bird heads usually sit at the top edge — lock the crop to top center */
  .birdscope-app .notebook-card .bird-image {
    object-position: top center;
  }

  .birdscope-app .hero-art-box {
    width: 130px;
    height: 130px;
    margin-bottom: 18px;
  }

  .birdscope-app .menu-group {
    gap: 12px;
  }
}

/* Short phones (< 600px, height <= 660px): extra compact to avoid scrolling */
@media (max-width: 599px) and (max-height: 660px) {
  .birdscope-app.birdscope-page-stage:not(.birdscope-dex-stage) {
    padding: 8px 8px 10px;
  }

  .birdscope-app .notebook-sheet {
    min-height: calc(100dvh - 66px);
    padding: 10px 12px;
  }

  .birdscope-app .notebook-card .bird-photo-frame {
    min-height: 135px;
  }

  .birdscope-app .notebook-card .fact-sticky-note {
    height: 72px;
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .birdscope-app .notebook-card .options-group {
    gap: 6px;
  }

  .birdscope-app .notebook-card .opt-btn {
    height: 40px;
  }

  .birdscope-app .hero-art-box {
    width: 112px;
    height: 112px;
    margin-bottom: 12px;
  }

  .birdscope-app .game-subtitle {
    margin-bottom: 14px;
  }

  .birdscope-app .screen-container .btn {
    padding: 12px 16px;
    font-size: 1.15rem;
  }
}

/* 2. Tablet portrait (600px–767px): roomier centered single-page notebook */
@media (min-width: 600px) {
  .birdscope-app.birdscope-page-stage:not(.birdscope-dex-stage) {
    justify-content: center;
    padding: 24px 16px 40px;
  }

  .birdscope-app .notebook-sheet {
    padding: 20px 22px 20px;
  }

  .birdscope-app .quiz-loading-card.notebook-sheet {
    padding: 40px 26px 36px;
  }

  .birdscope-app .notebook-card .polaroid-frame {
    background: #FFFDF9;
    border: 2.5px solid var(--wood-dark);
    border-radius: 12px 14px 10px 15px;
    box-shadow: 3px 4px 0 var(--wood-dark);
    padding: 8px;
  }

  .birdscope-app .notebook-card .bird-photo-frame {
    height: 185px;
  }
}

/* 3. Landscape tablet / desktop (>= 768px): two-page notebook spread */
@media (min-width: 768px) {
  .birdscope-app.birdscope-page-stage:not(.birdscope-dex-stage) {
    padding: 28px 24px 48px;
  }

  .birdscope-app .notebook-card {
    max-width: 820px;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    grid-template-rows: auto 1fr auto;
    column-gap: 0;
    row-gap: 14px;
    padding: 22px 26px;
    text-align: left;
  }

  .birdscope-app .notebook-card .top-bar {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .birdscope-app .notebook-card .spread-left {
    grid-column: 1;
    grid-row: 2;
    padding-right: 26px;
    gap: 12px;
  }

  .birdscope-app .notebook-card .bottom-utility {
    grid-column: 1;
    grid-row: 3;
    padding-right: 26px;
    justify-content: flex-start;
  }

  .birdscope-app .notebook-card .spread-right {
    grid-column: 2;
    grid-row: 2 / 4;
    padding-left: 26px;
    border-left: 1.5px dashed rgba(63, 46, 35, 0.16);
    gap: 10px;
  }

  .birdscope-app .notebook-card .bird-photo-frame {
    height: 290px;
  }

  .birdscope-app .notebook-card .fact-sticky-note {
    height: auto;
    min-height: 96px;
  }

  .birdscope-app .notebook-card .options-group {
    margin-top: auto;
  }
}

@media (max-width: 599px) and (min-height: 620px) {
  .birdscope-app .modal-overlay {
    padding: 12px 10px 12px;
  }

  .birdscope-app .modal-card {
    min-height: calc(100dvh - 56px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px 14px 16px;
  }
}

@media (min-width: 600px) {
  .birdscope-app .modal-overlay {
    align-items: center;
    padding: 24px;
  }
}

@media (max-width: 768px) {
  .birdscope-app .quiz-loading-card {
    padding: 30px 20px 28px;
  }
}

@media (max-width: 480px) {
  .birdscope-app .game-title { font-size: 2.2rem; }
  .birdscope-app .dex-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* 彻底根治手机竖屏（宽 < 599px）竖图切头与反撑问题 */
.birdscope-app .notebook-card .polaroid-frame,
.birdscope-app .notebook-card .polaroid-img-box.bird-photo-frame {
  min-height: 0 !important;
  overflow: hidden !important;
}

.birdscope-app .notebook-card .polaroid-img-box .bird-image,
.birdscope-app .notebook-card .bird-image {
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center;
}
