:root {
    --wheel-primary-blue: #007bff;
    --wheel-primary-green: #28a745;
    --wheel-primary-red: #dc3545;
    --wheel-secondary-gray: #6c757d;
    --wheel-light-gray: #f8f9fa;
    --wheel-border-color: #dee2e6;
}

/* --- Floating Action Button (FAB) --- */
.wheel-fab {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 120;
    width: 70px;
    height: 70px;
    background-color: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}
.wheel-fab:hover {
    transform: translateX(-50%) scale(1.1);
}
.wheel-fab img {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* --- Modal Structure --- */
.wheel-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(248, 249, 250, 0.8); /* Light "frosted glass" overlay */
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.wheel-modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.wheel-modal-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    width: 95%;
    max-width: 500px;
    height: 80vh;
    max-height: 600px;
    transform: scale(0.95);
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.wheel-modal-overlay.visible .wheel-modal-content {
    transform: scale(1);
}

.wheel-modal-content.wheel-mode {
    background-color: transparent;
    box-shadow: none;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
}

.wheel-modal-header, .wheel-modal-footer {
    padding: 1rem 1.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.wheel-modal-header {
    justify-content: space-between;
    border-bottom: 1px solid var(--wheel-border-color);
}
.wheel-modal-footer {
    border-top: 1px solid var(--wheel-border-color);
    gap: 0.5rem;
}

.wheel-modal-content.wheel-mode .wheel-modal-header,
.wheel-modal-content.wheel-mode .wheel-modal-footer {
    border: none;
    position: absolute;
    width: 100%;
    z-index: 2010;
    box-sizing: border-box;
}
.wheel-modal-content.wheel-mode .wheel-modal-header { top: 0; left: 0; }
.wheel-modal-content.wheel-mode .wheel-modal-footer { bottom: 0; left: 0; padding: 1.5rem; }
.wheel-modal-content.wheel-mode .wheel-modal-header h2 { color: #333; text-shadow: none; }
.wheel-modal-content.wheel-mode .close-btn { color: #555; text-shadow: none; font-size: 2.5rem; }

.wheel-modal-body {
    padding: 1rem 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}
.wheel-modal-content.wheel-mode .wheel-modal-body {
    padding: 0;
    align-items: center;
    justify-content: center;
}

/* --- Name Entry View --- */
#wheel-name-textarea {
    width: 100%;
    height: 100px;
    padding: 0.75rem;
    border: 1px solid var(--wheel-border-color);
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    resize: vertical;
    flex-shrink: 0;
}
.wheel-name-entry-buttons { display: flex; gap: 0.5rem; }
.wheel-btn { padding: 0.75rem; font-size: 1rem; color: white; border: none; border-radius: 8px; cursor: pointer; flex-grow: 1; }
.wheel-btn-info { background-color: #17a2b8; }
.wheel-btn-danger { background-color: var(--wheel-primary-red); }

#wheel-name-list-container {
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid var(--wheel-border-color);
    border-radius: 8px;
    padding: 0.5rem;
}
#wheel-name-list { list-style: none; padding: 0; margin: 0; }
#wheel-name-list li { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0.75rem; border-radius: 6px; }
#wheel-name-list li:nth-child(odd) { background-color: var(--wheel-light-gray); }
.wheel-remove-name-btn { background: none; border: none; color: var(--wheel-primary-red); cursor: pointer; font-weight: bold; }

/* --- Wheel View --- */
#wheel-canvas-container {
    width: min(90vw, 90vh);
    height: min(90vw, 90vh);
    position: relative;
    z-index: 2005;
}
#wheel-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2));
}
#wheel-canvas-container::after {
    content: '▼';
    font-size: clamp(40px, 5vmin, 60px);
    color: var(--wheel-primary-red);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
}

.wheel-action-button {
    padding: 1rem;
    font-size: 1.25rem;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.wheel-action-button:active { transform: scale(0.98); }
.wheel-action-button:disabled { background-color: #adb5bd; cursor: not-allowed; }

#wheel-spin-button { background-color: var(--wheel-primary-green); flex-grow: 2; }
#wheel-go-to-wheel-btn { background-color: var(--wheel-primary-blue); }
.wheel-btn-secondary { background-color: var(--wheel-secondary-gray); }
.wheel-spin-icon { height: 30px; width: 30px; }

#wheel-winner-announcement {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2020;
    text-align: center;
    display: none;
}
#wheel-winner-announcement h3 {
    margin: 0;
    font-size: clamp(2rem, 10vmin, 5rem);
    color: #333;
    text-shadow: 0 2px 6px rgba(255,255,255,0.7);
    animation: wheel-bounceIn 0.5s ease;
}

@keyframes wheel-bounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}
.hidden { display: none !important; }