.stackattack-shell {
    background: linear-gradient(180deg, #f5fbff 0%, #eef4ff 100%);
    border: 1px solid #d9e7ff;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(64, 92, 170, 0.12);
    margin: 20px 0;
    padding: 16px;
}

.stackattack-play-area {
    background: #101c3d;
    border-radius: 16px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

    .stackattack-play-area:fullscreen {
        border-radius: 0;
        display: flex;
        flex-direction: column;
        height: 100vh;
        padding: 8px;
        width: 100vw;
    }

.stackattack-topbar {
    align-items: center;
    background: rgba(8, 16, 38, 0.45);
    display: flex;
    justify-content: space-between;
    padding: 8px 8px 0;
}

.stackattack-topbar-stats {
    display: flex;
    gap: 10px;
}

.stackattack-topbar-stat {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #ffffff;
    min-width: 86px;
    padding: 8px 12px;
}

.stackattack-topbar-stat-label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.04em;
    opacity: 0.8;
    text-transform: uppercase;
}

.stackattack-topbar-stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.1;
    margin-top: 2px;
}

.stackattack-topbar-actions {
    display: flex;
    gap: 10px;
}

@media (max-width: 575px) {
    .stackattack-topbar {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .stackattack-topbar-stats,
    .stackattack-topbar-actions {
        justify-content: center;
    }
}

.stackattack-topbar-btn {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    color: #ffffff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 14px;
}

    .stackattack-topbar-btn:hover,
    .stackattack-topbar-btn:focus {
        background: rgba(255, 255, 255, 0.22);
        outline: none;
    }

    .stackattack-topbar-btn.is-active {
        background: rgba(106, 229, 157, 0.25);
    }

.stackattack-stage {
    align-items: center;
    background: #101c3d;
    display: flex;
    flex: 1 1 auto;
    justify-content: center;
    min-height: 772px;
    overflow: hidden;
    padding: 4px;
    position: relative;
}

#gameCanvas {
    background: transparent;
    border-radius: 12px;
    display: block;
    height: auto;
    max-width: 100%;
    width: 100%;
}

.stackattack-play-area,
.stackattack-stage,
#gameCanvas {
    overscroll-behavior: contain;
    touch-action: none;
}

.stackattack-overlay {
    align-items: center;
    background: rgba(10, 18, 41, 0.66);
    display: flex;
    inset: 4px;
    justify-content: center;
    padding: 16px;
    position: absolute;
    z-index: 5;
}

    .stackattack-overlay.is-hidden {
        display: none;
    }

.stackattack-panel {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 20px;
    box-shadow: 0 16px 50px rgba(18, 30, 76, 0.28);
    color: #20315f;
    max-width: 560px;
    padding: 26px;
    text-align: center;
    width: 100%;
}

    .stackattack-panel h2,
    .stackattack-panel h3 {
        color: #24356c;
        margin-top: 0;
    }

    .stackattack-panel p,
    .stackattack-panel li {
        font-size: 16px;
        line-height: 1.55;
    }

.stackattack-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}

.stackattack-input {
    border: 2px solid #cad8ff;
    border-radius: 12px;
    font-size: 18px;
    margin-top: 12px;
    padding: 10px 14px;
    text-align: center;
    width: 100%;
}

.stackattack-status {
    color: #7b2248;
    font-weight: 600;
    margin-top: 12px;
    min-height: 24px;
}

.stackattack-hint-text {
    color: #1b4e86;
    font-size: 26px;
    font-weight: 700;
    margin-top: 14px;
    min-height: 42px;
    opacity: 0;
}

    .stackattack-hint-text.show {
        animation: stackattackHintFade 3s linear forwards;
    }

.stackattack-list {
    margin: 16px auto 0;
    max-width: 430px;
    padding-left: 20px;
    text-align: left;
}

.stackattack-note {
    background: #eef4ff;
    border-radius: 12px;
    color: #314777;
    margin-top: 14px;
    padding: 12px 14px;
}

.stackattack-hud {
    margin-top: 16px;
}

.stackattack-card {
    background: #ffffff;
    border: 1px solid #d9e7ff;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(64, 92, 170, 0.08);
    height: 100%;
    padding: 16px;
}

    .stackattack-card h4 {
        color: #24356c;
        font-size: 16px;
        margin: 0 0 10px;
    }

.stackattack-stat-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stackattack-stat {
    background: #f6f9ff;
    border-radius: 12px;
    padding: 10px 12px;
}

.stackattack-stat-label {
    color: #5d6f99;
    display: block;
    font-size: 12px;
    text-transform: uppercase;
}

.stackattack-stat-value {
    color: #24356c;
    display: block;
    font-size: 22px;
    font-weight: 700;
}

.stackattack-meta {
    color: #314777;
    line-height: 1.7;
    margin: 0;
}

.stackattack-controls {
    color: #314777;
    margin-bottom: 10px;
    padding-left: 18px;
}

    .stackattack-controls li + li {
        margin-top: 6px;
    }

#stackattackNextPieceCanvas {
    background: linear-gradient(180deg, #1a2d5d 0%, #16254c 100%);
    border-radius: 12px;
    display: block;
    height: 120px;
    margin: 0 auto;
    width: 120px;
}

@keyframes stackattackHintFade {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}
