/* ============================================
   SPINWHEEL "FUNWALK FESTAMA VOL.4"
   SMP Negeri 9 Malang  -  Layout 1920x1080 IFP
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;900&family=Poppins:wght@400;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 1920px;
    height: 1080px;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0a0a2e 0%, #1a1a4e 50%, #0d0d35 100%);
    color: #fff;
    user-select: none;
    -webkit-user-select: none;
}

/* ===== ADMIN PANEL (LEFT) ===== */
#admin-panel {
    position: absolute;
    top: 0; left: 0;
    width: 300px;
    height: 1080px;
    background: linear-gradient(180deg, #131340 0%, #0c0c2a 100%);
    border-right: 2px solid #2a2a6a;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 10;
}

#admin-panel .logo-area {
    text-align: center;
    padding-bottom: 12px;
    border-bottom: 2px solid #2a2a6a;
}

#admin-panel .logo-area h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 17px;
    font-weight: 900;
    color: #FFD700;
    line-height: 1.3;
}

#admin-panel .logo-area .subtitle {
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
}

.panel-section {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 14px 16px;
}

.panel-section label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.panel-section select,
.panel-section input {
    width: 100%;
    height: 48px;
    border: 2px solid #333;
    border-radius: 8px;
    background: #1a1a40;
    color: #fff;
    font-size: 16px;
    padding: 0 12px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: border 0.2s;
}

.panel-section select:focus,
.panel-section input:focus {
    border-color: #FFD700;
}

/* Stats */
#stats-box {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    text-align: center;
}

.stat-item {
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 8px 4px;
}

.stat-item .stat-num {
    font-size: 20px;
    font-weight: 700;
    color: #4FC3F7;
}

.stat-item .stat-label {
    font-size: 10px;
    color: #888;
}

/* Buttons */
.btn {
    width: 100%;
    height: 56px;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: transform 0.1s, box-shadow 0.2s;
}

.btn:active { transform: scale(0.96); }

#btn-spin {
    background: linear-gradient(135deg, #E74C3C, #C0392B);
    color: #fff;
    font-size: 28px;
    font-weight: 900;
    height: 80px;
    letter-spacing: 3px;
    box-shadow: 0 6px 30px rgba(231,76,60,0.5);
}

#btn-spin:hover { box-shadow: 0 8px 40px rgba(231,76,60,0.7); }
#btn-spin:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* History */
#history-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    padding: 8px;
    font-size: 11px;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

#history-list::-webkit-scrollbar { width: 4px; }
#history-list::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

.history-item {
    padding: 8px 10px;
    margin-bottom: 4px;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    border-left: 3px solid #FFD700;
}

.history-item .hi-name {
    font-weight: 600;
    font-size: 12px;
    color: #FFD700;
}

.history-item .hi-meta {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}

/* ===== WHEEL AREA (RIGHT) ===== */
#wheel-area {
    position: absolute;
    top: 0; left: 300px;
    width: 1620px;
    height: 1080px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Header */
#header-title {
    text-align: center;
    margin-bottom: 10px;
}

#header-title h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 42px;
    font-weight: 900;
    color: #FFD700;
    text-shadow: 0 0 30px rgba(255,215,0,0.4);
    line-height: 1.2;
}

#header-title .event-sub {
    font-size: 18px;
    color: #bbb;
    letter-spacing: 2px;
}

/* Single wheel container */
#wheel-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#wheel-container .mode-badge {
    font-family: 'Montserrat', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #4FC3F7;
    letter-spacing: 2px;
    margin-bottom: 8px;
    background: rgba(79,195,247,0.1);
    padding: 6px 24px;
    border-radius: 20px;
}

.wheel-wrapper {
    position: relative;
}

.wheel-wrapper canvas {
    display: block;
    filter: drop-shadow(0 0 30px rgba(255,215,0,0.2));
}

/* Pointer */
.wheel-pointer {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 36px solid #FFD700;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
    z-index: 5;
}

/* Triple wheel container */
#triple-container {
    display: none;
    width: 100%;
    justify-content: center;
    gap: 24px;
    padding: 0 20px;
}

#triple-container .triple-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#triple-container .triple-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #FFD700;
    margin-bottom: 8px;
}

#triple-container .wheel-wrapper {
    margin-bottom: 10px;
}

/* Winner Popup */
#winner-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 1920px;
    height: 1080px;
    background: rgba(0,0,0,0.75);
    z-index: 100;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#winner-overlay.active {
    display: flex;
}

#winner-card {
    background: linear-gradient(135deg, #1a1a50, #0f0f30);
    border: 3px solid #FFD700;
    border-radius: 24px;
    padding: 40px 60px;
    text-align: center;
    box-shadow: 0 0 80px rgba(255,215,0,0.4);
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#winner-card.triple {
    padding: 24px 40px;
    display: flex;
    gap: 30px;
}

@keyframes scaleIn {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

#winner-card .win-title {
    font-size: 16px;
    color: #4FC3F7;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 8px;
}

#winner-card .win-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 48px;
    font-weight: 900;
    color: #FFD700;
    text-shadow: 0 0 30px rgba(255,215,0,0.6);
}

#winner-card .win-kelas {
    font-size: 22px;
    color: #aaa;
    margin-top: 4px;
}

#winner-card .win-prize {
    font-size: 18px;
    color: #4FC3F7;
    margin-top: 8px;
    font-weight: 600;
}

#winner-card.triple .win-name { font-size: 28px; }
#winner-card.triple .win-kelas { font-size: 16px; }

#winner-close {
    margin-top: 24px;
    padding: 12px 48px;
    background: #FFD700;
    color: #1a1a2e;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: transform 0.1s;
}

#winner-close:active { transform: scale(0.95); }

/* Triple winner card items */
.triple-winner-item {
    text-align: center;
    padding: 10px 16px;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.triple-winner-item:last-child { border-right: none; }

.triple-winner-item .tw-label {
    font-size: 13px;
    color: #4FC3F7;
    margin-bottom: 6px;
}

.triple-winner-item .tw-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #FFD700;
}

.triple-winner-item .tw-kelas {
    font-size: 14px;
    color: #aaa;
}

/* Confetti canvas */
#confetti-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 1920px;
    height: 1080px;
    pointer-events: none;
    z-index: 200;
}

/* Bottom buttons row */
#bottom-btns {
    display: flex;
    gap: 8px;
}

#btn-reset {
    flex: 3;
    background: rgba(255,255,255,0.08);
    color: #ff6b6b;
    height: 42px;
    font-size: 13px;
    border: 1px solid rgba(255,107,107,0.3);
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
}

#fullscreen-btn {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    color: #aaa;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
}

/* Notification */
#notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #E74C3C;
    color: #fff;
    padding: 12px 32px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    z-index: 300;
    display: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

#notification.show {
    display: block;
    animation: fadeInOut 3s forwards;
}

@keyframes fadeInOut {
    0%   { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    10%  { opacity: 1; transform: translateX(-50%) translateY(0); }
    80%  { opacity: 1; }
    100% { opacity: 0; }
}

/* Loading spinner */
#loading {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

#loading.active { display: flex; }

#loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: #FFD700;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
