﻿:root {
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top,0px);
    padding-bottom: env(safe-area-inset-bottom,0px);
    --pill: rgba(12,14,22,.86);
    --ui: #fff;
    --line: #3a3046;
    --acc: #c13ad0;
}

html {
    scroll-padding-top: env(safe-area-inset-top,0px);
}

@media (prefers-color-scheme:dark) {
    :root:not([data-theme="light"]) {
        --pill: rgba(12,14,22,.92)
    }
}

:root[data-theme="dark"] {
    --pill: rgba(12,14,22,.92)
}

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #1565e6;
    font-family: system-ui, sans-serif;
}

canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block
}

#recent {
    position: fixed;
    left: 12px;
    top: calc(34px + env(safe-area-inset-top,0px));
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 5
}

#ttl {
    position: fixed;
    left: 12px;
    top: calc(10px + env(safe-area-inset-top,0px));
    font: 800 14px system-ui,sans-serif;
    color: #fff;
    text-shadow: 0 1px 3px #000;
    z-index: 5
}

.pill {
    display: flex;
    align-items: center;
    gap: 7px;
    max-width: 230px;
    padding: 4px 11px 4px 8px;
    border-radius: 20px;
    background: var(--pill);
    color: var(--ui);
    font: 700 13px/1.1 system-ui,sans-serif;
    animation: pi .35s ease-out
}

    .pill i {
        flex: none;
        width: 9px;
        height: 9px;
        border-radius: 50%;
        background: #00e5ff
    }

    .pill.gift {
        box-shadow: 0 0 0 2px #ff5aa5 inset
    }

        .pill.gift i {
            background: #ff2d3d
        }

    .pill b {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap
    }

@keyframes pi {
    from {
        opacity: 0;
        transform: translateX(-18px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

#hud {
    position: fixed;
    left: 50%;
    bottom: calc(12px + env(safe-area-inset-bottom,0px));
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5
}

    #hud button {
        font: 700 14px system-ui,sans-serif;
        border: 0;
        border-radius: 18px;
        padding: 9px 16px;
        color: var(--ui);
        background: var(--pill);
        cursor: pointer
    }

        #hud button.on {
            background: #ff3da8
        }

#snd {
    position: fixed;
    left: 50%;
    bottom: calc(60px + env(safe-area-inset-bottom,0px));
    transform: translateX(-50%);
    font: 700 12px system-ui,sans-serif;
    color: #fff;
    background: var(--pill);
    padding: 5px 12px;
    border-radius: 14px;
    z-index: 5;
    transition: opacity .4s;
    pointer-events: none
}

/* ================================================== */
/* ⭐ TAMBAHAN: SETTINGS MODAL & ADS                    */
/* ================================================== */
#btn-open-settings {
    position: fixed;
    right: 12px;
    top: calc(10px + env(safe-area-inset-top,0px));
    background: var(--pill);
    color: #fff;
    border: 1px solid var(--line);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

#settings-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0,0,0,.75);
    justify-content: center;
    align-items: center;
    padding: 16px;
}

    #settings-modal.show {
        display: flex;
    }

.settings-card {
    background: #1a1425;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,.7);
    color: #fff;
    animation: modalFadeIn .3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

    .settings-header h3 {
        margin: 0;
        font-size: 15px;
    }

.settings-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.setting-label {
    display: block;
    font-size: 12px;
    color: #cbd5e1;
    margin-bottom: 6px;
    margin-top: 10px;
}

.setting-input-text {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #0f0a1a;
    color: #fff;
}

    .setting-input-text:focus {
        outline: none;
        border-color: var(--acc);
    }

.server-btn {
    flex: 1;
    padding: 8px 10px;
    font-size: 11px;
    border-radius: 8px;
    background: #334155;
    border: 1px solid var(--line);
    color: #fff;
    cursor: pointer;
}

    .server-btn.active {
        background: linear-gradient(135deg, var(--acc), #8a5cff);
        border-color: transparent;
        font-weight: 800;
    }

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(180deg,var(--acc),#8f27a0);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    margin-top: 15px;
}

    .btn-primary:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #888;
    margin-right: 6px;
}

#adsModalTikTok {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

    #adsModalTikTok.show {
        display: flex;
    }

    #adsModalTikTok > div {
        background: #1a1425;
        padding: 22px;
        max-width: 600px;
        width: 100%;
        border-radius: 14px;
        color: #fff;
        text-align: center;
    }

#adsContainerTikTok {
    min-height: 100px;
    margin: 10px 0;
    background: rgba(0,0,0,.25);
    border-radius: 8px;
    padding: 8px;
    text-align: left;
}

#continueBtnTikTok {
    padding: 10px 40px;
    font-size: 15px;
    font-weight: 800;
    border: none;
    border-radius: 8px;
    background: #28a745;
    color: white;
    cursor: pointer;
}

    #continueBtnTikTok:disabled {
        background: #6c757d;
        cursor: not-allowed;
        opacity: .7;
    }
