:root {
  --cream: #F7F3EA;
  --bg: #1F3B2D;
  --surface: #FFFDF8;
  --ink: #1C2620;
  --muted: #56645A;
  --brand: #1F3B2D;
  --brand-2: #2F5A43;
  --accent: #C8402E;
  --accent-hover: #A93222;
  --gold: #E8B04A;
  --line: #DCE4D3;
  --serif: "Lora", Georgia, serif;
  --sans: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }

#shell { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 16px; gap: 8px; }
#stage {
  position: relative; width: min(100%, calc((100vh - 60px) * 16 / 9)); aspect-ratio: 16 / 9;
  max-width: 1600px; background: #CFE3EE; border-radius: 12px; overflow: hidden; container-type: inline-size;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
#stage:fullscreen { width: 100vw; height: 100vh; max-width: none; border-radius: 0; aspect-ratio: auto; display: flex; align-items: center; justify-content: center; background: #000; }
#stage:fullscreen canvas { width: min(100vw, 100vh * 16 / 9); height: auto; }
canvas { display: block; width: 100%; height: 100%; }
.foot { margin: 0; font-size: .9rem; }
.foot { color: var(--cream); }
.foot a { color: var(--cream); }
.home-link { margin: 1em 0 0; font-weight: 700; }

.topbar { position: absolute; top: 1.2cqw; right: 1.2cqw; display: flex; gap: .6cqw; z-index: 5; }
.icon-btn {
  width: max(30px, 3.6cqw); height: max(30px, 3.6cqw); border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 253, 248, .85); color: var(--brand); font-size: max(13px, 1.5cqw); line-height: 1;
}
.icon-btn:hover { background: #fff; }
.icon-btn.close-btn { width: max(40px, 4.8cqw); height: max(40px, 4.8cqw); margin-left: .4cqw; background: var(--brand); color: #fff; font-size: max(20px, 2.4cqw); font-weight: 800; }
.icon-btn.close-btn:hover { background: #C8402E; }
.icon-btn.off { opacity: .5; text-decoration: line-through; }

.screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 3cqw; background: rgba(31, 59, 45, .45); z-index: 4; overflow: auto; }
.screen[hidden] { display: none; }
.panel {
  background: var(--surface); border-radius: 14px; padding: clamp(14px, 2.6cqw, 34px); width: min(100%, 620px);
  max-height: 100%; overflow: auto; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); font-size: clamp(13px, 1.7cqw, 17px);
}
.panel-wide { width: min(100%, 900px); }
.panel-small { width: min(100%, 340px); text-align: center; }
.panel-title { text-align: center; }
h1, h2, h3 { font-family: var(--serif); color: var(--brand); line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(40px, 8cqw, 84px); letter-spacing: -.01em; }
h2 { font-size: clamp(20px, 3cqw, 32px); }
h3 { font-size: clamp(15px, 2cqw, 20px); }
p { margin: 0 0 .8em; }
.kicker { color: var(--accent); font-weight: 800; margin-bottom: .2em; }
.lede { font-size: 1.1em; max-width: 34em; margin: 0 auto 1.2em; }
.tiny { font-size: .82em; color: var(--muted); margin: 1em 0 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 1em; }
.row.col { flex-direction: column; }
.btn {
  font: inherit; font-weight: 800; border: 2px solid var(--brand); color: var(--brand); background: #fff;
  border-radius: 999px; padding: .55em 1.4em; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn:hover, .btn:focus-visible { background: var(--cream); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
a { color: var(--brand-2); }
.howto { padding-left: 1.2em; margin: 0; }
.howto li { margin-bottom: .45em; }

.pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.pick {
  position: relative; text-align: left; font: inherit; background: #fff; border: 2px solid var(--line); border-radius: 12px;
  padding: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; color: var(--ink);
}
.pick:hover:not([disabled]), .pick:focus-visible { border-color: var(--accent); }
.pick img { width: 70%; align-self: center; }
.pick strong { font-family: var(--serif); color: var(--brand); font-size: 1.05em; line-height: 1.2; }
.pick .meta { font-size: .85em; color: var(--muted); }
.pick .best { font-size: .85em; font-weight: 800; color: var(--brand-2); }
.pick[disabled] { cursor: not-allowed; }
.pick[disabled] img { filter: grayscale(1) brightness(.6); opacity: .5; }
.pick .lock { font-size: .82em; color: var(--accent); font-weight: 700; }
.stars { color: var(--gold); letter-spacing: 2px; }
.stars .no { color: #D9D4C7; }

.brief { display: grid; grid-template-columns: 44% 1fr; gap: 2.4cqw; align-items: start; }
.brief img { width: 100%; }
.route { list-style: none; padding: 0; margin: 0 0 1em; counter-reset: leg; }
.route li { counter-increment: leg; padding: 3px 0 3px 2em; position: relative; }
.route li::before { content: counter(leg); position: absolute; left: 0; top: 4px; width: 1.4em; height: 1.4em; border-radius: 50%; background: var(--brand); color: #fff; font-size: .8em; display: grid; place-items: center; font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 1em; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--cream); border-radius: 999px; padding: 2px 10px 2px 4px; font-size: .88em; font-weight: 700; }
.chip img { width: 1.8em; height: 1.8em; }
.fact { background: var(--cream); border-radius: 10px; padding: .8em 1em; margin: .8em 0; }
.fact b { display: block; font-family: var(--serif); color: var(--brand); }
.tip { border-left: 4px solid var(--gold); padding-left: .8em; text-align: left; }
.stats { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; text-align: center; margin: .6em 0; }
.stats div { background: var(--cream); border-radius: 10px; padding: .5em; }
.stats b { display: block; font-size: 1.4em; color: var(--brand); font-family: var(--serif); }
.stats span { font-size: .8em; color: var(--muted); }
.big-score { font-family: var(--serif); font-size: 2.4em; color: var(--brand); margin: 0; line-height: 1.1; }
.new-best { color: var(--accent); font-weight: 800; }
.flock-bonus { color: var(--green, #2F7D4F); font-weight: 700; margin: 2px 0 6px; }
.unlock { background: #FFF4D6; border-radius: 10px; padding: .6em 1em; font-weight: 700; }
#end, #rest { text-align: center; }
#end .fact, #rest .fact { text-align: left; }

.rotate { display: none; }
@media (orientation: portrait) and (max-width: 700px) {
  #stage { width: 100%; }
  body:not(.turned) .screen { padding-bottom: 64px; }
  .rotate { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; position: absolute; left: 0; right: 0; bottom: 0; background: var(--accent); color: #fff; text-align: center; font-weight: 800; font-size: 13px; padding: 5px 6px; z-index: 6; }
  .turn-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; border-radius: 999px; background: #fff; color: var(--accent); font: 800 13px var(--sans); padding: 4px 12px; cursor: pointer; }
  .phone-ico { width: 20px; height: 20px; }
  .brief { grid-template-columns: 1fr; }
  .brief img { width: 30%; }
}

.icon-btn.pill { width: auto; border-radius: 999px; padding: 0 .9em; font-weight: 800; font-family: var(--sans); font-size: max(12px, 1.2cqw); }
.btn-big { font-size: 1.15em; padding: .65em 1.8em; }
.next-card { display: flex; gap: 1em; align-items: center; text-align: left; background: #FFF4D6; border: 2px solid var(--gold); border-radius: 12px; padding: .8em 1em; margin: .6em 0; }
.next-card img { width: 26%; flex: none; }
.next-card h3 { margin: 0 0 .2em; }
.next-card p { margin: 0 0 .6em; }
.next-label { color: var(--accent); font-weight: 800; margin: 0 !important; }
.next-up { font-weight: 800; color: var(--brand); margin: .8em 0 0; }
.chips.skip .chip { opacity: .6; }
.food-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 1em; }
.food-card { background: var(--cream); border-radius: 10px; padding: 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 2px solid transparent; }
.food-card img { width: 52px; height: 52px; }
.food-card b { font-size: .92em; line-height: 1.2; }
.food-card span { font-size: .78em; color: var(--muted); line-height: 1.3; }
.food-grid:not(.skip) .food-card { border-color: #BFD8C4; }
.food-grid.skip .food-card { opacity: .6; }
.eat-h { color: var(--good, #2F7D4F); }
.skip-h { color: var(--accent); }

.map-wrap { position: relative; }
.route-map { display: block; width: 100%; height: auto; border-radius: 10px; font-family: var(--sans); }
.brief-bird { position: absolute; left: -6px; bottom: -6px; width: 30% !important; filter: drop-shadow(0 2px 4px rgba(0,0,0,.2)); }
.map-key { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin: .4em 0 0; }
.key-line { display: inline-block; width: 22px; height: 0; border-top: 3px solid #2F7D4F; border-radius: 2px; vertical-align: middle; }
.key-line.night { border: 0; height: 5px; width: 24px; background: radial-gradient(circle, #2F6FE0 2.4px, transparent 2.8px) 0 0 / 8px 5px repeat-x; }
.key-dot { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--brand); font-size: 10px; font-weight: 800; }
.note-box { background: #EEF3EA; border-radius: 10px; padding: .5em .8em; font-size: .9em; margin: 0 0 .7em; }
.note-box.night { background: #E6E9F4; }
.rest-grid { display: grid; grid-template-columns: 40% 1fr; gap: 14px; align-items: center; text-align: left; }
.rest-grid .stats { margin-top: 0; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin: .6em 0; }
.ach { display: flex; gap: 10px; align-items: flex-start; background: var(--cream); border-radius: 10px; padding: 8px 10px; font-size: .88em; opacity: .55; }
.ach.got { opacity: 1; background: #FFF4D6; }
.ach b { display: block; font-family: var(--serif); color: var(--brand); }
.ach-icon { font-size: 1.5em; line-height: 1; color: var(--gold); }
/* Top left, under the energy bar, so it never covers the arrow circle in the bottom corners. */
.toast { position: absolute; left: 1.5cqw; top: 13%; z-index: 8; display: flex; gap: 10px; align-items: center;
  background: var(--brand); color: #fff; border-radius: 12px; padding: 10px 16px; box-shadow: 0 8px 30px rgba(0,0,0,.3); font-size: clamp(12px, 1.5cqw, 15px); max-width: min(90%, 340px); }
.toast[hidden] { display: none; }
.toast small { display: block; color: var(--gold); font-weight: 800; }
.toast b { display: block; font-family: var(--serif); font-size: 1.15em; }
.toast-icon { font-size: 2em; color: var(--gold); line-height: 1; }

/* Small screens (phones held sideways): fit everything without scrolling. */
.screen { padding-top: max(46px, 5.5cqw); }
@container (max-width: 760px) {
  .topbar { gap: 4px; }
  .icon-btn { width: 26px; height: 26px; font-size: 12px; }
  .icon-btn.pill { font-size: 11px; padding: 0 .7em; }
  .icon-btn.close-btn { width: 34px; height: 34px; font-size: 17px; margin-left: 2px; }
  .panel { font-size: 12px; padding: 12px 14px; }
  .pick-grid { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .pick { padding: 6px; }
  .pick img { width: 92%; }
  .pick .meta { display: none; }
  .food-grid { grid-template-columns: repeat(5, 1fr); gap: 5px; }
  .food-card img { width: 34px; height: 34px; }
  .next-card img { width: 18%; }
  .brief { grid-template-columns: 33% 1fr; }
  .rest-grid { grid-template-columns: 32% 1fr; }
  .ach-grid { grid-template-columns: repeat(2, 1fr); }
  .big-score { margin: 0; }
  .row { margin-top: .6em; }
  .btn { padding: .4em 1.1em; }
  .stats b { font-size: 1.15em; }
  .big-score { font-size: 1.8em; }
  h1 { font-size: 44px; }
  h2 { font-size: 18px; }
  .pick strong { font-size: .95em; }
  .pick .lock, .pick .best { font-size: .75em; line-height: 1.3; }
  .fact { padding: .5em .8em; margin: .5em 0; }
  .stats { margin: .3em 0; }
  .stats div { padding: .3em; }
}
@media (max-height: 500px) {
  #shell { padding: 0; }
  .foot { display: none; }
  #stage { width: min(100%, 100vh * 16 / 9); border-radius: 0; }
}

/* Installed as an app: the system handles full screen. */
html.app #btn-full { display: none; }
html.app #shell { padding: 0; }
html.app .foot { display: none; }
html.app #stage { width: min(100vw, 100vh * 16 / 9); border-radius: 0; }
#btn-full svg { width: 1.1em; height: 1.1em; }

.btn[hidden] { display: none; }

/* "Turn the game": the whole game turns a quarter turn to fill a portrait screen, and the player turns the phone
   to match. Handy when screen rotation is locked. */
.turn-back { display: none; }
body.turned { overflow: hidden; background: #000; }
body.turned .foot { display: none; }
body.turned .turn-back { display: inline-flex; }
body.turned #stage {
  position: fixed; top: 50%; left: 50%; width: min(100dvh, 100vw * 16 / 9); max-width: none; border-radius: 0;
  transform: translate(-50%, -50%) rotate(-90deg);
}
/* "Left" means the player turns the phone left (counterclockwise), so the game turns the other way to stay upright. */
body.turned.turned-left #stage { transform: translate(-50%, -50%) rotate(90deg); }
.icon-btn.turn-icon { display: none; }
body.turned .icon-btn.turn-icon { display: inline-flex; align-items: center; gap: 3px; background: var(--accent); color: #fff; }
.icon-btn .phone-ico { width: 1.3em; height: 1.3em; }
body.turned .rotate { display: none; }

/* Celebration */
.screen-party { overflow: hidden; }
.panel-party { position: relative; z-index: 1; text-align: center; }
.party-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 1em; align-items: center; text-align: left; margin: .6em 0; }
.party-map { box-shadow: inset 0 0 0 1px #C9BFA4; }
.party-route { stroke-dasharray: 1; stroke-dashoffset: 1; animation: party-draw 1.6s ease-in-out forwards; animation-delay: calc(var(--i) * .45s + .2s); }
.party-end { opacity: 0; animation: party-pop .4s ease-out forwards; animation-delay: calc(var(--i) * .45s + 1.6s); transform-box: fill-box; transform-origin: center; }
@keyframes party-draw { to { stroke-dashoffset: 0; } }
@keyframes party-pop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }
.party-legend { list-style: none; margin: 0 0 .6em; padding: 0; display: grid; gap: .35em; }
.party-legend li { display: flex; align-items: center; gap: .5em; line-height: 1.2; }
.party-legend .swatch { width: 1.4em; height: .35em; border-radius: 3px; flex: none; }
.party-legend img { width: 2em; height: 2em; flex: none; }
.party-legend b { display: block; }
.party-legend .stars { font-size: .9em; margin-left: .3em; }
.party-note { font-size: .92em; color: var(--muted); max-width: 40em; margin: .4em auto .8em; }
.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.confetti i { position: absolute; top: -8%; left: var(--x); width: 10px; height: 22px; background: var(--c); border-radius: 50% 50% 50% 50% / 80% 80% 20% 20%; opacity: .9;
  animation: party-fall var(--t) linear var(--d) infinite; transform: rotate(var(--r)); }
@keyframes party-fall { to { top: 108%; transform: rotate(calc(var(--r) + 540deg)) translateX(40px); } }
@container (max-width: 760px) { .party-grid { gap: .6em; margin: .3em 0; } .party-map { max-height: 16em; width: auto; max-width: 100%; margin: 0 auto; } .party-note { display: none; } .party-legend { gap: .15em; font-size: .9em; } .party-legend img { width: 1.6em; height: 1.6em; } .panel-party h2 { margin-bottom: .2em; } }
@media (prefers-reduced-motion: reduce) { .party-route { animation: none; stroke-dashoffset: 0; } .party-end { animation: none; opacity: 1; } .confetti { display: none; } }

/* High scores */
.hs-box { background: #FFF4D6; border: 2px solid var(--gold); border-radius: 12px; padding: .7em 1em; margin: .5em auto .8em; max-width: 32em; text-align: center; }
.hs-alert { font-family: var(--serif); font-weight: 700; color: var(--accent); font-size: 1.25em; margin: 0 0 .15em; }
.hs-big .hs-alert { font-size: 1.5em; animation: hs-pop .5s ease-out; }
@keyframes hs-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.hs-sub { margin: 0 0 .5em; font-size: .95em; }
.hs-form { display: flex; gap: .5em; justify-content: center; flex-wrap: wrap; }
.hs-name { font: 700 1em var(--sans); padding: .5em .8em; border: 2px solid var(--brand); border-radius: 999px; width: 13em; max-width: 100%; background: #fff; color: var(--ink); }
.hs-name:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.hs-msg { margin: .4em 0 0; font-size: .9em; color: var(--accent); min-height: 0; }
.hs-msg:empty { display: none; }
.hs-tabs { display: flex; flex-wrap: wrap; gap: .4em; justify-content: center; margin: .2em 0 .4em; }
.hs-tab { display: inline-flex; align-items: center; gap: .35em; border: 2px solid var(--line); background: #fff; color: var(--brand); border-radius: 999px; padding: .25em .8em .25em .3em; font: 800 .9em var(--sans); cursor: pointer; }
.hs-tab img { width: 1.8em; height: 1.8em; }
.hs-tab .hs-all { width: 1.8em; text-align: center; color: var(--gold); font-size: 1.2em; }
.hs-tab.on { border-color: var(--brand); background: var(--brand); color: #fff; }
.hs-note { text-align: center; margin: 0 0 .5em; }
.hs-list { max-width: 40em; margin: 0 auto; }
.hs-rows { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 1.2em; }
.hs-rows li { display: flex; gap: .6em; align-items: baseline; padding: .25em .5em; border-bottom: 1px solid var(--line); break-inside: avoid; }
.hs-rank { width: 2.2em; text-align: right; color: var(--muted); font-weight: 800; flex: none; }
.hs-who { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-pts { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--brand); }
.hs-rows li.top1 .hs-rank, .hs-rows li.top2 .hs-rank, .hs-rows li.top3 .hs-rank { color: var(--accent); }
.hs-rows li.top1 .hs-rank::before { content: "\2605 "; color: var(--gold); }
.hs-rows li.me { background: #FFF4D6; border-radius: 6px; }
.hs-empty { text-align: center; color: var(--muted); }
.hs-head { display: flex; justify-content: space-between; align-items: center; gap: 1em; }
.hs-head h2 { margin: 0; }
@container (max-width: 760px) { .hs-tab { font-size: .8em; } }
@container (max-width: 480px) { .hs-rows { columns: 1; } }

/* Leg quests */
.quest-line { margin: .6em 0; padding: .5em .8em; border-radius: 10px; background: #EEE8F6; color: #4A3672; font-weight: 800; font-size: .92rem; }
.quest-line.done { background: #E3F1E6; color: #2F7D4F; }
.quest-line:empty { display: none; }

/* End of a trip: the main buttons sit right under the score, big and easy to spot. */
.end-actions { margin: .5em 0 .8em; }
.end-actions .btn { font-size: 1.08em; }
.end-actions .btn-primary { padding-left: 1.6em; padding-right: 1.6em; }
.score-label { margin: .2em 0 0; font-size: .8em; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* Bird intro: compact, so it fits a phone held sideways without scrolling. */
.brief-text h2 { margin-bottom: .1em; }
.brief-sum { margin-bottom: .4em; }
.brief-actions { justify-content: flex-start; margin: .1em 0 .45em; }
.brief-head { margin: 0 0 .2em; }
.brief .route { margin-bottom: .4em; }
.brief .route .tiny { margin: 0; }
#brief { font-size: clamp(12px, 1.55cqw, 16px); }
.brief-map .chips { margin-top: .6em; align-items: center; }
.chips-label { margin-right: 2px; }
.brief .chips { gap: 4px; }
.brief .chip { font-size: .82em; padding: 1px 8px 1px 3px; }
.brief .map-key { font-size: .78em; gap: 2px 8px; }
.brief-sum .tiny { margin: 0; white-space: nowrap; }
.brief .route li { padding: 1px 0 1px 1.8em; }
.brief .route li::before { top: 2px; }
.brief .chips { margin-bottom: .5em; }
.brief .note-box { margin-bottom: .35em; padding: .3em .65em; line-height: 1.3; }
.brief .tiny { margin-top: .3em; }
.brief .route { font-size: .92em; line-height: 1.25; }
.brief .route li { padding: 2px 0 2px 1.7em; }
.brief-more { grid-column: 1 / -1; border-top: 1px solid #E5E0D3; padding-top: .8em; margin-top: .2em; }
.brief-more h3 { margin-bottom: .3em; }
.brief-more h4 { margin: 0 0 .3em; font-size: .95em; color: var(--brand); }
.brief-more p { margin: 0 0 .5em; }
.map-key > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.map-key b { color: var(--brand); }
/* A big "More" arrow that stays in the bottom-right corner until the extra details scroll into view. */
.more-fab-wrap { grid-column: 1 / -1; position: sticky; bottom: 0; height: 0; z-index: 2; }
.more-fab { position: absolute; right: 0; bottom: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  width: 64px; height: 64px; border: 0; border-radius: 50%; background: var(--brand); color: #fff; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3); font: 800 12px var(--sans); }
.more-arrow { font-size: 28px; line-height: 1; animation: more-bob 1.3s ease-in-out infinite; }
.more-word { margin-top: -2px; }
@keyframes more-bob { 50% { transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .more-arrow { animation: none; } }
.brief .note-box { margin-right: 72px; }
.more-fab-wrap.gone { display: none; }
.credits { margin: .6em auto 0; padding: .35em 1.1em; max-width: 30em; border-radius: 14px; background: linear-gradient(135deg, #FFF4D6, #FDE8EC); box-shadow: inset 0 0 0 1.5px rgba(232,176,74,.45); }
.credits p { margin: 0; }
.credits .dedication { font-family: var(--serif); font-style: italic; font-size: 1.05em; color: var(--brand); }
.credits .designer { font-size: .85em; color: var(--muted); margin-top: .1em; }
.credits .heart { display: inline-block; font-style: normal; animation: heartbeat 1.6s ease-in-out infinite; }
.credits .twinkle { display: inline-block; font-style: normal; animation: twinkle 2.2s ease-in-out infinite; }
@keyframes heartbeat { 0%, 60%, 100% { transform: scale(1); } 15% { transform: scale(1.22); } 30% { transform: scale(1); } 45% { transform: scale(1.14); } }
@keyframes twinkle { 0%, 100% { transform: rotate(0) scale(1); filter: drop-shadow(0 0 0 rgba(242,194,48,0)); } 50% { transform: rotate(18deg) scale(1.2); filter: drop-shadow(0 0 6px rgba(242,194,48,.9)); } }
@media (prefers-reduced-motion: reduce) { .credits .heart, .credits .twinkle { animation: none; } }
.party-credits { margin: .8em auto 0; }
.panel-title .home-link { margin-top: .6em; }
.howto-credits { margin-top: 1em; text-align: center; }
/* Short screens (phones held sideways): a little tighter so the full credits fit without scrolling. */
@media (max-height: 460px) {
  .panel-title h1 { margin-bottom: .2em; }
  .panel-title .lede { margin-bottom: .8em; }
  .panel-title .home-link { margin-top: .45em; }
  .panel-title .credits { margin-top: .5em; }
}

/* Challenge a friend */
.panel-small.challenge-card { width: min(100%, 420px); }
.challenge-bird { width: 84px; height: 84px; display: block; margin: 0 auto .3em; }
.challenge-card h2 { font-size: 1.25em; line-height: 1.25; }
.challenge-score { color: var(--accent); white-space: nowrap; }
.challenge-line { color: var(--accent); font-weight: 800; margin: .3em 0; }
.challenge-win { display: inline-block; background: #2F7D4F; color: #fff; font-weight: 800; padding: .35em 1em; border-radius: 999px; margin: .3em 0; }
.challenge-note { display: table; font-size: .82em; line-height: 1.35; background: #FFF4D6; border: 2px dashed var(--gold); border-radius: 999px; padding: .2em .5em .2em .9em; margin: .2em auto .5em; }
.link-btn.drop { text-decoration: none; color: var(--muted); margin-left: .3em; }
.link-btn { background: none; border: 0; padding: 0 .2em; font: inherit; font-weight: 800; color: var(--accent); text-decoration: underline; cursor: pointer; }
.share-box { margin: .6em 0; }
.share-form { background: #FFF4D6; border: 2px solid var(--gold); border-radius: 14px; padding: .6em .8em; max-width: 28em; margin: 0 auto; }
.share-head { font-weight: 800; margin: 0 0 .4em; }
.share-row { display: flex; gap: .5em; justify-content: center; flex-wrap: wrap; }
.share-msg { margin: .4em 0 0; font-weight: 700; }
.share-url { width: 100%; margin-top: .3em; font: 600 .95em var(--sans); padding: .4em .6em; border: 2px solid var(--brand); border-radius: 10px; }
.challenge-note[hidden] { display: none; }
/* Turned game on a portrait phone: the bar is short, so drop Foods (it's in the pause menu) and full screen
   (turning already uses full screen), which keeps the Upright button clear of the route bar. */
body.turned #btn-foods, body.turned #btn-full { display: none; }
@media (max-width: 360px) { body.turned .turn-word { display: none; } } /* smallest phones: phone icon only */
.boss-card { max-width: 34em; margin-left: auto !important; margin-right: auto !important; background: #EEE8F7; border: 2px solid #6B4FA0; border-radius: 12px; padding: .5em .8em; margin: .5em 0; text-align: left; }
.boss-card b { display: block; color: #6B4FA0; }

/* Get-ready card at the start of each leg (the game waits until Fly) */
.panel-small.ready-card { width: min(100%, 460px); }
.ready-card h2 { margin: .1em 0 .2em; }
.ready-sub { margin: 0 0 .5em; }
.ready-notes { list-style: none; padding: 0; margin: 0 0 .7em; text-align: left; display: grid; gap: .4em; }
.ready-notes li { border-radius: 10px; padding: .4em .7em; font-size: .92em; line-height: 1.35; }
.ready-quest { background: #EEE8F7; }
.ready-quest b { color: #6B4FA0; }
.ready-gold { background: #FFF4D6; }
.ready-gold b { color: #8A6508; }
.ready-boss { background: #E8EAF2; }
.ready-boss b { color: #343A4E; }
@media (max-height: 460px) { .ready-card h2 { font-size: 1.3em; } .ready-notes li { font-size: .85em; padding: .3em .6em; } }
/* Ran out over the Gulf: retry choices */
.gulf-retry { background: #FFF4D6; border: 2px solid var(--gold); border-radius: 14px; padding: .6em .8em; margin: .5em auto; max-width: 40em; }
.gulf-retry > p { margin: 0 0 .5em; font-weight: 700; }
.gulf-retry .end-actions + .end-actions { margin-top: .5em; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn-gold:hover, .btn-gold:focus-visible { background: #F2C46A; }
/* Installed app: no links back to the website (closing closes the app) */
body.app-mode .site-link, body.app-mode .foot { display: none !important; }
