﻿
 :root

{
    /* --- PALETTE 2026: ĐỎ RUBY & VÀNG KIM (MÃ ĐÁO) --- */
    --primary-red: #8E0E00;
    --deep-red: #4a0000;
    --gradient-bg: radial-gradient(circle at center, #8E0E00 0%, #2b0303 100%);
    --gold-1: #FFD700;
    --gold-2: #FDB931;
    --gold-text: #fff3cd;
    /* Glassmorphism Variables */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 215, 0, 0.3);
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

html {
    height: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
}

body {

    margin: 0;
    padding: 0;
    min-height: 100vh;
    height: auto;
    font-family: 'Montserrat', sans-serif;
    background: var(--primary-red);
    background: var(--gradient-bg);
    color: #fff;
}
    /* Họa tiết nền mờ */
    body::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: auto;
        min-height: 100vh;
        background-image: repeating-linear-gradient(45deg, rgba(255,215,0,0.05) 0, rgba(255,215,0,0.05) 1px, transparent 0, transparent 50%);
        background-size: 20px 20px;
        pointer-events: none;
        z-index: 0;
    }

/* --- LAYOUT CHÍNH --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    height: auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* --- COMPACT HEADER STYLE (CHIẾM < 20% CHIỀU CAO) --- */
.header-compact {
    position: relative;
    /* Dùng Flexbox để dàn ngang: Logo bên trái, Nút bên phải */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px; /* Padding nhỏ để tiết kiệm diện tích */
    margin-bottom: 20px;
    background: rgba(142, 14, 0, 0.6); /* Nền đỏ trong suốt */
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 100;
    height: auto;
    min-height: 70px; /* Đảm bảo chiều cao tối thiểu */
}

/* Khu vực bên trái: Logo + Tiêu đề */
.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-compact {
    max-height: 50px; /* Logo nhỏ lại */
    width: auto;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.6));
}

.title-compact {
    font-family: 'Comfortaa', sans-serif;
    font-size: 20px; /* Font chữ vừa phải */
    font-weight: 700;
    margin: 0;
    
    background: linear-gradient(to right, #FFD700, #fff, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

/* Khu vực bên phải: User info + Nút */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-greeting {
    font-size: 13px;
    color: #e0e0e0;
    text-align: right;
}

.user-name-highlight {
    font-family: 'Comfortaa', sans-serif;
    font-weight: 800;
    display: block;
    /* Tạo hiệu ứng chữ màu Gradient */
    background: linear-gradient(to bottom, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    filter: drop-shadow(0px 2px 2px rgba(0,0,0,0.2));
    margin: 10px 0;
}
/* Nút bấm nhỏ gọn (Mini buttons) */
.btn-mini {
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.btn-mini-login {
    background: linear-gradient(90deg, #FFD700, #FDB931);
    color: #8E0E00 !important;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.2);
}

.btn-mini-logout {
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff !important;
}

    .btn-mini-logout:hover {
        background: rgba(255, 0, 0, 0.2);
        border-color: #ff4d4d;
    }

/* --- RESPONSIVE MOBILE (Dưới 768px) --- */
@media (max-width: 768px) {
    .header-compact {
        flex-direction: column; /* Mobile thì xếp dọc lại nhưng vẫn gọn */
        padding: 10px;
        gap: 8px;
    }

    .header-left {
        justify-content: center;
        width: 100%;
    }

    .title-compact {
        font-size: 18px; /* Chữ nhỏ hơn trên mobile */
    }

    .logo-compact {
        max-height: 40px;
    }

    .header-right {
        width: 100%;
        justify-content: center;
        background: rgba(0,0,0,0.2);
        padding: 5px;
        border-radius: 15px;
    }

    .user-greeting {
        font-size: 12px;
        display: flex;
        gap: 5px;
        align-items: center;
    }

    .user-name-highlight {
        display: inline; /* Trên mobile tên nằm cùng dòng */
    }
}
/* --- GRID LAYOUT --- */
.grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: flex-start;
}

/* --- CỘT TRÁI: VÒNG QUAY --- */
.wheel-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.wheel-aura {
    position: absolute;
    width: 110%;
    height: 110%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255,215,0,0.15) 0%, rgba(0,0,0,0) 70%);
    z-index: 0;
    animation: pulse-aura 4s infinite;
}

/* --- VÒNG QUAY: Thu nhỏ kích thước tối đa --- */
canvas#wheel {
    width: 100%;
    max-width: 460px; /* Giảm từ 600px xuống ~40% (còn 380px) */
    height: auto;
    aspect-ratio: 1/1;
    z-index: 2;
    filter: drop-shadow(0 10px 25px rgba(0,0,0,0.6));
    border-radius: 50%;
    box-shadow: 0 0 0 6px #8E0E00, 0 0 0 10px #FFD700; /* Thu nhỏ viền */
    transition: transform 3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.btn-spin-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700, #FDB931, #e6ac00);
    color: #8E0E00;
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 14px;
    border: 3px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4), inset 0 0 15px rgba(255,255,255,0.6);
    cursor: pointer;
    z-index: 10;
    outline: none;
    transition: all 0.2s;
    text-transform: uppercase;
}

    .btn-spin-center:active {
        transform: translate(-50%, -50%) scale(0.95);
    }

    .btn-spin-center:hover {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
        color: #d32f2f;
    }

.pointer {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 35px solid #fff;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,0.5));
}

    .pointer::after {
        content: '';
        position: absolute;
        top: -37px;
        left: -10px;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 20px solid #d32f2f;
    }

/* --- CỘT PHẢI: BẢNG ĐIỀU KHIỂN --- */
.control-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 15px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: auto;
    min-height: 400px;
    animation: fadeInRight 1s ease-out;
}

.input-group {
    position: relative;
    margin-bottom: 10px;
}

.input-custom {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 2px solid rgba(255, 215, 0, 0.4);
    background: rgba(255,255,255,0.95);
    color: #8E0E00;
    font-weight: 700;
    font-size: 16px;
    text-align: center;
    box-sizing: border-box;
    transition: all 0.3s;
    font-family: 'Montserrat', sans-serif;
}

    .input-custom:focus {
        outline: none;
        border-color: #FFD700;
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    }

    .input-custom::placeholder {
        color: #999;
        font-weight: normal;
    }

.alert-box {
    background: rgba(255, 243, 205, 0.9);
    color: #856404;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid #ffeeba;
    display: block;
}

.btn-link-action {
    display: block;
    text-align: center;
    color: #FFD700;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    margin-top: 5px;
    padding: 8px;
    border: 1px dashed rgba(255,215,0,0.3);
    border-radius: 8px;
    transition: background 0.2s;
}

    .btn-link-action:hover {
        background: rgba(255,215,0,0.1);
    }

.prize-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 10px;
    background: rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: 12px;
}

.prize-item {
    text-align: center;
    font-size: 10px;
    color: #fff;
    position: relative;
}

.prize-img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 3px;
}

.winners-box {
    flex-grow: 1;
    overflow-y: auto;
    margin-top: 15px;
    padding-right: 5px;
    max-height: 220px;
    scrollbar-width: thin;
    scrollbar-color: #FFD700 rgba(0,0,0,0.1);
}

    .winners-box::-webkit-scrollbar {
        width: 6px;
    }

    .winners-box::-webkit-scrollbar-thumb {
        background: #FFD700;
        border-radius: 10px;
    }

.winner-card {
    background: rgba(255, 255, 255, 0.08);
    border-left: 3px solid #FFD700;
    padding: 6px 10px;
    margin-bottom: 5px;
    border-radius: 0 6px 6px 0;
    transition: transform 0.2s;
}

    .winner-card:hover {
        transform: translateX(5px);
        background: rgba(255, 255, 255, 0.15);
    }

.w-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.w-name {
    font-weight: 700;
    color: #fff;
    font-size: 12px;
}

.w-prize {
    color: #FFD700;
    font-weight: 600;
    font-size: 12px;
}

.w-time {
    font-size: 11px;
    color: #ffcccc;
    font-style: italic;
}

@media (max-width: 900px) {
    .grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .title {
        font-size: 24px;
    }

    canvas#wheel {
        max-width: 85vw;
    }

    .control-panel {
        height: auto;
        min-height: auto;
    }

    .winners-box {
        max-height: 250px;
    }

    .btn-spin-center {
        width: 65px;
        height: 65px;
        font-size: 16px;
    }
}

/* --- POPUP WIN --- */
.win-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
}

    .win-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }

.win-popup {
    background: radial-gradient(circle, #fffbf0, #fff);
    border: 4px solid #b71c1c;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    width: 85%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.6);
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.win-overlay.show .win-popup {
    transform: scale(1);
}

.win-title-text {
    font-family: 'Playfair Display', serif;
    color: #d32f2f;
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 10px;
    text-transform: uppercase;
}

@keyframes pulse-aura {
    0% {
        opacity: 0.3;
        transform: translate(-50%,-50%) scale(0.95);
    }

    50% {
        opacity: 0.6;
        transform: translate(-50%,-50%) scale(1.05);
    }

    100% {
        opacity: 0.3;
        transform: translate(-50%,-50%) scale(0.95);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.music-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #FFD700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFD700;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s;
    animation: fadeInDown 1s ease-out;
}

    .music-btn:hover {
        background: #8E0E00;
        transform: scale(1.1);
        box-shadow: 0 0 15px #FFD700;
    }

.music-playing {
    animation: music-spin 3s linear infinite;
    border-color: #00ff00;
    color: #00ff00;
}

@keyframes music-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}



