html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #0f172a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

.zipzip-game-wrapper {
    position: relative;
    width: 100%;
    height: 650px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: #0f172a;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

@media (max-width: 540px) {
    .zipzip-game-wrapper {
        height: 560px;
        max-height: 85vh;
        border-radius: 12px;
    }
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: grab;
}
#game-canvas:active {
    cursor: grabbing;
}

#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    z-index: 10;
}
.hud-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.hud-box {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 14px;
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
}
.hud-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
}
.hud-value {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
}
#combo-container {
    align-self: center;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(168, 85, 247, 0.25));
    border: 1px solid rgba(56, 189, 248, 0.4);
    padding: 4px 16px;
    border-radius: 20px;
}
#combo-text {
    font-size: 14px;
    font-weight: 800;
    color: #38bdf8;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}
#pause-btn {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
#pause-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.hud-group-center {
    align-items: center;
}
.hud-box-score {
    align-items: center;
    padding: 4px 16px;
}
.hud-value-score {
    font-size: 24px;
}
.last-combo-wrap {
    margin-top: 4px;
}
.last-combo-badge {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 3px 10px;
    border-radius: 12px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: inline-block;
}
.last-combo-value {
    color: #38bdf8;
    font-weight: 700;
}
.hud-top-bar {
    pointer-events: auto;
}

.hidden {
    display: none !important;
}

.ui-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.screen-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 18, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 30;
    pointer-events: auto;
}

#countdown-overlay {
    background: radial-gradient(circle at center, rgba(30, 41, 59, 0.72) 0%, rgba(15, 23, 42, 0.88) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
#countdown-number {
    font-size: clamp(42px, 9vw, 60px);
    font-weight: 900;
    color: #ffe13d;
    text-shadow: 0 0 24px rgba(255, 225, 61, 0.65), 0 3px 10px rgba(0, 0, 0, 0.85);
    animation: countdownPulse 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
#countdown-number.is-start,
.countdown-value.is-start {
    font-size: clamp(26px, 5.5vw, 34px) !important;
    letter-spacing: 1px !important;
}
.countdown-caption {
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}
@keyframes countdownPulse {
    0% { transform: scale(0.35); opacity: 0; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.game-modal {
    background: linear-gradient(145deg, #1e272e, #141c22);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 24px 20px;
    width: 100%;
    max-width: 340px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.game-icon-badge {
    font-size: 36px;
    line-height: 1;
}
.game-modal-title {
    color: #ffffff;
    font-size: 24px;
    font-weight: 800;
    margin: 0;
}
.game-modal-subtitle {
    color: #95a5a6;
    font-size: 14px;
    margin: 0 0 4px 0;
}
.game-score-card {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 14px;
    padding: 12px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.score-label {
    color: #7f8c8d;
    font-size: 12px;
    font-weight: 700;
}
.score-val {
    color: #0fbcf9;
    font-size: 24px;
    font-weight: 900;
}
.score-divider {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
}
.game-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}
.btn-game {
    width: 100%;
    height: 44px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-transform: uppercase;
}
.btn-game:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}
.btn-game-primary {
    background: linear-gradient(135deg, #0fbcf9, #0984e3);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(15, 188, 249, 0.4);
}
.btn-game-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
