:root {
    --bg-dark: #120502;
    --bg-panel: #3c0f05;
    --bg-panel-transparent: rgba(60, 15, 5, 0.85);
    --text-main: #fcf1ef;
    --text-muted: #d0b8b4;
    --accent: #ff6b4a;
    --accent-hover: #ff8b70;
    --border: rgba(255, 107, 74, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    background-image: radial-gradient(circle at top, var(--bg-panel) 0%, var(--bg-dark) 80%);
}

.app-container {
    display: flex;
    width: 95%;
    max-width: 1200px;
    height: 85vh;
    gap: 2rem;
    animation: fadeUp 0.8s ease-out;
}

.main-panel {
    flex: 2;
    background: var(--bg-panel-transparent);
    border-radius: 24px;
    border: 1px solid var(--border);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
}

header {
    text-align: center;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff, #ffae9e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stats {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.draw-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
}

.winner-display {
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    width: 100%;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s ease;
}

.winner-display.drawing {
    animation: pulse 0.5s infinite alternate;
    opacity: 0.8;
}

.winner-name {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--accent);
    text-shadow: 0 0 20px rgba(255, 107, 74, 0.4);
    animation: zoomIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.placeholder-text {
    font-size: 2rem;
    color: var(--text-muted);
    font-weight: 300;
    opacity: 0.5;
}

/* Buttons */
.btn {
    font-family: inherit;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:active {
    transform: scale(0.96);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-draw {
    position: relative;
    padding: 1.5rem 4rem;
    font-size: 1.8rem;
    background: var(--accent);
    color: #120502;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(255, 107, 74, 0.3);
}

.btn-draw:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 15px 30px rgba(255, 107, 74, 0.4);
    transform: translateY(-2px);
}

.btn-draw .btn-glow {
    position: absolute;
    width: 100px;
    height: 100%;
    background: rgba(255,255,255,0.3);
    top: 0;
    left: -150px;
    transform: skewX(-30deg);
    transition: 0.5s;
}

.btn-draw:hover:not(:disabled) .btn-glow {
    left: 120%;
    transition: 0.7s;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: var(--text-main);
    padding: 0.8rem 2rem;
    font-size: 1rem;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255,255,255,0.15);
}

/* Sidebar */
.sidebar {
    flex: 1;
    background: var(--bg-panel-transparent);
    border-radius: 24px;
    border: 1px solid var(--border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.sidebar-header {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.sidebar-header h2 {
    font-weight: 500;
    font-size: 1.5rem;
}

.winners-list {
    list-style: none;
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 0.5rem;
}

.winners-list::-webkit-scrollbar {
    width: 6px;
}

.winners-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

.winner-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    margin-bottom: 0.8rem;
    animation: slideInRight 0.4s ease-out;
}

.winner-item .badge {
    background: var(--accent);
    color: #120502;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 1rem;
    flex-shrink: 0;
}

.winner-item .name {
    font-size: 1.1rem;
    font-weight: 500;
}

.winner-item .time {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Spinner Animation */
.spinner-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto;
}

.spinner-pointer {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; 
    height: 0; 
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 20px solid #fff;
    z-index: 10;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.6));
}

.spinner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        #ff6b4a 0deg 45deg,
        #ffd166 45deg 90deg,
        #ff6b4a 90deg 135deg,
        #ffd166 135deg 180deg,
        #ff6b4a 180deg 225deg,
        #ffd166 225deg 270deg,
        #ff6b4a 270deg 315deg,
        #ffd166 315deg 360deg
    );
    border: 4px solid #fff;
    box-shadow: 0 0 30px rgba(255, 107, 74, 0.6), inset 0 0 15px rgba(0,0,0,0.3);
    animation: spin 0.4s linear infinite;
    position: relative;
}

.spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.9);
    color: #120502;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    transform: translateX(150%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(0.98); }
    100% { transform: scale(1.02); }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Responsive */
@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
        height: auto;
        padding: 2rem 0;
    }
    .winner-name {
        font-size: 2.5rem;
    }
    .sidebar {
        height: 400px;
    }
}
