/*
 * fuglelyde.dk — Modern Nordic Minimalist Theme (v4)
 * Clean · Tactile · Organic · Warm Scandinavian Design
 */

/* =========================================================
   DESIGN TOKENS
   ========================================================= */
:root {
  /* Canvas & Warm Surfaces */
  --bg-page:        #F6F4EE;
  --bg-surface:     #FFFFFF;
  --bg-subtle:      #EFECE4;
  --bg-pill:        #EAE5DA;

  /* Nordic Pine & Greens */
  --pine:           #245C42;
  --pine-light:     #347A5A;
  --pine-accent:    #4CAF79;
  --pine-tint:      #EBF5EF;
  --pine-border:    rgba(36, 92, 66, 0.22);

  /* Warm Earth & Birch Accents */
  --birch:          #D8A468;
  --birch-tint:     #FBF6EE;
  --birch-border:   rgba(216, 164, 104, 0.35);

  /* Mistakes / Danger */
  --wrong-red:      #B93845;
  --wrong-tint:     #FDF0F1;
  --wrong-border:   rgba(185, 56, 69, 0.25);

  /* Typography Colors */
  --text-main:      #1C2621;
  --text-secondary: #58655E;
  --text-muted:     #5A6862;
  --text-inverse:   #FFFFFF;

  /* Borders & Dividers */
  --border-subtle:  #E8E3D7;
  --border-medium:  #DCD6C8;

  /* Typography Stacks — system fonts only, no external font requests. */
  --font-sans:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-serif:     Georgia, "Times New Roman", serif;
  --font-mono:      ui-monospace, "SF Mono", "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
  --font:           var(--font-sans);

  /* Radii */
  --r-card:         20px;
  --r-btn:          14px;
  --r-pill:         999px;
  --r-badge:        8px;

  /* Layered Scandinavian Ambient Shadows */
  --shadow-sm:      0 2px 5px rgba(28, 38, 33, 0.04), 0 1px 2px rgba(28, 38, 33, 0.03);
  --shadow-md:      0 6px 18px rgba(28, 38, 33, 0.05), 0 2px 6px rgba(28, 38, 33, 0.03);
  --shadow-lg:      0 14px 34px rgba(28, 38, 33, 0.07), 0 4px 12px rgba(28, 38, 33, 0.04);
  --shadow-pine:    0 8px 24px rgba(36, 92, 66, 0.22);
  --shadow-xs:      0 1px 3px rgba(28, 38, 33, 0.03);
  --shadow-lift:    0 10px 28px rgba(28, 38, 33, 0.08);

  /* Full Compatibility Aliases for all pages & scripts */
  --bg:             var(--bg-page);
  --bg-card:        var(--bg-surface);
  --bg-alt:         var(--bg-subtle);
  --bg-deep:        var(--bg-pill);
  --border:         var(--border-subtle);
  --border-strong:  var(--border-medium);
  --border-glass:   rgba(36, 92, 66, 0.12);
  --text-primary:   var(--text-main);
  --font:           var(--font-sans);
  --radius-sm:      8px;
  --radius-md:      var(--r-btn);
  --radius-lg:      var(--r-card);
  --radius-pill:    var(--r-pill);
  --emerald:        var(--pine);
  --gold:           var(--birch);
  --red:            var(--wrong-red);
  --fjord:          #2C5F8A;
  --fjord-bg:       rgba(44, 95, 138, 0.08);
  --fjord-border:   rgba(44, 95, 138, 0.25);
  --amber:          var(--birch);
  --wrong:          var(--wrong-red);
}

/* =========================================================
   RESET & BASE STYLES
   ========================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Visually hidden but readable by screen readers — for a page's real <h1>
   where the visible branded header already carries the title text. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  min-height: 100vh;
  background-color: var(--bg-page);
  background-image: 
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.9) 0%, rgba(246, 244, 238, 0.4) 60%),
    linear-gradient(180deg, #FAF8F2 0%, var(--bg-page) 100%);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  user-select: none;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  outline: none;
}
/* :focus-visible (not :focus) shows this only for keyboard navigation, not
   mouse clicks — every button on the site lost its focus ring with no
   replacement, making Tab-based navigation invisible. This is the one
   sitewide fix for that, rather than a hunt through every individual
   button style. */
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2.5px solid var(--pine);
  outline-offset: 2px;
  border-radius: 4px;
}

/* =========================================================
   APP SHELL & LAYOUT
   ========================================================= */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =========================================================
   SITE HEADER
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 244, 238, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 24px;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.brand:hover {
  transform: translateY(-1px);
}
.brand-badge {
  font-size: 1.35rem;
  line-height: 1;
}
.brand-text {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  color: var(--pine);
  font-weight: 400;
}
.brand-pill {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--pine-tint);
  color: var(--pine);
  padding: 2px 7px;
  border-radius: var(--r-pill);
  border: 1px solid var(--pine-border);
}

/* Nav */
.header-nav,
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(234, 229, 218, 0.5);
  padding: 4px 6px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-subtle);
}

.nav-link,
.nav-btn {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 5px 13px;
  border-radius: var(--r-pill);
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover,
.nav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-sm);
}
.nav-link.active,
.nav-btn.active {
  color: var(--pine);
  background: #FFFFFF;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.deck-count {
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--pine);
  color: #fff;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  line-height: 1.4;
}

/* Header Right / Score Pill */
.header-right {
  display: flex;
  align-items: center;
}

.score-pill {
  background: var(--bg-surface) !important;
  border: 1.5px solid var(--border-subtle) !important;
  border-radius: var(--r-pill) !important;
  padding: 5px 12px !important;
  box-shadow: var(--shadow-sm) !important;
  transition: all 0.2s ease !important;
}
.score-pill:hover {
  box-shadow: var(--shadow-md) !important;
  border-color: var(--pine-border) !important;
}

.score-pill-inner {
  display: flex;
  align-items: center;
  gap: 7px;
}

.score-icon {
  font-size: 0.95rem;
}

.score-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.score-numeral {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1;
  color: var(--pine);
  min-width: 14px;
}

.score-pts-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--pine);
  background: var(--pine-tint);
  border: 1px solid var(--pine-border);
  padding: 2px 7px;
  border-radius: var(--r-pill);
  line-height: 1.3;
}

/* =========================================================
   MAIN GAME CONTAINER
   ========================================================= */
.game-container {
  flex: 1;
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 24px 32px;
  display: flex;
  flex-direction: column;
}

.game-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

/* The round's mystery card — its own sections (sound/description/photo/
   identity) reveal progressively as revealStage advances; the control
   panel below stays a single, always-visible audio workstation. */
#gameCardMount {
  display: flex;
  justify-content: center;
  margin: 0 0 20px;
}

/* =========================================================
   CARD 1: THE BIRD SOUND & HINT STAGE
   ========================================================= */
.stage-card {
  background: var(--bg-surface);
  border-radius: var(--r-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Header inside stage card */
.stage-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
}

/* Difficulty (Sværhedsgrad) Selector */
.difficulty-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.difficulty-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.difficulty-pills {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--r-pill);
  gap: 2px;
}
.difficulty-pill {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.18s ease;
}
.difficulty-pill:hover {
  color: var(--text-main);
}
.difficulty-pill.active {
  background: var(--bg-surface);
  color: var(--pine);
  box-shadow: var(--shadow-sm);
}

/* Actions on the right of stage header */
.stage-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stage-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  transition: all 0.16s ease;
  border: 1px solid transparent;
}
.stage-action-btn:hover {
  color: var(--text-main);
  background: #fff;
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}
.stage-action-btn.primary {
  background: var(--pine);
  color: #fff;
  border-color: var(--pine);
}
.stage-action-btn.primary:hover {
  background: #1C4532;
  border-color: #1C4532;
  color: #fff;
}
.stage-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.stage-action-btn:disabled:hover {
  background: var(--bg-subtle);
  border-color: transparent;
  color: var(--text-secondary);
}
.stage-action-btn.primary:disabled:hover {
  background: var(--pine);
  border-color: var(--pine);
  color: #fff;
}

.inspect-sound-btn {
  text-decoration: none;
}
.inspect-sound-btn:hover {
  color: var(--pine);
}

/* Trimmed audio mode toggle in player */
.trim-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(46, 117, 89, 0.12);
  color: var(--pine);
  border: 1px solid rgba(46, 117, 89, 0.3);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all 0.16s ease;
  user-select: none;
}
.trim-mode-toggle:hover {
  background: var(--pine);
  color: #ffffff;
  border-color: var(--pine);
}
.trim-mode-toggle.full-mode {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-color: var(--border-subtle);
}
.trim-mode-toggle.full-mode:hover {
  background: var(--text-secondary);
  color: #ffffff;
}

.action-icon {
  width: 14px;
  height: 14px;
}
.replay-btn:hover .action-icon {
  transform: rotate(-180deg);
  transition: transform 0.35s ease;
}

/* Floating feedback control — fixed to the viewport's bottom-right corner.
   The toggle button reveals a small stack of the three rating buttons
   above it; picking one (or clicking the toggle again) closes it. */
.feedback-fab-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.feedback-fab-menu {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 14px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  pointer-events: none;
}
.feedback-fab-wrap.open .feedback-fab-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.feedback-fab-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.feedback-fab-group-label {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 2px 8px;
  border-radius: var(--r-pill);
}
.feedback-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}
.feedback-btn:disabled:hover {
  transform: none;
  color: var(--text-muted);
  background: var(--bg-surface);
}

.feedback-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  transition: all 0.15s ease;
}
.fb-icon {
  width: 18px;
  height: 18px;
}
.feedback-btn:hover {
  transform: scale(1.06);
  color: var(--text-main);
}
.feedback-btn.upvote:hover, .feedback-btn.upvote.active-fb {
  color: var(--pine);
  background: var(--pine-tint);
  border-color: var(--pine-border);
}
.feedback-btn.downvote:hover, .feedback-btn.downvote.active-fb {
  color: var(--birch);
  background: var(--birch-tint);
  border-color: var(--birch);
}
.feedback-btn.dismiss:hover, .feedback-btn.dismiss.active-fb {
  color: var(--wrong-red);
  background: var(--wrong-tint);
  border-color: var(--wrong-border);
}

.feedback-fab-toggle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--pine);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-pine);
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.18s ease;
}
.feedback-fab-toggle:hover {
  transform: scale(1.06);
}
.feedback-fab-wrap.open .feedback-fab-toggle {
  background: var(--text-main);
}
.fab-icon {
  width: 22px;
  height: 22px;
}

/* Stage Card Body & Views */
.stage-card-body {
  min-height: 130px;
  display: flex;
  align-items: center;
}

.hint-view {
  display: none;
  width: 100%;
  animation: fadeIn 0.2s ease-out;
}
.hint-view.active {
  display: block;
}

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

/* =========================================================
   AUDIO PLAYER VIEW
   ========================================================= */
.custom-audio-player {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  padding: 4px 0;
}

/* Top Row: Bird Avatar + Play Button + Info & Controls */
.game-player-top-row {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
}

/* Hero Play Button */
.hero-play-wrapper {
  position: relative;
  flex-shrink: 0;
}

.play-halo {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: var(--pine-tint);
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.3s ease;
  pointer-events: none;
}
.view-audio.playing .play-halo {
  opacity: 1;
  transform: scale(1.08);
  animation: haloPulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}
@keyframes haloPulse {
  0% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 0.3; }
  100% { transform: scale(1); opacity: 0.7; }
}
@media (prefers-reduced-motion: reduce) {
  .view-audio.playing .play-halo {
    animation: none;
    opacity: 0.5;
  }
}

.hero-play-btn {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--pine-tint);
  border: 2px solid var(--pine);
  color: var(--pine);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(36, 92, 66, 0.15);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hero-play-btn:hover {
  transform: scale(1.06);
  background: var(--pine);
  color: #fff;
  box-shadow: var(--shadow-pine);
}
.hero-play-btn:active {
  transform: scale(0.96);
}

.view-audio.playing .hero-play-btn {
  background: var(--pine);
  color: #fff;
  box-shadow: var(--shadow-pine);
}

.play-btn-icon svg {
  width: 28px;
  height: 28px;
}
.icon-pause-wrapper {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.rewind-sub-tag {
  font-size: 0.52rem;
  font-weight: 700;
  line-height: 1;
  margin-top: -2px;
}

.view-audio.playing .icon-play { display: none; }
.view-audio.playing .icon-pause-wrapper { display: flex; }

/* Player Center Info */
.game-player-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.player-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.player-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all 0.2s ease;
}
.view-audio.playing .status-dot {
  background: var(--pine-accent);
  box-shadow: 0 0 8px var(--pine-accent);
}

.player-status {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--pine);
  letter-spacing: 0.02em;
}

.game-call-summary {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--pine);
  background: var(--pine-tint);
  border: 1px solid var(--pine-border);
  padding: 3px 8px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}

.player-controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.jump-first-call-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--pine-tint);
  color: var(--pine);
  border: 1.5px solid var(--pine-border);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.jump-first-call-btn:hover {
  background: var(--pine);
  color: #FFFFFF;
  border-color: var(--pine);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.audio-time-display {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

/* =========================================================
   FULL-WIDTH ANNOTATED WAVEFORM TIMELINE (Game Studio)
   ========================================================= */
.waveform-timeline-box {
  position: relative;
  width: 100%;
  height: 84px;
  background: #FAF8F5;
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  margin-top: 2px;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.waveform-timeline-box:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-xs);
}

.waveform-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.call-block {
  position: absolute;
  top: 6px;
  bottom: 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0 6px;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s, box-shadow 0.15s;
  z-index: 5;
}
.call-block.target {
  background: rgba(36, 92, 66, 0.25);
  border: 1.5px solid #245C42;
  color: #1C4532;
  backdrop-filter: blur(2px);
}
.call-block.background {
  background: rgba(216, 164, 104, 0.32);
  border: 1.5px solid #C48E50;
  color: #784E1A;
  backdrop-filter: blur(2px);
}
/* No confident target call means the exact position isn't known — not that
   the bird isn't in the recording. This spans the whole clip so the
   timeline never reads as "nothing here" by omission. Sits below target/
   background blocks (z-index) since those are more specific when present. */
.call-block.whole-recording {
  background: repeating-linear-gradient(
    135deg,
    rgba(36, 92, 66, 0.07),
    rgba(36, 92, 66, 0.07) 8px,
    rgba(36, 92, 66, 0.13) 8px,
    rgba(36, 92, 66, 0.13) 16px
  );
  border: 1.5px dashed rgba(36, 92, 66, 0.4);
  cursor: default;
  z-index: 1;
}
.call-block.whole-recording:hover {
  transform: none;
  filter: none;
  box-shadow: none;
}
.call-block:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

.playhead-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2.5px;
  background: var(--pine);
  box-shadow: 0 0 8px rgba(36, 92, 66, 0.7);
  pointer-events: none;
  transform: translateX(0);
  z-index: 20;
  transition: none;
}

.marker-kbd-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--fjord, #2C5F8A);
  pointer-events: none;
  z-index: 21;
  display: none;
}
.waveform-timeline-box:focus-visible .marker-kbd-cursor,
.waveform-timeline-box:focus .marker-kbd-cursor {
  display: block;
}
.waveform-timeline-box:focus-visible,
.waveform-timeline-box:focus {
  outline: 2.5px solid var(--pine);
  outline-offset: 2px;
}

.timeline-ticks {
  position: absolute;
  bottom: 3px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* =========================================================
   MARKER TOOL (marker.html)
   ========================================================= */
.marker-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin: 0 0 6px;
  color: var(--text-main);
}
.marker-intro {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  max-width: 60ch;
}
.marker-birdcard-mount {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}
.marker-audio-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.marker-timeline-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#markerTimeline {
  touch-action: none;
}
.marker-selection {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(46, 117, 89, 0.28);
  border: 1.5px solid var(--pine);
  z-index: 15;
  pointer-events: none;
}
.marker-existing-mark {
  position: absolute;
  top: 6px;
  bottom: 20px;
  background: rgba(196, 142, 80, 0.28);
  border: 1px solid rgba(196, 142, 80, 0.6);
  border-radius: 4px;
  z-index: 4;
  pointer-events: none;
}
.marker-progress-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.marker-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Call Chips Row */
.call-chips-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.call-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all 0.16s ease;
}
.call-chip:hover {
  transform: translateY(-1px);
  border-color: var(--pine-border);
  background: var(--bg-subtle);
  box-shadow: var(--shadow-sm);
}
.call-chip.target {
  border-left: 3px solid var(--pine);
}
.call-chip.background {
  border-left: 3px solid var(--birch);
}
.call-chip-time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}
.call-chip-conf {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--pine);
  background: var(--pine-tint);
  padding: 1px 5px;
  border-radius: var(--r-pill);
}
@keyframes eqBounce {
  0%   { transform: scaleY(0.15); }
  50%  { transform: scaleY(0.95); }
  100% { transform: scaleY(0.35); }
}

/* Progress track */
.audio-progress-container {
  width: 100%;
  height: 4px;
  background: var(--bg-subtle);
  border-radius: var(--r-pill);
  overflow: hidden;
  position: relative;
}
.audio-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--pine);
  border-radius: var(--r-pill);
  transition: width 0.1s linear;
}

/* Media annotation badge */
.media-annotation-badge {
  display: none;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 2px 8px;
  border-radius: var(--r-pill);
}
.media-annotation-badge:not(:empty) {
  display: inline-block;
}

/* Spoiler blur */
.spoiler-blur {
  filter: blur(5px);
  background: var(--pine-tint);
  border-radius: 4px;
  padding: 1px 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.spoiler-blur:hover, .spoiler-blur.revealed, .round-over .spoiler-blur {
  filter: blur(0);
  background: transparent;
  color: var(--pine);
  font-weight: 600;
}

/* =========================================================
   CARD 2: QUIZ CHOICES & 12 ANSWER BUTTONS
   ========================================================= */
.quiz-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-prompt-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.quiz-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.quiz-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.quiz-prompt-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 4px 10px;
  border-radius: var(--r-pill);
}
.pulse-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pine);
}

/* 12 Bird Answer Grid */
.bird-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

/* Individual Bird Button */
.bird-btn {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--r-btn);
  padding: 12px 14px;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
  transition: 
    transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease,
    opacity 0.2s ease;
}

.bird-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--pine-border);
  background: #FFFFFF;
  box-shadow: var(--shadow-md);
}
.bird-btn:active:not(:disabled) {
  transform: translateY(0);
}

/* Number pill on the left */
.bird-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.bird-btn:hover:not(:disabled) .bird-num {
  background: var(--pine-tint);
  color: var(--pine);
}

/* Bird Name */
.bird-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Correct Guess */
.bird-btn.correct {
  background: var(--pine) !important;
  border-color: var(--pine) !important;
  color: #fff !important;
  box-shadow: var(--shadow-pine) !important;
  transform: translateY(-2px) scale(1.02) !important;
  animation: popSuccess 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.bird-btn.correct .bird-name {
  color: #fff !important;
}
.bird-btn.correct .bird-num {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #fff !important;
}

@keyframes popSuccess {
  0% { transform: scale(0.96); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1.02); }
}

/* Wrong Guess */
.bird-btn.wrong {
  background: var(--wrong-tint) !important;
  border-color: var(--wrong-border) !important;
  opacity: 0.45 !important;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  animation: shakeGentle 0.35s ease;
}
.bird-btn.wrong .bird-name {
  color: var(--wrong-red) !important;
  text-decoration: line-through;
}
.bird-btn.wrong .bird-num {
  background: var(--wrong-border) !important;
  color: var(--wrong-red) !important;
}

@keyframes shakeGentle {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

/* =========================================================
   ACTION / REVEAL BANNER (Inline — Never covers options)
   ========================================================= */
.action-banner {
  display: none;
  width: 100%;
  animation: bannerSlideDown 0.28s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.action-banner.visible {
  display: block;
}

@keyframes bannerSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.banner-inner {
  width: 100%;
  background: var(--bg-surface);
  border: 1.5px solid var(--pine-border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-md);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-sizing: border-box;
}

.banner-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--pine-tint);
  color: var(--pine);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.banner-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.banner-heading-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

#bannerTitle {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--text-main);
  font-weight: 400;
}

.banner-pts-tag {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.4;
}

.banner-sources {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.source-chip {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 3px 10px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.source-chip:hover {
  color: var(--pine);
  background: var(--pine-tint);
}
.chip-icon {
  width: 12px;
  height: 12px;
}

.next-round-btn {
  background: var(--pine);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: var(--r-btn);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-pine);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}
.next-round-btn:hover {
  background: var(--pine-light);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(36, 92, 66, 0.3);
}
.next-round-btn:active {
  transform: translateY(0);
}
.next-btn-arrow {
  transition: transform 0.2s ease;
}
.next-round-btn:hover .next-btn-arrow {
  transform: translateX(3px);
}

/* =========================================================
   SITE FOOTER
   ========================================================= */
.site-footer {
  max-width: 1040px;
  margin: 40px auto 0;
  padding: 20px 24px 28px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.76rem;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: center;
}
.site-footer p {
  margin: 0 0 6px;
}
.site-footer p:last-child {
  margin-bottom: 0;
}
.site-footer a {
  color: var(--pine);
  text-decoration: none;
}
.site-footer a:hover {
  text-decoration: underline;
}

/* =========================================================
   FEEDBACK TOAST
   ========================================================= */
.feedback-toast {
  position: fixed;
  top: 75px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--text-main);
  color: #fff;
  padding: 8px 18px;
  border-radius: var(--r-pill);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2000;
}
.feedback-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =========================================================
   LAPTOP LAYOUT — three real columns: birdcard, birdcall
   (audio player), options (answer grid), each with its own
   dedicated space instead of two of them stacked and
   competing for room. Difficulty sits above as a full-width
   bar. Below this width everything falls back to a single
   stacked column in DOM order, like before.
   Selectors here are deliberately scoped under .game-content
   (not bare .birdcard-hero etc.) so they win the cascade over
   cards.css's defaults regardless of <link> order. Explicit
   grid-column placement (rather than reordering the HTML) is
   what puts the card first visually even though the audio
   player comes first in the DOM.
   ========================================================= */
@media (min-width: 1024px) {
  .game-container {
    max-width: 1280px;
    padding: 12px 24px 16px;
  }
  .game-content {
    display: grid;
    grid-template-columns: 290px 330px 1fr;
    align-items: start;
    gap: 16px 24px;
  }
  .game-content .difficulty-bar {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }
  .game-content .game-col-card { grid-column: 1; grid-row: 2; }
  .game-content .game-col-audio { grid-column: 2; grid-row: 2; }
  .game-content .game-col-options { grid-column: 3; grid-row: 2; }

  .game-content #gameCardMount {
    margin: 0;
    display: flex;
    justify-content: center;
  }

  /* Audio player module — each column now has its own full vertical
     budget rather than sharing one with the card, so this only needs a
     light trim, not the aggressive squeeze a shared column would need. */
  .game-content .stage-card {
    padding: 16px 18px;
    gap: 12px;
  }
  .game-content .waveform-timeline-box {
    height: 64px;
  }
  .game-content .call-chips-row {
    max-height: 40px;
    overflow-y: auto;
  }

  /* Mystery card — a slightly shorter photo and a cap on the hint text
     (see cards.css's general desc-unclamped cap) keep its total height
     predictable regardless of how long a given bird's description is. */
  .game-content .birdcard-hero {
    max-width: 100%;
  }
  .game-content .birdcard-hero .card-photo-wrapper {
    height: 170px;
  }
  .game-content .birdcard-hero .card-desc-box.desc-unclamped {
    max-height: 92px;
  }

  /* Answer grid — its own column now, comfortably 3 wide */
  .game-content .bird-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .game-content .bird-btn {
    min-height: 46px;
    padding: 10px 12px;
  }
  .game-content .quiz-section {
    gap: 10px;
  }
}

/* =========================================================
   RESPONSIVE DESIGN
   ========================================================= */
@media (max-width: 860px) {
  .bird-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .stage-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .stage-actions {
    width: 100%;
    justify-content: space-between;
  }
  .custom-audio-player {
    gap: 16px;
  }
  .hero-play-btn {
    width: 66px;
    height: 66px;
  }
}

@media (max-width: 620px) {
  .header-nav {
    display: none;
  }
  .bird-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .banner-inner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .banner-heading-row {
    justify-content: center;
  }
  .banner-sources {
    justify-content: center;
  }
}

/* Click-to-copy bird names (Danish / scientific) */
.copyable-text {
  cursor: pointer;
  position: relative;
  border-radius: 4px;
  transition: background 0.15s ease;
}
.copyable-text:hover {
  background: var(--bg-subtle, rgba(0, 0, 0, 0.04));
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.copy-toast {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%) translateY(4px);
  background: var(--pine, #245C42);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--r-pill, 999px);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}
.copy-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
