/* ── Birdle – style.css ─────────────────────────────────────── */

:root {
  --cream:      #f5f2eb;
  --cream-dark: #ede9df;
  --sage:       #3d6b4f;
  --sage-light: #6a9e7a;
  --sage-pale:  #d4e6da;
  --amber:      #e8a830;
  --amber-pale: #fef3d8;
  --red:        #d94f3d;
  --red-pale:   #fde8e6;
  --ink:        #2a2a2a;
  --ink-mid:    #555;
  --ink-soft:   #888;
  --border:     #ddd8cc;
  --card-bg:    #ffffff;
  --shadow:     0 2px 12px rgba(0,0,0,0.07);
  --shadow-lg:  0 6px 30px rgba(0,0,0,0.11);
  --radius:     16px;
  --radius-sm:  10px;
  --font-head:  'Lora', Georgia, serif;
  --font-body:  'DM Sans', sans-serif;
  --correct:    #3d6b4f;
  --wrong:      #e07b2a;
  --failed:     #d94f3d;
}

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

body {
  background: var(--cream);
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(106,158,122,0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(232,168,48,0.07) 0%, transparent 55%);
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  line-height: 1.55;
}


/* very important, stops the weird delay on ipad */
button, .thumb, .artist-list-item, .ac-item, .work-card,
.choice-card, .call-tab {
  touch-action: manipulation;
}




/* ── Header ─────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo-bird { width: 40px; height: 40px; }
.logo-text { display: flex; flex-direction: column; }
.logo-title {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--sage);
  line-height: 1.1;
}
.logo-sub {
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.header-date {
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-style: italic;
}

/* ── Layout ─────────────────────────────────────── */
.game-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.game-layout {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 16px;
  align-items: start;
}

/* ── Timeline ─────────────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 8px;
  gap: 0;
  position: sticky;
  top: 90px;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  cursor: default;
}

.step-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink-soft);
  transition: all 0.35s ease;
  position: relative;
  z-index: 1;
}

.timeline-step.active .step-circle {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
  box-shadow: 0 0 0 4px var(--sage-pale);
}

.timeline-step.done .step-circle {
  background: var(--sage-pale);
  border-color: var(--sage);
  color: var(--sage);
}

.timeline-step.done .step-circle::after {
  content: '✓';
  font-size: 1rem;
}
.timeline-step.done .step-circle { font-size: 0; }
.timeline-step.done .step-circle::after { font-size: 1rem; }

.timeline-step.done-orange .step-circle {
  background: var(--amber-pale);
  border-color: var(--amber);
  color: var(--amber);
}
.timeline-step.done-red .step-circle {
  background: var(--red-pale);
  border-color: var(--red);
  color: var(--red);
}
.timeline-step.done-orange .step-circle::after,
.timeline-step.done-red .step-circle::after {
  content: '';
}



.star-circle {
  background: var(--amber-pale);
  border-color: var(--amber);
  color: var(--amber);
  font-size: 1.1rem !important;
}

.timeline-step.active.reveal-step .step-circle {
  background: var(--amber);
  border-color: var(--amber);
  color: #fff;
  box-shadow: 0 0 0 4px var(--amber-pale);
}

.step-dot-line {
  width: 2px;
  height: 52px;
  background: repeating-linear-gradient(
    to bottom,
    var(--border) 0px,
    var(--border) 5px,
    transparent 5px,
    transparent 9px
  );
  margin: 2px 0;
}

.timeline-step.active .step-dot-line,
.timeline-step.done .step-dot-line,
.timeline-step.done-orange .step-dot-line,
.timeline-step.done-red .step-dot-line {
  background: repeating-linear-gradient(
    to bottom,
    var(--sage-light) 0px,
    var(--sage-light) 5px,
    transparent 5px,
    transparent 9px
  );
}

.step-label {
  font-size: 0.65rem;
  text-align: center;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
  margin-top: 3px;
  margin-bottom: 2px;
}

.timeline-step.active .step-label { color: var(--sage); font-weight: 600; }

/* ── Audio Player ─────────────────────────────────────── */
.audio-section {
  text-align: center;
  margin-bottom: 20px;
}

.section-label {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 400;
  color: var(--ink-mid);
  margin-bottom: 16px;
}

.audio-player {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 10px 20px;
  margin-bottom: 14px;
}

.play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--sage);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}
.play-btn:hover { background: var(--sage-light); transform: scale(1.05); }
.play-btn svg { width: 22px; height: 22px; }

.waveform {
  flex: 1;
  height: 40px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.waveform-bars {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  height: 100%;
}

.waveform-bars .bar {
  flex: 1;
  border-radius: 2px;
  background: var(--border);
  transition: background 0.1s;
  min-width: 2px;
}

.waveform-bars .bar.played { background: var(--sage); }
.waveform-bars .bar.playing { background: var(--sage-light); }

.audio-time {
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 34px;
}

.call-type-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.call-tab {
  padding: 7px 20px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--ink-mid);
  cursor: pointer;
  transition: all 0.2s;
}
.call-tab.active {
  background: var(--sage-pale);
  border-color: var(--sage);
  color: var(--sage);
  font-weight: 600;
}
.call-tab:hover:not(.active) { background: var(--cream-dark); }

/* ── Stages ─────────────────────────────────────── */
.stages { min-width: 0; }

.stage { transition: opacity 0.3s; }
.hidden { display: none !important; }
.stage.hidden { display: none !important; }
.stage.completed {
  opacity: 0.82;
  border-color: var(--sage-pale);
}

.stage-title {
  font-family: var(--font-head);
  font-size: 1.18rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 6px;
  color: var(--ink);
}

.highlight {
  color: var(--sage);
  font-style: italic;
}

.stage-desc {
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink);
  margin-bottom: 20px;
}

/* ── Choice grids ─────────────────────────────────────── */
.choices {
  display: grid;
  gap: 14px;
}

.choices-order,
.choices-family,
.choices-species,
.choices-range {
  grid-template-columns: repeat(3, 1fr);
}

/* Choice card */
.choice-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.25s, transform 0.15s, box-shadow 0.2s;
  background: var(--cream);
  position: relative;
}

.choice-card:hover:not(.locked):not(.wrong) {
  border-color: var(--sage-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.choice-card.wrong {
  border-color: var(--wrong);
}

.choice-card.shake {
  animation: shake 0.3s ease;
}

.choice-card.correct {
  border-color: var(--correct);
  cursor: default;
  pointer-events: none;
}

.choice-card.locked:not(.correct):not(.wrong) {
  border-color: var(--border);
  cursor: default;
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Image-based cards (order, range, species) */
.choice-img-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.choice-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.choice-label {
  padding: 10px 10px 12px;
  text-align: center;
}

.choice-name {
  font-family: var(--font-head);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  display: block;
}

.choice-desc {
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-top: 3px;
  line-height: 1.4;
}

/* Silhouette cards (family group) */
.choice-silhouette {
  padding: 18px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.silhouette-img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}

/* Result overlay */
.choice-card.correct::after,
.choice-card.wrong::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: calc(var(--radius-sm) - 2px);
  pointer-events: none;
}

.choice-card.correct::after {
  background: rgba(61,107,79,0.06);
}

/* ── Reveal Panel ─────────────────────────────────────── */
/*.reveal-panel { }*/

.reveal-animate {
  animation: fadeSlideUp 0.5s ease;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal-congrats {
  font-family: var(--font-head);
  font-size: 0.95rem;
  color: var(--amber);
  font-weight: 600;
  text-align: center;
  margin-bottom: 18px;
  letter-spacing: 0.01em;
}

/* Hero + info side by side */
.reveal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
  align-items: start;
}

.reveal-hero-wrap {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 1 / 1;
  background: var(--cream-dark);
}

.reveal-hero-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/*.reveal-info {}*/

.reveal-name {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}
.reveal-latin {
  font-family: var(--font-head);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin-bottom: 14px;
}

/* Meta table */
.reveal-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.reveal-meta dt {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
  padding-top: 1px;
  white-space: nowrap;
}

.reveal-meta dd {
  font-size: 0.85rem;
  color: var(--ink);
  margin: 0;
}

.reveal-about strong {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
}
.reveal-about p {
  font-size: 0.85rem;
  color: var(--ink-mid);
  margin-top: 5px;
  line-height: 1.55;
}

/* Score row — below the body */
.score-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.score-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
  white-space: nowrap;
}

.score-circles {
  display: flex;
  gap: 8px;
}

.score-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
}

.score-circle.green  { background: var(--correct); }
.score-circle.orange { background: var(--wrong); }
.score-circle.red    { background: var(--failed); }

/* Reveal actions */
.reveal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.btn-share, .btn-play-again {
  padding: 11px 26px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 1.5px solid transparent;
}

.btn-share {
  background: var(--cream);
  border-color: var(--border);
  color: var(--ink-mid);
}
.btn-share:hover { background: var(--cream-dark); }

.btn-play-again {
  background: var(--sage);
  color: #fff;
}
.btn-play-again:hover { background: var(--sage-light); }

@media (max-width: 520px) {
  .reveal-body { grid-template-columns: 1fr; }
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 600px) {
  .game-layout { grid-template-columns: 54px 1fr; }
  .card { padding: 18px 16px; }
  .choices-order,
  .choices-family,
  .choices-species,
  .choices-range { grid-template-columns: repeat(3, 1fr); }
  .reveal-header { grid-template-columns: 1fr; }
  .reveal-badge { flex-direction: row; }
  .score-row { flex-direction: column; }
  .step-dot-line { height: 38px; }
}

@media (max-width: 420px) {
  .choices-order,
  .choices-family,
  .choices-species,
  .choices-range { grid-template-columns: 1fr 1fr; }
}

/* ── Lonely bird mascot ─────────────────────────────── */
.lonely-bird-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  animation: birdBob 2.5s ease-in-out infinite;
}

.lonely-bird {
  width: 80px;
  height: 80px;
}

.speech-bubble {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.75rem;
  color: var(--ink-mid);
  text-align: center;
  max-width: 130px;
  line-height: 1.4;
  box-shadow: var(--shadow);
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border);
}

.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #fff;
  z-index: 1;
}

@keyframes birdBob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}