#game-root .bg-shell {
    box-sizing: border-box;
    width: min(100%, 780px);
    margin: 0 auto;
    padding: 0 0 8px;
    color: var(--cg-ink);
    font-family: Inter, Arial, sans-serif;
}

#game-root .bg-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

#game-root .bg-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

#game-root .bg-info-t {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}

#game-root .bg-info-t strong {
    font-size: 1rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#game-root .bg-info-t span {
    color: var(--cg-muted);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#game-root .bg-dot {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #8c6b32;
    background: radial-gradient(circle at 35% 30%, #fffdf4, #efdcae 60%, #b8975b);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: background 200ms;
}

#game-root .bg-dot-2 {
    border-color: #d9a441;
    background: radial-gradient(circle at 35% 30%, #8a5560, #40222a 60%, #1b0d12);
}

#game-root .bg-actions {
    display: flex;
    flex: none;
    gap: 6px;
}

#game-root .bg-btn,
#game-root .bg-mode {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--cg-line);
    border-radius: 10px;
    background: var(--cg-panel);
    color: var(--cg-ink);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(33, 43, 40, 0.08);
    transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

#game-root .bg-actions .bg-btn {
    padding: 0;
}

#game-root .bg-btn:hover:not(:disabled),
#game-root .bg-mode:hover {
    transform: translateY(-1px);
    border-color: #b8862c;
}

#game-root .bg-btn:focus-visible,
#game-root .bg-mode:focus-visible,
#game-root .bg-canvas:focus-visible {
    outline: 3px solid rgba(184, 134, 44, 0.5);
    outline-offset: 2px;
}

#game-root .bg-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

#game-root .bg-btn-primary {
    border-color: #b8862c;
    background: linear-gradient(180deg, #e0b95f, #b8862c);
    color: #24160a;
}

#game-root .bg-armed {
    border-color: #c0392b;
    background: #fbe3df;
    color: #8f1f14;
}

#game-root .bg-slash {
    display: none;
}

#game-root .bg-mute[aria-pressed="true"] .bg-slash {
    display: block;
}

#game-root .bg-stage {
    position: relative;
}

#game-root .bg-canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 100 / 118;
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(24, 14, 8, 0.32);
    touch-action: manipulation;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    background: #3a2110;
}

@media (min-width: 640px) {
    #game-root .bg-canvas {
        aspect-ratio: 100 / 76;
    }
}

#game-root .bg-result {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    width: min(88%, 380px);
    padding: 16px;
    border: 1px solid #b8862c;
    border-radius: 14px;
    background: rgba(28, 16, 8, 0.92);
    color: #fff3d6;
    text-align: center;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -50%);
    animation: bg-pop 280ms ease-out;
}

#game-root .bg-result[hidden] {
    display: none;
}

@keyframes bg-pop {
    from { opacity: 0; transform: translate(-50%, -46%) scale(0.94); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

#game-root .bg-result-head strong {
    display: block;
    font-size: 1.5rem;
    color: #ffd166;
}

#game-root .bg-result-head span {
    display: block;
    margin-top: 4px;
    color: #e6d3ad;
    font-size: 0.9rem;
}

#game-root .bg-result-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}

#game-root .bg-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 10px;
}

#game-root .bg-modes {
    display: flex;
    gap: 6px;
}

#game-root .bg-mode {
    font-size: 0.85rem;
}

#game-root .bg-mode-on {
    border-color: #b8862c;
    background: linear-gradient(180deg, #f4e2b0, #e2c27a);
    color: #3a2508;
}

#game-root .bg-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 14px;
    color: var(--cg-muted);
    font-size: 0.8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

#game-root .bg-hint {
    font-family: inherit;
    margin: 8px 0 0;
    color: var(--cg-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

@media (pointer: fine) {
    #game-root .bg-hint {
        font-size: 0.85rem;
    }
}

#game-root .bg-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(20, 14, 8, 0.5);
}

#game-root .bg-overlay[hidden] {
    display: none;
}

#game-root .bg-dialog {
    position: relative;
    width: min(100%, 440px);
    max-height: 90vh;
    overflow: auto;
    padding: 20px;
    border: 1px solid var(--cg-line);
    border-radius: 14px;
    background: var(--cg-panel);
    box-shadow: 0 24px 70px rgba(20, 14, 8, 0.35);
}

#game-root .bg-dialog h2 {
    margin: 0 52px 10px 0;
    font-size: 1.4rem;
}

#game-root .bg-dialog ul {
    margin: 0;
    padding-left: 18px;
    color: var(--cg-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

#game-root .bg-dialog li + li {
    margin-top: 6px;
}

#game-root .bg-close {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0;
    font-size: 1.6rem;
    line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
    #game-root .bg-result {
        animation: none;
    }
}
