:root {
  --navbar-height: 48px;
  --fab-container-height: 100px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, sans-serif;
  padding: 20px;
  max-width: 400px;
  margin: 0 auto;
  color: #333;
}

h1 {
  margin-bottom: 8px;
}

/* Location button color states */
.btn.location-unset {
  border-color: #c00;
}

.btn.location-unset:active {
  background: #c00;
}

.btn.location-set {
  border-color: #4caf50;
}

.btn.location-set:active {
  background: #4caf50;
}

.button-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px;
  text-decoration: none;
  background: transparent;
  color: #333;
  border: 2px solid #38592D;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.btn:active {
  background: #38592D;
  color: #fff;
}

/* Disabled button state */
.btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: auto;
}

.btn.disabled:active {
  background: transparent;
  color: #333;
}

.btn-icon {
  font-size: 1.4rem;
}

.btn-text {
  font-size: 1.1rem;
}

/* Homepage-specific button styling */
.button-container .btn {
  flex-direction: row;
  /* Make buttons fill available height, ensure all 4 fit on screen */
  /* Account for: navbar, body padding, gaps between buttons */
  /* Four buttons + three 12px gaps between them */
  min-height: 80px;
  height: calc((100vh - 140px) / 4 - 9px);
  max-height: min(280px, calc((100vh - 140px) / 4 - 9px));
}

.button-container .btn-icon {
  /* Scale icon size based on button height */
  /* At min-height 100px = 1.4rem, at max 360px = ~5rem */
  font-size: clamp(1.4rem, calc(0.5rem + 4vh), 5rem);
}

.button-container .btn-text {
  /* Scale text size based on button height */
  /* At min-height 100px = 1.1rem, at max 360px = ~2.5rem */
  font-size: clamp(1.1rem, calc(0.5rem + 2vh), 2.5rem);
  font-weight: 500;
}

.back-btn {
  display: inline-block;
  margin-bottom: 16px;
  text-decoration: none;
  color: #333;
}

/* Game Navbar */
.game-navbar {
  position: sticky;
  top: 0;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--navbar-height);
  margin: -20px -20px 16px -20px;
  padding: 0 20px;
  z-index: 100;
  border-bottom: 1px solid #eee;
  position: relative;
}

/* Center content only on the home page navbar (when it only has title + home button) */
.game-navbar:not(.search-navbar) {
  justify-content: center;
}

.home-btn {
  position: absolute;
  left: 20px;
  background: #f5f5f5 url('icon-192.png') center/contain no-repeat;
  border: 1px solid #ddd;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: opacity 0.2s;
}

.home-btn:hover {
  opacity: 0.8;
}

.search-navbar {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 100;
}

.game-navbar .back-btn {
  margin-bottom: 0;
}

.menu-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  color: #333;
}

.menu-dropdown {
  position: absolute;
  top: 100%;
  right: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  overflow: hidden;
  min-width: 160px;
}

.menu-dropdown button {
  display: block;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
}

.menu-dropdown button:hover {
  background: #f5f5f5;
}

.menu-dropdown button.danger {
  color: #c00;
}

.menu-dropdown button.danger:hover {
  background: #fee;
}

/* Search page */
.filter-row {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.filter-row select,
.filter-row button {
  padding: 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.filter-row select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
  cursor: pointer;
}

.filter-row button {
  background: #333;
  color: #fff;
  border: none;
  cursor: pointer;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #4caf50;
}

/* Region filters */
.region-filters {
  flex-wrap: wrap;
  gap: 8px;
}

.region-filters select {
  flex: 1;
  min-width: 120px;
  padding: 12px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background-color: #fff;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  transition: border-color 0.2s;
}

.region-filters select:focus {
  outline: none;
  border-color: #4caf50;
}

.region-filters select:disabled {
  background-color: #f5f5f5;
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Search bar */
.search-bar {
  margin: 12px 0;
}

.search-bar input {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
}

.search-bar input:focus {
  outline: none;
  border-color: #333;
}

.pick-location-btn {
  width: 100%;
  padding: 8px;
  background: #f5f5f5;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

/* Map picker */
#map-container {
  margin: 12px 0;
}

#map {
  height: 200px;
  border-radius: 4px;
}

.map-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.map-actions button {
  flex: 1;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
}

#map-confirm-btn {
  background: #333;
  color: #fff;
  border: none;
}

.recent-searches {
  margin: 16px 0;
  padding: 12px;
  background: #f5f5f5;
  border-radius: 4px;
}

.recent-searches h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

.recent-searches ul {
  list-style: none;
}

.recent-searches li {
  margin: 4px 0;
}

.recent-searches a {
  color: #333;
  font-size: 14px;
}

.loading {
  padding: 20px;
  text-align: center;
  color: #666;
}

/* Bird list */
.bird-list {
  list-style: none;
  margin-top: 16px;
}

.bird-item {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #eee;
  position: relative;
}

.bird-item a {
  flex: 1;
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 20px 0;
  text-decoration: none;
  color: #333;
}

/* Compact offline layout (no thumbnails) */
.bird-item a:not(:has(.bird-thumbnail)) {
  justify-content: space-between;
  padding: 12px 0;
  gap: 8px;
}

/* Text-only mode for offline birds with no cached images */
.bird-item.text-only-mode .bird-thumbnail {
  display: none;
}

.bird-item.text-only-mode a {
  justify-content: space-between;
  padding: 12px 0;
  gap: 8px;
}

.bird-item .bird-thumbnail {
  width: 160px;
  min-width: 160px;
  height: 160px;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f5;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.bird-item .bird-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bird-item .bird-thumbnail.loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.bird-item .bird-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.bird-item .bird-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.remove-btn {
  background: none;
  border: none;
  color: #999;
  font-size: 16px;
  padding: 8px;
  cursor: pointer;
}

.remove-btn:hover {
  color: #c00;
}

.bird-item .bird-name {
  font-weight: 500;
}

.bird-item .bird-location {
  font-size: 12px;
  color: #666;
}

.bird-item.seen {
  background: #e8f5e9;
}

.seen-badge {
  color: #4caf50;
  font-weight: bold;
}

.bingo-badge {
  font-size: 1.1em;
  margin-left: 4px;
}

.bingo-badge-corner {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 1.2em;
  z-index: 10;
  pointer-events: none;
}

.empty {
  padding: 20px;
  text-align: center;
  color: #666;
}

/* Bird detail */
.bird-image-container {
  width: 100%;
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
}

.bird-image-container img {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
}

/* Image lightbox */
.image-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.image-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.scientific-name {
  font-style: italic;
  color: #666;
  margin-bottom: 16px;
}

.detail-row {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.detail-row .label {
  font-weight: 500;
  margin-right: 8px;
}

.seen-btn {
  margin-top: 24px;
  width: 100%;
  cursor: pointer;
  border: none;
}

.seen-btn.is-seen {
  background: #4caf50;
}

/* Games list */
.games-list {
  list-style: none;
  margin-top: 16px;
  padding-bottom: var(--fab-container-height);
}

.games-list li {
  border-bottom: 1px solid #eee;
}

.games-list a {
  display: block;
  padding: 12px 0;
  text-decoration: none;
  color: #333;
}

.games-list .game-title {
  display: block;
  font-weight: 500;
}

.games-list .game-info {
  display: block;
  font-size: 12px;
  color: #666;
}

.games-list .empty {
  color: #666;
  text-align: center;
  padding: 40px 0;
}

/* FAB (floating action button) */
.fab-container {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 400px;
  height: var(--fab-container-height);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 24px;
  background: linear-gradient(to bottom, transparent 0%, #fff 50%);
  pointer-events: none;
}

.fab {
  position: relative;
  width: 56px;
  height: 56px;
  background: #333;
  border-radius: 50%;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  pointer-events: auto;
}

.fab::before,
.fab::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background: #fff;
  border-radius: 2px;
}

.fab::before {
  width: 24px;
  height: 3px;
  transform: translate(-50%, -50%);
}

.fab::after {
  width: 3px;
  height: 24px;
  transform: translate(-50%, -50%);
}

/* New game form */
.form-group {
  margin-bottom: 20px;
  overflow: hidden;
}

.form-group:last-of-type {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: #333;
  font-size: 14px;
}

.form-group > input[type="text"] {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.form-group > input[type="text"]::placeholder {
  color: #999;
  font-style: italic;
}

.form-group .hint {
  font-size: 12px;
  color: #666;
  margin: 4px 0;
}

/* Form inputs for modals */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  max-width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Fix for date inputs on mobile */
input[type="date"].form-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #4caf50;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-select:disabled {
  background-color: #f5f5f5;
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

.form-select + .form-select {
  margin-top: 8px;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.form-textarea::placeholder {
  color: #999;
}

.input-row {
  display: flex;
  gap: 8px;
}

.input-row input {
  flex: 1;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.input-row button {
  padding: 10px 16px;
  background: #eee;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
}

.info-box {
  background: #e8f5e9;
  border-left: 4px solid #4caf50;
  padding: 16px;
  margin-bottom: 24px;
  border-radius: 4px;
}

.info-box p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #2e7d32;
}

.location-btn {
  width: 100%;
  padding: 14px;
  margin-top: 12px;
  margin-bottom: 8px;
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.location-btn:hover {
  background: #45a049;
}

.location-btn:active {
  transform: scale(0.98);
}

.location-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

/* Current Location Button (Search Page) */
.current-location-btn {
  width: 100%;
  padding: 12px;
  margin: 12px 0;
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.current-location-btn:hover {
  background: #45a049;
}

.current-location-btn:active {
  transform: scale(0.98);
}

/* Location Option Sections in Modal */
.location-option {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e0e0e0;
}

.location-option:last-of-type {
  border-bottom: none;
  margin-bottom: 16px;
  padding-bottom: 0;
}

.location-option h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
}

.location-option .hint {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
}

/* Button styles for modal */
.btn-primary {
  padding: 10px 16px;
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
  background: #45a049;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  padding: 10px 16px;
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 8px;
  width: 100%;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #e8e8e8;
}

.region-selects {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.region-selects select {
  padding: 12px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background-color: #fff;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  transition: border-color 0.2s;
}

.region-selects select:focus {
  outline: none;
  border-color: #4caf50;
}

.region-selects select:disabled {
  background-color: #f5f5f5;
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

.create-btn {
  width: 100%;
  margin-top: 24px;
  padding: 16px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  background: #4caf50;
  color: #fff;
  transition: background 0.2s, transform 0.1s;
}

.create-btn:hover {
  background: #45a049;
}

.create-btn:active {
  transform: scale(0.98);
}

.create-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

/* Game Detail Page */
.game-header {
  margin-bottom: 16px;
}

.location-link {
  display: inline-block;
  color: #0066cc;
  font-size: 14px;
  margin-top: 4px;
}

.game-dates {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

.ended-banner {
  background: #fff3cd;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 16px;
  color: #856404;
  font-size: 14px;
}

/* Score Summary */
.score-summary {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px;
  background: #f5f5f5;
  border-radius: 8px;
  margin-bottom: 16px;
}

.score-item {
  text-align: center;
  flex: 1;
}

.score-number {
  display: block;
  font-size: 24px;
  font-weight: bold;
}

.score-label {
  font-size: 10px;
  color: #666;
  text-transform: uppercase;
}

.score-item.common .score-number { color: #4caf50; }
.score-item.rare .score-number { color: #2196f3; }
.score-item.ultra .score-number { color: #9c27b0; }

.score-item {
  cursor: pointer;
  border-radius: 8px;
  padding: 8px 4px;
  transition: background 0.15s, transform 0.1s;
}

.score-item:hover {
  background: rgba(0,0,0,0.05);
}

.score-item:active {
  transform: scale(0.95);
}

.score-item.active {
  background: #333;
}

.score-item.active .score-number,
.score-item.active .score-label {
  color: #fff;
}

.score-item.common.active { background: #4caf50; }
.score-item.rare.active { background: #2196f3; }
.score-item.ultra.active { background: #9c27b0; }

/* Bird Sections */
.bird-section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 14px;
  text-transform: uppercase;
  padding: 8px 0;
  border-bottom: 2px solid #eee;
  margin-bottom: 0;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: var(--navbar-height);
  background: #fff;
  z-index: 50;
  margin-left: -20px;
  margin-right: -20px;
  padding-left: 20px;
  padding-right: 20px;
}

.section-title .toggle-arrow {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.section-title.collapsed .toggle-arrow {
  transform: rotate(-90deg);
}

.section-title.collapsed + .game-bird-list {
  display: none;
}

.section-title.common { border-color: #4caf50; color: #4caf50; background: #f0fff0; }
.section-title.rare { border-color: #2196f3; color: #2196f3; background: #f0f7ff; }
.section-title.ultra { border-color: #9c27b0; color: #9c27b0; background: #f8f0ff; }

.game-bird-list {
  list-style: none;
}

.game-bird-list li {
  border-bottom: 1px solid #eee;
}

.game-bird-list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  text-decoration: none;
  color: #333;
  cursor: pointer;
}

.game-bird-list li.seen {
  background: #f0fff0;
}

.game-bird-list .bird-name {
  font-weight: 500;
}

.game-bird-list .seen-check {
  color: #4caf50;
  font-weight: bold;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  max-height: 90vh;
  overflow-x: hidden;
  overflow-y: auto;
}

.modal-content h3 {
  margin: 0 0 20px 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.modal-rarity {
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.modal-btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  margin-bottom: 0;
  border: none;
  border-radius: 10px;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s;
}

.modal-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modal-btn:active {
  transform: translateY(0);
}

.modal-btn.seen {
  background: #4caf50;
  color: #fff;
  border: none;
}

.modal-btn.seen:hover {
  background: #45a049;
}

.modal-btn.cancel {
  background: #f5f5f5;
  border: none;
  color: #666;
}

.modal-btn.cancel:hover {
  background: #e8e8e8;
}

.modal-btn.danger {
  background: #d32f2f;
  color: #fff;
  border: none;
}

.modal-btn.danger:hover {
  background: #c62828;
}

.share-options {
  margin-bottom: 16px;
}

.share-options .checkbox-label {
  display: block;
  margin-bottom: 8px;
}

.share-timeframe {
  margin-bottom: 16px;
}

.share-timeframe select {
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#custom-dates {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

#custom-dates input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Life List Page */
.life-navbar {
  position: sticky;
  top: 0;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--navbar-height);
  margin: -20px -20px 16px -20px;
  padding: 0 20px;
  z-index: 100;
  border-bottom: 1px solid #eee;
}

.life-navbar h1 {
  font-size: 18px;
  margin: 0;
}

.life-navbar .back-btn {
  margin-bottom: 0;
}

.total-count {
  font-size: 14px;
  color: #666;
}

.life-main {
  padding-bottom: 40px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.empty-state p {
  margin-bottom: 16px;
}

/* Continent Sections */
.continent-section {
  margin-bottom: 8px;
}

.continent-title {
  background: #333;
  color: white;
  padding: 12px 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: var(--navbar-height);
  z-index: 9;
}

.continent-title .toggle-arrow {
  font-size: 12px;
  transition: transform 0.2s;
}

.continent-title.collapsed .toggle-arrow {
  transform: rotate(-90deg);
}

.continent-title.collapsed + .continent-content {
  display: none;
}

.continent-count {
  margin-left: auto;
  opacity: 0.7;
}

/* Country Sections */
.country-section {
  border-bottom: 1px solid #ddd;
}

.country-title {
  background: #e8e8e8;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.country-title .toggle-arrow {
  font-size: 11px;
  transition: transform 0.2s;
}

.country-title.collapsed .toggle-arrow {
  transform: rotate(-90deg);
}

.country-title.collapsed + .country-content {
  display: none;
}

.country-count {
  margin-left: auto;
  color: #555;
}

.country-birds {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Region Sections */
.region-section {
  border-bottom: 1px solid #eee;
}

.region-title {
  background: #f5f5f5;
  padding: 10px 16px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.region-title .toggle-arrow {
  font-size: 10px;
  transition: transform 0.2s;
}

.region-title.collapsed .toggle-arrow {
  transform: rotate(-90deg);
}

.region-title.collapsed + .region-content {
  display: none;
}

.region-count {
  margin-left: auto;
  color: #666;
}

/* Life List Bird Items */
.life-bird {
  border-bottom: 1px solid #eee;
}

.life-bird a {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 20px 16px;
  text-decoration: none;
  color: #333;
}

.life-bird:hover {
  background: #fafafa;
}

.sighting-count {
  background: #e0e0e0;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  color: #666;
}

/* Life List Modal Stats */
.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
  padding: 12px;
  background: #f5f5f5;
  border-radius: 8px;
}

.stat {
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 11px;
  color: #666;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.stat-value {
  font-weight: bold;
  font-size: 14px;
}

/* Google Search Button */
.btn.google-btn {
  background: #4285f4;
  color: #fff;
  border-color: #4285f4;
  margin-top: 12px;
}

.modal-btn.google {
  background: #4285f4;
  color: white;
  text-decoration: none;
  text-align: center;
}

/* Modal Actions */
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

/* Sightings Section (Bird Detail) */
.sightings-section {
  margin-top: 24px;
  border-top: 1px solid #eee;
  padding-top: 16px;
}

.sightings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.sightings-header h2 {
  font-size: 16px;
  margin: 0;
}

.btn-small {
  padding: 6px 12px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}

/* Sightings List */
.sightings-list {
  margin: 8px 0;
}

.sightings-list .empty {
  color: #666;
  font-size: 14px;
  text-align: center;
  padding: 16px;
}

.sighting-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 12px;
  background: #f9f9f9;
  border-radius: 6px;
  margin-bottom: 8px;
}

.sighting-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sighting-date {
  font-weight: 500;
  font-size: 14px;
}

.sighting-location {
  font-size: 12px;
  color: #666;
}

.sighting-notes {
  font-size: 12px;
  color: #888;
  font-style: italic;
  margin-top: 4px;
}

.delete-sighting-btn {
  background: none;
  border: none;
  color: #999;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  margin: -4px -8px -4px 8px;
}

.delete-sighting-btn:hover {
  color: #c00;
}

/* Modal Sightings (Game) */
.modal-sightings {
  margin: 16px 0;
  padding: 12px;
  background: #f5f5f5;
  border-radius: 8px;
}

.modal-sightings h4 {
  font-size: 12px;
  text-transform: uppercase;
  color: #666;
  margin: 0 0 8px 0;
}

.modal-sightings .sightings-list {
  margin: 0;
}

.modal-sightings .sighting-item {
  background: #fff;
}

.modal-sightings .empty {
  padding: 8px;
  margin: 0;
}

/* Modal Subtitle */
.modal-subtitle {
  color: #666;
  font-size: 14px;
  margin: -8px 0 16px 0;
}

/* Hint Text */
.hint {
  font-size: 12px;
  color: #666;
  margin: 8px 0;
}

/* Download Progress */
#download-progress {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
}

.progress-bar-container {
  width: 100%;
  height: 24px;
  background: #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4caf50, #66bb6a);
  border-radius: 12px;
  transition: width 0.3s ease;
  box-shadow: 0 1px 3px rgba(76, 175, 80, 0.3);
}

#progress-text {
  font-size: 12px;
  color: #666;
}

#download-status {
  color: #333;
}

/* ===== LIFER CHALLENGE ===== */

/* Lifer Header */
.daily-header {
  margin-bottom: 16px;
}

.daily-date {
  font-size: 14px;
  color: #666;
}

.daily-location {
  font-size: 12px;
  color: #666;
}

.daily-location a {
  color: #2196f3;
  text-decoration: none;
  font-size: 13px;
}

.daily-location a:hover {
  text-decoration: underline;
}

/* Daily Error State */
.daily-error {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.daily-error p {
  margin-bottom: 16px;
}

/* Daily Score - uses same style as game score-summary */
.daily-score-summary {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: #f5f5f5;
  border-radius: 8px;
  margin-bottom: 16px;
}

.daily-score-summary .score-item {
  text-align: center;
  flex: 1;
}

/* Daily Bird List - uses same style as game-bird-list */
.daily-bird-list {
  list-style: none;
}

.daily-bird-item {
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.daily-bird-item .bird-detail-link {
  flex: 1;
  padding: 12px 0;
  text-decoration: none;
  color: #333;
  cursor: pointer;
}

.daily-bird-item .bird-info {
  flex: 1;
}

.daily-bird-item .bird-name {
  font-weight: 500;
  display: block;
}

.daily-bird-item .bird-rarity {
  font-size: 11px;
  text-transform: uppercase;
}

.daily-bird-item .bird-rarity.common { color: #4caf50; }
.daily-bird-item .bird-rarity.rare { color: #2196f3; }
.daily-bird-item .bird-rarity.ultra { color: #9c27b0; }

.daily-bird-item.found {
  background: #f0fff0;
}

.daily-bird-item .found-check {
  color: #4caf50;
  font-weight: bold;
  margin-left: 8px;
}

.daily-found-btn {
  padding: 8px 16px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}

.daily-found-btn:disabled {
  background: #ccc;
  cursor: default;
}

/* Daily Completed Banner */
.daily-completed {
  background: #e8f5e9;
  padding: 16px;
  border-radius: 8px;
  text-align: center;
  margin-top: 16px;
}

.daily-completed h2 {
  font-size: 16px;
  margin-bottom: 8px;
  color: #2e7d32;
}

.daily-completed p {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
}

/* Share Preview */
.share-preview {
  background: #f5f5f5;
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 13px;
  white-space: pre-wrap;
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ===== BIRD BINGO ===== */

/* Bingo Header */
.bingo-header {
  margin-bottom: 16px;
  text-align: center;
}

.bingo-date {
  font-size: 14px;
  color: #666;
}

.bingo-location {
  font-size: 12px;
  color: #666;
}

/* View Toggle */
.bingo-view-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.view-toggle-btn:hover {
  background: #555;
}

.view-toggle-btn:active {
  transform: scale(0.98);
}

/* Bingo Grid */
.bingo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-bottom: 16px;
}

.bingo-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #f5f5f5;
  border-radius: 6px;
  padding: 4px;
  font-size: 10px;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  overflow: hidden;
  word-break: break-word;
  hyphens: auto;
  position: relative;
}

.bingo-cell:hover {
  background: #e8e8e8;
}

.bingo-cell:active {
  transform: scale(0.95);
}

.bingo-cell.found {
  background: #4caf50;
  color: white;
}

.bingo-cell.free {
  background: #ffd700;
  color: #333;
  font-weight: bold;
}

.bingo-cell.bingo-line {
  box-shadow: inset 0 0 0 2px #333;
}

/* Image view mode */
.bingo-grid.image-view .bingo-cell {
  padding: 0;
}

.bingo-grid.image-view .bingo-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bingo-grid.image-view .bingo-cell .bird-name {
  display: none;
}

.bingo-grid.image-view .bingo-cell.loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.bingo-grid.image-view .bingo-cell.found::after {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 4px;
  background: #4caf50;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Text view mode - hide images */
.bingo-grid:not(.image-view) .bingo-cell img {
  display: none;
}

/* Text-only mode for offline bingo cells with no cached images */
.bingo-grid.image-view .bingo-cell.text-only-mode {
  background: #f5f5f5;
  padding: 4px;
}

.bingo-grid.image-view .bingo-cell.text-only-mode .bird-name {
  display: block;
}

.bingo-grid.image-view .bingo-cell.text-only-mode.found {
  background: #4caf50;
  color: white;
}

/* Bingo Winner Banner */
.bingo-winner {
  background: linear-gradient(135deg, #ffd700, #ffb300);
  padding: 16px;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 16px;
  animation: bingo-pulse 0.5s ease-out;
}

@keyframes bingo-pulse {
  0% { transform: scale(0.9); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.bingo-winner h2 {
  font-size: 24px;
  margin-bottom: 8px;
  color: #333;
}

.bingo-winner p {
  font-size: 14px;
  color: #555;
}

/* Found Birds Section */
.found-section {
  margin-top: 24px;
  border-top: 1px solid #eee;
  padding-top: 16px;
}

.found-section h3 {
  font-size: 14px;
  margin-bottom: 12px;
  color: #333;
}

.found-list {
  list-style: none;
}

.found-list li {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.found-list li::before {
  content: '\2713';
  color: #4caf50;
  font-weight: bold;
}

.found-list .empty {
  color: #666;
  text-align: center;
  padding: 16px;
}

.found-list .empty::before {
  display: none;
}

/* Scroll to Top Button in Navbar */
.scroll-to-top-nav {
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: bold;
}

.scroll-to-top-nav:hover {
  background: #45a049;
  transform: translateY(-1px);
}

.scroll-to-top-nav:active {
  transform: translateY(0);
}
