/* Reset cơ bản */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Nunito', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f0f8ff;
    background-image: radial-gradient(#ffe4b5 1px, transparent 1px), radial-gradient(#ffe4b5 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
    color: #333;
    min-height: 100vh;
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

header h1 {
    color: #ff6b6b;
    font-size: 2.5rem;
    text-shadow: 2px 2px 0px #fff, 4px 4px 0px #ffcccb;
    margin-bottom: 5px;
}

header p {
    color: #4ecdc4;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

/* Các nút bấm */
button {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    transition: transform 0.2s, background-color 0.2s;
}

button:active {
    transform: scale(0.95);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.toggle-btn {
    background-color: #e0e0e0;
    color: #555;
    padding: 8px 16px;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.primary-btn {
    background-color: #4ecdc4;
    color: white;
    padding: 10px 20px;
    font-size: 1rem;
}

.primary-btn.warning {
    background-color: #ff6b6b;
}

/* Khu vực Cấu hình */
.config-panel {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    border: 2px dashed #ffb8b8;
}

.config-panel.hidden {
    display: none;
}

.input-group {
    margin-bottom: 15px;
    display: inline-block;
    margin-right: 20px;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #666;
}

.input-group input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    width: 100px;
    text-align: center;
    font-size: 1.1rem;
}

.note {
    font-size: 0.8rem;
    color: #ff6b6b;
    margin-top: 10px;
}

/* Khu vực Layout chính */
.game-area {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center;
    align-items: flex-start;
}

/* Vòng quay */
.wheel-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.pointer {
    position: absolute;
    top: 15px;
    font-size: 2rem;
    color: #ff6b6b;
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.wheel {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: conic-gradient(
        #ff9a9e 0deg 60deg, 
        #fecfef 60deg 120deg, 
        #a1c4fd 120deg 180deg, 
        #c2e9fb 180deg 240deg, 
        #d4fc79 240deg 300deg, 
        #96e6a1 300deg 360deg
    );
    border: 8px solid #fff;
    box-shadow: 0 0 0 5px #ffb8b8, 0 10px 20px rgba(0,0,0,0.2);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    /* CSS transition để quay mượt mà, chậm dần ở cuối */
    transition: transform 5s cubic-bezier(0.15, 0.85, 0.25, 1);
}

.center-circle {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
    border: 4px solid #ffde6b;
    z-index: 5;
    /* Để chữ số không bị xoay lộn ngược theo vòng quay */
    position: absolute; 
}

#center-number {
    font-size: 3rem;
    font-weight: 900;
    color: #ff6b6b;
}

.spin-btn {
    margin-top: 30px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #d81b60;
    padding: 15px 40px;
    font-size: 1.5rem;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(255, 154, 158, 0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.spin-btn:hover {
    box-shadow: 0 8px 20px rgba(255, 154, 158, 0.6);
}

.status-text {
    margin-top: 15px;
    color: #888;
    font-style: italic;
}

/* Bảng Lịch sử */
.history-container {
    flex: 1;
    min-width: 300px;
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.history-container h2 {
    color: #fca311;
    margin-bottom: 20px;
}

.table-wrapper {
    max-height: 400px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f8f9fa;
    color: #555;
    position: sticky;
    top: 0;
}

tr:nth-child(even) { background-color: #fafafa; }

.prize-col { font-weight: bold; color: #4ecdc4; }
.number-col { font-weight: bold; color: #ff6b6b; font-size: 1.2rem; }

/* Modal Pop-up */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.bounce-text {
    color: #ff6b6b;
    font-size: 2.5rem;
    margin-bottom: 15px;
}

#modal-message {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 20px;
}

.winning-number-display {
    font-size: 5rem;
    font-weight: 900;
    color: #fca311;
    background: #fff9e6;
    border-radius: 15px;
    padding: 20px;
    margin: 0 auto 30px;
    display: inline-block;
    border: 3px dashed #fca311;
}

#close-modal-btn {
    font-size: 1.2rem;
    padding: 12px 30px;
}