:root {
    /* Bảng màu theo thương hiệu DGD */
    --primary-color: #F26522;  /* Cam chủ đạo */
    --secondary-color: #002D5B; /* Xanh đen đậm */
    --accent-color: #ff8246;   /* Cam sáng (cho hover) */
    --text-color: #333333;
    --white: #ffffff;
    --bg-light: #fff8f5;       /* Màu nền phụ rất nhạt hơi ám cam */
}

body {
    font-family: 'Roboto', sans-serif;
    /* Đổi nền sang trắng hoàn toàn để tệp với nền logo */
    background-color: var(--white);
    background-image: linear-gradient(180deg, #ffffff 0%, #fffbf8 100%);
    margin: 0;
    padding: 0;
    color: var(--text-color);
    min-height: 100vh;
}

.main-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* --- HEADER & LOGO --- */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 10px;
}

.logo-wrapper {
    margin-bottom: 10px;
    text-align: center;
}

.dgd-logo {
    height: 70px; /* Tăng kích thước logo lên chút cho rõ */
    width: auto;
    object-fit: contain;
    /* Không cần đổ bóng nữa vì nền đã trắng, nhìn sẽ liền mạch hơn */
}

header h1 {
    color: var(--secondary-color); /* Tiêu đề màu Xanh đen */
    font-size: 2.2rem;
    margin-bottom: 5px;
    font-weight: 800;
    text-transform: uppercase;
}
header h1 i {
    color: var(--primary-color); /* Icon bên cạnh tiêu đề màu Cam */
}

header p {
    color: #666;
    font-style: italic;
}

/* --- TABS NAVIGATION --- */
.tabs-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.tab-btn {
    padding: 12px 30px;
    border: 2px solid #eee;
    border-radius: 50px;
    background: var(--white);
    font-weight: bold;
    color: #777;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.tab-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tab-btn.active {
    /* Tab đang chọn màu Cam */
    background: linear-gradient(90deg, var(--primary-color), #ff8e4f);
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(242, 101, 34, 0.3);
    transform: translateY(-2px);
}

/* --- GAME CARD --- */
.game-card {
    background: var(--white);
    border-radius: 20px;
    padding: 30px;
    /* Đổ bóng nhẹ màu cam để nổi bật trên nền trắng */
    box-shadow: 0 10px 30px rgba(0, 45, 91, 0.08); 
    text-align: center;
    min-height: 400px;
    border: 1px solid #f0f0f0;
}

.game-card h2 {
    color: var(--secondary-color);
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.game-card h2 i {
    color: var(--primary-color);
    margin-right: 8px;
}

/* --- GAME 1: RANDOM NUMBER --- */
.result-box {
    font-size: 6rem;
    font-weight: 800;
    color: var(--primary-color); /* Số kết quả màu Cam */
    margin: 20px 0;
    font-family: monospace;
}

.settings-area {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.input-group label {
    font-weight: bold;
    color: var(--secondary-color);
    display: block;
    margin-bottom: 5px;
}

.input-group input {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    width: 100px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.input-group input:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* --- BUTTONS --- */
button {
    font-family: 'Roboto', sans-serif;
}

.btn-play {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    color: var(--white);
    border: none;
    padding: 15px 50px;
    font-size: 1.3rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(242, 101, 34, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(242, 101, 34, 0.5);
}

.btn-play:active { transform: scale(0.98); }

/* --- GAME 2: LUCKY BOX (LƯỚI QUÀ) --- */
.lucky-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 15px;
    padding: 15px;
    max-height: 450px;
    overflow-y: auto;
    background: var(--bg-light);
    border-radius: 15px;
    border: 1px dashed #ddd;
}

.lucky-item {
    background: var(--white);
    border: 2px solid var(--primary-color); /* Viền màu Cam */
    border-radius: 12px;
    aspect-ratio: 1/1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.lucky-item i {
    font-size: 2.2rem;
    color: var(--primary-color); /* Icon hộp quà màu Cam */
    transition: transform 0.3s;
    margin-bottom: 5px;
}

.lucky-item span {
    font-size: 13px;
    font-weight: bold;
    color: var(--secondary-color);
}

.lucky-item:hover {
    transform: translateY(-5px);
    background-color: var(--primary-color);
    box-shadow: 0 8px 15px rgba(242, 101, 34, 0.3);
}

.lucky-item:hover i, 
.lucky-item:hover span {
    color: var(--white); /* Đổi màu chữ/icon sang trắng khi hover */
}

/* Trạng thái đã mở */
.lucky-item.opened {
    background: #f0f0f0;
    border-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.lucky-item.opened i { color: #999; }
.lucky-item.opened span { color: #999; }


/* Các nút cài đặt nhỏ */
.control-row { margin-top: 20px; }

.btn-settings { 
    background: var(--secondary-color); 
    color: white; 
    border:none; 
    padding: 10px 20px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: bold;
}
.btn-settings:hover { background: #0b3d75; }

.btn-reset {
    background: #fff;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 10px;
    transition: 0.3s;
}
.btn-reset:hover {
    background: var(--primary-color);
    color: white;
}

/* Panel Cài đặt */
.settings-panel {
    margin-top: 20px;
    text-align: left;
    background: #fdfdfd;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #eee;
}
.settings-panel.hidden { display: none; }

textarea {
    width: 100%;
    height: 120px;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-family: inherit;
    resize: vertical;
}
textarea:focus { outline: 1px solid var(--primary-color); }

.checkbox-wrapper { margin-bottom: 15px; }

.btn-save { 
    background: #28a745; 
    color: white; 
    border:none; 
    padding: 12px; 
    border-radius: 8px; 
    cursor: pointer; 
    width: 100%;
    font-weight: bold;
    font-size: 1rem;
}
.btn-save:hover { background: #218838; }

/* --- GAME 3: WHEEL --- */
.wheel-layout {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    align-items: flex-start;
}
.wheel-container {
    position: relative;
    width: 400px;
    height: 400px;
}
.pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    font-size: 50px;
    color: var(--secondary-color); /* Kim chỉ màu Xanh đen */
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}
#spin-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--white);
    border: 5px solid var(--primary-color); /* Viền nút quay màu Cam */
    font-weight: bold;
    color: var(--primary-color);
    cursor: pointer;
    z-index: 5;
    font-size: 14px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
#spin-btn:hover {
    background: var(--primary-color);
    color: var(--white);
}

.wheel-controls {
    width: 100%;
    max-width: 350px;
    text-align: left;
}
.wheel-controls h3 {
    color: var(--secondary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    display: inline-block;
}

/* --- MODAL (POPUP) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 45, 91, 0.8); /* Nền tối xanh đen */
    backdrop-filter: blur(4px);
}
.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    position: relative;
    animation: slideDown 0.4s;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    border-top: 10px solid var(--primary-color);
}
.close-modal {
    position: absolute;
    top: 10px; right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #999;
}
.close-modal:hover { color: var(--primary-color); }

.congrats-icon { font-size: 60px; color: #FFD700; margin-bottom: 15px; }
.modal-content h3 { color: var(--primary-color); font-size: 2rem; margin: 0; }
#modal-text { font-size: 24px; font-weight: bold; color: var(--secondary-color); margin-top: 10px;}

@keyframes slideDown {
    from {top: -100px; opacity: 0;}
    to {top: 0; opacity: 1;}
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(242, 101, 34, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 15px rgba(242, 101, 34, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(242, 101, 34, 0); }
}
.pulse-animation { animation: pulse 2s infinite; }

/* Responsive Mobile */
@media (max-width: 768px) {
    .dgd-logo { height: 50px; }
    .wheel-layout { flex-direction: column; align-items: center; }
    .wheel-controls { width: 100%; margin-top: 20px; }
    .wheel-container { width: 300px; height: 300px; }
    #wheel { width: 300px; height: 300px; }
    .game-card { padding: 15px; }
    .tabs-nav { gap: 5px; }
    .tab-btn { padding: 8px 15px; font-size: 0.9rem; }
}
