:root{
    --bg:#07111f;
    --card:#0d1b2f;
    --gold:#f6c453;
    --cyan:#39d7ff;
    --muted:#91a4bb;
    --danger:#ff5f6d;
}

*{
    box-sizing:border-box;
}

body{
    margin:0;
    font-family:Inter,system-ui,Arial,sans-serif;
    background:radial-gradient(
        circle at 50% 30%,
        #12345a 0,
        #07111f 55%,
        #030711 100%
    );
    color:#fff;
    min-height:100vh;
}

/* ===== HEADER APKASI ===== */

.top{
    display:grid;
    grid-template-columns:1fr auto 1fr;
    align-items:center;

    padding:18px 30px;

    background:linear-gradient(135deg,#0b1b3a,#114a8a);
    border-bottom:4px solid #F6C453;
}

/* Logo header */

.header-logo.left{
    justify-self:start;
}

.header-logo.right{
    justify-self:end;
}

.header-title{
    justify-self:center;
    text-align:center;
}

.header-logo{
    display:flex;
    align-items:center;
    justify-content:center;
}

.header-logo img{
    width:100px;
    height:100px;
    object-fit:contain;
}

.brand{
    font-size:40px;
    font-weight:900;
    color:white;
}

.sub{
    font-size:22px;
    color:#FFD54F;
}

/* =========================================================
   MAIN WRAPPER
   ========================================================= */

.wrap{
    max-width:1200px;
    margin:auto;
    padding:0 20px 35px;
}

/* =========================================================
   ROULETTE
   ========================================================= */

.roulette-layout{
    display:grid;
    grid-template-columns:170px minmax(0,1fr) 170px;
    align-items:center;
    justify-content:center;
    gap:18px;

    width:100%;
    max-width:1400px;
    margin:0 auto;

    padding:0 15px;
}

.wheel-card,
.side{
    background:rgba(13,27,47,.78);
    border:1px solid rgba(255,255,255,.1);
    border-radius:24px;
    box-shadow:0 20px 60px #0008;
    backdrop-filter:blur(12px);
}

.wheel-card{
    width:100%;
    max-width:760px;
    margin:auto;
    padding:12px;

    background:rgba(13,27,47,.78);
    border:1px solid rgba(255,255,255,.1);
    border-radius:24px;

    box-shadow:0 20px 60px #0008;
    backdrop-filter:blur(12px);

    text-align:center;
}

.canvas-wrap{
    position:relative;

    width:min(100%, 680px);

    aspect-ratio:1;

    margin:auto;
}

.canvas-wrap canvas{
    width:100%;
    height:100%;
    display:block;
}

.pointer{
    position:absolute;
    top:-3px;
    left:50%;
    transform:translateX(-50%);
    z-index:3;
    width:0;
    height:0;
    border-left:18px solid transparent;
    border-right:18px solid transparent;
    border-top:42px solid #fff;
    filter:drop-shadow(0 3px 5px #000);
}

/* Tombol spin lama */
.spin{
    border:0;
    border-radius:999px;
    padding:16px 52px;
    font-size:24px;
    font-weight:900;
    background:linear-gradient(
        135deg,
        #ffd76a,
        #f0a81a
    );
    color:#201600;
    cursor:pointer;
    box-shadow:0 10px 30px #f6c45355;
    transition:.2s;
}

.spin:hover{
    transform:translateY(-2px) scale(1.02);
}

.spin:disabled{
    opacity:.45;
    cursor:not-allowed;
    transform:none;
}

/* =========================================================
   SPIN BUTTON DI TENGAH ROULETTE
   ========================================================= */

.wheel-container{
    position:relative;
    width:700px;
    height:700px;
    max-width:100%;
    margin:auto;
}

#wheel{
    width:100%;
    height:100%;
    display:block;
}

.spin-center{
    position:absolute;
    top:50%;
    left:50%;
    transform:translate(-50%,-50%);

    width:125px;
    height:125px;

    padding:12px;

    border-radius:50%;
    border:6px solid #fff;

    background:#fff;

    cursor:pointer;

    display:flex;
    align-items:center;
    justify-content:center;

    box-shadow:
        0 8px 20px rgba(0,0,0,.4),
        0 0 0 5px rgba(246,196,83,.8);

    transition:.2s;

    z-index:10;
}

.spin-center img{
    width:100%;
    height:100%;
    object-fit:contain;
    border-radius:50%;
}

.spin-center:hover{
    transform:translate(-50%,-50%) scale(1.06);
}

.spin-center:active{
    transform:translate(-50%,-50%) scale(.96);
}

.spin-center:disabled{
    cursor:not-allowed;
    opacity:.65;
}

/* =========================================================
   SIDE PRIZE LIST
   ========================================================= */

.side{
    padding:22px;
}

.side h3{
    margin-top:0;
}

.prize-list{
    max-height:480px;
    overflow:auto;
}

.p{
    padding:12px 0;
    border-bottom:1px solid #ffffff12;
    display:flex;
    justify-content:space-between;
    gap:10px;
}

.p b{
    font-size:14px;
}

.pill{
    font-size:12px;
    color:#08101b;
    background:var(--cyan);
    border-radius:999px;
    padding:4px 9px;
    font-weight:800;
    height:max-content;
}

/* =========================================================
   HINT
   ========================================================= */

.hint{
    color:var(--muted);
    margin-top:10px;
    font-size:13px;
}

/* =========================================================
   RESULT / WINNER MODAL
   ========================================================= */

.result{
    display:none;
    position:fixed;
    inset:0;
    background:#000b;
    z-index:20;
    align-items:center;
    justify-content:center;
    padding:20px;
}

.result.show{
    display:flex;
}

.result-box{
    max-width:700px;
    width:100%;
    text-align:center;
    padding:45px;
    border-radius:30px;
    background:linear-gradient(
        145deg,
        #102b4a,
        #081323
    );
    border:1px solid #ffffff22;
    box-shadow:0 30px 100px #000;
}

.result small{
    color:var(--cyan);
    letter-spacing:4px;
}

.result h1{
    font-size:clamp(40px,7vw,84px);
    margin:18px 0;
    color:var(--gold);
}

.winner-input{
    width:min(420px,100%);
    padding:13px;
    border-radius:10px;
    border:1px solid #ffffff2a;
    background:#fff;
    color:#111;
    font-size:16px;
}

.actions{
    display:flex;
    gap:10px;
    justify-content:center;
    margin-top:15px;
}

/* =========================================================
   GENERAL BUTTON
   ========================================================= */

.btn{
    border:0;
    border-radius:10px;
    padding:12px 20px;
    font-weight:800;
    cursor:pointer;
    transition:.2s;
}

.btn:hover{
    transform:translateY(-1px);
}

.btn:active{
    transform:translateY(0);
}

.primary{
    background:var(--gold);
    color:#201600;
}

.secondary{
    background:#ffffff14;
    color:#fff;
    border:1px solid #ffffff22;
}

/* =========================================================
   ADMIN PAGE
   ========================================================= */

.admin-body{
    background:#f2f5f9;
    color:#172033;
}

.admin-nav{
    background:#07111f;
    color:#fff;
    padding:18px 25px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    box-shadow:0 3px 15px rgba(0,0,0,.15);
}

.admin-wrap{
    max-width:1200px;
    margin:auto;
    padding:25px;
}

/* =========================================================
   ADMIN STATISTICS
   ========================================================= */

.stats{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:15px;
}

.stat{
    background:#fff;
    border-radius:16px;
    padding:18px;
    box-shadow:0 5px 20px #17203312;
}

.stat strong{
    display:block;
    font-size:28px;
    margin-top:5px;
}

.stat:first-child strong{
    color:#2563eb;
}

.stat:nth-child(2) strong{
    color:#16a34a;
}

.stat:nth-child(3) strong{
    color:#f59e0b;
}

.stat:nth-child(4) strong{
    color:#dc2626;
}

/* =========================================================
   ADMIN PANEL
   ========================================================= */

.panel{
    background:#fff;
    border-radius:16px;
    padding:18px;
    box-shadow:0 5px 20px #17203312;
    margin-top:20px;
}

.panel h2{
    margin-top:0;
    color:#172033;
}

/* =========================================================
   TABLE
   ========================================================= */

table{
    width:100%;
    border-collapse:collapse;
}

th,
td{
    text-align:left;
    padding:12px;
    border-bottom:1px solid #e6eaf0;
    white-space:nowrap;
    vertical-align:middle;
}

th{
    background:#f8fafc;
    color:#475569;
    font-size:13px;
}

td{
    color:#172033;
}

tr:hover td{
    background:#f8fafc;
}

td small{
    color:#64748b;
}

/* =========================================================
   ADMIN FORM
   ========================================================= */

.form{
    display:grid;
    grid-template-columns:2fr 1fr 1fr 1fr auto;
    gap:10px;
}

.form input,
.form textarea,
.form select{
    padding:10px;
    border:1px solid #ccd4df;
    border-radius:9px;
    background:#fff;
    color:#172033;
}

.form input:focus,
.form textarea:focus,
.form select:focus{
    outline:none;
    border-color:#2563eb;
    box-shadow:0 0 0 3px rgba(37,99,235,.1);
}

/* =========================================================
   ADMIN ACTION BUTTONS
   ========================================================= */

.action-buttons{
    display:flex;
    flex-wrap:wrap;
    gap:7px;
    align-items:center;
}

.action-buttons form{
    display:inline-flex;
    margin:0;
    padding:0;
}

.action-buttons .btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:5px;
    padding:9px 13px;
    font-size:13px;
    line-height:1;
    white-space:nowrap;
    border-radius:8px;
}

/* Tombol Kecualikan */
.btn-warning{
    background:#f59e0b !important;
    color:#fff !important;
    border:1px solid #d97706 !important;
}

/* Tombol Aktifkan */
.btn-success{
    background:#16a34a !important;
    color:#fff !important;
    border:1px solid #15803d !important;
}

/* Tombol Edit */
.btn-edit{
    background:#2563eb !important;
    color:#fff !important;
    border:1px solid #1d4ed8 !important;
}

/* Tombol Hapus */
.btn-delete{
    background:#dc2626 !important;
    color:#fff !important;
    border:1px solid #b91c1c !important;
}

.action-buttons .btn:hover{
    filter:brightness(1.1);
    transform:translateY(-1px);
}

.action-buttons .btn:active{
    transform:translateY(0);
}

/* =========================================================
   DANGER / LEGACY
   ========================================================= */

.danger{
    color:#b2182b;
}

.toggle{
    cursor:pointer;
}

/* =========================================================
   STATUS BADGE
   ========================================================= */

.badge{
    display:inline-block;
    padding:5px 10px;
    border-radius:20px;
    font-size:12px;
    font-weight:700;
}

.badge.green{
    background:#dcfce7;
    color:#166534;
    border:1px solid #86efac;
}

.badge.orange{
    background:#fef3c7;
    color:#92400e;
    border:1px solid #fcd34d;
}

.badge.gray{
    background:#e2e8f0;
    color:#475569;
    border:1px solid #cbd5e1;
}

/* =========================================================
   EDIT MODAL
   ========================================================= */

.modal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.65);
    display:none;
    justify-content:center;
    align-items:center;
    z-index:999;
    padding:20px;
}

.modal.show{
    display:flex;
}

.modal-box{
    width:500px;
    max-width:100%;
    max-height:90vh;
    overflow:auto;
    background:#121b2b;
    color:white;
    border-radius:18px;
    padding:24px;
    box-shadow:0 30px 80px rgba(0,0,0,.5);
}

.modal-box h2{
    margin-top:0;
    margin-bottom:20px;
}

.modal-box label{
    display:block;
    margin-bottom:5px;
    font-weight:600;
}

.modal-box input,
.modal-box select{
    width:100%;
    padding:12px;
    margin-top:6px;
    margin-bottom:16px;
    border-radius:10px;
    border:1px solid #334155;
    background:#1e293b;
    color:#fff;
}

.modal-box input:focus,
.modal-box select:focus{
    outline:none;
    border-color:#39d7ff;
    box-shadow:0 0 0 3px rgba(57,215,255,.1);
}

/* Checkbox */
.modal-box input[type="checkbox"]{
    width:auto;
    margin:0 7px 0 0;
    padding:0;
    accent-color:#f6c453;
}

.modal-box label:has(input[type="checkbox"]){
    display:flex;
    align-items:center;
    margin-top:2px;
    margin-bottom:20px;
}

/* Modal buttons */
.modal-actions{
    display:flex;
    gap:12px;
    justify-content:flex-end;
    margin-top:10px;
}

.flash{
    padding:14px 18px;
    border-radius:10px;
    margin-bottom:18px;
    font-weight:700;
}

.flash.error{
    background:#fee2e2;
    color:#991b1b;
    border:1px solid #fecaca;
}

.flash.success{
    background:#dcfce7;
    color:#166534;
    border:1px solid #bbf7d0;
}

.sponsor-section{
    width:min(1100px,100%);
    margin:25px auto 0;

    padding:18px 25px 22px;

    background:rgba(13,27,47,.78);

    border:1px solid rgba(255,255,255,.1);

    border-radius:20px;

    box-shadow:0 15px 45px rgba(0,0,0,.3);

    backdrop-filter:blur(10px);
}

.sponsor-title{
    text-align:center;

    color:#f6c453;

    font-size:14px;
    font-weight:900;

    letter-spacing:3px;

    margin-bottom:15px;
}

.sponsor-grid{
    display:grid;

    grid-template-columns:
        repeat(5,1fr);

    gap:12px;
}

.sponsor-column{
    width:170px;

    display:flex;
    flex-direction:column;

    justify-content:center;

    gap:10px;
}

.sponsor-item{
    width:170px;
    height:72px;

    background:#fff;

    border-radius:10px;

    padding:7px 10px;

    display:flex;
    align-items:center;
    justify-content:center;

    box-shadow:0 5px 15px rgba(0,0,0,.25);
}

.sponsor-item img{
    max-width:100%;
    max-height:55px;

    width:auto;
    height:auto;

    object-fit:contain;
}

/* =========================================================
   RESPONSIVE TABLE
   ========================================================= */

@media(max-width:1000px){

    .admin-wrap{
        padding:20px;
    }

    .action-buttons{
        min-width:240px;
    }

    th,
    td{
        padding:10px;
    }
}

/* =========================================================
   RESPONSIVE ROULETTE
   ========================================================= */

@media(max-width:850px){

    .roulette-layout{
        grid-template-columns:1fr;
    }

    .stats{
        grid-template-columns:repeat(2,1fr);
    }

    .form{
        grid-template-columns:1fr;
    }

    .wheel-card{
        padding:8px;
    }

    .side{
        order:2;
    }

    .wheel-container{
        width:100%;
        height:auto;
        aspect-ratio:1;
    }

    .spin-center{
        width:100px;
        height:100px;
        font-size:20px;
    }
}

/* =========================================================
   MOBILE
   ========================================================= */


@media(max-width:700px){

    .sponsor-grid{
        grid-template-columns:
            repeat(2,1fr);
    }

    .sponsor-item{
        height:65px;
    }

}

/* Responsive */

@media(max-width:768px){

    .top{
        gap:12px;
        padding:14px;
    }

    .header-logo{
        width:55px;
        height:55px;
    }

    .brand{
        font-size:22px;
    }

    .sub{
        font-size:15px;
    }
}

@media(max-width:600px){

    .stats{
        grid-template-columns:1fr 1fr;
    }

    .top{
        padding:14px;
    }

    .spin{
        padding:14px 40px;
    }

    .admin-nav{
        padding:15px;
    }

    .admin-wrap{
        padding:15px;
    }

    .panel{
        padding:14px;
    }

    .action-buttons{
        min-width:200px;
    }

    .action-buttons .btn{
        padding:8px 10px;
        font-size:12px;
    }

    .modal{
        padding:12px;
    }

    .modal-box{
        padding:18px;
    }

    .modal-actions{
        flex-direction:column-reverse;
    }

    .modal-actions .btn{
        width:100%;
    }
}

/* =========================================================
   VERY SMALL SCREEN
   ========================================================= */

@media(max-width:400px){

    .stats{
        grid-template-columns:1fr;
    }

    .spin-center{
        width:85px;
        height:85px;
        font-size:18px;
    }

    .admin-nav{
        font-size:13px;
    }
}