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;
}

.cubuklar-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);
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}

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

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

.hud-top-bar {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 25;
    pointer-events: auto;
}

.hud-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.hud-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

.hud-stats-bar {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    gap: 10px;
    z-index: 20;
    pointer-events: none;
}

.hud-stat-box {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 14px;
    border-radius: 12px;
    color: #ffffff;
    text-align: center;
}
.hud-stat-label {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
}
.hud-stat-label.label-sky { color: #38bdf8; }
.hud-stat-label.label-amber { color: #fbbf24; }
.hud-stat-label.label-emerald { color: #4ade80; }
.hud-stat-label.label-pink { color: #f472b6; }

.hud-stat-val {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
}
.hud-stat-val.text-sky { color: #38bdf8; }
.hud-stat-val.text-amber { color: #fbbf24; }
.hud-stat-val.text-emerald { color: #4ade80; }
.hud-stat-val.text-pink { color: #f472b6; }

.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;
}
#screen-countdown {
    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-num {
    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-num.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;
}
.go-reason {
    color: #ff7979;
    font-size: 13px;
    margin: -4px 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);
}
