.fg-game-shell,
.fg-game-shell * {
    box-sizing: border-box;
}

.fg-game-shell {
    --fg-bg: #081f18;
    --fg-panel: rgba(255, 255, 255, 0.94);
    --fg-ink: #10221b;
    --fg-muted: rgba(16, 34, 27, 0.66);
    --fg-lime: #b7ff5a;
    --fg-green: #0f7a4a;
    --fg-gold: #ffd166;
    --fg-red: #ef476f;
    --fg-blue: #118ab2;
    --fg-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 18px 10px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--fg-ink);
}

.fg-card {
    width: min(100%, 520px);
    overflow: hidden;
    border-radius: 28px;
    background:
        radial-gradient(circle at 10% 0%, rgba(183, 255, 90, 0.20), transparent 28%),
        linear-gradient(135deg, #0d3024 0%, #071813 52%, #0d3024 100%);
    box-shadow: var(--fg-shadow);
    border: 1px solid rgba(255, 255, 255, 0.16);
    padding: 14px;
}

.fg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 4px 4px 12px;
    color: white;
}

.fg-eyebrow {
    margin: 0 0 2px;
    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.68);
    font-weight: 800;
}

.fg-header h2 {
    margin: 0;
    font-size: clamp(30px, 8vw, 42px);
    line-height: 0.95;
    letter-spacing: -0.055em;
    color: white;
}

.fg-small-btn,
.fg-main-btn,
.fg-difficulty button {
    appearance: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-weight: 900;
    -webkit-tap-highlight-color: transparent;
}

.fg-small-btn {
    border-radius: 999px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.14);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.fg-small-btn:hover,
.fg-small-btn:focus-visible {
    background: rgba(255, 255, 255, 0.22);
}

.fg-scorebar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.fg-score-pill {
    border-radius: 18px;
    background: var(--fg-panel);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.fg-score-pill span {
    font-size: 11px;
    line-height: 1;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 900;
}

.fg-score-pill strong {
    margin-top: 4px;
    font-size: 25px;
    line-height: 1;
    color: var(--fg-ink);
}

.fg-difficulty {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.fg-difficulty button {
    padding: 11px 10px;
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.74);
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.13);
}

.fg-difficulty button.is-active {
    background: var(--fg-lime);
    color: #10221b;
    border-color: rgba(255, 255, 255, 0.64);
    box-shadow: 0 12px 24px rgba(183, 255, 90, 0.22);
}

.fg-stage-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: #12814e;
    border: 1px solid rgba(255, 255, 255, 0.20);
    touch-action: none;
}

.fg-canvas {
    display: block;
    width: 100%;
    aspect-ratio: 9 / 14;
    max-height: 78vh;
    background: #12814e;
    user-select: none;
    touch-action: none;
}

.fg-message {
    position: absolute;
    left: 50%;
    top: 48%;
    transform: translate(-50%, -50%) scale(1);
    width: min(82%, 330px);
    padding: 18px 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.90);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

.fg-message.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.02);
}

.fg-message strong {
    display: block;
    font-size: 26px;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--fg-ink);
}

.fg-message span {
    display: block;
    margin-top: 7px;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 750;
    color: var(--fg-muted);
}

.fg-footer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding-top: 12px;
}

.fg-tip {
    color: rgba(255, 255, 255, 0.70);
    font-size: 13px;
    line-height: 1.25;
    font-weight: 750;
}

.fg-main-btn {
    border-radius: 999px;
    padding: 13px 18px;
    background: white;
    color: var(--fg-ink);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.20);
}

.fg-main-btn:hover,
.fg-main-btn:focus-visible {
    transform: translateY(-1px);
}

.fg-main-btn[disabled] {
    opacity: 0.42;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 420px) {
    .fg-game-shell {
        padding: 8px 0;
    }

    .fg-card {
        border-radius: 0;
        width: 100%;
        min-height: 100svh;
        padding: 12px;
    }

    .fg-score-pill {
        padding: 8px 8px;
        min-height: 58px;
        border-radius: 15px;
    }

    .fg-score-pill strong {
        font-size: 22px;
    }

    .fg-stage-wrap {
        border-radius: 20px;
    }

    .fg-footer {
        grid-template-columns: 1fr;
    }

    .fg-main-btn {
        width: 100%;
    }
}
