:root {
    --sbg-ink: #17372d;
    --sbg-deep: #123b31;
    --sbg-cream: #fffaf0;
    --sbg-gold: #ffc83d;
    --sbg-red: #e32636;
    --sbg-red-deep: #8f1220;
    --sbg-card: rgba(255, 250, 240, 0.98);
}

body.sbg-lock-scroll {
    overflow: hidden !important;
    overscroll-behavior: none;
    touch-action: none;
}

.sbg-app,
.sbg-app * {
    box-sizing: border-box;
}

.sbg-app {
    position: fixed;
    inset: 0;
    z-index: 2147482000;
    width: 100vw;
    height: 100dvh;
    min-height: 100vh;
    overflow: hidden;
    isolation: isolate;
    background: var(--sbg-deep);
    color: var(--sbg-ink);
    font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

.sbg-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #8bdcf0 0 16%, #63ad58 16% 100%);
}

.sbg-topbar {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: auto minmax(250px, 1fr) auto auto auto;
    align-items: center;
    gap: clamp(8px, 1vw, 15px);
    min-height: 100px;
    padding: 9px clamp(10px, 1.7vw, 22px);
    border-bottom: 4px solid rgba(23, 55, 45, .19);
    background: rgba(255, 250, 240, .975);
    box-shadow: 0 10px 28px rgba(8, 42, 30, .2);
}

.sbg-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: max-content;
}

.sbg-brand__bee {
    display: grid;
    place-items: center;
    width: 64px;
    height: 48px;
    border-radius: 18px;
    background: linear-gradient(145deg, #fff4a5, #ffc83d);
    box-shadow: inset 0 -5px 0 rgba(109, 71, 8, .12), 0 4px 10px rgba(29, 61, 46, .12);
}

.sbg-bee-icon {
    display: block;
    width: 58px;
    height: 42px;
    overflow: visible;
}

.sbg-brand__name {
    max-width: 140px;
    font-size: clamp(18px, 1.7vw, 26px);
    font-weight: 1000;
    line-height: .98;
    letter-spacing: -.04em;
}

.sbg-question {
    min-width: 0;
    padding: 10px 16px;
    border: 2px solid rgba(23, 55, 45, .15);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 5px 0 rgba(23, 55, 45, .08);
    text-align: center;
}

.sbg-question__label {
    display: block;
    margin-bottom: 3px;
    color: #537267;
    font-size: 11px;
    font-weight: 1000;
    line-height: 1;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.sbg-question__text {
    display: block;
    font-size: clamp(17px, 2vw, 29px);
    font-weight: 1000;
    line-height: 1.1;
}

.sbg-stats {
    display: flex;
    gap: 7px;
}

.sbg-stats > div {
    display: grid;
    min-width: 66px;
    padding: 7px 9px;
    border-radius: 13px;
    background: #e6f3e8;
    text-align: center;
}

.sbg-stats span,
.sbg-timer-panel span {
    color: #537267;
    font-size: 10px;
    font-weight: 1000;
    line-height: 1;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sbg-stats strong {
    font-size: 22px;
    line-height: 1.08;
}

.sbg-timer-panel {
    display: grid;
    place-items: center;
    min-width: 138px;
    padding: 8px 14px 7px;
    border: 3px solid #f2a5ad;
    border-radius: 17px;
    background: linear-gradient(180deg, #fff8f8, #ffe3e6);
    box-shadow: 0 5px 0 rgba(143, 18, 32, .15), 0 8px 18px rgba(143, 18, 32, .11);
}

.sbg-timer-panel strong {
    color: var(--sbg-red);
    font-family: Consolas, "Courier New", monospace;
    font-size: clamp(32px, 3.2vw, 49px);
    font-weight: 1000;
    line-height: .98;
    letter-spacing: .025em;
    text-shadow: 0 2px 0 #fff;
}

.sbg-timer-panel.sbg-timer--urgent {
    border-color: var(--sbg-red);
    background: #fff0f1;
    animation: sbgUrgent 620ms ease-in-out infinite alternate;
}

@keyframes sbgUrgent {
    from { transform: scale(1); box-shadow: 0 5px 0 rgba(143,18,32,.18), 0 0 0 rgba(227,38,54,0); }
    to { transform: scale(1.045); box-shadow: 0 5px 0 rgba(143,18,32,.18), 0 0 24px rgba(227,38,54,.44); }
}

.sbg-actions {
    display: flex;
    gap: 5px;
}

.sbg-icon-btn,
.sbg-dpad button,
.sbg-primary,
.sbg-secondary {
    appearance: none;
    border: 0;
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.sbg-icon-btn {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #e7f3e9;
    color: var(--sbg-ink);
    font-size: 19px;
    font-weight: 1000;
}

.sbg-icon-btn:hover,
.sbg-icon-btn:focus-visible,
.sbg-dpad button:hover,
.sbg-dpad button:focus-visible,
.sbg-primary:focus-visible,
.sbg-secondary:focus-visible {
    outline: 4px solid var(--sbg-gold);
    outline-offset: 2px;
}

.sbg-stage {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #6ab35e;
}

.sbg-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #70b660;
    touch-action: none;
}

.sbg-toast {
    position: absolute;
    top: 18px;
    left: 50%;
    z-index: 7;
    max-width: min(86vw, 620px);
    padding: 11px 19px;
    transform: translate(-50%, -18px) scale(.94);
    border-radius: 999px;
    background: rgba(23, 55, 45, .94);
    color: #fff;
    font-size: clamp(14px, 1.5vw, 19px);
    font-weight: 1000;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.sbg-toast.sbg-toast--show {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
}

.sbg-toast.sbg-toast--wrong {
    background: rgba(143, 31, 39, .96);
}

.sbg-dpad {
    position: absolute;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
    z-index: 6;
    display: none;
    grid-template-columns: repeat(3, 54px);
    grid-template-rows: repeat(3, 54px);
    gap: 4px;
    opacity: .93;
    user-select: none;
}

.sbg-dpad button,
.sbg-dpad span {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: rgba(255, 250, 240, .94);
    color: var(--sbg-ink);
    box-shadow: 0 4px 0 rgba(23, 55, 45, .2);
    font-size: 21px;
    font-weight: 1000;
}

.sbg-dpad span {
    overflow: hidden;
    background: rgba(255, 218, 91, .96);
}

.sbg-dpad span .sbg-bee-icon {
    width: 46px;
    height: 34px;
}

.sbg-dpad button:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 rgba(23, 55, 45, .2);
}

.sbg-dpad [data-dir="up"] { grid-column: 2; grid-row: 1; }
.sbg-dpad [data-dir="left"] { grid-column: 1; grid-row: 2; }
.sbg-dpad span { grid-column: 2; grid-row: 2; }
.sbg-dpad [data-dir="right"] { grid-column: 3; grid-row: 2; }
.sbg-dpad [data-dir="down"] { grid-column: 2; grid-row: 3; }

.sbg-orientation {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 6;
    display: none;
    max-width: 180px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(23, 55, 45, .84);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    text-align: center;
}

.sbg-modal {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: none;
    place-items: center;
    padding: 18px;
    background: rgba(12, 46, 36, .72);
    backdrop-filter: blur(8px);
}

.sbg-modal--open {
    display: grid;
}

.sbg-card {
    width: min(92vw, 540px);
    max-height: 92dvh;
    overflow: auto;
    padding: clamp(22px, 4vw, 40px);
    border: 3px solid rgba(255, 255, 255, .72);
    border-radius: 28px;
    background: var(--sbg-card);
    box-shadow: 0 24px 70px rgba(8, 32, 22, .38);
    text-align: center;
    scrollbar-width: thin;
}

.sbg-card--start {
    width: min(94vw, 650px);
}

.sbg-card--results {
    width: min(94vw, 820px);
    padding: clamp(20px, 3vw, 34px);
}

.sbg-start-scene {
    position: relative;
    height: 118px;
    margin: -12px -12px 18px;
    overflow: hidden;
    border-radius: 21px;
    background: linear-gradient(#8bdcf0 0 61%, #82c96b 61% 100%);
}

.sbg-start-scene::before,
.sbg-start-scene::after {
    content: "";
    position: absolute;
    bottom: -22px;
    width: 64%;
    height: 76px;
    border-radius: 50% 50% 0 0;
    background: #4f9f53;
}

.sbg-start-scene::before { left: -8%; transform: rotate(4deg); }
.sbg-start-scene::after { right: -8%; background: #65b95e; transform: rotate(-4deg); }

.sbg-start-sun {
    position: absolute;
    top: 12px;
    right: 28px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #ffe671;
    box-shadow: 0 0 0 9px rgba(255, 230, 113, .22);
}

.sbg-start-bee {
    position: absolute;
    top: 27px;
    left: 25%;
    z-index: 3;
    display: block;
    width: 94px;
    animation: sbgBeeFloat 2.1s ease-in-out infinite alternate;
}

.sbg-start-bee .sbg-bee-icon { width: 94px; height: 68px; }

@keyframes sbgBeeFloat {
    from { transform: translate(-4px, 6px) rotate(-5deg); }
    to { transform: translate(16px, -7px) rotate(4deg); }
}

.sbg-start-flower {
    position: absolute;
    bottom: 3px;
    left: 58%;
    z-index: 3;
    color: #fff1a0;
    font-size: 50px;
    text-shadow: 0 3px 0 #4c8c44;
}

.sbg-start-flower--two { left: 72%; color: #ffd0e5; font-size: 41px; }
.sbg-start-flower--three { left: 84%; color: #d9cbff; font-size: 34px; }

.sbg-kicker {
    margin: 0 0 6px;
    color: #557367;
    font-size: 12px;
    font-weight: 1000;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.sbg-card h2 {
    margin: 0 0 12px;
    color: var(--sbg-ink);
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1;
    letter-spacing: -.04em;
}

.sbg-card h3 {
    margin: 0;
    font-size: 22px;
}

.sbg-card p {
    font-size: 17px;
    line-height: 1.5;
}

.sbg-rules {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 18px 0 23px;
}

.sbg-rules span {
    padding: 7px 11px;
    border-radius: 999px;
    background: #e8f3e9;
    font-size: 13px;
    font-weight: 900;
}

.sbg-primary,
.sbg-secondary {
    min-height: 50px;
    padding: 12px 24px;
    border-radius: 14px;
    font-weight: 1000;
}

.sbg-primary {
    background: linear-gradient(180deg, #ffd866, #f6b82c);
    color: #2d311f;
    box-shadow: 0 5px 0 #a87411;
}

.sbg-primary:active { transform: translateY(3px); box-shadow: 0 2px 0 #a87411; }

.sbg-secondary {
    margin-left: 8px;
    background: #e8f3e9;
    color: var(--sbg-ink);
    box-shadow: 0 4px 0 #a7c2ad;
}

.sbg-small {
    margin: 17px 0 0 !important;
    color: #677d74;
    font-size: 12px !important;
}

.sbg-results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 18px 0;
}

.sbg-results > div {
    display: grid;
    padding: 13px 10px;
    border-radius: 16px;
    background: #e9f4e9;
}

.sbg-results span {
    color: #5c756b;
    font-size: 11px;
    font-weight: 1000;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.sbg-results strong {
    font-size: clamp(27px, 4vw, 42px);
    line-height: 1.05;
}

.sbg-review-heading {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 18px 0 12px;
    padding: 12px 15px;
    border-radius: 17px;
    background: linear-gradient(90deg, #fff2b9, #fff9e3);
    text-align: left;
}

.sbg-review-heading > span {
    font-size: 36px;
}

.sbg-review-heading p {
    margin: 2px 0 0;
    color: #5c6f67;
    font-size: 14px;
}

.sbg-review-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
    margin-bottom: 20px;
    text-align: left;
}

.sbg-review-card {
    position: relative;
    overflow: hidden;
    padding: 15px 16px 15px 19px;
    border: 2px solid #e7d7be;
    border-radius: 17px;
    background: #fffdf8;
    box-shadow: 0 5px 0 rgba(85, 71, 48, .08);
}

.sbg-review-card::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 7px;
    background: linear-gradient(#ffc94b, #e996b7);
}

.sbg-review-question {
    margin: 0 0 10px !important;
    color: #536c62;
    font-size: 13px !important;
    font-weight: 800;
    line-height: 1.35 !important;
}

.sbg-review-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
}

.sbg-review-answer {
    min-width: 0;
    padding: 9px 10px;
    border-radius: 12px;
}

.sbg-review-answer span {
    display: block;
    margin-bottom: 3px;
    font-size: 9px;
    font-weight: 1000;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sbg-review-answer strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 19px;
    line-height: 1.08;
}

.sbg-review-answer--selected {
    background: #ffe9eb;
    color: #8a2430;
}

.sbg-review-answer--correct {
    background: #e2f4df;
    color: #255b32;
}

.sbg-review-empty {
    grid-column: 1 / -1;
    padding: 24px;
    border: 2px solid #b9d9b7;
    border-radius: 18px;
    background: #ecf8e9;
    text-align: center;
}

.sbg-review-empty strong {
    display: block;
    margin-bottom: 4px;
    font-size: 23px;
}

@media (pointer: coarse), (max-width: 900px) {
    .sbg-dpad { display: grid; }
}

@media (max-width: 900px) {
    .sbg-topbar {
        grid-template-columns: minmax(0, 1fr) auto auto;
        min-height: 122px;
        padding: 7px 9px;
    }

    .sbg-brand { display: none; }
    .sbg-question { grid-column: 1 / 2; grid-row: 1 / 3; align-self: stretch; display: grid; align-content: center; padding: 8px 10px; }
    .sbg-stats { grid-column: 2; grid-row: 1; }
    .sbg-timer-panel { grid-column: 2; grid-row: 2; min-width: 126px; }
    .sbg-actions { grid-column: 3; grid-row: 1 / 3; flex-direction: column; }
    .sbg-question__text { font-size: clamp(16px, 3vw, 22px); }
    .sbg-timer-panel strong { font-size: 36px; }
}

@media (max-width: 620px) {
    .sbg-topbar {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
        min-height: 132px;
    }

    .sbg-question { grid-column: 1; grid-row: 1 / 3; }
    .sbg-stats { grid-column: 2; grid-row: 1; }
    .sbg-timer-panel { grid-column: 2; grid-row: 2; min-width: 118px; padding-inline: 9px; }
    .sbg-actions { position: absolute; right: 7px; bottom: -48px; z-index: 11; flex-direction: row; }
    .sbg-icon-btn { width: 39px; height: 39px; background: rgba(255,250,240,.92); box-shadow: 0 3px 8px rgba(17,49,36,.18); }
    .sbg-stats > div { min-width: 55px; padding: 5px 6px; }
    .sbg-stats strong { font-size: 18px; }
    .sbg-question__label { font-size: 9px; }
    .sbg-question__text { font-size: 15px; }
    .sbg-timer-panel strong { font-size: 31px; }
    .sbg-dpad { transform: scale(.9); transform-origin: bottom left; }
    .sbg-orientation { display: block; }
    .sbg-results { gap: 6px; }
    .sbg-results > div { padding: 9px 5px; }
    .sbg-results strong { font-size: 24px; }
    .sbg-review-list { grid-template-columns: 1fr; }
    .sbg-card--results { padding: 18px 14px; }
    .sbg-review-row { grid-template-columns: 1fr 1fr; }
}

@media (max-height: 600px) and (orientation: landscape) {
    .sbg-topbar { min-height: 82px; padding-block: 5px; }
    .sbg-brand__bee { width: 54px; height: 40px; }
    .sbg-brand__name { font-size: 18px; }
    .sbg-question { padding-block: 6px; }
    .sbg-question__text { font-size: 17px; }
    .sbg-timer-panel { padding-block: 5px; }
    .sbg-timer-panel strong { font-size: 32px; }
    .sbg-icon-btn { width: 36px; height: 36px; }
    .sbg-dpad { transform: scale(.78); transform-origin: bottom left; }
    .sbg-card { max-height: 96dvh; }
}

@media (prefers-reduced-motion: reduce) {
    .sbg-start-bee,
    .sbg-timer-panel.sbg-timer--urgent {
        animation: none;
    }
}

.sbg-bee-avatar { display:block; width:100%; height:100%; object-fit:contain; user-select:none; -webkit-user-drag:none; }


/* 1.4.0 WIP full-screen gameplay refresh — keeps the maze as the visual focus. */
.sbg-shell {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #5b9e52;
}

.sbg-stage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #5b9e52;
}

.sbg-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.sbg-topbar {
    position: absolute;
    top: max(8px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    z-index: 14;
    display: grid;
    grid-template-columns: auto minmax(260px, 1fr) auto auto auto;
    align-items: center;
    gap: clamp(7px, .9vw, 12px);
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
}

.sbg-topbar > * { pointer-events: auto; }

.sbg-brand,
.sbg-question,
.sbg-stats > div,
.sbg-timer-panel,
.sbg-icon-btn {
    border: 2px solid rgba(91, 57, 24, .56);
    box-shadow: 0 5px 0 rgba(80, 47, 21, .28), 0 8px 18px rgba(24, 51, 35, .18);
}

.sbg-brand {
    min-width: 158px;
    min-height: 58px;
    padding: 7px 12px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,247,204,.98), rgba(247,213,118,.97));
}

.sbg-brand__bee {
    width: 50px;
    height: 39px;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.sbg-brand__name {
    max-width: 112px;
    font-size: clamp(18px, 1.55vw, 24px);
    color: #513516;
    text-shadow: 0 1px 0 #fff2be;
}

.sbg-question {
    min-height: 58px;
    padding: 7px 14px;
    border-radius: 18px;
    background: rgba(255, 252, 236, .96);
}

.sbg-question__label {
    color: #775c36;
    font-size: 10px;
}

.sbg-question__text {
    color: #253e2d;
    font-size: clamp(15px, 1.55vw, 22px);
}

.sbg-stats {
    gap: 6px;
}

.sbg-stats > div {
    min-width: 67px;
    min-height: 58px;
    align-content: center;
    padding: 6px 8px;
    border-radius: 16px;
    background: rgba(255, 249, 223, .96);
}

.sbg-stats > div:nth-child(2) {
    background: rgba(232, 247, 210, .97);
}

.sbg-stats > div:nth-child(3) {
    min-width: 78px;
    background: rgba(255, 237, 165, .97);
}

.sbg-stats span,
.sbg-timer-panel span {
    color: #775c36;
}

.sbg-stats strong {
    color: #253e2d;
    font-size: 19px;
}

.sbg-timer-panel {
    min-width: 108px;
    min-height: 58px;
    padding: 5px 10px;
    border-color: rgba(139, 67, 43, .56);
    background: rgba(255, 242, 218, .97);
}

.sbg-timer-panel strong {
    font-size: clamp(27px, 2.8vw, 38px);
}

.sbg-actions {
    gap: 6px;
}

.sbg-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 244, 190, .96);
}

.sbg-toast {
    top: 86px;
}

.sbg-garden-banner {
    position: absolute;
    left: 50%;
    bottom: max(14px, env(safe-area-inset-bottom));
    z-index: 8;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    width: min(690px, calc(100vw - 28px));
    padding: 10px 14px;
    transform: translate(-50%, 24px) scale(.96);
    border: 3px solid #ffdf65;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(142,56,166,.97), rgba(100,35,135,.97));
    box-shadow: 0 8px 0 rgba(67, 28, 89, .34), 0 15px 32px rgba(32, 30, 55, .28), 0 0 28px rgba(255, 222, 91, .28);
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.sbg-garden-banner--open {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
}

.sbg-garden-banner__flower {
    color: #ffdd52;
    font-size: 34px;
    line-height: 1;
    text-shadow: 0 2px 0 #6b2b85;
}

.sbg-garden-banner__copy {
    min-width: 0;
    text-align: left;
}

.sbg-garden-banner__copy strong,
.sbg-garden-banner__copy small {
    display: block;
}

.sbg-garden-banner__copy strong {
    font-size: clamp(18px, 2vw, 25px);
    line-height: 1.05;
}

.sbg-garden-banner__copy small {
    margin-top: 2px;
    color: #fff5bc;
    font-size: clamp(11px, 1.2vw, 14px);
    font-weight: 900;
}

.sbg-garden-banner__count,
.sbg-garden-banner__time {
    display: grid;
    place-items: center;
    min-width: 58px;
    min-height: 42px;
    padding: 5px 8px;
    border-radius: 13px;
    background: rgba(255,255,255,.16);
    font-size: 18px;
    font-weight: 1000;
}

.sbg-garden-banner__time {
    min-width: 50px;
    background: rgba(255, 218, 78, .2);
    color: #fff2a7;
    font-family: Consolas, "Courier New", monospace;
}

@media (max-width: 900px) {
    .sbg-topbar {
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-rows: auto auto;
        gap: 5px;
    }

    .sbg-brand { display: none; }
    .sbg-question {
        grid-column: 1;
        grid-row: 1 / 3;
        min-height: 70px;
        padding: 6px 9px;
    }
    .sbg-stats {
        grid-column: 2;
        grid-row: 1;
    }
    .sbg-stats > div {
        min-width: 53px;
        min-height: 37px;
        padding: 3px 5px;
        border-radius: 11px;
        box-shadow: 0 3px 0 rgba(80,47,21,.22);
    }
    .sbg-stats > div:nth-child(3) { min-width: 61px; }
    .sbg-stats span { font-size: 8px; }
    .sbg-stats strong { font-size: 14px; }
    .sbg-timer-panel {
        grid-column: 2;
        grid-row: 2;
        min-width: 95px;
        min-height: 32px;
        padding: 3px 7px;
        border-width: 2px;
        border-radius: 11px;
        box-shadow: 0 3px 0 rgba(80,47,21,.22);
    }
    .sbg-timer-panel strong { font-size: 23px; }
    .sbg-actions {
        grid-column: 3;
        grid-row: 1 / 3;
        flex-direction: column;
    }
    .sbg-icon-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
        box-shadow: 0 3px 0 rgba(80,47,21,.22);
    }
    .sbg-toast { top: 82px; }
    .sbg-garden-banner {
        bottom: max(8px, env(safe-area-inset-bottom));
        width: min(560px, calc(100vw - 18px));
        padding: 8px 10px;
        gap: 7px;
    }
    .sbg-garden-banner__flower { font-size: 27px; }
    .sbg-garden-banner__count,
    .sbg-garden-banner__time {
        min-width: 45px;
        min-height: 34px;
        padding: 3px 6px;
        font-size: 14px;
    }
}

@media (max-width: 620px) {
    .sbg-topbar {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
    }
    .sbg-question { grid-column: 1; grid-row: 1 / 3; }
    .sbg-stats { grid-column: 2; grid-row: 1; }
    .sbg-stats > div:nth-child(3) { display: none; }
    .sbg-timer-panel { grid-column: 2; grid-row: 2; }
    .sbg-actions {
        position: absolute;
        top: 78px;
        right: 0;
        bottom: auto;
        z-index: 15;
        flex-direction: row;
    }
    .sbg-garden-banner {
        grid-template-columns: auto minmax(0, 1fr) auto;
        padding-right: 8px;
    }
    .sbg-garden-banner__time { display: none; }
    .sbg-garden-banner__copy small { font-size: 10px; }
    .sbg-dpad {
        transform: scale(.82);
        transform-origin: bottom left;
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    .sbg-topbar {
        top: 5px;
        left: 6px;
        right: 6px;
        gap: 5px;
    }
    .sbg-brand { min-width: 128px; min-height: 44px; padding: 4px 8px; }
    .sbg-brand__bee { width: 39px; height: 31px; }
    .sbg-brand__name { font-size: 17px; }
    .sbg-question { min-height: 44px; padding-block: 4px; }
    .sbg-question__text { font-size: 15px; }
    .sbg-stats > div { min-height: 44px; }
    .sbg-timer-panel { min-height: 44px; }
    .sbg-timer-panel strong { font-size: 25px; }
    .sbg-icon-btn { width: 34px; height: 34px; }
    .sbg-toast { top: 62px; }
    .sbg-garden-banner {
        bottom: 7px;
        width: min(600px, calc(100vw - 16px));
        padding-block: 7px;
    }
    .sbg-garden-banner__copy strong { font-size: 17px; }
    .sbg-garden-banner__copy small { font-size: 10px; }
}


/* === 1.5.0 PREMIUM VISUAL + GAME-FEEL PASS ===
   Presentation-only layer over the proven maze/collision/question logic.
   No external libraries, fonts or network assets are required. */
.sbg-app {
    --sbg-hud: rgba(8, 31, 30, .90);
    --sbg-hud-2: rgba(16, 56, 46, .94);
    --sbg-hud-border: rgba(255, 218, 99, .72);
    --sbg-mint: #72f0af;
    --sbg-gold: #ffd85a;
    --sbg-cream: #fff7d7;
    font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
    background: #163f34;
}

.sbg-shell,
.sbg-stage,
.sbg-canvas { background: #428c49; }

.sbg-topbar {
    top: max(10px, env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    grid-template-columns: auto minmax(280px, 1fr) auto auto auto;
    gap: 9px;
}

.sbg-brand,
.sbg-question,
.sbg-stat,
.sbg-timer-panel,
.sbg-icon-btn {
    border: 2px solid rgba(255, 224, 112, .72);
    background: linear-gradient(180deg, rgba(24, 69, 56, .96), rgba(8, 35, 32, .96));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 6px 0 rgba(8,28,24,.30), 0 12px 24px rgba(5,30,24,.24);
    color: #fff8dd;
}

.sbg-brand {
    min-width: 176px;
    min-height: 60px;
    border-radius: 19px;
    padding: 6px 13px 6px 8px;
}
.sbg-brand__bee { width: 55px; height: 43px; background: transparent; }
.sbg-brand__name { color: #fff4bd; text-shadow: 0 2px 0 #1c4d3c; letter-spacing: -.035em; }

.sbg-question {
    min-height: 60px;
    border-color: rgba(123, 232, 174, .62);
    background: linear-gradient(180deg, rgba(14, 52, 46, .97), rgba(7, 30, 31, .97));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 6px 0 rgba(4,25,25,.30), 0 12px 25px rgba(4,25,25,.24);
}
.sbg-question__label { color: #83e9b2; }
.sbg-question__text { color: #fff9e8; text-shadow: 0 2px 0 rgba(0,0,0,.28); }

.sbg-stats { gap: 7px; }
.sbg-stat {
    position: relative;
    min-width: 72px !important;
    min-height: 60px !important;
    padding: 6px 9px !important;
    border-radius: 17px !important;
    overflow: hidden;
}
.sbg-stat::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 42%;
    background: linear-gradient(180deg, rgba(255,255,255,.08), transparent);
    pointer-events: none;
}
.sbg-stat--score { border-color: rgba(255, 217, 86, .78); }
.sbg-stat--streak { border-color: rgba(111, 237, 164, .72); }
.sbg-stat--garden { border-color: rgba(246, 186, 255, .62); min-width: 88px !important; }
.sbg-stats span, .sbg-timer-panel span { color: #b8ddc8; }
.sbg-stats strong { color: #fff7d2; font-size: 19px; }

.sbg-streak-pips {
    display: flex !important;
    justify-content: center;
    gap: 3px;
    margin-top: 3px;
}
.sbg-streak-pips i {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(190,238,205,.52);
    background: rgba(255,255,255,.10);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.24);
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.sbg-streak-pips i.is-on {
    transform: scale(1.18);
    background: #74f2a4;
    box-shadow: 0 0 10px rgba(98,255,160,.8);
}

.sbg-timer-panel {
    min-width: 112px;
    min-height: 60px;
    border-color: rgba(255, 151, 118, .72);
}
.sbg-timer-panel strong { color: #ffbb82; text-shadow: 0 2px 0 rgba(0,0,0,.30); }
.sbg-timer-panel.sbg-timer--urgent { border-color: #ff846e; background: linear-gradient(180deg, rgba(104,35,38,.97), rgba(54,20,27,.97)); }

.sbg-icon-btn {
    width: 43px;
    height: 43px;
    border-radius: 50%;
    font-size: 18px;
}
.sbg-icon-btn:hover { transform: translateY(-1px); filter: brightness(1.12); }
.sbg-icon-btn:active { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 2px 0 rgba(8,28,24,.32); }

.sbg-toast {
    top: 86px;
    border: 2px solid rgba(255, 224, 112, .72);
    background: linear-gradient(180deg, rgba(17,65,51,.97), rgba(7,38,34,.97));
    box-shadow: 0 8px 24px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.10);
}
.sbg-toast--wrong { border-color: rgba(255,153,166,.82); background: linear-gradient(180deg, rgba(117,42,53,.97), rgba(71,25,34,.97)); }

.sbg-garden-banner {
    border-color: #ffe169;
    background: linear-gradient(180deg, rgba(122, 54, 151, .98), rgba(71, 27, 112, .98));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 8px 0 rgba(55,25,75,.38), 0 18px 36px rgba(25,20,48,.34), 0 0 35px rgba(255,221,89,.34);
}
.sbg-app.sbg-garden-live .sbg-stat--garden {
    border-color: #ffe066;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 6px 0 rgba(8,28,24,.30), 0 0 26px rgba(255,221,92,.38);
}

.sbg-dpad { opacity: .97; }
.sbg-dpad button,
.sbg-dpad span {
    border: 2px solid rgba(255,224,112,.65);
    background: rgba(9, 40, 36, .91);
    color: #fff7ce;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 4px 0 rgba(4,25,22,.36), 0 8px 18px rgba(5,30,25,.18);
}
.sbg-dpad span { background: rgba(54, 117, 67, .94); }

.sbg-modal { background: radial-gradient(circle at 50% 38%, rgba(28,83,59,.65), rgba(5,27,26,.91)); backdrop-filter: blur(10px); }
.sbg-card {
    border: 2px solid rgba(255,224,117,.70);
    background:
        radial-gradient(circle at 82% 8%, rgba(255,218,94,.16), transparent 24%),
        radial-gradient(circle at 12% 95%, rgba(87,223,151,.13), transparent 28%),
        linear-gradient(180deg, rgba(17,58,49,.985), rgba(7,30,31,.99));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 26px 80px rgba(0,0,0,.48);
    color: #fff8df;
}
.sbg-card h2, .sbg-card h3 { color: #fff4bd; }
.sbg-card p { color: #d9e8df; }
.sbg-kicker { color: #79efad !important; }
.sbg-rules span { background: rgba(255,255,255,.07); border-color: rgba(131,231,178,.25); color: #eaf7ef; }
.sbg-primary {
    border: 2px solid #bbff8d;
    background: linear-gradient(180deg, #77ed75, #27b85c);
    color: #092e24;
    box-shadow: 0 6px 0 #15793d, 0 11px 24px rgba(0,0,0,.24);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.sbg-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.sbg-primary:active { transform: translateY(4px); box-shadow: 0 2px 0 #15793d; }
.sbg-secondary { border-color: rgba(255,255,255,.25); color: #eef7f1; background: rgba(255,255,255,.06); }

.sbg-start-scene {
    border: 1px solid rgba(255,224,117,.40);
    background: linear-gradient(180deg,#83d8e8 0 42%,#66b754 42% 100%);
    box-shadow: inset 0 -26px 40px rgba(25,86,45,.18), 0 10px 26px rgba(0,0,0,.18);
}
.sbg-start-bee { filter: drop-shadow(0 8px 8px rgba(16,55,34,.26)); }

.sbg-results > div,
.sbg-review-card,
.sbg-review-empty { background: rgba(255,255,255,.065); border-color: rgba(255,224,117,.20); color: #f7fbf7; }
.sbg-review-answer--selected { background: rgba(142,57,68,.38); }
.sbg-review-answer--correct { background: rgba(46,126,77,.38); }

@media (max-width: 900px) {
    .sbg-topbar { grid-template-columns: minmax(0,1fr) auto auto; }
    .sbg-question { min-height: 69px; }
    .sbg-stat { min-width: 54px !important; min-height: 38px !important; padding: 3px 5px !important; }
    .sbg-stat--garden { min-width: 64px !important; }
    .sbg-streak-pips i { width: 6px; height: 6px; }
    .sbg-timer-panel { min-height: 34px; }
}

@media (max-width: 620px) {
    .sbg-stat--garden { display: none !important; }
    .sbg-topbar { gap: 5px; }
    .sbg-question { border-radius: 14px; }
}

@media (max-height: 600px) and (orientation: landscape) {
    .sbg-topbar { top: 5px; }
    .sbg-brand, .sbg-question, .sbg-stat, .sbg-timer-panel { min-height: 44px !important; }
}

@media (prefers-reduced-motion: reduce) {
    .sbg-streak-pips i,
    .sbg-icon-btn,
    .sbg-primary,
    .sbg-garden-banner { transition: none !important; }
}

/* Final 1.5.0 specificity guard: legacy 1.4 nth-child backgrounds must not override the premium HUD. */
.sbg-app .sbg-stat--score,
.sbg-app .sbg-stat--streak,
.sbg-app .sbg-stat--garden {
    background: linear-gradient(180deg, rgba(24, 69, 56, .96), rgba(8, 35, 32, .96)) !important;
}
.sbg-app .sbg-stat--streak { background: linear-gradient(180deg, rgba(23, 78, 54, .97), rgba(8, 41, 34, .97)) !important; }
.sbg-app .sbg-stat--garden { background: linear-gradient(180deg, rgba(66, 54, 91, .97), rgba(32, 31, 59, .97)) !important; }
.sbg-app .sbg-stats strong { color: #fff7d2 !important; }

/* Android/tablet landscape: keep every gameplay control on-screen instead of letting the HUD overflow. */
@media (max-width: 1024px) and (max-height: 600px) and (orientation: landscape) {
    .sbg-topbar {
        grid-template-columns: minmax(240px, 1fr) auto auto auto;
        grid-template-rows: auto;
        align-items: start;
    }
    .sbg-brand { display: none; }
    .sbg-question { grid-column: 1; grid-row: 1; min-height: 48px !important; }
    .sbg-stats { grid-column: 2; grid-row: 1; }
    .sbg-timer-panel { grid-column: 3; grid-row: 1; min-width: 96px; }
    .sbg-actions { grid-column: 4; grid-row: 1; position: static; flex-direction: row; }
    .sbg-icon-btn { width: 34px; height: 34px; }
}


/* v1.7.0 — adaptive spelling mode selector */
.sbg-mode-chip{display:inline-flex;align-items:center;justify-content:center;margin-left:5px;padding:3px 8px;border:1px solid rgba(255,226,105,.42);border-radius:999px;background:rgba(18,61,47,.78);color:#fff1a8;font:900 10px/1.2 "Trebuchet MS",sans-serif;text-transform:uppercase;letter-spacing:.05em;white-space:nowrap}
.sbg-mode-picker{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;width:min(760px,100%);margin:13px auto 7px}
.sbg-mode-option{position:relative;min-height:92px;padding:11px 10px;border:2px solid rgba(141,225,181,.24);border-radius:15px;background:linear-gradient(180deg,rgba(16,54,48,.94),rgba(9,34,36,.97));color:#ecfff2;text-align:left;box-shadow:inset 0 1px rgba(255,255,255,.05),0 5px 16px rgba(0,0,0,.2);cursor:pointer;transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease}
.sbg-mode-option:hover,.sbg-mode-option:focus-visible{transform:translateY(-2px);border-color:#7be6a5;outline:none}
.sbg-mode-option.is-selected{border-color:#ffe06b;box-shadow:0 0 0 2px rgba(255,224,107,.16),0 8px 22px rgba(0,0,0,.28);background:linear-gradient(180deg,rgba(29,86,57,.98),rgba(12,47,39,.98))}
.sbg-mode-option strong{display:block;color:#fff7ca;font:1000 17px/1.1 "Trebuchet MS",sans-serif}
.sbg-mode-option small{display:block;margin-top:7px;color:#d5ebe0;font:700 12px/1.3 system-ui,sans-serif}
.sbg-mode-option span{position:absolute;top:8px;right:8px;padding:3px 6px;border-radius:999px;background:#ffe06b;color:#17382e;font:1000 8px/1 system-ui,sans-serif;text-transform:uppercase;letter-spacing:.04em}
.sbg-mode-note{margin:4px auto 10px!important;color:#c9e9d5!important;font-weight:800!important;text-align:center}
.sbg-session-summary{margin:10px 0 12px;padding:9px 12px;border:1px solid rgba(132,222,172,.22);border-radius:12px;background:rgba(18,61,47,.5);color:#e4f7ea;font:700 13px/1.4 system-ui,sans-serif}
.sbg-results{grid-template-columns:repeat(5,minmax(0,1fr))!important}
@media(max-width:760px){.sbg-mode-picker{grid-template-columns:1fr}.sbg-mode-option{min-height:67px}.sbg-results{grid-template-columns:repeat(2,minmax(0,1fr))!important}.sbg-mode-chip{display:none}}
@media(max-height:600px) and (orientation:landscape){.sbg-mode-picker{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:7px auto 5px}.sbg-mode-option{min-height:58px;padding:7px 8px}.sbg-mode-option strong{font-size:13px}.sbg-mode-option small{font-size:9px;margin-top:3px}.sbg-mode-note{display:none}}

/* v1.8.0 — professional gameplay, accessibility and mode-control pass */
.sbg-instructions {
    margin-inline: auto !important;
    max-width: 60ch;
    color: #f5fbf7 !important;
    font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif !important;
    font-size: 17px !important;
    font-weight: 700;
    line-height: 1.55 !important;
    letter-spacing: .005em !important;
    word-spacing: .08em !important;
    white-space: normal !important;
    text-rendering: optimizeLegibility;
}

.sbg-mode-toggle {
    appearance: none;
    min-width: 108px;
    min-height: 42px;
    margin: 0;
    padding: 7px 10px;
    border: 2px solid rgba(255, 224, 105, .7);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(35, 93, 70, .98), rgba(11, 51, 44, .98));
    color: #fff !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 4px 0 rgba(5,31,26,.36);
    font: 1000 10px/1.1 "Trebuchet MS", sans-serif;
    letter-spacing: .045em;
    text-transform: uppercase;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.sbg-mode-toggle:hover,
.sbg-mode-toggle:focus-visible {
    border-color: #fff0a1;
    filter: brightness(1.08);
    outline: 3px solid rgba(255, 224, 105, .55);
    outline-offset: 2px;
}
.sbg-mode-toggle:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 2px 0 rgba(5,31,26,.36); }

/* The results modal is deliberately dark; every textual element on that surface is white by default. */
.sbg-card--results,
.sbg-card--results h2,
.sbg-card--results h3,
.sbg-card--results p,
.sbg-card--results span,
.sbg-card--results strong,
.sbg-card--results .sbg-review-question,
.sbg-card--results .sbg-review-answer,
.sbg-card--results .sbg-review-answer span,
.sbg-card--results .sbg-review-answer strong,
.sbg-card--results .sbg-session-summary,
.sbg-card--results .sbg-review-empty,
.sbg-card--results .sbg-review-empty strong {
    color: #fff !important;
}
.sbg-card--results .sbg-results > div {
    border: 1px solid rgba(255,255,255,.13);
    background: linear-gradient(180deg, rgba(36, 83, 66, .92), rgba(14, 53, 46, .94));
}
.sbg-card--results .sbg-review-heading {
    border: 1px solid rgba(255,224,117,.22);
    background: linear-gradient(90deg, rgba(39, 87, 69, .92), rgba(27, 66, 59, .92));
}
.sbg-card--results .sbg-review-card {
    border-color: rgba(255,224,117,.20);
    background: linear-gradient(180deg, rgba(31, 70, 59, .92), rgba(17, 49, 45, .95));
}
.sbg-card--results .sbg-review-answer--selected {
    border: 1px solid rgba(255, 174, 184, .22);
    background: rgba(127, 49, 61, .48);
}
.sbg-card--results .sbg-review-answer--correct {
    border: 1px solid rgba(139, 244, 166, .22);
    background: rgba(34, 112, 65, .48);
}
.sbg-review-feedback {
    margin: 11px 0 0 !important;
    padding: 10px 11px;
    border-left: 3px solid #ffe071;
    border-radius: 8px;
    background: rgba(255,255,255,.06);
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 700;
    line-height: 1.45 !important;
}
.sbg-card--results .sbg-primary { color: #092e24 !important; }

@media (max-width: 760px) {
    .sbg-mode-chip.sbg-mode-toggle { display: inline-flex !important; }
}

@media (max-width: 1024px) and (max-height: 600px) and (orientation: landscape) {
    .sbg-actions { gap: 4px; align-items: center; }
    .sbg-mode-toggle {
        display: inline-flex !important;
        min-width: 82px;
        min-height: 34px;
        height: 34px;
        padding: 4px 6px;
        border-radius: 10px;
        font-size: 8px;
        line-height: 1.05;
    }
    .sbg-icon-btn { width: 32px; height: 34px; }
}

/* v1.8.0 compact start screen for short landscape devices (Android/Chromebook split-screen). */
@media (max-width: 1024px) and (max-height: 520px) and (orientation: landscape) {
    .sbg-modal[data-sbg-start-modal] { align-items: center; padding: 5px; }
    .sbg-card--start {
        width: min(96vw, 820px);
        max-height: 97dvh;
        padding: 10px 14px 11px;
        border-radius: 18px;
    }
    .sbg-card--start .sbg-start-scene {
        height: 48px;
        margin: -2px -4px 6px;
        border-radius: 13px;
    }
    .sbg-card--start .sbg-start-sun { top: 6px; right: 22px; width: 24px; height: 24px; box-shadow: 0 0 0 5px rgba(255,230,113,.18); }
    .sbg-card--start .sbg-start-bee { top: 1px; left: 22%; width: 64px; }
    .sbg-card--start .sbg-start-bee .sbg-bee-icon { width: 64px; height: 46px; }
    .sbg-card--start .sbg-start-flower { bottom: -3px; font-size: 30px; }
    .sbg-card--start .sbg-start-flower--two { font-size: 26px; }
    .sbg-card--start .sbg-start-flower--three { font-size: 22px; }
    .sbg-card--start .sbg-kicker { margin-bottom: 2px; font-size: 9px; }
    .sbg-card--start h2 { margin-bottom: 4px; font-size: 24px; line-height: 1; }
    .sbg-card--start .sbg-instructions {
        max-width: 92ch;
        margin: 0 auto 4px !important;
        font-size: 11px !important;
        line-height: 1.28 !important;
    }
    .sbg-card--start .sbg-mode-picker { gap: 5px; margin: 5px auto 3px; }
    .sbg-card--start .sbg-mode-option { min-height: 49px; padding: 5px 7px; border-radius: 11px; }
    .sbg-card--start .sbg-mode-option strong { font-size: 12px; }
    .sbg-card--start .sbg-mode-option small { margin-top: 2px; font-size: 8px; line-height: 1.15; }
    .sbg-card--start .sbg-mode-option span { top: 4px; right: 4px; padding: 2px 4px; font-size: 6px; }
    .sbg-card--start .sbg-mode-note { display: none; }
    .sbg-card--start .sbg-rules { gap: 4px; margin: 4px 0 6px; }
    .sbg-card--start .sbg-rules span { padding: 3px 6px; font-size: 8px; }
    .sbg-card--start .sbg-primary { min-height: 34px; padding: 6px 18px; border-radius: 10px; font-size: 12px; }
    .sbg-card--start .sbg-small { margin: 5px 0 0; font-size: 8px; line-height: 1.2; }
}
