/* /flappy-bird/ — Flappy Bird (port of the Pocket Games "wind gardens" flight).
   Page frame, headline, rank rows and the more-games row come from games.css.
   The board (canvas + HUD + bird collection) keeps the app's own colours. Shared by all locales. */

@media (max-width: 640px) {
  .fb-h1 { font-size: var(--step-2); }
  .fb-h1-sub { display: none; }
}
.fb-lb-cta { display: flex; justify-content: center; }

/* ── Board ─────────────────────────────────────────────────────────── */
.fb-stage {
  --fb-ink: #315b53; --fb-panel: #fff9e9ed; --fb-accent: #1593a2;
  position: relative;
  inline-size: min(100%, 645px);
  block-size: min(calc((100vw - 2 * var(--gutter, 16px)) * 4 / 3), 78vh, 820px);
  min-block-size: 360px;
  margin-inline: auto;
  overflow: hidden;
  border-radius: var(--radius-lg, 16px);
  background: #94dcd2;
  box-shadow: 0 10px 30px rgb(0 0 0 / .25);
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  cursor: pointer;
  font-family: "Nunito Variable", Nunito, var(--font-body), system-ui, sans-serif;
}
.fb-stage canvas { position: absolute; inset: 0; display: block; inline-size: 100%; block-size: 100%; }

/* HUD: score left, world centre, best + bird collection right (Game.tsx .flappy-hud) */
.fb-hud {
  position: absolute; z-index: 3; inset: 0 0 auto;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 10px 12px; pointer-events: none;
}
.fb-hud button { pointer-events: auto; }
.fb-hud-end { display: flex; gap: 8px; align-items: flex-start; }
.fb-score, .fb-best { display: grid; padding: 3px 8px; border-radius: 10px; background: var(--fb-panel); color: var(--fb-ink); text-align: center; }
.fb-score span, .fb-best span { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.fb-score strong { font-size: 36px; line-height: 1.1; font-weight: 900; }
.fb-best strong { font-size: 24px; line-height: 1.4; font-weight: 900; }
.fb-world { position: absolute; inset-inline: 64px; top: 78px; display: grid; justify-items: center; gap: 2px; text-align: center; color: var(--fb-ink); }
.fb-world strong, .fb-world span { padding: 2px 7px; background: var(--fb-panel); border-radius: 6px; }
.fb-world strong { font-size: 12px; font-weight: 900; }
.fb-world span { font-size: 10px; font-weight: 800; }
.fb-birds-toggle {
  display: flex; align-items: center; gap: 3px; min-block-size: 44px; padding: 1px 8px 1px 2px;
  border: 2px solid #fff; border-radius: 14px; background: #fff7dfed; color: #6d542f;
  box-shadow: 0 3px 0 #bb93445a; font: inherit; cursor: pointer;
}
.fb-birds-toggle[hidden] { display: none; }
.fb-birds-toggle img { inline-size: 37px; block-size: 37px; object-fit: contain; }
.fb-birds-toggle span { display: grid; font-size: 9px; font-weight: 800; text-align: start; }
.fb-birds-toggle b { font-size: 11px; }
.fb-birds-toggle:focus-visible, .fb-skins button:focus-visible, .fb-ready:focus-visible, .fb-go:focus-visible { outline: 3px solid var(--fb-accent); outline-offset: 2px; }

/* Praise banner (kit.praise) */
.fb-praise {
  position: absolute; z-index: 4; inset-inline: 0; top: 34%; margin-inline: auto; inline-size: max-content; max-inline-size: 86%;
  display: grid; justify-items: center; gap: 2px; padding: 8px 18px; border-radius: 16px;
  background: #fff9e9f2; color: #315b53; box-shadow: 0 6px 0 #bb934433, 0 12px 26px #2b1e3f26;
  opacity: 0; transform: translateY(8px) scale(.9); pointer-events: none;
}
.fb-praise b { font-size: 22px; font-weight: 900; }
.fb-praise small { font-size: 13px; font-weight: 800; color: #8d7047; }
.fb-praise.is-on { animation: fb-praise 1.5s ease both; }
@keyframes fb-praise {
  0% { opacity: 0; transform: translateY(8px) scale(.9); }
  12% { opacity: 1; transform: translateY(0) scale(1.04); }
  22%, 80% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-10px) scale(.98); }
}

/* Bird collection (the milestone flyers; Game.tsx .flappy-wardrobe) */
.fb-wardrobe {
  position: absolute; z-index: 5; inset: 70px 12px 12px; max-inline-size: 620px; margin-inline: auto;
  overflow: auto; padding: 20px 16px 0; border: 3px solid #fff; border-radius: 25px;
  background: linear-gradient(145deg, #fffdf4, #ffefd4); color: #745329; box-shadow: 0 16px 40px #66451533;
  cursor: default; scrollbar-width: thin;
}
.fb-wardrobe[hidden] { display: none; }
.fb-wardrobe h3 { margin: 0 0 8px; font-size: 21px; font-weight: 900; color: #745329; }
.fb-wardrobe p { margin: 0 0 12px; color: #67553b; font-size: 12px; line-height: 1.5; }
.fb-skin-goal { font-weight: 800; }
.fb-skin-goal progress { display: block; block-size: 5px; inline-size: 100%; margin-top: 7px; accent-color: #edb342; }
.fb-skins { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fb-skins button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-inline-size: 0; min-block-size: 132px; padding: 8px 5px;
  border: 2px solid #efe0bd; border-radius: 13px; background: linear-gradient(#fffbef, #fbe9c5); color: #5d472b;
  box-shadow: inset 0 1px 0 #fff, 0 3px 0 #d8b97844; font: inherit; cursor: pointer; transition: transform .16s, box-shadow .16s;
}
.fb-skins button:disabled { background: #eee7d7; border-color: #c8bfa9; cursor: not-allowed; }
.fb-skins button:disabled img { filter: grayscale(.85) brightness(.9); opacity: .6; }
.fb-skins button:not(:disabled):active { transform: translateY(2px); box-shadow: none; }
.fb-skins button.selected { border-color: var(--fb-accent); background: linear-gradient(#e5faf4, #c9f0e4); color: #226c70; box-shadow: 0 3px 0 #1593a244; }
.fb-skins img { inline-size: 100%; max-inline-size: 96px; block-size: 60px; object-fit: contain; }
.fb-skins strong { font-size: 12px; line-height: 1.2; font-weight: 900; overflow-wrap: anywhere; text-align: center; }
.fb-skins small { font-size: 10px; line-height: 1.25; }
.fb-skins span { min-block-size: 16px; font-size: 11px; font-weight: 800; }
.fb-wardrobe footer { position: sticky; bottom: 0; margin: 12px -4px 0; padding: 4px 4px 14px; background: linear-gradient(#fff1dc, #ffefd4); box-shadow: 0 -8px 14px #fff1dcd9; }
.fb-cosmetic-note { display: block; margin: 6px 0 10px; font-size: 10px; line-height: 1.4; color: #67553b; }
.fb-ready, .fb-go {
  display: block; inline-size: 100%; min-block-size: 46px; padding: 10px 18px; border: 2px solid #fff; border-radius: 16px;
  background: var(--fb-accent); color: #fff; font: inherit; font-size: 16px; font-weight: 900; cursor: pointer;
  box-shadow: 0 4px 0 #0e6b76;
}
.fb-ready:active, .fb-go:active { transform: translateY(2px); box-shadow: 0 2px 0 #0e6b76; }
@media (min-width: 480px) { .fb-skins { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-height: 600px) { .fb-wardrobe-intro, .fb-cosmetic-note { display: none; } .fb-skins img { block-size: 40px; } .fb-skins button { min-block-size: 104px; } }

/* Standalone result / pause card (the play layer shows its own sheets) */
.fb-overlay {
  position: absolute; z-index: 6; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px;
  padding: 20px; text-align: center; background: linear-gradient(#d5f6f3c0, #fff4dde0); color: #594527; cursor: default;
}
.fb-overlay[hidden] { display: none; }
.fb-overlay h2 { margin: 0; font-size: clamp(26px, 6vw, 34px); font-weight: 900; color: #315b53; }
.fb-overlay p { margin: 0; font-size: 16px; font-weight: 700; color: #8d7047; }
.fb-overlay p b { color: #315b53; font-size: 20px; }
.fb-overlay .fb-go { inline-size: auto; min-inline-size: 200px; margin-top: 6px; }
.play-layer .fb-overlay { display: none !important; }

.fb-shake { animation: fb-shake .32s ease; }
@keyframes fb-shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 3px); } 40% { transform: translate(5px, -3px); }
  60% { transform: translate(-3px, 2px); } 80% { transform: translate(2px, -1px); }
}

/* ── Play layer (assets/play/play.mjs): only the board, filling the slot ── */
html.play-open .fb-play > :not(#fb-stage) { display: none; }
.play-slot .fb-play { inline-size: 100%; }
.play-slot .fb-stage { inline-size: 100%; max-inline-size: none; block-size: var(--fb-h, 70vh); min-block-size: 0; border-radius: 18px; }
html.play-open .fb-play .cps-announce { display: none; }

@media (prefers-reduced-motion: reduce) {
  .fb-praise.is-on { animation: none; opacity: 1; transform: none; }
  .fb-shake { animation: none; }
  .fb-skins button { transition: none; }
  .fb-skins button:not(:disabled):active, .fb-ready:active, .fb-go:active { transform: none; }
}

/* ── /flappy-bird-leaderboard/: Season 2 / Classic switch ── */
.fbl-seasons { margin-block-end: var(--space-3, 12px); }
.fbl-panel[hidden] { display: none; }
.fbl-note { margin: 0 auto var(--space-3, 12px); max-inline-size: 60ch; text-align: center; color: var(--text-muted); font-size: var(--step--1, .9rem); }
.fbl-classic-tabs { margin-block-end: var(--space-3, 12px); }
.fbl-diff { margin-inline-start: .25em; font-weight: 700; }
.fb-stage .fb-score strong, .fb-stage .fb-best strong, .fb-stage .fb-world strong, .fb-stage .fb-world span { color: var(--fb-ink); }
.fb-stage .fb-birds-toggle b, .fb-stage .fb-birds-toggle span { color: #6d542f; }
.fb-stage .fb-praise b { color: #315b53; }
.fb-stage .fb-overlay h2 { text-transform: none; letter-spacing: 0; font-family: inherit; }
.fb-stage .fb-skins strong { color: inherit; }
.fbl-seasons, .fbl-classic-tabs { flex-wrap: wrap; justify-content: center; }
