* {
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

body {
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    font-family: 'Quicksand', 'Segoe UI', system-ui, -apple-system, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    padding: 4px;
}

/* ===== GAME WRAPPER - MODERN GLASS ===== */
.game-wrapper {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 10px 8px 14px;
    border-radius: 28px;
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.08);
    width: 100%;
    max-width: 100%;
    max-height:100vh;display:flex;justify-content:center;
    position: relative;
    opacity: 0;
    transition: opacity 0.8s ease;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}
.game-wrapper.show { opacity: 1; }

/* ===== CANVAS ===== */
canvas {
    display: block;
    width: 100%;
    height: auto;
    max-width: 450px;
    max-height: calc(100vh - 180px);
    aspect-ratio: 450 / 650;
    border-radius: 24px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    box-shadow: 
        inset 0 0 60px rgba(0,0,0,0.3),
        0 15px 30px rgba(0,0,0,0.4);
    cursor: default;
    touch-action: none;
    margin: 0 auto;
    border: 2px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

/* ===== SHIELD STATUS BAR - MODERN ===== */
.shield-status-bar {
    width: 100%;
    max-width: 450px;

    margin: 0 auto 4px auto;
    padding: 0;

    aspect-ratio: 450 / 100;
    height: auto;

    border-radius: 12px;
    overflow: hidden;

    background-image: url('assets/bg.jpg');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: 100% 100%;

    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);

    flex-shrink: 0;
}

.shield-status-bar * {
    display: none !important;
}
.shield-status-bar .gift-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
    border-radius: 4px;
}
.shield-status-bar .statik-value {
    color: #ffd700;
    font-weight: 700;
}
.shield-status-bar .divider {
    color: rgba(255,255,255,0.15);
    margin: 0 3px;
}

/* ===== TOP BAR - MODERN ===== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    padding: 5px 10px;
    margin: 0 0 4px 0;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    gap: 6px;
    width: 100%;
    max-width: 450px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    flex-shrink: 0;
}



/* ===== ENTRY BOX - MODERN ===== */
.entry-box {
    background: rgba(255, 215, 0, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 6px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.12);
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.04);
    margin: 4px auto;
    width: 100%;
    max-width: 450px;
    text-align: center;
    position: relative;
    z-index: 50;
    transition: border-color 0.3s ease;
    flex-shrink: 0;
}
.entry-box:hover {
    border-color: rgba(255, 215, 0, 0.25);
}
.entry-content {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}
.entry-icon { 
    font-size: 14px;
    opacity: 0.8;
}
.entry-text {
    color: rgba(255,255,255,0.85);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.2px;
    white-space: nowrap;
}
.entry-text strong {
    color: #ffd700;
    font-weight: 700;
    font-size: 11px;
}
.entry-text .highlight-green {
    color: #4ade80;
    font-weight: 600;
}
.entry-text .arena-text {
    color: #ffd700;
    font-weight: 600;
}

/* ===== LIKE PANEL - MODERN ===== */
.like-panel {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.04);
    padding: 3px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    flex: 1;
    width: 100%;
    min-width: 0;
}
.like-panel .like-label {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    white-space: nowrap;
}
.like-panel .like-label .heart { 
    color: #f472b6;
    display: inline-block;
    animation: heartBeat 1.5s ease-in-out infinite;
}
@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
.like-bar-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 1px;
    flex: 1;
    min-width: 0;
}
#likeFillMini {
    width: 60px !important;
    min-width: 40px !important;
    flex: 1 !important;
    height: 5px !important;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    overflow: hidden;
}
#likeFillMiniBar {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #f472b6, #fb923c, #fbbf24);
    box-shadow: 0 0 16px rgba(244, 114, 182, 0.3);
    transition: width 0.3s ease;
}
#likePercentText {
    min-width: 20px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: rgba(255,255,255,0.7) !important;
    text-shadow: none !important;
    margin: 0;
    background: transparent;
    padding: 0;
    border: none;
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===== TIMER BOX - MODERN ===== */
.timer-box {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.04);
    padding: 3px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.timer-box span.timer-icon {
    font-size: 1rem;
    line-height: 1;
    opacity: 0.6;
}
#roundTimerDisplay {
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 1px 6px;
    min-width: 28px;
    text-align: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: #fff;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

/* ===== POWER INDICATOR - MODERN ===== */
.power-indicator {
    position: relative;
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.power-indicator.active-2x {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.25);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.08);
}
.power-indicator.active-shield {
    background: rgba(96, 165, 250, 0.15);
    border-color: rgba(96, 165, 250, 0.25);
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.08);
}
.power-indicator.active-shoot {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.25);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.08);
}
.power-emoji {
    font-size: 1rem;
    line-height: 1;
    z-index: 2;
}
.power-progress {
    position: absolute;
    top: -2px;
    left: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    border-radius: 10px;
    border: 2px solid transparent;
    border-top-color: rgba(255,255,255,0.25);
    border-right-color: rgba(255,255,255,0.08);
    border-bottom-color: rgba(255,255,255,0.05);
    border-left-color: rgba(255,255,255,0.15);
    transform: rotate(0deg);
    animation: rotate 2s linear infinite;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.power-progress.active { opacity: 1; }
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
#powerTimerText {
    position: absolute;
    bottom: -14px;
    font-size: 0.55rem;
    font-weight: 600;
    background: rgba(0,0,0,0.6);
    padding: 1px 4px;
    border-radius: 6px;
    min-width: 16px;
    text-align: center;
    color: rgba(255,255,255,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 3;
}




/* ===== POPUP NOTIFICATION - MODERN ===== */
.popup-notification {
    position: fixed;
    top: 12%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 12px 20px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 16px 48px rgba(0,0,0,0.4);
    z-index: 2000;
    display: none;
    animation: popupIn 0.25s ease-out forwards;
    min-width: 200px;
    max-width: 90%;
    text-align: center;
}
.popup-notification.show { display: block; }
.popup-notification.hiding { animation: popupOut 0.2s ease-in forwards; }
.popup-notification.success { border-color: rgba(74, 222, 128, 0.15); }
.popup-notification.error { border-color: rgba(239, 68, 68, 0.15); }
.popup-notification.info { border-color: rgba(96, 165, 250, 0.15); }
.popup-notification.gift { border-color: rgba(255, 215, 0, 0.15); }

@keyframes popupIn {
    0% { opacity: 0; transform: translateX(-50%) scale(0.9) translateY(-16px); }
    100% { opacity: 1; transform: translateX(-50%) scale(1) translateY(0); }
}
@keyframes popupOut {
    0% { opacity: 1; transform: translateX(-50%) scale(1) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) scale(0.9) translateY(-16px); }
}
.popup-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: white;
    font-size: 14px;
    font-weight: 500;
}
.popup-icon { font-size: 22px; flex-shrink: 0; }
.popup-message { color: rgba(255,255,255,0.9); line-height: 1.4; }
.popup-message .highlight { color: #ffd700; font-weight: 600; }
.popup-message .username { color: #60a5fa; font-weight: 600; }

.leaderboard-overlay.show ~ .popup-notification,
.leaderboard-overlay.show + .popup-notification {
    display: none !important;
}
.leaderboard-overlay.show ~ * .popup-notification,
.leaderboard-overlay.show + * .popup-notification {
    display: none !important;
}

.noti-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    vertical-align: middle;
    margin-right: 3px;
    border: 1px solid rgba(255,255,255,0.08);
}
.noti-gift-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 3px;
}
.fruit-image {
    width: 24px;
    height: 24px;
    object-fit: contain;
    vertical-align: middle;
}





/* ===== Styles moved from index.html ===== */
/* reset / base */
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        body {
            background: #0b0e1a;
            font-family: 'Quicksand', sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height:100vh;display:flex;justify-content:center;
            margin: 0;
            padding: 16px;
        }
        .game-wrapper {
            max-width: 450px;
            width: 100%;
            background: #151b2b;
            border-radius: 40px 40px 28px 28px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
            padding: 20px 16px 28px;
            position: relative;
        }

        /* leaderboard overlay – sentral & profesional */
        .leaderboard-overlay {
            position: fixed !important;
            inset: 0 !important;
            display: flex !important;
            flex-direction: column !important;
            justify-content: center !important;
            align-items: center !important;
            background: rgba(10, 12, 28, 0.88) !important;
            backdrop-filter: blur(6px);
            -webkit-backdrop-filter: blur(6px);
            padding: 20px !important;
            box-sizing: border-box !important;
            z-index: 9999 !important;
            transition: opacity 0.2s ease;
            opacity: 0;
            pointer-events: none;
        }
        .leaderboard-overlay.show {
            opacity: 1;
            pointer-events: auto;
        }

        .lb-panel {
            background: #1f2740;
            border-radius: 48px 48px 32px 32px;
            padding: 32px 14px 28px;
            max-width: 450px;
            width: 100%;
            box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 215, 0, 0.15);
            border: 1px solid rgba(255, 215, 0, 0.25);
            transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
            transform: scale(0.96);
        }
        .leaderboard-overlay.show .lb-panel {
            transform: scale(1);
        }

        .lb-title {
            font-size: clamp(25px, 5vw, 28px) !important;
            font-weight: 700;
            text-align: center;
            color: #ffd966;
            letter-spacing: 1px;
            text-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
            margin: 0 0 8px 0;
            line-height: 1.2;
            white-space: normal;
            word-break: break-word;
        }
        .lb-subtitle {
            font-size: clamp(16px, 2.2vw, 22px);
            text-align: center;
            color: #aab4d6;
            font-weight: 400;
            margin-bottom: 18px;
            letter-spacing: 0.3px;
        }

        /* daftar top 10 */
        .lb-list {
            display: flex;
            flex-direction: column;
            gap: 1px;
            width: 100%;
            max-height: 58vh;
            overflow-y: hidden;
            padding: 4px 0;
            
}
        .lb-item {
            display:flex;
            align-items:center;
            width:100%;
            min-height:52px;
            padding:8px 8px;
            gap:10px;
            border-radius:60px;
            background:rgba(28,36,60,.7);
            backdrop-filter:blur(2px);
            border:1px solid rgba(255,255,255,.04);
            transition:background .15s;
        }
        .lb-item.top3 {
            background: rgba(45, 55, 90, 0.8);
            border-color: rgba(255, 215, 0, 0.25);
        }
        .lb-item.empty {
            opacity: 0.5;
            filter: grayscale(0.4);
        }
        .lb-rank {
            font-weight: 700;
            font-size: clamp(15px, 2vw, 20px);
            flex:0 0 42px;
            text-align: center;
            color: #bcc6e6;
        }
        .lb-rank.gold { color: #f7c948; text-shadow: 0 0 10px #f7c94866; }
        .lb-rank.silver { color: #d0d8ee; text-shadow: 0 0 6px #d0d8ee66; }
        .lb-rank.bronze { color: #e6b88a; text-shadow: 0 0 6px #e6b88a66; }

        .lb-avatar {
            width: 40px !important;
            height: 40px !important;
            border-radius: 50%;
            object-fit: cover;
            background: #2f3a60;
            border: 2px solid rgba(255, 215, 0, 0.2);
            flex:0 0 auto;
        }
        .lb-item.top3 .lb-avatar {
            width: 52px !important;
            height: 52px !important;
            border-width: 3px;
        }
        .lb-item:nth-child(1) .lb-avatar { width: 60px !important; height: 60px !important; }
        .lb-item:nth-child(2) .lb-avatar { width: 54px !important; height: 54px !important; }
        .lb-item:nth-child(3) .lb-avatar { width: 50px !important; height: 50px !important; }

        .lb-username {
            flex:1 1 auto;
            font-weight: 600;
            font-size: clamp(15px, 1.8vw, 19px);
            color: #edf2ff;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            min-width: 0;
        }
        .lb-score {
            flex:0 0 auto;
            margin-left:auto;
            font-weight: 700;
            font-size: clamp(16px, 2vw, 22px);
            color: #ffd966;
            background: rgba(0, 0, 0, 0.25);
            padding: 2px 14px;
            border-radius: 40px;
            white-space: nowrap;
            border: 1px solid rgba(255, 215, 0, 0.15);
        }

        .lb-timer {
            display: block !important;
            margin-top: 20px !important;
            font-size: clamp(20px, 3vw, 32px) !important;
            text-align: center !important;
            font-weight: 700;
            color: #c8d2f0;
            background: rgba(0, 0, 0, 0.25);
            padding: 10px 16px;
            border-radius: 60px;
            letter-spacing: 1px;
            border: 1px solid rgba(255, 215, 0, 0.1);
        }
        .lb-timer span {
            color: #ffd966;
            font-weight: 800;
            background: #1a223b;
            padding: 0 14px;
            border-radius: 40px;
            display: inline-block;
            min-width: 48px;
        }



/* ===== GAME OVER OVERLAY - MODERN ===== */
.gameover-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 24px 28px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 200;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    width: 80%;
    max-width: 280px;
    text-align: center;
}
.gameover-overlay.show { display: flex; }
.gameover-text {
    font-size: 2.5rem;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.3));
}
.gameover-message {
    font-size: 1.3rem;
    color: #fff;
    font-weight: 700;
    background: rgba(239, 68, 68, 0.12);
    padding: 6px 16px;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.15);
}
#playAgainBtn {
    background: linear-gradient(135deg, #ffd700, #f59e0b);
    border: none;
    border-radius: 12px;
    padding: 10px 24px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.15);
}
#playAgainBtn:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.1);
}
     
.entry-box{display:none!important;}
#arenaCommentOverlay{
position:absolute;
top:80px;
left:50%;
transform:translateX(-50%);
width:400px;
max-width:88%;
padding:8px 12px;
border-radius:12px;
background:rgba(0,0,0,.45);
color:#fff;
font-size:18px;
font-weight:700;
text-align:center;
z-index:999;
pointer-events:none;
backdrop-filter:blur(4px);
}
#arenaCommentOverlay b{color:#ffd700;}
#arenaCommentOverlay span{color:#ffd700;}
