/* ==========================================================================
   Bird Blocks — global theme & layout
   Component-specific layout lives in scoped *.razor.css files; this file holds
   the shared theme variables, the page shell, the reusable block visual, and
   the bird art.
   ========================================================================== */

:root {
    /* Every block is the same warm amber (wood-block look); modes that need a
       target use art/icons rather than color. */
    --bb-block-fill: #e8973a;

    /* Accent "species" colors — used by UI (logo, progress bars, mode chips),
       no longer by the blocks themselves. */
    --bb-robin: #f0563a;
    --bb-bluejay: #3d8bff;
    --bb-canary: #ffce33;
    --bb-parrot: #2fd07a;
    --bb-flamingo: #ff6fa5;
    --bb-raven: #9b6bff;

    /* Night-sky surfaces */
    --bb-bg-top: #1a1b2e;
    --bb-bg-bottom: #08080f;
    --bb-board-bg: #0b0c16;
    --bb-cell-empty: #191b2c;
    --bb-box-line: #050509;
    --bb-tray-bg: #0e0f1c;

    /* Text */
    --bb-text: #eef1f8;
    --bb-text-dim: #888fb0;

    /* Robin icon palette (overridable per instance) */
    --bird-back: #46557a;
    --bird-breast: #ef6c3b;
    --bird-beak: #f5b13e;
    --bird-eye: #11131b;
    --bird-wing: #36425f;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--bb-text);
    overscroll-behavior: none;
    -webkit-text-size-adjust: 100%;
}

/* Clean night-sky gradient, fixed so it stays put as content scrolls. This is
   the same gradient the loading screen uses, for a seamless hand-off. */
body {
    background:
        radial-gradient(125% 80% at 50% -12%, rgba(96, 116, 190, 0.26), transparent 62%),
        linear-gradient(165deg, var(--bb-bg-top) 0%, var(--bb-bg-bottom) 100%);
    background-attachment: fixed;
}

.bb-app {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: max(14px, env(safe-area-inset-top)) 12px
             max(14px, env(safe-area-inset-bottom)) 12px;
    box-sizing: border-box;
}

/* The game column is capped so it stays a comfortable size on desktop while
   filling the width on phones. */
.bb-game {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.bb-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: clamp(1.4rem, 6vw, 2rem);
    font-weight: 800;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(120, 140, 220, 0.25);
}

/* ==========================================================================
   Bird art (scalable icon library — see Components/BirdIcon.razor). The chosen
   SVG masks a solid fill (currentColor by default) so any bird can be tinted.
   ========================================================================== */
.bb-bird {
    display: inline-block;
    width: 1em;
    height: 1em;
    flex: none;
    background-color: currentColor;
    -webkit-mask: var(--bird-mask) center / contain no-repeat;
            mask: var(--bird-mask) center / contain no-repeat;
}

.bb-title-bird {
    width: 1.55em;
    height: 1.55em;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.4));
}

.bb-score {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.1;
}

.bb-score-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--bb-text-dim);
}

.bb-score-value {
    font-size: clamp(1.4rem, 6vw, 2rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.bb-score-best {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--bb-text-dim);
    font-variant-numeric: tabular-nums;
}

/* Header "Menu" button (returns to the main menu, saving the game). */
.bb-menu-button {
    flex: none;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--bb-text);
    font: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.15s ease;
}

.bb-menu-button:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* The current mode name, centered in the playing header. */
.bb-now-mode {
    flex: 1 1 auto;
    text-align: center;
    font-weight: 800;
    font-size: clamp(1rem, 4.5vw, 1.25rem);
    letter-spacing: 0.3px;
    color: var(--bb-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   Main menu (home screen)
   ========================================================================== */
.bb-menu {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.bb-menu-hero {
    text-align: center;
    padding: 8px 0 4px;
}

.bb-menu-bird {
    display: block;
    width: 92px;
    height: 92px;
    margin: 0 auto;
    /* Warm brand gradient clipped to the bird shape by the inherited mask. */
    background: linear-gradient(160deg, var(--bb-canary), var(--bb-robin));
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5));
}

.bb-menu-title {
    margin: 10px 0 4px;
    font-size: clamp(2rem, 9vw, 2.8rem);
    font-weight: 800;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 14px rgba(120, 140, 220, 0.3);
}

.bb-menu-sub {
    margin: 0;
    color: var(--bb-text-dim);
    font-size: 0.9rem;
}

/* Resume card — the prominent call to action when a game is in progress. */
.bb-continue {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px;
    border: 1px solid rgba(255, 206, 51, 0.4);
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(255, 206, 51, 0.14), rgba(240, 86, 58, 0.1));
    color: var(--bb-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: 0 0 28px -10px var(--bb-canary);
    transition: transform 0.06s ease, filter 0.15s ease;
}

.bb-continue:hover { filter: brightness(1.06); }
.bb-continue:active { transform: translateY(1px) scale(0.995); }

.bb-continue-top {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    font-weight: 800;
    color: var(--bb-canary);
}

.bb-continue-mid {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.bb-continue-mode {
    font-size: 1.3rem;
    font-weight: 800;
}

.bb-continue-score {
    color: var(--bb-text-dim);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.bb-continue-go {
    font-weight: 800;
    color: var(--bb-parrot);
}

/* Home screen — two big paths: Freeplay and Flyway. */
.bb-home-choices {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bb-home-choice {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--bb-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 0.06s ease, background 0.15s ease, border-color 0.15s ease;
}

.bb-home-choice:hover { border-color: rgba(255, 255, 255, 0.2); }
.bb-home-choice:active { transform: translateY(1px) scale(0.995); }

.bb-home-choice--freeplay {
    background: linear-gradient(150deg, rgba(61, 139, 255, 0.16), rgba(47, 208, 122, 0.1));
    border-color: rgba(61, 139, 255, 0.35);
}

.bb-home-choice--flyway {
    background: linear-gradient(150deg, rgba(255, 206, 51, 0.14), rgba(155, 107, 255, 0.12));
    border-color: rgba(255, 206, 51, 0.32);
}

.bb-home-choice-bird {
    width: 44px;
    height: 44px;
    margin-bottom: 2px;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.45));
}

.bb-home-choice-name {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.bb-home-choice-desc {
    font-size: 0.85rem;
    color: var(--bb-text-dim);
    line-height: 1.35;
}

.bb-home-choice-tag {
    margin-top: 4px;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--bb-parrot);
}

.bb-home-choice--flyway .bb-home-choice-tag {
    color: var(--bb-canary);
}

/* Submenu header (Back + title). */
.bb-submenu-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bb-submenu-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
}

.bb-menu-heading {
    margin: 0 0 10px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--bb-text-dim);
}

/* Modes are full-width rows so long names and one-line taglines have room
   to breathe instead of being squeezed into a narrow grid cell. */
.bb-menu-modes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bb-mode-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--bb-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 0.06s ease, background 0.15s ease, border-color 0.15s ease;
}

.bb-mode-row:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
}

.bb-mode-row:active { transform: translateY(1px) scale(0.995); }

.bb-mode-row-bird {
    width: 36px;
    height: 36px;
    flex: none;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

/* Text column takes the remaining width; min-width:0 lets the tagline wrap
   or ellipsize instead of forcing the row wider. */
.bb-mode-row-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bb-mode-row-name {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.2;
}

.bb-mode-row-tag {
    font-size: 0.82rem;
    color: var(--bb-text-dim);
    line-height: 1.3;
}

/* Best score sits at the trailing edge as a compact stacked badge. */
.bb-mode-row-best {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 4px 10px;
    border-radius: 10px;
    background: rgba(255, 206, 51, 0.12);
}

.bb-mode-row-best-label {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--bb-text-dim);
}

.bb-mode-row-best-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--bb-canary);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* Confirm dialog — shown when starting a game would overwrite a saved one. */
.bb-confirm {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(4, 4, 10, 0.78);
    backdrop-filter: blur(3px);
    animation: bb-fade-in 0.18s ease-out;
}

.bb-confirm-card {
    width: 100%;
    max-width: 340px;
    text-align: center;
    padding: 24px 22px 22px;
    border-radius: 18px;
    background: linear-gradient(160deg, #1c1e36, #0d0e1b);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
}

.bb-confirm-title {
    margin: 0 0 10px;
    font-size: 1.3rem;
    font-weight: 800;
}

.bb-confirm-text {
    margin: 0;
    color: var(--bb-text-dim);
    font-size: 0.92rem;
    line-height: 1.4;
}

.bb-confirm-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bb-confirm-actions .bb-button {
    margin-top: 0;
}

/* ==========================================================================
   Game-mode selector (segmented control) + goal progress
   ========================================================================== */
.bb-modes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-self: center;
    gap: 4px;
    padding: 4px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.bb-mode {
    padding: 6px 18px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--bb-text-dim);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
    transition: color 0.15s ease, background 0.15s ease;
}

.bb-mode.is-active {
    background: linear-gradient(90deg, var(--bb-parrot), var(--bb-bluejay));
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.bb-goal {
    align-self: stretch;
}

.bb-goal-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--bb-text-dim);
    font-variant-numeric: tabular-nums;
}

.bb-goal-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.bb-goal-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--bb-canary), var(--bb-robin));
    transition: width 0.3s ease;
}

.bb-goal--nests .bb-goal-fill {
    background: linear-gradient(90deg, #e6cf9a, #9a7748);
}

.bb-goal--migration .bb-goal-fill {
    background: linear-gradient(90deg, var(--bb-bluejay), var(--bb-parrot));
}

.bb-goal--gather .bb-goal-fill {
    background: linear-gradient(90deg, var(--bb-canary), var(--bb-flamingo));
}

/* Small bird emblem in the Gather HUD, matching the on-block mark. */
.bb-gather-mark {
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.2em;
    background-color: var(--bb-text);
    -webkit-mask: url("/_content/BirdBlocks.Core/birds/swallow.svg") center / contain no-repeat;
            mask: url("/_content/BirdBlocks.Core/birds/swallow.svg") center / contain no-repeat;
}

.bb-goal-subrow {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--bb-text-dim);
    font-variant-numeric: tabular-nums;
}

.bb-goal-subrow .bb-energy-low {
    color: var(--bb-robin);
}

.bb-cuckoo-hud {
    align-self: stretch;
    text-align: center;
    padding: 7px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--bb-text-dim);
    font-size: 0.82rem;
    font-weight: 600;
}

.bb-combo {
    align-self: center;
    margin-top: -4px;
    padding: 4px 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--bb-robin), var(--bb-flamingo));
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    box-shadow: 0 0 18px -2px var(--bb-flamingo), 0 3px 10px rgba(0, 0, 0, 0.4);
    animation: bb-combo-pop 0.25s ease-out;
}

@keyframes bb-combo-pop {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.bb-trays {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.bb-tray-slot {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* ==========================================================================
   Reusable block visual (board + trays + drag ghost). Every block is the same
   amber; only Gather's target blocks carry a mark (see .bb-block--marked).
   ========================================================================== */
.bb-block {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 5px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(0, 0, 0, 0.16)),
        var(--bb-block-fill);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.32),
        inset 0 -3px 5px rgba(0, 0, 0, 0.32),
        0 0 8px -2px var(--bb-block-fill);
}

/* Gather target: a bird emblem marks the blocks to collect into the flock. */
.bb-block--marked::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: #fff;
    -webkit-mask: url("/_content/BirdBlocks.Core/birds/swallow.svg") center / 58% no-repeat;
            mask: url("/_content/BirdBlocks.Core/birds/swallow.svg") center / 58% no-repeat;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
    pointer-events: none;
}

/* Cells of a completed line shrink and fade out before being removed.
   Duration must match the delay in GameView before the cells are cleared. */
.bb-block--clearing {
    animation: bb-clear 0.22s ease-in forwards;
}

@keyframes bb-clear {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(0.15); opacity: 0; }
}

/* Drop-preview variants of the block visual. */
.bb-block--preview {
    opacity: 0.42;
}

.bb-block--preview-invalid {
    background: rgba(240, 86, 58, 0.32);
    box-shadow: inset 0 0 0 2px rgba(240, 86, 58, 0.85);
}

/* ==========================================================================
   Game-over overlay
   ========================================================================== */
.bb-gameover {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(4, 4, 10, 0.78);
    backdrop-filter: blur(3px);
    animation: bb-fade-in 0.2s ease-out;
}

.bb-gameover-card {
    width: 100%;
    max-width: 320px;
    text-align: center;
    padding: 26px 24px 24px;
    border-radius: 18px;
    background: linear-gradient(160deg, #1c1e36, #0d0e1b);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
}

/* Goal-reached variant gets a warm golden glow. */
.bb-gameover-card--won {
    border-color: rgba(255, 206, 51, 0.45);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 44px -10px var(--bb-canary);
}

.bb-gameover-card--won .bb-gameover-title {
    color: var(--bb-canary);
}

/* The mode selector sits between the stats and the Play Again button. */
.bb-gameover .bb-modes {
    margin-top: 18px;
}

.bb-gameover-bird {
    display: block;
    width: 66px;
    height: 66px;
    margin: 0 auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

/* Mode chip above the result title, matching the menu's labelling. */
.bb-gameover-mode {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--bb-text-dim);
}

.bb-gameover-title {
    margin: 8px 0 12px;
    font-size: 1.5rem;
    font-weight: 800;
}

/* Best-score line; the new-record variant glows gold and pops in. */
.bb-gameover-best {
    margin: 6px 0 0;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    color: var(--bb-text-dim);
    font-variant-numeric: tabular-nums;
}

.bb-gameover-best.is-new {
    font-size: 1rem;
    color: var(--bb-canary);
    text-shadow: 0 0 14px rgba(255, 206, 51, 0.5);
    animation: bb-combo-pop 0.3s ease-out;
}

.bb-gameover-score {
    margin: 0;
    font-size: 1.1rem;
    color: var(--bb-text-dim);
}

.bb-gameover-score strong {
    color: var(--bb-text);
    font-size: 1.5rem;
}

.bb-gameover-combo {
    margin: 4px 0 0;
    color: var(--bb-flamingo);
    font-weight: 700;
}

.bb-button {
    margin-top: 20px;
    padding: 12px 28px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--bb-parrot), var(--bb-bluejay));
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: 0 0 22px -4px var(--bb-bluejay), 0 6px 16px rgba(0, 0, 0, 0.45);
    transition: transform 0.06s ease, filter 0.15s ease;
}

.bb-button:hover {
    filter: brightness(1.08);
}

.bb-button:active {
    transform: translateY(1px) scale(0.98);
}

@keyframes bb-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.bb-button--ghost {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.bb-gameover-actions {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bb-gameover-actions .bb-button {
    margin-top: 0;
}

/* ==========================================================================
   Flyway — journey banner + stop map
   ========================================================================== */
.bb-flyway-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.bb-flyway-back {
    flex: none;
    padding: 6px 12px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--bb-text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}

.bb-flyway-banner-bird {
    width: 28px;
    height: 28px;
    flex: none;
}

.bb-flyway-banner-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.bb-flyway-banner-name {
    font-weight: 800;
}

.bb-flyway-banner-obj {
    font-size: 0.8rem;
    color: var(--bb-text-dim);
}

.bb-flyway-map {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(4, 4, 10, 0.82);
    backdrop-filter: blur(3px);
    animation: bb-fade-in 0.2s ease-out;
}

.bb-flyway-card {
    width: 100%;
    max-width: 380px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    padding: 24px 20px;
    border-radius: 18px;
    background: linear-gradient(160deg, #1c1e36, #0d0e1b);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
}

.bb-flyway-bird {
    display: block;
    width: 52px;
    height: 52px;
    margin: 0 auto;
}

.bb-flyway-title {
    margin: 6px 0 2px;
    font-size: 1.6rem;
    font-weight: 800;
}

.bb-flyway-sub {
    margin: 0 0 16px;
    font-size: 0.85rem;
    color: var(--bb-text-dim);
}

.bb-flyway-resume {
    margin: 0 0 14px;
    width: 100%;
}

.bb-flyway-stops {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Stops mirror the Freeplay mode rows (.bb-mode-row): same padding, radius,
   spacing and hover so the two lists read as one consistent style. */
.bb-flyway-stop button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--bb-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 0.06s ease, background 0.15s ease, border-color 0.15s ease;
}

.bb-flyway-stop:not(.is-locked) button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
}

.bb-flyway-stop:not(.is-locked) button:active { transform: translateY(1px) scale(0.995); }

.bb-flyway-stop.is-current button {
    border-color: var(--bb-parrot);
    box-shadow: 0 0 16px -4px var(--bb-parrot);
}

.bb-flyway-stop.is-current button:hover {
    border-color: var(--bb-parrot);
}

.bb-flyway-stop.is-locked button {
    opacity: 0.5;
    cursor: not-allowed;
}

.bb-flyway-stop-num {
    flex: none;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    font-weight: 800;
    font-size: 0.85rem;
}

.bb-flyway-stop.is-done .bb-flyway-stop-num {
    background: var(--bb-parrot);
    color: #06281a;
}

.bb-flyway-stop-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bb-flyway-stop-name {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.2;
}

.bb-flyway-stop-obj {
    font-size: 0.82rem;
    color: var(--bb-text-dim);
    line-height: 1.3;
}

.bb-flyway-stop-state {
    flex: none;
    font-weight: 800;
}

.bb-flyway-complete {
    margin: 0 0 14px;
    color: var(--bb-canary);
    font-weight: 700;
}

/* ==========================================================================
   Drag ghost — the floating piece that follows the pointer. Its transform and
   --drag-cell size are set by js/dragdrop.js; Blazor never writes its style.
   ========================================================================== */
.bb-drag-layer {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    pointer-events: none;
    /* Start off-screen so there is no flash at (0,0) before JS positions it. */
    transform: translate(-100vw, -100vh);
    will-change: transform;
    filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.5));
}

.bb-drag-piece {
    display: grid;
    gap: 2px;
}

.bb-drag-cell {
    width: var(--drag-cell, 30px);
    height: var(--drag-cell, 30px);
}

@media (prefers-reduced-motion: reduce) {
    .bb-combo { animation: none; }
}
