/*==================================================
    Fruit Blast
    A painted backdrop (scene.js) sits behind two
    screens, the map and the board. The UI is plum
    panels with gold rims, glossy buttons and cream
    parchment dialogs with ribbon titles.
==================================================*/

:root {
    --plum-1: #6a2a94;
    --plum-2: #3c1259;
    --plum-3: #24082f;
    --gold-1: #fff0b0;
    --gold-2: #f0b840;
    --gold-3: #a8621a;
    --rim-dark: #5a2e08;
    --cream-1: #fff9ec;
    --cream-2: #fbe6c8;
    --ink: #4a1d3f;
    --pink: #ff4f86;
    --display: "Lilita One", "Fredoka", system-ui, sans-serif;
    color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
    font-family: "Nunito", system-ui, sans-serif;
    font-weight: 800;
    color: #fff;
    background: #2a1040;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

button { font: inherit; cursor: pointer; color: inherit; }
button:disabled { cursor: default; }
img { -webkit-user-drag: none; }

.fb-backdrop {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.fb-screen {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
}
.fb-screen[hidden] { display: none; }

/* An outline for white display text. */
.fb-outline, .fb-logo, .fb-node, .fb-sign b, .fb-ribbon span, .fb-play-next, .fb-btn.primary, .fb-btn.gold, .fb-btn.blue, .fb-btn.red, .fb-score strong, .fb-tool span, .fb-dock-btn span, .fb-counter, .fb-chest-track em, .fb-tool-hint {
    --ol: #3a0d2e;
    text-shadow:
        2px 0 var(--ol), -2px 0 var(--ol), 0 2px var(--ol), 0 -2px var(--ol),
        1.4px 1.4px var(--ol), -1.4px 1.4px var(--ol), 1.4px -1.4px var(--ol), -1.4px -1.4px var(--ol),
        0 3px 0 var(--ol);
}

.fb-glyph {
    display: block;
    background: center / contain no-repeat;
}

/* ---------- glossy round buttons ---------- */

.fb-icon-btn {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px; height: 44px;
    flex: none;
    border: 0;
    border-radius: 50%;
    padding: 0;
    background: radial-gradient(circle at 50% 28%, #c58cff, #7a36c4 55%, #44137a);
    box-shadow:
        0 0 0 3px var(--gold-2), 0 0 0 5px var(--rim-dark),
        0 4px 0 5px #33180a, 0 8px 12px 5px rgba(0, 0, 0, .3),
        inset 0 -4px 0 rgba(0, 0, 0, .25), inset 0 3px 0 rgba(255, 255, 255, .4);
    text-decoration: none;
    transition: transform .1s;
}
.fb-icon-btn .fb-glyph { width: 62%; height: 62%; }
.fb-icon-btn.small { width: 36px; height: 36px; }
.fb-icon-btn:active { transform: translateY(3px); }

/* The account button: a mark shows the cloud save's state. */
.fb-account-mark {
    position: absolute;
    right: -5px; bottom: -4px;
    display: none;
    width: 17px; height: 17px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #fff;
    font: 11px/17px var(--display);
    color: #fff;
    text-align: center;
}
.fb-account.in .fb-account-mark { display: block; background: radial-gradient(circle at 40% 35%, #9ff0b8, #23a05a); }
.fb-account.in .fb-account-mark::after { content: "\2713"; }
.fb-account.saving .fb-account-mark { background: radial-gradient(circle at 40% 35%, #fff2a8, #e0a010); }
.fb-account.saving .fb-account-mark::after { content: "\2026"; }
.fb-account.error .fb-account-mark, .fb-account.conflict .fb-account-mark { background: radial-gradient(circle at 40% 35%, #ff9aaa, #e0284a); }
.fb-account.error .fb-account-mark::after, .fb-account.conflict .fb-account-mark::after { content: "!"; }
.fb-account.out .fb-account-mark { display: block; background: radial-gradient(circle at 40% 35%, #ffd98a, #f08a10); }
.fb-account.out .fb-account-mark::after { content: "+"; }

/* ---------- the map: top bar ---------- */

.fb-top {
    position: relative;
    z-index: 50;
    padding: 10px 14px 12px;
    background:
        radial-gradient(circle at 15% -40%, rgba(255, 255, 255, .18), transparent 60%),
        linear-gradient(180deg, #5c2384, #36104f);
    box-shadow: 0 3px 0 var(--gold-2), 0 6px 0 var(--rim-dark), 0 10px 18px rgba(0, 0, 0, .4);
}
.fb-top-row {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 720px;
    margin: 0 auto;
}
.fb-top-row + .fb-top-row { margin-top: 10px; }

.fb-logo {
    position: relative;
    flex: 1;
    min-width: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(24px, 6.2vw, 34px);
    letter-spacing: .5px;
    white-space: nowrap;
    color: #ffcf3a;
    --ol: #4a0f2c;
}
.fb-logo span { color: #ff6b6b; }
.fb-logo .fb-logo-b { color: #ffd23f; }
.fb-logo-fruit {
    width: 1.25em; height: 1.25em;
    flex: none;
    margin-top: -4px;
    background: center / contain no-repeat;
    filter: drop-shadow(0 3px 0 #4a0f2c);
    animation: wobble 3s ease-in-out infinite;
}

.fb-purse { display: flex; gap: 14px; }
.fb-counter {
    position: relative;
    display: flex;
    align-items: center;
    height: 30px;
    border: 0;
    border-radius: 999px;
    padding: 0 12px 0 28px;
    margin-left: 12px;
    background: linear-gradient(180deg, #1c0628, #3a1252);
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, .6), 0 0 0 2px var(--gold-2), 0 0 0 4px var(--rim-dark);
    font-family: var(--display);
    font-size: 17px;
    font-weight: 400;
}
.fb-counter .fb-glyph {
    position: absolute;
    left: -14px; top: 50%;
    width: 36px; height: 36px;
    transform: translateY(-50%);
    filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .4));
}
.fb-plus {
    display: grid;
    place-items: center;
    width: 20px; height: 20px;
    margin: 0 -8px 0 8px;
    border-radius: 50%;
    background: linear-gradient(180deg, #8ff07a, #23a03e);
    box-shadow: 0 0 0 2px #0f5a1e;
    font-size: 16px;
    line-height: 1;
}

.fb-chest-bar {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    height: 26px;
    border: 0;
    padding: 0 0 0 30px;
    margin-left: 8px;
    background: none;
    min-width: 0;
}
.fb-chest-icon {
    position: absolute;
    left: -12px; top: 50%;
    width: 48px; height: 48px;
    transform: translateY(-54%);
    z-index: 1;
    filter: drop-shadow(0 3px 1px rgba(0, 0, 0, .45));
}
.fb-chest-track {
    position: relative;
    flex: 1;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(180deg, #1c0628, #3a1252);
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, .6), 0 0 0 2px var(--gold-2), 0 0 0 4px var(--rim-dark);
    overflow: hidden;
}
.fb-chest-track i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background:
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, .22) 0 8px, transparent 8px 16px),
        linear-gradient(180deg, #fff3a0, #ffb21f 55%, #e07b00);
    box-shadow: inset 0 -3px 0 rgba(160, 70, 0, .35);
    transition: width .5s;
}
.fb-chest-track em {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-style: normal;
    font-family: var(--display);
    font-size: 14px;
    letter-spacing: .5px;
}
.fb-chest-bar.ready .fb-chest-icon { animation: chestShake 1s ease-in-out infinite; }
.fb-chest-bar.ready .fb-chest-track { box-shadow: inset 0 3px 5px rgba(0, 0, 0, .6), 0 0 0 2px #fff6b0, 0 0 0 4px var(--rim-dark), 0 0 14px 4px rgba(255, 220, 90, .8); }

/* ---------- the map: worlds, trail and nodes ---------- */

.fb-map-scroll {
    position: relative;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .35) transparent;
}
.fb-map-path { position: relative; width: 100%; }

.fb-world {
    position: absolute;
    left: 0; right: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .13) 0 1.5px, transparent 2.5px) 0 0 / 34px 30px,
        radial-gradient(circle at 70% 70%, rgba(0, 0, 0, .1) 0 2px, transparent 3px) 0 0 / 46px 52px,
        radial-gradient(ellipse 90px 40px at 50% 50%, rgba(255, 255, 255, .06), transparent) 0 0 / 260px 190px,
        linear-gradient(180deg, var(--g1), var(--g2));
}
/* Rounded hilltops along the top of each band. */
.fb-world::before {
    content: "";
    position: absolute;
    left: 0; right: 0;
    top: -18px;
    height: 20px;
    background: radial-gradient(30px 20px at 30px 20px, var(--g1) 97%, transparent 100%) 0 0 / 60px 20px repeat-x;
}
.fb-world::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 90px;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .14));
    pointer-events: none;
}

.fb-trail { position: absolute; left: 0; top: 0; pointer-events: none; }
.fb-trail path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.fb-trail .t-shadow { stroke: rgba(0, 0, 0, .2); stroke-width: 44; transform: translateY(6px); }
.fb-trail .t-edge { stroke: var(--p2); stroke-width: 38; }
.fb-trail .t-fill { stroke: var(--p1); stroke-width: 29; }
.fb-trail .t-stones { stroke: var(--p2); stroke-opacity: .5; stroke-width: 9; stroke-dasharray: .1 24; }

.fb-prop {
    position: absolute;
    height: auto;
    pointer-events: none;
}

.fb-sign {
    position: absolute;
    left: 50%;
    z-index: 40;
    width: min(290px, 78%);
    transform: translateX(-50%);
    padding: 9px 14px 11px;
    border-radius: 14px;
    text-align: center;
    color: #ffe9b8;
    background:
        radial-gradient(circle, #5a3412 0 3px, #c9955a 3.5px 4.5px, transparent 5px) 8px 8px / 12px 12px no-repeat,
        radial-gradient(circle, #5a3412 0 3px, #c9955a 3.5px 4.5px, transparent 5px) calc(100% - 8px) 8px / 12px 12px no-repeat,
        radial-gradient(circle, #5a3412 0 3px, #c9955a 3.5px 4.5px, transparent 5px) 8px calc(100% - 8px) / 12px 12px no-repeat,
        radial-gradient(circle, #5a3412 0 3px, #c9955a 3.5px 4.5px, transparent 5px) calc(100% - 8px) calc(100% - 8px) / 12px 12px no-repeat,
        repeating-linear-gradient(180deg, transparent 0 17px, rgba(70, 30, 5, .35) 17px 19px),
        repeating-linear-gradient(90deg, transparent 0 40px, rgba(255, 220, 160, .06) 40px 70px),
        linear-gradient(180deg, #dca15c, #a8642a);
    box-shadow:
        0 0 0 3px #5a2e0c, inset 0 3px 0 rgba(255, 235, 190, .55), inset 0 -4px 0 rgba(0, 0, 0, .25),
        0 7px 0 3px #3e1e06, 0 14px 20px rgba(0, 0, 0, .35);
}
.fb-sign::before, .fb-sign::after {
    content: "";
    position: absolute;
    top: 100%;
    z-index: -1;
    width: 14px; height: 44px;
    background: linear-gradient(90deg, #6b3a14, #a8642a 50%, #6b3a14);
    box-shadow: 0 0 0 2px #3e1e06;
}
.fb-sign::before { left: 22%; }
.fb-sign::after { right: 22%; }
.fb-sign small {
    display: block;
    font-family: var(--display);
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #ffe08a;
    text-shadow: 0 2px 0 #5a2e0c;
}
.fb-sign b {
    display: block;
    margin: 1px 0 3px;
    font-family: var(--display);
    font-weight: 400;
    font-size: 23px;
    color: #fff;
    --ol: #5a2405;
}
.fb-sign-stars {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 10px 1px 4px;
    border-radius: 99px;
    background: rgba(60, 25, 5, .45);
    font-family: var(--display);
    font-size: 14px;
    color: #ffe9a8;
}
.fb-sign-stars i { width: 18px; height: 18px; background: var(--i-star) center / contain no-repeat; }
.fb-sign.locked { filter: saturate(.45) brightness(.85); }

.fb-map-cap {
    position: absolute;
    left: 50%;
    z-index: 40;
    transform: translateX(-50%);
    padding: 8px 18px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .85);
    box-shadow: 0 4px 0 rgba(0, 0, 0, .15);
    color: var(--ink);
    font-family: var(--display);
    font-size: 16px;
    white-space: nowrap;
}

.fb-node {
    --gem: #e5383b; --gem-hi: #ffb0b0; --gem-lo: #7a0d12;
    position: absolute;
    z-index: 30;
    width: 62px; height: 62px;
    margin: -31px 0 0 -31px;
    border: 0;
    border-radius: 50%;
    padding: 0;
    background:
        radial-gradient(ellipse 34% 20% at 50% 22%, rgba(255, 255, 255, .75), rgba(255, 255, 255, 0)),
        radial-gradient(circle at 50% 38%, var(--gem-hi), var(--gem) 55%, var(--gem-lo));
    box-shadow:
        0 0 0 4px var(--gold-2), 0 0 0 7px var(--rim-dark),
        0 6px 0 6px #3a1a04, 0 12px 16px 6px rgba(0, 0, 0, .3),
        inset 0 -6px 0 rgba(0, 0, 0, .22);
    font-family: var(--display);
    font-size: 25px;
    color: #fff;
    transition: transform .12s;
}
.fb-node:active { transform: translateY(3px); }
.fb-node span { position: relative; z-index: 1; }
.fb-node.hard { --gem: #ef2f4f !important; --gem-hi: #ffb8c4 !important; --gem-lo: #6e0418 !important; }
.fb-node.super { --gem: #9a3cf0 !important; --gem-hi: #e8c4ff !important; --gem-lo: #36086e !important; }
.fb-node.locked {
    --gem: #8e879c !important; --gem-hi: #d8d2e0 !important; --gem-lo: #4a4458 !important;
    color: #e6e0ee;
    --ol: #3b3446;
    box-shadow:
        0 0 0 4px #b6aec0, 0 0 0 7px #4a4458,
        0 6px 0 6px #2a2632, 0 12px 16px 6px rgba(0, 0, 0, .25),
        inset 0 -6px 0 rgba(0, 0, 0, .22);
}
.fb-node.locked::after {
    content: "";
    position: absolute;
    left: 50%; bottom: -16px;
    width: 26px; height: 26px;
    transform: translateX(-50%);
    background: var(--i-padlock) center / contain no-repeat;
    filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .4));
}
.fb-node.current {
    width: 72px; height: 72px;
    margin: -36px 0 0 -36px;
    font-size: 29px;
    box-shadow:
        0 0 0 4px #fff6c0, 0 0 0 7px var(--rim-dark),
        0 6px 0 6px #3a1a04, 0 0 26px 12px rgba(255, 240, 160, .75),
        inset 0 -6px 0 rgba(0, 0, 0, .22);
}
.fb-node.current::after {
    content: "";
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, .9);
    animation: halo 1.6s ease-out infinite;
}
.fb-node-stars {
    position: absolute;
    left: 50%; bottom: -20px;
    display: flex;
    align-items: flex-end;
    transform: translateX(-50%);
}
.fb-node:not(.done) .fb-node-stars { display: none; }
.fb-node-stars b {
    width: 22px; height: 22px;
    margin: 0 -1px;
    background: var(--i-starOff) center / contain no-repeat;
    filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .4));
}
.fb-node-stars b:nth-child(2) { width: 26px; height: 26px; margin-bottom: -5px; }
.fb-node-stars b.on { background-image: var(--i-star); }
.fb-node-badge {
    position: absolute;
    right: -14px; top: -12px;
    width: 30px; height: 30px;
    background: var(--i-flame) center / contain no-repeat;
    filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .5));
}
.fb-node.super .fb-node-badge { background-image: var(--i-flameP); width: 34px; height: 34px; }

.fb-marker {
    position: absolute;
    z-index: 35;
    width: 0; height: 0;
    pointer-events: none;
    animation: markerBob 1.4s ease-in-out infinite;
}
.fb-marker i {
    position: absolute;
    left: -27px; top: -128px;
    width: 54px; height: 54px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: radial-gradient(circle at 40% 35%, #fff, #ffe6f0 70%, #f7c2d8);
    box-shadow: 0 0 0 4px var(--pink), 0 0 0 6px #6e0a26, -4px 6px 10px rgba(0, 0, 0, .35);
}
.fb-marker img {
    position: absolute;
    inset: 6px;
    width: 42px; height: 42px;
    transform: rotate(45deg);
}

/* ---------- the map: dock ---------- */

.fb-dock {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 45;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: clamp(14px, 4vw, 28px);
    padding: 40px 12px max(16px, env(safe-area-inset-bottom));
    background: linear-gradient(180deg, transparent, rgba(30, 6, 45, .5) 55%, rgba(30, 6, 45, .7));
    pointer-events: none;
}
.fb-dock > * { pointer-events: auto; }
.fb-dock-btn {
    position: relative;
    width: 62px; height: 62px;
    margin-bottom: 14px;
    border: 0;
    border-radius: 50%;
    padding: 0;
    background: radial-gradient(circle at 50% 30%, #fff8ea, #f5dcb8 60%, #d8a46a);
    box-shadow:
        0 0 0 4px var(--gold-2), 0 0 0 7px var(--rim-dark),
        0 5px 0 7px #3a1a04, 0 10px 16px 6px rgba(0, 0, 0, .35),
        inset 0 -5px 0 rgba(140, 70, 10, .25);
    transition: transform .1s;
}
.fb-dock-btn:active { transform: translateY(3px); }
.fb-dock-btn .fb-glyph { width: 74%; height: 74%; margin: auto; }
.fb-dock-btn span {
    position: absolute;
    left: 50%; bottom: -18px;
    transform: translateX(-50%);
    font-family: var(--display);
    font-size: 15px;
    color: #fff;
}
.fb-dot {
    position: absolute;
    top: -6px; right: -6px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #ff9aaa, #ff2a4f 60%, #a0001e);
    box-shadow: 0 0 0 2px #fff;
    animation: pulse 1s ease-in-out infinite;
}
.fb-dot::after { content: "!"; display: block; font: 15px/22px var(--display); color: #fff; }

.fb-play-next {
    position: relative;
    display: grid;
    justify-items: center;
    min-width: 190px;
    border: 0;
    border-radius: 22px;
    padding: 6px 30px 12px;
    background: linear-gradient(180deg, #a8f582, #36c24e 50%, #1f9a38);
    box-shadow:
        0 0 0 4px #fff6c0, 0 0 0 7px #0f5a1e,
        0 7px 0 7px #0a3a12, 0 14px 22px 6px rgba(0, 0, 0, .35),
        inset 0 -6px 0 rgba(0, 60, 10, .3), inset 0 4px 0 rgba(255, 255, 255, .5);
    font-family: var(--display);
    font-size: 28px;
    line-height: 1.05;
    color: #fff;
    --ol: #0f5a1e;
    overflow: hidden;
    transition: transform .1s;
    animation: breathe 2.2s ease-in-out infinite;
}
.fb-play-next small { font-size: 15px; letter-spacing: 3px; text-transform: uppercase; color: #eaffcf; }
.fb-play-next::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    width: 40%;
    left: -60%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
    animation: sheen 3s ease-in-out infinite;
}
.fb-play-next:active { transform: translateY(4px); animation: none; }

/* ---------- playing: HUD ---------- */

.fb-hud {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 16px 14px 6px;
}
.fb-hud-panel {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 6px 12px 6px 8px;
    border-radius: 22px;
    background:
        radial-gradient(circle at 30% -30%, rgba(255, 255, 255, .2), transparent 60%),
        linear-gradient(180deg, #622790, #3a1257);
    box-shadow:
        0 0 0 3px var(--gold-2), 0 0 0 5px var(--rim-dark),
        0 5px 0 5px #33180a, 0 10px 18px 5px rgba(0, 0, 0, .35),
        inset 0 3px 0 rgba(255, 255, 255, .18), inset 0 -4px 0 rgba(0, 0, 0, .25);
}
.fb-moves {
    display: grid;
    place-content: center;
    width: 78px; height: 78px;
    margin: -16px 0;
    border-radius: 50%;
    text-align: center;
    background:
        radial-gradient(ellipse 38% 20% at 50% 20%, rgba(255, 255, 255, .9), transparent),
        radial-gradient(circle at 50% 40%, #fffaf0, #ffe0c4 70%, #eab07e);
    box-shadow:
        0 0 0 4px var(--pink), 0 0 0 7px #6e0a26,
        0 5px 0 7px #3a0414, 0 10px 14px 6px rgba(0, 0, 0, .35),
        inset 0 -5px 0 rgba(170, 80, 40, .25);
    color: var(--ink);
}
.fb-moves small, .fb-goals-wrap > small {
    font-family: var(--display);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #a0406a;
}
.fb-moves strong {
    font-family: var(--display);
    font-weight: 400;
    font-size: 34px;
    line-height: .95;
}
.fb-moves.low { animation: pulse .8s ease-in-out infinite; }
.fb-moves.low strong { color: #e0143c; }

.fb-goals-wrap { min-width: 0; text-align: center; }
.fb-goals-wrap > small { color: #ffd9f0; display: block; margin-bottom: 3px; }
.fb-goals {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}
.fb-goal {
    position: relative;
    display: grid;
    place-items: center;
    width: 52px; height: 52px;
    border-radius: 15px;
    background: radial-gradient(circle at 50% 40%, #4a1868, #23072f);
    box-shadow: inset 0 3px 7px rgba(0, 0, 0, .65), 0 1px 0 rgba(255, 255, 255, .25), 0 0 0 2px rgba(255, 210, 120, .35);
}
.fb-goal .fb-ico { width: 40px; height: 40px; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .45)); }
.fb-goal b {
    position: absolute;
    right: -9px; bottom: -8px;
    min-width: 26px; height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff, #f0e2f6);
    box-shadow: 0 0 0 2px #3a1256, 0 2px 0 2px #1c0628;
    color: var(--ink);
    font-family: var(--display);
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
}
.fb-goal.done b {
    min-width: 26px; width: 26px; height: 26px;
    padding: 0;
    background: var(--i-check) center / contain no-repeat;
    box-shadow: none;
}
.fb-goal.done { box-shadow: inset 0 3px 7px rgba(0, 0, 0, .65), 0 0 0 2px #5df08a, 0 0 12px rgba(93, 240, 138, .6); }
.fb-goal.bump .fb-ico { animation: bump .3s ease; }
.fb-goal.bump b { animation: bump .3s ease; }

.fb-score { min-width: 136px; text-align: center; }
.fb-score small {
    display: block;
    font-family: var(--display);
    font-size: 13px;
    letter-spacing: 1px;
    color: #ffd23f;
    text-shadow: 0 2px 0 #3a0d2e;
}
.fb-score strong {
    display: block;
    font-family: var(--display);
    font-weight: 400;
    font-size: 24px;
    line-height: 1.1;
}
.fb-score-bar {
    position: relative;
    height: 14px;
    margin: 4px 10px 6px 2px;
    border-radius: 99px;
    background: linear-gradient(180deg, #14031c, #2e0c40);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, .7), 0 0 0 2px rgba(255, 210, 120, .45);
}
.fb-score-bar i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background:
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, .25) 0 6px, transparent 6px 12px),
        linear-gradient(180deg, #fff3a0, #ffb21f 55%, #e07b00);
    box-shadow: inset 0 -2px 0 rgba(160, 70, 0, .4);
    transition: width .35s;
}
.fb-score-bar b {
    position: absolute;
    top: 50%;
    width: 24px; height: 24px;
    transform: translate(-50%, -50%);
    background: var(--i-starOff) center / contain no-repeat;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5));
}
.fb-score-bar b.on { background-image: var(--i-star); animation: starPop .4s cubic-bezier(.2, 1.6, .4, 1); }
.fb-score-bar b[data-star="3"] { left: 100% !important; }

/* ---------- playing: board ---------- */

.fb-board-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    margin: 8px 6px 2px;
}
#board { position: absolute; inset: 0; touch-action: none; }

.fb-banner {
    position: absolute;
    left: 50%; top: 42%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    font-family: var(--display);
    font-size: clamp(36px, 8.5vw, 62px);
    color: #fff;
    white-space: nowrap;
    --ol: #8a1f5a;
    text-shadow:
        3px 0 var(--ol), -3px 0 var(--ol), 0 3px var(--ol), 0 -3px var(--ol),
        2.2px 2.2px var(--ol), -2.2px 2.2px var(--ol), 2.2px -2.2px var(--ol), -2.2px -2.2px var(--ol),
        0 7px 0 #4a0a2e, 0 10px 20px rgba(0, 0, 0, .5), 0 0 30px rgba(255, 120, 200, .8);
    animation: bannerIn 1.5s ease forwards;
}
.fb-banner.word {
    top: 28%;
    font-size: clamp(30px, 7vw, 50px);
    color: #ffe45a;
    --ol: #a0400f;
    text-shadow:
        3px 0 var(--ol), -3px 0 var(--ol), 0 3px var(--ol), 0 -3px var(--ol),
        2.2px 2.2px var(--ol), -2.2px 2.2px var(--ol), 2.2px -2.2px var(--ol), -2.2px -2.2px var(--ol),
        0 6px 0 #5a2005, 0 0 26px rgba(255, 200, 80, .9);
}
.fb-banner.big { font-size: clamp(40px, 10vw, 70px); }

/* ---------- playing: booster shelf ---------- */

.fb-tools {
    position: relative;
    display: flex;
    justify-content: center;
    padding: 10px 12px max(12px, env(safe-area-inset-bottom));
}
.fb-shelf {
    display: flex;
    gap: 22px;
    padding: 12px 26px 24px;
    border-radius: 24px;
    background:
        radial-gradient(circle at 30% -40%, rgba(255, 255, 255, .2), transparent 60%),
        linear-gradient(180deg, #622790, #3a1257);
    box-shadow:
        0 0 0 3px var(--gold-2), 0 0 0 5px var(--rim-dark),
        0 5px 0 5px #33180a, 0 10px 18px 5px rgba(0, 0, 0, .35),
        inset 0 3px 0 rgba(255, 255, 255, .18), inset 0 -4px 0 rgba(0, 0, 0, .25);
}
.fb-shelf:not(:has(.fb-tool:not([hidden]))) { display: none; }
.fb-tool {
    position: relative;
    width: 58px; height: 58px;
    border: 0;
    border-radius: 50%;
    padding: 0;
    background:
        radial-gradient(ellipse 36% 20% at 50% 20%, rgba(255, 255, 255, .95), transparent),
        radial-gradient(circle at 50% 40%, #fffaf0, #f3dcbc 62%, #d29c62);
    box-shadow:
        0 0 0 3px var(--gold-2), 0 0 0 5px var(--rim-dark),
        0 4px 0 5px #33180a, inset 0 -5px 0 rgba(140, 70, 10, .25);
    transition: transform .12s, box-shadow .12s;
}
.fb-tool[hidden] { display: none; }
.fb-tool:active { transform: translateY(3px); }
.fb-tool.on {
    transform: translateY(-5px) scale(1.06);
    box-shadow:
        0 0 0 3px #fff6b0, 0 0 0 5px var(--rim-dark),
        0 4px 0 5px #33180a, 0 0 22px 8px rgba(255, 230, 120, .85),
        inset 0 -5px 0 rgba(140, 70, 10, .25);
}
.fb-tool-icon { display: block; width: 42px; height: 42px; margin: auto; background: center / contain no-repeat; }
.fb-tool b {
    position: absolute;
    right: -10px; top: -8px;
    min-width: 25px; height: 25px;
    padding: 0 6px;
    border-radius: 13px;
    background: linear-gradient(180deg, #ff86ac, #e0285a);
    box-shadow: 0 0 0 2px #fff, 0 2px 0 2px #6e0a26;
    color: #fff;
    font-family: var(--display);
    font-weight: 400;
    font-size: 15px;
    line-height: 25px;
}
.fb-tool.empty b { background: linear-gradient(180deg, #8ff07a, #23a03e); box-shadow: 0 0 0 2px #fff, 0 2px 0 2px #0f5a1e; font-size: 19px; }
.fb-tool span {
    position: absolute;
    left: 50%; bottom: -22px;
    transform: translateX(-50%);
    font-family: var(--display);
    font-size: 13px;
    white-space: nowrap;
    color: #ffe9a8;
}
.fb-tool-hint {
    position: absolute;
    left: 0; right: 0; top: -26px;
    margin: 0;
    text-align: center;
    font-family: var(--display);
    font-size: 17px;
    pointer-events: none;
}

/* ---------- dialogs ---------- */

.fb-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 16px;
}
.fb-modal[hidden] { display: none; }
.fb-modal-back {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 45%, rgba(40, 10, 60, .45), rgba(15, 3, 25, .8));
    backdrop-filter: blur(2px);
}
.fb-card {
    position: relative;
    width: min(420px, 100%);
    border: 6px solid transparent;
    border-radius: 30px;
    background:
        linear-gradient(180deg, var(--cream-1), var(--cream-2)) padding-box,
        linear-gradient(180deg, #fff3b8, var(--gold-2) 40%, var(--gold-3)) border-box;
    box-shadow: 0 0 0 3px var(--rim-dark), 0 9px 0 3px #3a1a04, 0 26px 50px rgba(0, 0, 0, .55);
    color: var(--ink);
    text-align: center;
    animation: cardIn .32s cubic-bezier(.2, 1.4, .4, 1);
}
.fb-card::before {
    content: "";
    position: absolute;
    inset: 5px;
    border: 2px dashed rgba(190, 130, 70, .35);
    border-radius: 21px;
    pointer-events: none;
}
.fb-card.titled { margin-top: 28px; }
.fb-card-body {
    position: relative;
    max-height: calc(100dvh - 90px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 20px 22px;
    border-radius: 24px;
    scrollbar-width: thin;
}
.fb-card.titled .fb-card-body { padding-top: 36px; }
.fb-card p { margin: 6px 0; font-weight: 800; line-height: 1.35; }

.fb-ribbon {
    position: absolute;
    left: 50%; top: -30px;
    z-index: 3;
    transform: translateX(-50%);
    white-space: nowrap;
    filter: drop-shadow(0 4px 0 #4a0418) drop-shadow(0 8px 8px rgba(0, 0, 0, .3));
}
.fb-ribbon span {
    position: relative;
    z-index: 1;
    display: block;
    padding: 9px 32px 12px;
    border-radius: 12px;
    background:
        radial-gradient(ellipse 60% 30% at 50% 10%, rgba(255, 255, 255, .5), transparent),
        linear-gradient(180deg, #ff7aa2, #e0285a 55%, #b0123f);
    box-shadow: 0 0 0 3px #6e0a26, inset 0 -4px 0 rgba(0, 0, 0, .2);
    font-family: var(--display);
    font-size: 27px;
    color: #fff;
    --ol: #6e0a26;
}
.fb-ribbon::before, .fb-ribbon::after {
    content: "";
    position: absolute;
    top: 16px;
    width: 38px; height: 40px;
    background: linear-gradient(180deg, #b0123f, #7a0a2a);
}
.fb-ribbon::before { left: -26px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 35% 50%); }
.fb-ribbon::after { right: -26px; clip-path: polygon(0 0, 100% 0, 65% 50%, 100% 100%, 0 100%); }

.fb-x {
    position: absolute;
    right: -16px; top: -16px;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 42px; height: 42px;
    border: 0;
    border-radius: 50%;
    padding: 0 0 3px;
    background: radial-gradient(circle at 50% 30%, #ff9a9a, #e0283a 60%, #8a0a1a);
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px #6e0a16, 0 4px 0 5px #3a0408, inset 0 -3px 0 rgba(0, 0, 0, .25);
    font-family: var(--display);
    font-size: 30px;
    line-height: 1;
    color: #fff;
}

.fb-kicker {
    margin: 0 0 4px !important;
    font-family: var(--display);
    font-weight: 400 !important;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #b0608a;
}
.fb-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 8px;
    font-family: var(--display);
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #b0608a;
}
.fb-section::before, .fb-section::after {
    content: "";
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, #e7c49c);
}
.fb-section::after { transform: scaleX(-1); }

.fb-tag {
    display: inline-block;
    border-radius: 99px;
    padding: 3px 14px 3px 30px;
    background: linear-gradient(180deg, #ff7a8a, #d81f40) ;
    box-shadow: 0 0 0 2px #6e0418, 0 3px 0 2px #4a0010;
    font-family: var(--display);
    font-size: 15px;
    color: #fff;
    position: relative;
}
.fb-tag::before {
    content: "";
    position: absolute;
    left: 4px; top: 50%;
    width: 24px; height: 24px;
    transform: translateY(-58%);
    background: var(--i-flame) center / contain no-repeat;
}
.fb-tag.super { background: linear-gradient(180deg, #c27aff, #7a2fd6); box-shadow: 0 0 0 2px #36086e, 0 3px 0 2px #22044a; }
.fb-tag.super::before { background-image: var(--i-flameP); }
.fb-hard-line { margin: 0 0 6px; }

.fb-ico { width: 40px; height: 40px; vertical-align: middle; }
.fb-ico.big { width: 92px; height: 92px; }
.fb-coin { width: 22px; height: 22px; vertical-align: -5px; }

.fb-stars { display: flex; justify-content: center; align-items: flex-end; gap: 2px; margin: 2px 0; }
.fb-stars i { width: 34px; height: 34px; background: var(--i-starOff) center / contain no-repeat; filter: drop-shadow(0 2px 1px rgba(90, 40, 0, .3)); }
.fb-stars i:nth-child(2) { width: 42px; height: 42px; margin-bottom: 6px; }
.fb-stars i.on { background-image: var(--i-star); }

.fb-socket {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 50px; height: 50px;
    border-radius: 15px;
    background: radial-gradient(circle at 50% 40%, #6a2f8a, #34104c);
    box-shadow: inset 0 3px 7px rgba(0, 0, 0, .55), 0 0 0 2px #d9a96a, 0 3px 0 2px #a8742e;
}
.fb-socket .fb-ico { width: 40px; height: 40px; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .4)); }
.fb-socket em {
    position: absolute;
    right: -10px; bottom: -8px;
    min-width: 26px;
    padding: 0 6px;
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #f0e2f6);
    box-shadow: 0 0 0 2px #3a1256;
    font-family: var(--display);
    font-style: normal;
    font-size: 15px;
    line-height: 22px;
    color: var(--ink);
}

.fb-goal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fb-goal-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 18px;
    padding: 6px 14px 6px 6px;
    background: #fff;
    box-shadow: 0 0 0 2px #ecd2b4, inset 0 -3px 0 #f3e2cc;
    text-align: left;
    font-size: 16px;
}
.fb-goal-row { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; margin: 10px 0 18px; padding: 0; }
.fb-moves-note { margin-top: 12px !important; color: #2f8f54; }
.fb-moves-note b { font-family: var(--display); font-weight: 400; font-size: 22px; }

.fb-intro {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 4px;
    border-radius: 18px;
    padding: 8px 12px 8px 8px;
    text-align: left;
    background: linear-gradient(180deg, #e6f7ff, #c9ecff);
    box-shadow: 0 0 0 2px #8cc8ea, inset 0 -3px 0 rgba(60, 140, 200, .2);
}
.fb-intro b { font-family: var(--display); font-weight: 400; font-size: 18px; color: #1f5a8a; }
.fb-intro .fb-ico.big { width: 62px; height: 62px; flex: none; }
.fb-intro p { margin: 2px 0 0 !important; font-size: 14px; }

.fb-starts { display: flex; justify-content: center; gap: 14px; margin-bottom: 4px; }
.fb-start {
    position: relative;
    width: 64px; height: 64px;
    border: 0;
    border-radius: 18px;
    padding: 0;
    background: radial-gradient(circle at 50% 35%, #fff, #f3e2cc);
    box-shadow: 0 0 0 2px #d9a96a, 0 4px 0 2px #a8742e, inset 0 -4px 0 rgba(160, 110, 50, .2);
    transition: transform .12s;
}
.fb-start .fb-ico { width: 46px; height: 46px; }
.fb-start:disabled { filter: grayscale(.8); opacity: .6; }
.fb-start.on {
    transform: translateY(-3px);
    background: radial-gradient(circle at 50% 35%, #f2fff0, #c8f5c8);
    box-shadow: 0 0 0 3px #2fb65a, 0 4px 0 3px #0f5a1e, 0 0 16px 4px rgba(80, 220, 110, .55);
}
.fb-start.on::after {
    content: "";
    position: absolute;
    left: -9px; top: -9px;
    width: 26px; height: 26px;
    background: var(--i-check) center / contain no-repeat;
}
.fb-start b {
    position: absolute;
    right: -8px; bottom: -8px;
    min-width: 24px;
    padding: 0 5px;
    border-radius: 12px;
    background: linear-gradient(180deg, #ff86ac, #e0285a);
    box-shadow: 0 0 0 2px #fff;
    color: #fff;
    font-family: var(--display);
    font-weight: 400;
    font-size: 14px;
    line-height: 22px;
}

/* Buttons: glossy, outlined and pressable. */
.fb-actions { display: flex; justify-content: center; gap: 14px; margin-top: 20px; flex-wrap: wrap; }
/* The last row of buttons stays in view when a dialog has to scroll. */
.fb-card-body > .fb-actions:last-child {
    position: sticky;
    bottom: -22px;
    z-index: 6;
    margin: 12px -20px -22px;
    padding: 12px 20px 22px;
    background: linear-gradient(180deg, rgba(251, 230, 200, 0), var(--cream-2) 28%);
}
.fb-btn {
    --b1: #fff8ec; --b2: #ead2b0; --bd: #8a5a2a; --bd2: #5a3410; --tx: #5a3046;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 0;
    border-radius: 16px;
    padding: 10px 22px 13px;
    background: linear-gradient(180deg, var(--b1), var(--b2));
    box-shadow:
        0 0 0 3px var(--bd), 0 5px 0 3px var(--bd2), 0 9px 12px 3px rgba(0, 0, 0, .25),
        inset 0 -5px 0 rgba(0, 0, 0, .13);
    font-family: var(--display);
    font-weight: 400;
    font-size: 20px;
    color: var(--tx);
    overflow: hidden;
    transition: transform .08s, box-shadow .08s;
}
.fb-btn::before {
    content: "";
    position: absolute;
    left: 7px; right: 7px; top: 3px;
    height: 42%;
    border-radius: 12px 12px 40% 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, .65), rgba(255, 255, 255, .05));
    pointer-events: none;
}
.fb-btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 3px var(--bd), 0 1px 0 3px var(--bd2), inset 0 -5px 0 rgba(0, 0, 0, .13); }
.fb-btn:disabled { filter: grayscale(.75); opacity: .65; }
.fb-btn.primary { --b1: #b4f78c; --b2: #2fb64d; --bd: #0f5a1e; --bd2: #083a10; --tx: #fff; --ol: #0f5a1e; }
.fb-btn.gold { --b1: #fff0a0; --b2: #f0a020; --bd: #7a4200; --bd2: #4a2800; --tx: #fff; --ol: #8a4a00; }
.fb-btn.blue { --b1: #a8dcff; --b2: #3482e6; --bd: #0c3274; --bd2: #061f4a; --tx: #fff; --ol: #0c3274; }
.fb-btn.red { --b1: #ffaab0; --b2: #e02a40; --bd: #6e0a18; --bd2: #44040e; --tx: #fff; --ol: #6e0a18; }
.fb-btn.big { font-size: 26px; padding: 12px 54px 15px; }
.fb-btn.small { padding: 7px 12px 10px; font-size: 16px; white-space: nowrap; }
.fb-btn.wide { display: flex; width: 100%; margin-top: 12px; }
.fb-btn .fb-coin { width: 24px; height: 24px; }
.fb-plus5 {
    display: inline-grid;
    place-items: center;
    width: 34px; height: 34px;
    margin-right: 2px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 30%, #8ff0d0, #1fa88a);
    box-shadow: 0 0 0 2px #0b5d4c;
    font-weight: 400;
    font-size: 16px;
}
.fb-pause-menu { display: grid; gap: 16px; margin: 8px 12px 6px; }

/* Heroes: a big icon on spinning light. */
.fb-hero {
    position: relative;
    display: grid;
    place-items: center;
    height: 132px;
    margin: -6px 0 2px;
}
.fb-hero .fb-ico.big { position: relative; z-index: 1; width: 104px; height: 104px; filter: drop-shadow(0 6px 4px rgba(90, 40, 0, .35)); animation: float 2.4s ease-in-out infinite; }
.fb-rays {
    position: absolute;
    left: 50%; top: 50%;
    width: 280px; height: 280px;
    margin: -140px 0 0 -140px;
    border-radius: 50%;
    background: repeating-conic-gradient(rgba(255, 200, 80, .5) 0 9deg, transparent 9deg 22.5deg);
    -webkit-mask: radial-gradient(circle, #000 18%, transparent 68%);
    mask: radial-gradient(circle, #000 18%, transparent 68%);
    animation: spin 14s linear infinite;
    pointer-events: none;
}

.fb-win-stars {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 4px;
    height: 118px;
    margin: -4px 0 6px;
}
.fb-win-stars .fb-rays { top: 58%; }
.fb-win-stars span {
    position: relative;
    z-index: 1;
    width: 74px; height: 74px;
    background: var(--i-starOff) center / contain no-repeat;
    filter: drop-shadow(0 4px 2px rgba(90, 40, 0, .35));
}
.fb-win-stars span:nth-child(3) { width: 96px; height: 96px; margin-bottom: 18px; }
.fb-win-stars span.on { background-image: var(--i-star); animation: starPop .5s cubic-bezier(.2, 1.6, .4, 1); }
.fb-final {
    margin: 0 !important;
    font-family: var(--display);
    font-weight: 400 !important;
    font-size: 38px;
    line-height: 1.1;
    color: #8a1f5a;
}
.fb-final small { display: block; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: #b0608a; }
.fb-final em {
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
    border-radius: 99px;
    padding: 2px 10px;
    background: linear-gradient(180deg, #8ff0b0, #23a05e);
    box-shadow: 0 0 0 2px #0b5532;
    font-style: normal;
    font-size: 14px;
    color: #fff;
    transform: rotate(-6deg);
}
.fb-rewards { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.fb-reward {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 99px;
    padding: 4px 14px 4px 6px;
    background: #fff;
    box-shadow: 0 0 0 2px #ecd2b4, inset 0 -3px 0 #f3e2cc;
    font-family: var(--display);
    font-size: 19px;
    color: var(--ink);
}
.fb-reward .fb-ico, .fb-reward .fb-coin { width: 30px; height: 30px; }
.fb-world-done {
    margin-top: 10px;
    border-radius: 18px;
    padding: 10px;
    background: linear-gradient(180deg, #fff6c8, #ffe08a);
    box-shadow: 0 0 0 2px #e0a63a, inset 0 -3px 0 rgba(200, 130, 0, .2);
}
.fb-world-done b { font-family: var(--display); font-weight: 400; font-size: 20px; color: #8a4a00; }
.fb-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 5; }
.fb-confetti i {
    position: absolute;
    top: -16px; left: var(--x);
    width: 8px; height: 14px;
    border-radius: 2px;
    background: var(--c);
    transform: rotate(var(--r));
    animation: confetti 2.6s var(--d) ease-in forwards;
}

.fb-days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0 4px; }
.fb-day {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 0 0 2px #ecd2b4, 0 3px 0 2px #d9b48a;
    padding-bottom: 6px;
}
.fb-day small {
    display: block;
    margin-bottom: 4px;
    padding: 3px 0;
    background: linear-gradient(180deg, #c27aff, #8a3ae0);
    font-family: var(--display);
    font-size: 13px;
    color: #fff;
}
.fb-day .fb-rewards { margin: 0; gap: 2px; }
.fb-day .fb-reward { background: none; box-shadow: none; padding: 0 2px; font-size: 14px; }
.fb-day .fb-ico, .fb-day .fb-coin { width: 26px; height: 26px; }
.fb-day > div { display: flex; flex-wrap: wrap; justify-content: center; }
.fb-day.got { filter: saturate(.4); opacity: .7; }
.fb-day.got::after {
    content: "";
    position: absolute;
    right: 3px; bottom: 3px;
    width: 24px; height: 24px;
    background: var(--i-check) center / contain no-repeat;
}
.fb-day.today { box-shadow: 0 0 0 3px #2fb65a, 0 3px 0 3px #0f5a1e, 0 0 16px 4px rgba(80, 220, 110, .6); animation: pulse 1.4s ease-in-out infinite; }
.fb-day.today small { background: linear-gradient(180deg, #8ff07a, #23a03e); }
.fb-day:last-child { grid-column: span 2; }
.fb-day:last-child small { background: linear-gradient(180deg, #ffd96a, #f09a10); }

.fb-wallet {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px !important;
    border-radius: 99px;
    padding: 4px 16px 4px 6px;
    background: linear-gradient(180deg, #2a0a3a, #4a1a63);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, .6), 0 0 0 2px var(--gold-2);
    font-family: var(--display);
    font-size: 20px;
    color: #fff;
}
.fb-wallet b { font-weight: 400; }
.fb-wallet .fb-coin { width: 30px; height: 30px; }
.fb-note { font-size: 13px; color: #9a6a7a; }

.fb-shop { display: grid; gap: 12px; margin: 6px 0; text-align: left; }
.fb-shop-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    border-radius: 18px;
    padding: 8px 12px 8px 8px;
    background: #fff;
    box-shadow: 0 0 0 2px #ecd2b4, inset 0 -3px 0 #f3e2cc;
}
.fb-shop-row b { font-family: var(--display); font-weight: 400; font-size: 17px; }
.fb-shop-row small { display: block; font-size: 12px; font-weight: 700; color: #7a5a6a; line-height: 1.25; }
.fb-shop-row.locked { opacity: .55; filter: grayscale(.6); }

.fb-hero.sad .fb-ico.big { animation: sway 2s ease-in-out infinite; filter: grayscale(.25) drop-shadow(0 6px 4px rgba(90, 40, 0, .3)); }

.fb-toasts { position: fixed; left: 50%; top: 84px; transform: translateX(-50%); z-index: 120; display: grid; gap: 8px; width: min(380px, calc(100% - 32px)); pointer-events: none; }
.fb-toast {
    border-radius: 16px;
    padding: 10px 16px;
    background: linear-gradient(180deg, #5c2384, #36104f);
    box-shadow: 0 0 0 2px var(--gold-2), 0 0 0 4px var(--rim-dark), 0 8px 18px rgba(0, 0, 0, .4);
    text-align: center;
    transition: opacity .4s, transform .4s;
    animation: cardIn .3s ease;
}
.fb-toast .fb-ico, .fb-toast .fb-coin { width: 26px; height: 26px; vertical-align: middle; }
.fb-toast .fb-reward { background: rgba(255, 255, 255, .9); padding: 1px 10px 1px 4px; font-size: 16px; }
.fb-toast.out { opacity: 0; transform: translateY(-10px); }

/* ---------- quests, trophies, win streak ---------- */

.fb-dock-btn.locked { filter: grayscale(.8) brightness(.85); }
.fb-streak-badge {
    position: absolute;
    top: 3px; right: 6px;
    width: 30px; height: 34px;
    padding-top: 10px;
    background: var(--i-flame) center / contain no-repeat;
    font: 15px/1 var(--display);
    color: #fff;
    --ol: #8f1400;
    text-shadow: 0 0 2px #8f1400, 0 1px 0 #8f1400, 1px 0 0 #8f1400, -1px 0 0 #8f1400;
}

.fb-quests { display: grid; gap: 10px; margin: 6px 0; text-align: left; }
.fb-quest {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    border-radius: 18px;
    padding: 8px 10px 8px 8px;
    background: #fff;
    box-shadow: 0 0 0 2px #ecd2b4, inset 0 -3px 0 #f3e2cc;
}
.fb-quest > div { min-width: 0; }
.fb-quest b { display: block; font-family: var(--display); font-weight: 400; font-size: 16px; line-height: 1.2; }
.fb-quest small { display: block; font-size: 12px; font-weight: 700; color: #7a5a6a; line-height: 1.25; }
.fb-quest.done { box-shadow: 0 0 0 3px #2fb65a, inset 0 -3px 0 #d6f5dc; background: #f2fff3; }
.fb-quest.claimed { opacity: .65; filter: saturate(.5); }
.fb-bar {
    position: relative;
    display: block;
    height: 18px;
    margin-top: 5px;
    border-radius: 9px;
    background: #3a1256;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, .5);
    overflow: hidden;
}
.fb-bar i {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    border-radius: 9px;
    background: linear-gradient(180deg, #a8f582, #36c24e 55%, #1f9a38);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45);
    transition: width .4s;
}
.fb-bar em {
    position: relative;
    display: block;
    font: 12px/18px var(--display);
    font-style: normal;
    text-align: center;
    color: #fff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .7);
}
.fb-claimed { width: 34px; height: 34px; background: var(--i-check) center / contain no-repeat; }
.fb-rewards.mini { flex-direction: column; align-items: flex-end; gap: 3px; margin: 0; }
.fb-rewards.mini .fb-reward { padding: 1px 8px 1px 3px; font-size: 14px; box-shadow: 0 0 0 1px #ecd2b4; }
.fb-rewards.mini .fb-ico, .fb-rewards.mini .fb-coin { width: 22px; height: 22px; }
.fb-quest-bonus {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    margin: 12px 0 6px;
    border-radius: 18px;
    padding: 8px 12px;
    background: linear-gradient(180deg, #fff6c8, #ffe08a);
    box-shadow: 0 0 0 2px #e0a63a, inset 0 -3px 0 rgba(200, 130, 0, .2);
    text-align: left;
}
.fb-quest-bonus > .fb-ico { width: 48px; height: 48px; }
.fb-quest-bonus b { font-family: var(--display); font-weight: 400; font-size: 17px; color: #8a4a00; }
.fb-quest-bonus .fb-rewards.mini { flex-direction: row; justify-content: flex-start; flex-wrap: wrap; margin-top: 4px; }
.fb-quest-bonus.ready { animation: pulse 1.4s ease-in-out infinite; }
.fb-quest-bonus.claimed { opacity: .6; filter: saturate(.5); }

.fb-medals { display: inline-flex; gap: 3px; margin-left: 4px; vertical-align: 1px; }
.fb-medals i {
    width: 13px; height: 13px;
    border-radius: 50%;
    background: #e4d6cc;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15);
}
.fb-medals i.ready { box-shadow: 0 0 0 2px #2fb65a; }
.fb-medals i.t0.on { background: radial-gradient(circle at 35% 30%, #ffd3a8, #c8733a 60%, #7a3a10); }
.fb-medals i.t1.on { background: radial-gradient(circle at 35% 30%, #ffffff, #b9c3d0 60%, #5d6878); }
.fb-medals i.t2.on { background: radial-gradient(circle at 35% 30%, #fff6b0, #ffc52e 60%, #a86200); }
.fb-trophy .fb-socket .fb-ico { width: 36px; height: 36px; }

.fb-flames { display: inline-flex; align-items: flex-end; gap: 0; flex: none; }
.fb-flames i { width: 22px; height: 26px; background: var(--i-flameOff) center / contain no-repeat; }
.fb-flames i:nth-child(2) { width: 26px; height: 32px; }
.fb-flames i:nth-child(3) { width: 30px; height: 38px; }
.fb-flames i.on { background-image: var(--i-flame); filter: drop-shadow(0 0 4px rgba(255, 140, 20, .8)); }
.fb-streak-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 4px;
    border-radius: 18px;
    padding: 8px 14px;
    background: #fff;
    box-shadow: 0 0 0 2px #ecd2b4, inset 0 -3px 0 #f3e2cc;
    text-align: left;
}
.fb-streak-row.hot { background: linear-gradient(180deg, #fff3d6, #ffd9a0); box-shadow: 0 0 0 2px #ff9419, inset 0 -3px 0 rgba(200, 90, 0, .2); }
.fb-streak-row b { display: block; font-family: var(--display); font-weight: 400; font-size: 17px; color: #a03a00; }
.fb-streak-row small { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 13px; font-weight: 800; color: #7a5a6a; }
.fb-streak-row small .fb-ico { width: 26px; height: 26px; }
.fb-win-streak { display: grid; justify-items: center; gap: 2px; margin: 8px 0 2px; }
.fb-win-streak b { font-family: var(--display); font-weight: 400; font-size: 19px; color: #c04a00; }
.fb-win-streak small { font-size: 13px; font-weight: 800; color: #7a5a6a; }

/* ---------- motion ---------- */

@keyframes pulse { 50% { transform: scale(1.07); } }
@keyframes breathe { 50% { transform: scale(1.04); } }
@keyframes halo { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
@keyframes markerBob { 50% { transform: translateY(-8px); } }
@keyframes sheen { 0%, 55% { left: -60%; } 100% { left: 130%; } }
@keyframes wobble { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes chestShake { 0%, 60%, 100% { transform: translateY(-54%) rotate(0); } 70% { transform: translateY(-58%) rotate(-10deg); } 80% { transform: translateY(-58%) rotate(10deg); } 90% { transform: translateY(-56%) rotate(-5deg); } }
@keyframes cardIn { from { transform: scale(.75); opacity: 0; } }
@keyframes starPop { 0% { transform: scale(0) rotate(-60deg); } 70% { transform: scale(1.25) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes bump { 50% { transform: scale(1.3); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-7px); } }
@keyframes sway { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes confetti { to { transform: translateY(560px) rotate(calc(var(--r) + 720deg)); opacity: .2; } }
@keyframes bannerIn {
    0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; }
    15% { transform: translate(-50%, -50%) scale(1.14); opacity: 1; }
    25% { transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; }
    100% { transform: translate(-50%, -70%) scale(1); opacity: 0; }
}

/* ---------- smaller screens ---------- */

@media (max-width: 520px) {
    .fb-top { padding: 8px 10px 10px; }
    .fb-top-row { gap: 8px; }
    .fb-purse { gap: 8px; }
    .fb-counter { font-size: 15px; height: 28px; padding: 0 10px 0 24px; margin-left: 10px; }
    .fb-counter .fb-glyph { width: 32px; height: 32px; left: -12px; }
    .fb-icon-btn { width: 38px; height: 38px; }
    .fb-logo-fruit { display: none; }

    .fb-hud { gap: 10px; padding: 14px 10px 4px; }
    .fb-hud-panel { grid-template-columns: auto 1fr; gap: 8px 10px; padding: 6px 10px 6px 8px; }
    .fb-moves { width: 68px; height: 68px; margin: -10px 0; }
    .fb-moves strong { font-size: 30px; }
    .fb-goals { gap: 10px; }
    .fb-goal { width: 46px; height: 46px; }
    .fb-goal .fb-ico { width: 34px; height: 34px; }
    .fb-score { grid-column: 1 / -1; display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 10px; padding-top: 6px; border-top: 2px solid rgba(255, 255, 255, .1); }
    .fb-score strong { font-size: 20px; }
    .fb-score-bar { margin: 0 12px 0 4px; }
    .fb-pause { align-self: flex-start; margin-top: 8px; }

    .fb-node { width: 56px; height: 56px; margin: -28px 0 0 -28px; font-size: 22px; }
    .fb-node.current { width: 64px; height: 64px; margin: -32px 0 0 -32px; font-size: 26px; }
    .fb-shelf { gap: 20px; padding: 10px 22px 22px; }
    .fb-tool { width: 54px; height: 54px; }
    .fb-tool-icon { width: 38px; height: 38px; }
    .fb-card-body { padding: 18px 14px 20px; }
    .fb-days { gap: 8px; }

    .fb-dock { gap: 7px; padding-left: 8px; padding-right: 8px; }
    .fb-dock-btn { width: 50px; height: 50px; }
    .fb-dock-btn span { font-size: 13px; bottom: -17px; }
    .fb-play-next { min-width: 112px; padding: 6px 16px 11px; font-size: 22px; }
    .fb-play-next small { font-size: 12px; letter-spacing: 2px; }
    .fb-streak-badge { top: 1px; right: 2px; width: 24px; height: 28px; padding-top: 9px; font-size: 13px; }
    .fb-quest { gap: 9px; }
    .fb-quest b { font-size: 15px; }
}

@media (max-height: 600px) {
    .fb-hud { padding-top: 10px; }
    .fb-moves { width: 62px; height: 62px; margin: -8px 0; }
    .fb-moves strong { font-size: 27px; }
    .fb-goals-wrap > small { display: none; }
    .fb-goal { width: 44px; height: 44px; }
    .fb-goal .fb-ico { width: 32px; height: 32px; }
    .fb-tools { padding-top: 6px; }
    .fb-shelf { padding: 8px 20px; gap: 18px; }
    .fb-tool { width: 46px; height: 46px; }
    .fb-tool-icon { width: 32px; height: 32px; }
    .fb-tool span { display: none; }
    .fb-top-row + .fb-top-row { margin-top: 6px; }
    .fb-dock { padding-top: 20px; }
    .fb-dock-btn { width: 52px; height: 52px; }
    .fb-play-next { font-size: 23px; padding: 4px 24px 9px; }
}

@media (prefers-reduced-motion: reduce) {
    .fb-node.current::after, .fb-marker, .fb-play-next, .fb-play-next::after, .fb-moves.low, .fb-dot, .fb-rays,
    .fb-hero .fb-ico.big, .fb-logo-fruit, .fb-day.today, .fb-chest-bar.ready .fb-chest-icon { animation: none; }
    .fb-confetti { display: none; }
}
