/* General Styling */
:root {
    --bg-color: #f0f2f5;
    --container-bg: #ffffff;
    --primary-text: #333;
    --secondary-text: #666;
    --border-color: #e0e0e0;
    --accent-color: #007bff;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --font-family: 'Poppins', sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--primary-text);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

h1, h2, h3 {
    font-weight: 600;
    color: var(--primary-text);
}

/* App Layout */
.app-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    background-color: var(--container-bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.wheel-container {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 320px;
}

.controls-container {
    flex: 1;
    min-width: 300px;
}

/* Wheel Styling */
.wheel-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1 / 1;
}

#wheelCanvas {
    width: 100%;
    height: 100%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#wheelCanvas:hover {
    transform: scale(1.02);
}

.wheel-pointer {
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    border-left: 30px solid #e74c3c; /* Warna penunjuk */
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.2));
}

/* Controls Styling */
.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--secondary-text);
}

textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-family: var(--font-family);
    font-size: 1rem;
    resize: vertical;
    box-sizing: border-box;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

button {
    flex-grow: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background-color: var(--accent-color);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

button:hover {
    background-color: #0056b3;
}

button:active {
    transform: scale(0.98);
}

/* Results Area */
.results-area {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

#winner-display {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    text-align: center;
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    animation: slideIn 0.4s ease-out;
}

#modalWinnerName {
    color: var(--accent-color);
    font-size: 2rem;
    margin: 10px 0;
}

.modal-options {
    margin: 20px 0;
    font-size: 1rem;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover {
    color: #000;
}

#okButton {
    width: 100%;
}

/* Audio element should be hidden */
#suspense-music, #win-sound {
    display: none;
}

/* Animations */
@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

@keyframes slideIn {
    from {transform: translateY(-50px); opacity: 0;}
    to {transform: translateY(0); opacity: 1;}
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        padding: 20px;
    }
    .wheel-container h1 {
        font-size: 1.5rem;
    }
    .wheel-pointer {
        right: -10px;
        border-left-width: 20px;
        border-top-width: 15px;
        border-bottom-width: 15px;
    }
}
