/* ------------------------------------------------------------------
   Wingtap — field-notebook palette, atlas typography, soft motion.
------------------------------------------------------------------ */

:root {
  --paper:        #F6F1E5;
  --paper-2:      #FBF7EE;
  --card:         #FFFCF6;
  --ink:          #1D2A27;
  --ink-soft:     #5F6E68;
  --ink-faint:    #8B978F;
  --line:         rgba(29, 42, 39, .13);
  --line-soft:    rgba(29, 42, 39, .07);
  --accent:       #2F6B5C;
  --accent-soft:  #E3EDE7;
  --ochre:        #C0803A;
  --crimson:      #BE4738;
  --gold:         #D8A83C;

  --shadow-sm: 0 1px 2px rgba(29,42,39,.06), 0 2px 8px rgba(29,42,39,.05);
  --shadow-md: 0 2px 6px rgba(29,42,39,.07), 0 14px 40px rgba(29,42,39,.10);
  --shadow-lg: 0 8px 20px rgba(29,42,39,.10), 0 40px 80px rgba(29,42,39,.16);

  --map-ocean:      #D8E5E4;
  --map-ocean-top:  #EDF3EF;
  --map-land:       #ECE1C9;
  --map-coast:      rgba(56, 82, 76, .42);
  --map-border:     rgba(56, 82, 76, .16);
  --map-grid:       rgba(56, 96, 96, .10);
  --map-shadow:     rgba(29, 42, 39, .22);
  --map-range:      rgba(28, 132, 104, .32);
  --map-range-edge: #1B7A60;
  --map-range-glow: rgba(28, 132, 104, .5);
  --map-arc:        rgba(190, 71, 56, .75);
  --map-pin:        #BE4738;
  --map-pin-dot:    #FBF7EE;
  --map-answer:     #2F6B5C;
  --map-answer-ring:#FBF7EE;
  --map-answer-halo:rgba(47, 107, 92, .28);
  --map-crosshair:  rgba(46, 70, 66, .45);
  --map-ocean-deep: #B5C9C8;
  --globe-atmo:     rgba(47, 107, 92, .13);
  --globe-limb:     rgba(22, 46, 42, .28);
  --globe-highlight:rgba(255, 255, 255, .30);
  --globe-rim:      rgba(46, 70, 66, .26);

  --medallion-1:    #EFE6D3;
  --medallion-2:    #D9E3DA;
  --medallion-halo: rgba(255,255,255,.34);
  --medallion-ground:#CBD8CB;
  --medallion-shadow:rgba(40,56,50,.14);
  --medallion-branch:#B39A78;
  --medallion-ring: rgba(29,42,39,.14);
  --medallion-water:#BFD6DA;
  --medallion-ripple:rgba(255,255,255,.7);

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-ui: ui-sans-serif, -apple-system, "SF Pro Text", "Segoe UI", Inter, system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  --glass:        rgba(255, 252, 246, .86);
  --veil:         rgba(246, 241, 229, .74);
  --tint:         rgba(238, 232, 216, .5);
  --accent-edge:  rgba(47, 107, 92, .4);
  --ochre-edge:   rgba(192, 128, 58, .5);
  --btn-shadow:   rgba(20, 62, 52, .55);
  --sel:          rgba(47, 107, 92, .3);

  --r-sm: 10px; --r-md: 16px; --r-lg: 22px; --r-xl: 30px;
}

html[data-theme="dark"] {
  --paper:        #0F1815;
  --paper-2:      #131E1B;
  --card:         #16211E;
  --ink:          #ECE6D8;
  --ink-soft:     #A2B0A8;
  --ink-faint:    #74837B;
  --line:         rgba(236, 230, 216, .14);
  --line-soft:    rgba(236, 230, 216, .07);
  --accent:       #6FC9A8;
  --accent-soft:  rgba(111, 201, 168, .14);
  --ochre:        #E0A957;
  --crimson:      #E4705C;
  --gold:         #E8C15C;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 2px 8px rgba(0,0,0,.45), 0 18px 44px rgba(0,0,0,.4);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.5), 0 50px 90px rgba(0,0,0,.55);

  --map-ocean:      #0E2026;
  --map-ocean-top:  #1B3A42;
  --map-land:       #2E3F37;
  --map-coast:      rgba(190, 215, 200, .40);
  --map-border:     rgba(180, 205, 192, .13);
  --map-grid:       rgba(150, 200, 195, .07);
  --map-shadow:     rgba(0, 0, 0, .6);
  --map-range:      rgba(111, 201, 168, .26);
  --map-range-edge: #6FC9A8;
  --map-range-glow: rgba(111, 201, 168, .45);
  --map-arc:        rgba(228, 112, 92, .8);
  --map-pin:        #E4705C;
  --map-pin-dot:    #16211E;
  --map-answer:     #6FC9A8;
  --map-answer-ring:#0F1815;
  --map-answer-halo:rgba(111, 201, 168, .25);
  --map-crosshair:  rgba(180, 205, 192, .4);
  --map-ocean-deep: #050E12;
  --globe-atmo:     rgba(111, 201, 168, .15);
  --globe-limb:     rgba(0, 0, 0, .55);
  --globe-highlight:rgba(186, 230, 218, .11);
  --globe-rim:      rgba(150, 200, 190, .30);

  --medallion-1:    #33453E;
  --medallion-2:    #21302B;
  --medallion-halo: rgba(255,255,255,.08);
  --medallion-ground:#2B3A33;
  --medallion-shadow:rgba(0,0,0,.35);
  --medallion-branch:#4A3F31;
  --medallion-ring: rgba(236,230,216,.13);
  --medallion-water:#16282C;
  --medallion-ripple:rgba(255,255,255,.22);

  --glass:        rgba(20, 31, 28, .84);
  --veil:         rgba(12, 20, 18, .78);
  --tint:         rgba(255, 255, 255, .035);
  --accent-edge:  rgba(111, 201, 168, .4);
  --ochre-edge:   rgba(224, 169, 87, .45);
  --btn-shadow:   rgba(0, 0, 0, .5);
  --sel:          rgba(111, 201, 168, .3);
}

/* Same tokens, applied when the viewer's OS is dark and they have not
   explicitly chosen light. The [data-theme] rules above/below always win. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:        #0F1815;
    --paper-2:      #131E1B;
    --card:         #16211E;
    --ink:          #ECE6D8;
    --ink-soft:     #A2B0A8;
    --ink-faint:    #74837B;
    --line:         rgba(236, 230, 216, .14);
    --line-soft:    rgba(236, 230, 216, .07);
    --accent:       #6FC9A8;
    --accent-soft:  rgba(111, 201, 168, .14);
    --ochre:        #E0A957;
    --crimson:      #E4705C;
    --gold:         #E8C15C;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 2px 8px rgba(0,0,0,.45), 0 18px 44px rgba(0,0,0,.4);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.5), 0 50px 90px rgba(0,0,0,.55);

    --map-ocean:      #0E2026;
    --map-ocean-top:  #1B3A42;
    --map-land:       #2E3F37;
    --map-coast:      rgba(190, 215, 200, .40);
    --map-border:     rgba(180, 205, 192, .13);
    --map-grid:       rgba(150, 200, 195, .07);
    --map-shadow:     rgba(0, 0, 0, .6);
    --map-range:      rgba(111, 201, 168, .26);
    --map-range-edge: #6FC9A8;
    --map-range-glow: rgba(111, 201, 168, .45);
    --map-arc:        rgba(228, 112, 92, .8);
    --map-pin:        #E4705C;
    --map-pin-dot:    #16211E;
    --map-answer:     #6FC9A8;
    --map-answer-ring:#0F1815;
    --map-answer-halo:rgba(111, 201, 168, .25);
    --map-crosshair:  rgba(180, 205, 192, .4);
    --map-ocean-deep: #050E12;
    --globe-atmo:     rgba(111, 201, 168, .15);
    --globe-limb:     rgba(0, 0, 0, .55);
    --globe-highlight:rgba(186, 230, 218, .11);
    --globe-rim:      rgba(150, 200, 190, .30);

    --medallion-1:    #33453E;
    --medallion-2:    #21302B;
    --medallion-halo: rgba(255,255,255,.08);
    --medallion-ground:#2B3A33;
    --medallion-shadow:rgba(0,0,0,.35);
    --medallion-branch:#4A3F31;
    --medallion-ring: rgba(236,230,216,.13);
    --medallion-water:#16282C;
    --medallion-ripple:rgba(255,255,255,.22);

    --glass:        rgba(20, 31, 28, .84);
    --veil:         rgba(12, 20, 18, .78);
    --tint:         rgba(255, 255, 255, .035);
    --accent-edge:  rgba(111, 201, 168, .4);
    --ochre-edge:   rgba(224, 169, 87, .45);
    --btn-shadow:   rgba(0, 0, 0, .5);
    --sel:          rgba(111, 201, 168, .3);
  }
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font-ui);
  touch-action: manipulation;          /* no double-tap zoom on the controls */
  overscroll-behavior: none;           /* no rubber-band while spinning */
  -webkit-tap-highlight-color: transparent;
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(1200px 600px at 12% -10%, var(--paper-2), transparent 60%),
    radial-gradient(900px 500px at 100% 110%, var(--paper-2), transparent 55%);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#app {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ----------------------------------------------------------- top bar */

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(14px, 3vw, 26px);
  border-bottom: 1px solid var(--line-soft);
}

.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }

/* A wing coming down onto the spot you tapped — the same wing the birds in the
   portraits fly with. Colours come from the tokens, so it flips with the theme. */
.mark {
  width: 27px; height: 27px;
  align-self: center;
  flex: none;
  line-height: 0;
  filter: drop-shadow(0 1px 2px rgba(29, 42, 39, .18));
}
.mark svg { width: 100%; height: 100%; display: block; }

.wordmark {
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: .01em;
  white-space: nowrap;
}

.dayline {
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rounds { display: flex; gap: 8px; margin-inline: auto; }

.round-dot {
  width: 34px; height: 8px; border-radius: 99px;
  background: var(--line);
  position: relative;
  transition: background .4s ease, transform .3s cubic-bezier(.2,1.4,.4,1);
}
.round-dot.is-active { background: var(--ink-faint); transform: scaleY(1.5); }
.round-dot.is-perfect { background: var(--accent); }
.round-dot.is-great   { background: #58A583; }
.round-dot.is-good    { background: var(--gold); }
.round-dot.is-ok      { background: var(--ochre); }
.round-dot.is-miss    { background: var(--crimson); }

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

.scoreboard {
  font-family: var(--font-display);
  display: flex; align-items: baseline; gap: 2px;
  padding: 4px 12px 5px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-right: 4px;
}
.scoreboard__num { font-size: 18px; font-variant-numeric: tabular-nums; }
.scoreboard__den { font-size: 11px; opacity: .7; }

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font: inherit; font-size: 15px;
  cursor: pointer;
  transition: background .18s, color .18s, transform .18s, border-color .18s;
}
.icon-btn:hover { background: var(--card); color: var(--ink); border-color: var(--line); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0) scale(.94); }
.icon-btn.ghost { background: var(--glass); backdrop-filter: blur(6px); }

/* ----------------------------------------------------------- stage */

.stage {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 380px);
  gap: clamp(12px, 1.6vw, 22px);
  padding: clamp(12px, 1.6vw, 22px);
  min-height: 0;
}

.mapwrap {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
  min-height: 0;
}

#map { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#map.is-pickable { cursor: crosshair; }
#map.is-dragging { cursor: grabbing; }

.readout {
  position: absolute; left: 12px; bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--ink-faint);
  background: var(--glass);
  backdrop-filter: blur(6px);
  padding: 5px 9px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-soft);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.readout.is-on { opacity: 1; }

.mapctl {
  position: absolute; right: 12px; bottom: 12px;
  display: flex; flex-direction: column; gap: 6px;
}

.maphint {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  pointer-events: none;
  max-width: min(78%, 460px);
}
.maphint span {
  display: inline-block;
  font-size: 12.5px;
  letter-spacing: .02em;
  color: var(--ink-soft);
  background: var(--glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-soft);
  padding: 7px 14px;
  border-radius: 99px;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .35s, transform .35s;
}
.maphint.is-on span { opacity: 1; transform: translateY(0); }

/* ----------------------------------------------------------- panel */

.panel {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden auto;
  scrollbar-width: thin;
}

.card-enter { animation: cardIn .5s cubic-bezier(.2,.9,.25,1) both; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* On desktop the head block is just flow content; on mobile it becomes a row. */
.bird-head { display: contents; }
.bird-head__text { display: contents; }

.medallion {
  align-self: center;
  width: min(250px, 72%);
  margin: 2px 0 14px;
  filter: drop-shadow(0 10px 24px rgba(29,42,39,.14));
  animation: bob 7s ease-in-out infinite;
}
.medallion svg { display: block; width: 100%; height: auto; }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-5px) } }

.eyebrow {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

.bird-name {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.4vw, 30px);
  line-height: 1.12;
  margin: 0 0 4px;
  letter-spacing: -.01em;
}

.bird-sci {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0 0 14px;
}

.rule {
  height: 1px;
  background: linear-gradient(to right, var(--ochre), transparent);
  opacity: .55;
  margin: 0 0 14px;
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.chip {
  font-size: 11.5px;
  letter-spacing: .02em;
  padding: 5px 11px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--tint);
  white-space: nowrap;
}
.chip--status { border-color: var(--ochre-edge); color: var(--ochre); }
.chip--tier   { border-color: var(--accent-edge); color: var(--accent); }

.prose { font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); margin: 0 0 16px; }
.prose strong { color: var(--ink); font-weight: 600; }

.spacer { flex: 1 1 auto; min-height: 12px; }

.btn {
  appearance: none;
  border: 0;
  font: inherit;
  font-size: 15px;
  font-weight: 550;
  letter-spacing: .01em;
  padding: 14px 20px;
  border-radius: 14px;
  background: var(--accent);
  color: #FBFAF5;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 2px 0 var(--btn-shadow), var(--shadow-sm);
  transition: transform .16s cubic-bezier(.2,1.3,.4,1), filter .16s, box-shadow .16s, opacity .2s;
}
html[data-theme="dark"] .btn { color: #0C1614; }
.btn:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 0 0 var(--btn-shadow); }
.btn:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }
.btn--ghost {
  background: transparent; color: var(--ink-soft);
  border: 1px solid var(--line); box-shadow: none;
}
.btn--ghost:hover:not(:disabled) { color: var(--ink); background: var(--paper); }
.btn-row { display: flex; gap: 10px; }

.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  padding: 1px 5px;
  border-radius: 5px;
  color: var(--ink-faint);
}

/* ----------------------------------------------------------- result */

.result-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 10px; }
.result-medal { flex: none; width: 82px; filter: drop-shadow(0 6px 14px rgba(29,42,39,.14)); }
.result-medal svg { width: 100%; height: auto; display: block; }

.verdict {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.1;
  margin: 2px 0 4px;
}
.verdict.is-perfect { color: var(--accent); }
.verdict.is-miss { color: var(--crimson); }

.stat-row { display: flex; gap: 10px; margin: 14px 0 16px; }
.stat {
  flex: 1;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 11px 12px;
  background: var(--tint);
}
.stat__label { font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-faint); }
.stat__value {
  font-family: var(--font-display);
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin-top: 2px;
}
.stat__value small { font-size: 13px; color: var(--ink-faint); }

.legend {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  font-size: 11.5px; color: var(--ink-faint);
  padding: 12px 0 14px;
  border-top: 1px solid var(--line-soft);
  margin-top: 6px;
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 13px; height: 13px; border-radius: 4px; display: inline-block; flex: none; }
.sw--range { background: var(--map-range); border: 1.5px dashed var(--map-range-edge); border-radius: 3px; }
.sw--pin { background: var(--map-pin); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); width: 11px; height: 11px; }
.sw--home { background: var(--map-answer); border-radius: 50%; box-shadow: 0 0 0 3px var(--map-answer-halo); width: 10px; height: 10px; margin: 0 2px; }

.factbox {
  border-left: 2px solid var(--ochre);
  padding: 2px 0 2px 14px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

/* ----------------------------------------------------------- overlay */

.overlay[hidden] { display: none; }

.overlay {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  padding: 20px;
  background: var(--veil);
  backdrop-filter: blur(14px) saturate(1.1);
  z-index: 50;
  animation: fade .3s ease both;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.sheet {
  width: min(560px, 100%);
  margin-bottom: env(safe-area-inset-bottom);
  max-height: min(88dvh, 860px);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: clamp(22px, 4vw, 36px);
  animation: sheetIn .5s cubic-bezier(.2,.9,.25,1) both;
  scrollbar-width: thin;
}
@keyframes sheetIn { from { opacity: 0; transform: translateY(22px) scale(.97) } to { opacity: 1; transform: none } }

.sheet h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 40px);
  line-height: 1.05;
  margin: 0 0 6px;
  letter-spacing: -.015em;
}
.sheet h2 {
  font-family: var(--font-display);
  font-size: 22px; margin: 0 0 10px;
}
.sheet p { font-size: 15px; line-height: 1.62; color: var(--ink-soft); }

.sheet-close {
  float: right; margin: -6px -6px 0 0;
}

.trio { display: flex; justify-content: center; margin: 6px 0 18px; }
.trio > * { margin-inline: -4px; }
.trio svg { width: 108px; height: 108px; filter: drop-shadow(0 8px 18px rgba(29,42,39,.16)); }
.trio > *:nth-child(1) { transform: rotate(-7deg) translateY(4px); }
.trio > *:nth-child(3) { transform: rotate(7deg) translateY(4px); }

.steps { list-style: none; padding: 0; margin: 4px 0 22px; display: grid; gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); }
.steps b {
  flex: none;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 700;
  font-family: var(--font-ui);
}

.scoreline {
  font-family: var(--font-display);
  font-size: clamp(46px, 9vw, 64px);
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.scoreline small { font-size: 20px; color: var(--ink-faint); letter-spacing: 0; }

.summary-list { display: grid; gap: 8px; margin: 20px 0; }
.summary-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--tint);
  animation: cardIn .45s cubic-bezier(.2,.9,.25,1) both;
}
.summary-row svg { width: 44px; height: 44px; flex: none; }
.summary-row .nm { font-family: var(--font-display); font-size: 16px; }
.summary-row .sub { font-size: 12px; color: var(--ink-faint); display: flex; align-items: center; gap: 7px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot--perfect { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dot--great { background: #58A583; }
.dot--good { background: var(--gold); }
.dot--ok { background: var(--ochre); }
.dot--miss { background: var(--crimson); }
.summary-row .pts { margin-left: auto; font-family: var(--font-display); font-size: 19px; font-variant-numeric: tabular-nums; }

.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 20px; }

.share-box {
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: pre-wrap;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 12px 14px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.countdown { text-align: center; font-size: 13px; color: var(--ink-faint); margin-top: 14px; }
.countdown b { font-family: var(--font-mono); color: var(--ink-soft); font-weight: 500; }

/* ----------------------------------------------------------- extras */

.feathers { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.feather {
  position: absolute; top: -40px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(115vh) rotate(var(--spin, 320deg)); opacity: 0; }
}

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(10px);
  background: var(--ink); color: var(--paper);
  padding: 10px 18px; border-radius: 99px;
  font-size: 13.5px; letter-spacing: .01em;
  box-shadow: var(--shadow-md);
  z-index: 70;
  opacity: 0;
  transition: opacity .25s, transform .25s;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

.journal { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.journal svg { width: 38px; height: 38px; opacity: .9; }

/* ----------------------------------------------------------- responsive */

/* Phones: the globe is height-limited here, so every pixel the card gives back
   makes the world bigger. Card chrome comes off the globe, text gets lean. */
@media (max-width: 900px) {
  .icon-btn { width: 38px; height: 38px; }
  .mapctl { gap: 7px; right: 6px; bottom: 6px; }

  .stage {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    padding: 4px 8px 8px;
    gap: 6px;
  }
  /* No card around the globe, and the pane runs to the screen edges so the
     sphere can bleed off them. */
  .mapwrap {
    background: none; border: 0; box-shadow: none; border-radius: 0;
    margin: -4px -8px 0;
  }

  .panel {
    max-height: 44dvh;
    padding: 12px 14px;
    border-radius: 20px;
  }

  /* ---- aiming card ---- */
  .bird-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
  .bird-head__text { display: block; min-width: 0; }
  .medallion { width: 66px; flex: none; margin: 0; animation: none; }
  .bird-head .bird-sci { margin-bottom: 0; font-size: 13px; }
  .bird-name { font-size: 20px; }
  .rule { margin-bottom: 10px; }
  .chips { gap: 6px; margin-bottom: 10px; }
  .chip { font-size: 11px; padding: 4px 9px; }
  .panel .prose { display: none; }

  /* ---- result card ---- */
  .result-head { gap: 12px; margin-bottom: 4px; }
  .result-medal { width: 56px; }
  .verdict { font-size: 21px; }
  .eyebrow { font-size: 9.5px; letter-spacing: .13em; margin-bottom: 3px; }
  .stat-row { gap: 8px; margin: 10px 0; }
  .stat { padding: 6px 10px 7px; border-radius: 12px; }
  .stat__label { font-size: 9px; letter-spacing: .12em; }
  .stat__value { font-size: 19px; }
  .stat__value small { font-size: 11px; }
  .factbox { font-size: 13px; line-height: 1.5; padding-left: 11px; }
  .legend { display: none; }

  .panel .btn {
    position: sticky; bottom: 0;
    padding: 12px 16px; font-size: 15px; border-radius: 13px;
  }
  .panel .btn .kbd { display: none; }

  /* ---- chrome ---- */
  .dayline { display: none; }
  .rounds { margin-inline: 0; gap: 6px; }
  .round-dot { width: 26px; }
  .topbar { gap: 8px; padding: 8px 12px; }
  .wordmark { font-size: 17px; }
  .scoreboard { padding: 3px 10px 4px; }
  .scoreboard__den { display: none; }
  .maphint span { font-size: 12px; padding: 6px 12px; }
}

/* Landscape phones are wide and short — put the globe back beside the card. */
@media (max-width: 900px) and (orientation: landscape) {
  .stage { grid-template-columns: 1fr minmax(250px, 40%); grid-template-rows: 1fr; }
  .panel { max-height: none; }
}

/* Short portrait screens (SE-sized): trim a little further. */
@media (max-width: 900px) and (max-height: 700px) and (orientation: portrait) {
  .panel { max-height: 42dvh; padding: 10px 12px; }
  .medallion, .result-medal { width: 50px; }
  .factbox { font-size: 12.5px; }
}

@media (max-width: 520px) {
  .brand .wordmark { display: none; }
  .stat__value { font-size: 21px; }
  .trio svg { width: 84px; height: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

::selection { background: var(--sel); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
