/* skin.css (22 Nov 2026, owner items 6, 7, 9, 10, 11, 13, 14): one shared look for the menu screens and their popups.
   Loaded last, so it wins over the older screen styles.

   SHARED STYLE (Settings and Market use it; Profile and Home already look like this):
     --fb-bg            the sky backdrop of Profile / Home
     --fb-panel         a navy panel (the Profile card)          --fb-panel-edge, --fb-panel-shadow
     --fb-tile          a dark row / tile inside a panel          --fb-tile-edge
     --fb-dim           small light-blue text on a panel
     .fb-screen         a screen root with the sky backdrop
     .fb-panel          a navy panel; .fb-panel-title its title (white, black outline, left)
     .fb-tile           a dark row or tile inside a panel
     .fb-bar / .fb-bar > i   a progress bar: a visible track (also at 0) and a fill with round ends and a minimum width */
:root {
  --fb-bg: url("assets/bg_sky.33054a52.webp") center / cover, linear-gradient(#5ec3ff, #2f9be9);
  --fb-panel: linear-gradient(#22346c, #131c42);
  --fb-panel-edge: #14161f;
  --fb-panel-shadow: 0 6px 0 #0006;
  --fb-tile: #ffffff12;
  --fb-tile-edge: #0b1636;
  --fb-dim: #a9bbe8;
  --fb-track: #070d26;
  --fb-track-rim: #3a4f8f;
}
.fb-screen { background: var(--fb-bg) !important; }
.fb-panel { background: var(--fb-panel) !important; border: 4px solid var(--fb-panel-edge) !important; border-radius: 20px; box-shadow: var(--fb-panel-shadow) !important; color: #fff; }
.fb-panel-title { margin: 0; font-weight: 700; font-size: var(--f48); color: #fff; -webkit-text-stroke: calc(var(--m) * var(--ow, 5.5) * 2) var(--oc); paint-order: stroke fill; text-align: left; --ow: 6; }
.fb-tile { background: var(--fb-tile) !important; border: 3px solid var(--fb-tile-edge) !important; border-radius: 14px; box-shadow: none !important; }

/* ---- progress bars (owner items 9 and 14): the empty track shows at 0; a fill has the track's full inner height,
   round ends and a minimum width, so 1/50 is a small round fill and not a square stub. A 0% fill is not drawn. ---- */
.g-prog, .fb-bar { background: var(--fb-track); box-shadow: inset 0 0 0 2px var(--fb-track-rim); border-radius: 999px; }
.g-prog i, .fb-bar > i { top: 0 !important; bottom: 0 !important; left: 0 !important; height: auto; border-radius: 999px; min-width: 12px; max-width: 100%; box-shadow: inset 0 2px 0 #ffffff66; }
.g-prog i[style*="width: 0%"], .g-prog i[style*="width:0%"], .g-prog i.zero, .fb-bar > i.zero { display: none; }
.fb-bar { position: relative; height: 16px; border: 3px solid var(--ink); overflow: hidden; }
.fb-bar > i { position: absolute; background: linear-gradient(#ffe680, #ffb21c); }
.fb-bar.green > i { background: linear-gradient(#8ef05a, #2f9a1f); }
/* the race result's mastery bar (res_fill) */
.fres-fill { border-radius: 999px; min-width: calc(var(--m) * 40); }
.fres-fill.zero { display: none; }

/* ---- Settings (item 7): (24 Nov 2026, Basil) back to the Figma "Hamburger" frame (fig.css #s-settings), no shared look here ---- */

/* ---- Profile (item 6): RECORDS in two labelled rows, each tile with a small icon; a medal on a board you lead ---- */
.pr-records { gap: 8px; }
.pr-row { display: flex; flex-direction: column; gap: 4px; }
.pr-lab { font-weight: 700; font-size: var(--f40); color: var(--fb-dim); -webkit-text-stroke: 0; text-align: left; letter-spacing: .04em; padding-left: 2px; --ow: 5.5; }
.pr-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pr-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px 5px; background: var(--fb-tile); border: 3px solid var(--fb-tile-edge); border-radius: 14px; min-width: 0; }
.pr-tile b { font-weight: 700; font-size: var(--f48); line-height: 1.05; color: #ffe066; -webkit-text-stroke: calc(var(--m) * var(--ow, 5.5) * 2) var(--oc); paint-order: stroke fill; --ow: 6; }
.pr-tile small { font: 700 var(--f32)/1.1 var(--font-ui); color: var(--fb-dim); letter-spacing: .03em; white-space: nowrap; overflow: hidden; max-width: 100%; --ow: 4.5; }
.pr-ico { display: grid; place-items: center; height: 24px; }
.pr-ico img { height: 22px; width: auto; }
.pr-ico canvas { image-rendering: pixelated; width: 30px !important; height: auto !important; }
.pr-tile.lead { border-color: #ffd23a; box-shadow: 0 0 0 2px var(--ink); padding-top: 13px; }
.pr-medal { position: absolute; top: -9px; right: -7px; display: flex; align-items: center; gap: 1px; padding: 1px 5px 1px 1px; border-radius: 999px; background: #e89400; border: 2px solid var(--ink); }
.pr-medal img { width: 16px; height: 16px; }
.pr-medal em { font: 700 var(--f24)/1 var(--font-ui); font-style: normal; color: #fff; white-space: nowrap; --ow: 4; }

/* ---- the profile editor (item 6) ---- */
.card.pe-card .body { align-items: stretch; gap: 6px; }
.pe-lab { font: 700 var(--f36) var(--font-ui)!important; color: var(--fb-dim) !important; letter-spacing: .08em; text-align: left; margin: 2px 0 0 !important; --ow: 5.2; }
.pe-card .acct-in { margin: 0 0 4px; }
.pe-birds { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.pe-bird { display: grid; place-items: center; height: 52px; padding: 0; border-radius: 14px; border: 3px solid var(--fb-tile-edge); background: radial-gradient(circle, #cfe9ff, #7cc4ff); cursor: pointer; }
.pe-bird canvas { image-rendering: pixelated; width: 40px !important; height: auto !important; }
.pe-bird.on { border-color: #ffd23a; box-shadow: 0 0 0 3px var(--ink), 0 0 0 6px #ffd23a; }
.pe-card .card-actions, .pe-card .g-row { margin-top: 6px; }

/* ---- help popups (items 11 and 13): short sections, one icon each, no scroll bar, fit one phone screen ---- */
.card.help-card { overflow: hidden auto; scrollbar-width: none; max-height: 94dvh; }
.card.help-card::-webkit-scrollbar { display: none; width: 0; height: 0; }
.card.help-card .body { gap: 8px; padding-top: 10px; }
.htp-list { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.htp-sec { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; align-items: center; text-align: left; padding: 7px 10px 7px 7px; border-radius: 14px; background: #ffffffb3; border: 3px solid #9ccff2; }
.htp-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: radial-gradient(circle, #ffffff, #bfe6ff); }
.htp-ico img, .htp-ico canvas { max-width: 42px; max-height: 42px; image-rendering: pixelated; }
.htp-sec h4 { margin: 0 0 1px; font: 700 var(--f40)/1.1 var(--font); color: #1e3a78; letter-spacing: .02em; --ow: 5.5; }
.htp-sec p { margin: 0 !important; font: 700 var(--f40)/1.28 var(--font-ui)!important; color: #2b3150 !important; --ow: 5.5; }
.htp-help { margin: 0 !important; font: 700 var(--f40)/1.3 var(--font-ui)!important; color: #2b3150 !important; text-align: center; --ow: 5.5; }

/* ---- the Rescue log (item 11): a list, newest first ---- */
.rl-list { display: flex; flex-direction: column; gap: 6px; width: 100%; max-height: min(46dvh, 340px); overflow: hidden auto; scrollbar-width: none; }
.rl-list::-webkit-scrollbar { display: none; }
.rl-row { flex: none; display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 4px 10px 4px 4px; border-radius: 14px; background: #ffffffb3; border: 3px solid #9ccff2; text-align: left; }
.rl-bird { display: grid; place-items: center; width: 54px; height: 44px; }
.rl-bird canvas { image-rendering: pixelated; max-width: 54px; max-height: 44px; }
.rl-txt { min-width: 0; }
.rl-txt b { display: block; font: 700 var(--f40)/1.1 var(--font); color: #1e3a78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; --ow: 5.5; }
.rl-txt small { display: block; font: 700 var(--f36)/1.2 var(--font-ui); color: #4a5a7a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; --ow: 5.2; }
.rl-tag { display: inline-flex; align-items: center; gap: 3px; padding: 3px 9px; border-radius: 999px; border: 2px solid var(--ink); font: 700 var(--f36)/1 var(--font); color: #fff; -webkit-text-stroke: calc(var(--m) * var(--ow, 5.5) * 2) var(--oc); paint-order: stroke fill; white-space: nowrap; --ow: 5.2; }
.rl-tag.new { background: #2f9a1f; }
.rl-tag.coins { background: #e89400; }
.rl-tag img { width: 14px; height: 14px; -webkit-text-stroke: 0; }

/* ---- Mastery (item 14) ---- */
.mastery-card .mc-head { margin: 0 !important; font: 700 var(--f48)/1.2 var(--font)!important; color: #fff !important; -webkit-text-stroke: calc(var(--m) * var(--ow, 5.5) * 2) var(--oc); paint-order: stroke fill; text-align: center; --ow: 6; }
.mastery-card .mg-row .ttl.mg-goal { font-size: var(--f40); --ow: 5.5; }
.mastery-card .mg-row .mg-bar { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.mastery-card .mg-row .mg-bar .fb-bar { flex: 1; height: 16px; margin: 0; }
.mastery-card .mg-row .mg-count { flex: none; font: 700 var(--f40)/1 var(--font); color: #fff; -webkit-text-stroke: calc(var(--m) * var(--ow, 5.5) * 2) var(--oc); paint-order: stroke fill; min-width: 54px; text-align: right; --ow: 5.5; }
.mastery-card .mg-reward small { font: 700 var(--f32)/1.1 var(--font-ui); --ow: 4.5; }
.mastery-card .mg-row.ready { border-color: #ffd23a; }

/* ---- the result screens' mastery line (item 14): "<Bird>: 34/100 pipes" and GOAL DONE! ---- */
.ml-line { display: inline-flex; align-items: center; justify-content: center; gap: 8px; max-width: 100%; box-sizing: border-box; padding: 4px 12px; border-radius: 999px; background: #0b2350e6; border: 3px solid var(--ink); color: #fff; font: 700 var(--f40)/1.1 var(--font); -webkit-text-stroke: calc(var(--m) * var(--ow, 5.5) * 2) var(--oc); paint-order: stroke fill; white-space: nowrap; --ow: 5.5; }
.ml-line canvas { image-rendering: pixelated; width: 28px !important; height: auto !important; flex: none; }
.ml-line.done { background: linear-gradient(#ffe066, #f7a400); color: #fff; cursor: pointer; animation: mlPop .5s cubic-bezier(.2, 1.6, .4, 1) both, mlGlow 1.6s ease-in-out .5s infinite; }
.ml-line.done em { font-style: normal; font-size: var(--f36); padding: 2px 8px; border-radius: 999px; background: #2f9a1f; border: 2px solid var(--ink); --ow: 5.2; }
@keyframes mlPop { from { transform: scale(.4); opacity: 0; } }
@keyframes mlGlow { 50% { box-shadow: 0 0 0 4px #ffe06699; } }
.go-card .ml-line { align-self: center; margin: 2px auto 0; }
.go-ml { display: flex; justify-content: center; }
.fres-ml { display: flex; align-items: center; justify-content: center; }
.fres-ml .ml-line { font-size: var(--f40); -webkit-text-stroke-width: calc(var(--m) * var(--ow, 5.5) * 2); padding: calc(var(--m) * 8) calc(var(--m) * 28); border-width: calc(var(--m) * 6); gap: calc(var(--m) * 16); --ow: 5.5; }
.fres-ml .ml-line canvas { width: calc(var(--m) * 64) !important; }
.fres-ml .ml-line.done em { font-size: var(--f32); padding: calc(var(--m) * 4) calc(var(--m) * 16); --ow: 4.5; }
body:has(.go-layer) #modal:not([hidden]) { z-index: 90; }   /* a card opened from the GAME OVER sheet (the MASTERY popup) sits over it */
/* the GAME OVER card is laid out in its own unit (--u = CSS px per mock px) */
.go-ml { margin-top: calc(var(--u) * 18); max-width: calc(var(--u) * 790); }
.go-ml .ml-line { font: 700 calc(var(--u) * 31.25)/1.1 var(--font-ui, sans-serif); -webkit-text-stroke: calc(var(--u) * var(--ow, 5.5) * 2.56) var(--oc); gap: calc(var(--u) * 14);
  padding: calc(var(--u) * 10) calc(var(--u) * 26); border-width: calc(var(--u) * 5); max-width: 100%; --ow: 5.5; }
.go-ml .ml-line span { overflow: hidden; text-overflow: ellipsis; }
.go-ml .ml-line.done em { font-size: calc(var(--u) * 25); padding: calc(var(--u) * 4) calc(var(--u) * 14); border-width: calc(var(--u) * 4); -webkit-text-stroke: calc(var(--u) * var(--ow, 5.5) * 2.56) var(--oc); --ow: 4.5; }
.go-card > .go-ml + .go-btns { margin-top: calc(var(--u) * 40); }
/* the race result's mastery card: the header says what moved; GOAL DONE! is gold and the card is one big button */
.fres-mlt.done { color: #ffe066; animation: mlBeat 1.2s ease-in-out .9s infinite; }
@keyframes mlBeat { 50% { transform: scale(1.06); } }
.fres-mlbtn { padding: 0; margin: 0; border: 0; background: transparent; cursor: pointer; border-radius: calc(var(--m) * 30); box-shadow: 0 0 0 calc(var(--m) * 10) #ffd23a; animation: mlRing 1.2s ease-in-out .9s infinite; }
.fres-mlbtn:focus-visible { outline: calc(var(--m) * 8) solid #fff; outline-offset: calc(var(--m) * 6); }
@keyframes mlRing { 50% { box-shadow: 0 0 0 calc(var(--m) * 18) #ffd23aaa; } }
/* (owner items 11 and 13: the grey bar under a popup) every light card's title band reaches 2 px past each side
   (fig.css: margin -2px), which made the card 2 px too wide: a horizontal scroll bar where scroll bars always show */
.card { overflow-x: hidden; }
/* Profile on a wide screen (the column is ~420 px): each row's label sits left of its tiles, so COLLECTION shows whole */
@media (min-width: 600px) {
  .pr-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 6px; }
  .pr-tile { padding: 4px 2px 4px; }
  .pr-tile.lead { padding-top: 11px; }
}
