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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f0;
  color: #222;
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 60px;
}

h1 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

h2 {
  font-size: 1.1rem;
  margin: 20px 0 8px;
}

a {
  color: #2d5a27;
}

button {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: #2d5a27;
  color: #fff;
  cursor: pointer;
}

button:active {
  transform: scale(0.98);
}

button.secondary {
  background: #eee;
  color: #222;
}

button.danger {
  background: #c62828;
}

input, select {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 100%;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.back-link {
  font-size: 0.9rem;
  text-decoration: none;
  color: #555;
}

.panel {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.status {
  font-size: 0.85rem;
  color: #666;
  margin-top: 8px;
  white-space: pre-wrap;
}

.location-summary {
  font-size: 0.9rem;
  background: #eef6ee;
  border: 1px solid #cde;
  padding: 10px 12px;
  border-radius: 8px;
  margin-top: 10px;
}

.location-summary .change-location-btn {
  margin-top: 8px;
  font-size: 0.8rem;
  padding: 6px 10px;
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.home-actions a {
  display: block;
  text-decoration: none;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 16px;
  color: #222;
}

.home-actions a .action-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 2px;
}

.home-actions a .action-desc {
  font-size: 0.82rem;
  color: #666;
}

/* Mode toggles (difficulty / hard mode / size) - pill button group */
.toggle-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toggle-btn {
  background: #eee;
  color: #333;
  border: 1px solid #ddd;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
}

.toggle-btn.active {
  background: #2d5a27;
  color: #fff;
  border-color: #2d5a27;
}

/* Bingo grid - always shows image + name, sized NxN */
.bingo-grid {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.bingo-cell {
  aspect-ratio: 1;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #eee;
  transition: transform 0.1s;
}

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

.bingo-cell .thumb-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e5e5e0;
}

.bingo-cell .thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bingo-cell .thumb-wrap .no-img {
  font-size: 1.6rem;
  color: #bbb;
}

.bingo-cell .cell-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.68rem;
  line-height: 1.2;
  padding: 3px 4px;
  text-align: center;
}

.bingo-cell.found {
  box-shadow: inset 0 0 0 3px #4caf50;
}

.bingo-cell.found::after {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  background: #4caf50;
  color: #fff;
  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.3);
}

.bingo-cell.bingo-line {
  box-shadow: inset 0 0 0 3px #ffb300;
}

/* Celebration banners */
.celebration-banner {
  padding: 16px;
  border-radius: 10px;
  text-align: center;
  margin-bottom: 16px;
  animation: celebrate-pulse 0.5s ease-out;
}

.celebration-banner.bingo-win {
  background: linear-gradient(135deg, #ffd700, #ffb300);
}

.celebration-banner.lifer-win {
  background: linear-gradient(135deg, #8ec5fc, #4caf50);
}

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

.celebration-banner h2 {
  margin: 0 0 6px;
  font-size: 1.3rem;
  color: #222;
}

.celebration-banner p {
  font-size: 0.85rem;
  color: #333;
  margin: 0;
}

/* Practice mode: multiple cards */
.practice-card-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.practice-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 14px;
}

.practice-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.practice-card-header .card-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.practice-card-header .card-meta {
  font-size: 0.75rem;
  color: #888;
}

/* Bird detail page */
.bird-detail-image {
  width: 100%;
  aspect-ratio: 1.3;
  object-fit: cover;
  border-radius: 10px;
  background: #eee;
  margin-bottom: 12px;
}

.bird-detail-name {
  font-size: 1.3rem;
  font-weight: 700;
}

.bird-detail-sci {
  font-style: italic;
  color: #777;
  margin-bottom: 12px;
}

.call-btn {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sighting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding: 8px 0;
  font-size: 0.85rem;
}

.sighting-item:last-child {
  border-bottom: none;
}

.sighting-item .delete-sighting-btn {
  background: none;
  color: #c62828;
  padding: 2px 8px;
  font-size: 1rem;
}

/* Life list */
.life-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.life-list-item:last-child {
  border-bottom: none;
}

.life-list-item .life-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #eee;
  flex-shrink: 0;
}

.life-list-item .life-info {
  flex: 1;
  text-decoration: none;
  color: #222;
}

.life-list-item .life-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.life-list-item .life-meta {
  font-size: 0.75rem;
  color: #888;
}

.life-list-item .remove-life-btn {
  background: none;
  color: #c62828;
  font-size: 1.1rem;
  padding: 4px 8px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 20px;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-content label {
  display: block;
  font-size: 0.8rem;
  color: #555;
  margin: 10px 0 4px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.empty-state {
  text-align: center;
  color: #888;
  padding: 30px 10px;
  font-size: 0.9rem;
}
