* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #e1306c;
    --primary-hover: #c13584;
    --secondary-color: #405de6;
    --background: #fafafa;
    --card-bg: #ffffff;
    --text-primary: #262626;
    --text-secondary: #8e8e8e;
    --border-color: #dbdbdb;
    --success-color: #00c853;
    --error-color: #ff1744;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.8rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 10px;
}

h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

input[type="text"],
input[type="number"],
textarea {
    width: 100%;
    padding: 16px 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1.1rem;
    font-family: inherit;
    transition: border-color 0.3s;
    min-height: 56px;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.conditions {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.condition-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: white;
    border-radius: 5px;
}

.condition-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.condition-item label {
    margin: 0;
    cursor: pointer;
}

.info-text {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    color: #856404;
}

.input-methods {
    display: block;
    margin-bottom: 30px;
}

.method-card {
    border: 2px solid var(--border-color);
    padding: 20px;
    border-radius: 10px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.method-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.small-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

input[type="file"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
}

.participants-list {
    margin-bottom: 20px;
}

.participants-list.invalid h3 {
    color: var(--error-color);
}

.list-box {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
    background: #fafafa;
}

.participant-item {
    padding: 16px;
    margin-bottom: 12px;
    background: white;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    font-size: 1.1rem;
}

.participant-item.valid {
    border-left: 4px solid var(--success-color);
}

.participant-item.invalid {
    border-left: 4px solid var(--error-color);
}

.participant-username {
    font-weight: 600;
    color: var(--text-primary);
}

.participant-status {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn {
    padding: 16px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    min-height: 56px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    width: 100%;
    font-size: 1.3rem;
    padding: 18px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    width: 100%;
}

.btn-secondary:hover {
    background: var(--background);
    border-color: var(--primary-color);
}

.btn-link {
    background: transparent;
    color: var(--primary-color);
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-link:hover {
    text-decoration: underline;
}

.draw-section {
    text-align: center;
}

/* Roulette Styles */
.roulette-container {
    margin-top: 40px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #c62828, #e53935);
    border-radius: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.roulette-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.roulette-lights {
    display: flex;
    gap: 8px;
}

.light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 10px #ffffff;
    animation: blink 1.5s infinite alternate;
}

.light:nth-child(2) { animation-delay: 0.3s; }
.light:nth-child(3) { animation-delay: 0.6s; }
.light:nth-child(4) { animation-delay: 0.9s; }
.light:nth-child(5) { animation-delay: 1.2s; }

@keyframes blink {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

.roulette-status {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid #ffffff;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    animation: pulse 2s infinite;
    flex: 1;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.roulette-frame {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    background: linear-gradient(135deg, #b71c1c, #c62828);
    border-radius: 25px;
    padding: 0;
    box-shadow: 
        inset 0 0 30px rgba(0, 0, 0, 0.5),
        0 0 0 4px #ffffff,
        0 0 20px rgba(255, 255, 255, 0.4);
    overflow: hidden;
}

.roulette-border-top,
.roulette-border-bottom {
    height: 60px;
    background: linear-gradient(to bottom, rgba(198, 40, 40, 0.95), transparent);
    position: relative;
    z-index: 5;
}

.roulette-border-bottom {
    background: linear-gradient(to top, rgba(198, 40, 40, 0.95), transparent);
}

.roulette-pointer {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    z-index: 10;
    pointer-events: none;
}

.pointer-arrow {
    position: absolute;
    left: 20px;
    font-size: 3rem;
    color: #ffffff;
    filter: drop-shadow(0 0 10px #ffffff) drop-shadow(0 0 20px #ffffff);
    animation: pointBounce 1s infinite;
}

@keyframes pointBounce {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

.roulette-viewport {
    height: 280px;
    overflow: hidden;
    position: relative;
    padding: 0 20px;
}

.roulette-wheel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 0;
    transition: transform 0.1s linear;
}

.roulette-item {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    padding: 22px 30px;
    border-radius: 15px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
    text-align: center;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 2px solid transparent;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.roulette-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.roulette-item:hover::before {
    left: 100%;
}

.roulette-item.winner {
    background: linear-gradient(135deg, #ffffff, #f5f5f5, #ffffff);
    background-size: 200% 200%;
    border: 3px solid #d32f2f;
    color: #c62828;
    animation: winnerShine 1s ease-in-out infinite, winnerGlow 0.5s ease-in-out infinite alternate;
    transform: scale(1.08);
    box-shadow: 
        0 0 30px rgba(255, 255, 255, 0.9),
        0 0 60px rgba(211, 47, 47, 0.6),
        inset 0 0 20px rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
    z-index: 5;
}

@keyframes winnerShine {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes winnerGlow {
    from {
        box-shadow: 
            0 0 30px rgba(255, 255, 255, 0.9),
            0 0 60px rgba(211, 47, 47, 0.6),
            inset 0 0 20px rgba(255, 255, 255, 0.5);
    }
    to {
        box-shadow: 
            0 0 50px rgba(255, 255, 255, 1),
            0 0 80px rgba(211, 47, 47, 0.8),
            inset 0 0 30px rgba(255, 255, 255, 0.7);
    }
}

.roulette-footer {
    margin-top: 20px;
    min-height: 50px;
    position: relative;
}

.roulette-confetti {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ffffff;
    top: -10px;
    animation: confettiFall 3s linear forwards;
    opacity: 0;
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(400px) rotate(720deg);
    }
}

@media (max-width: 768px) {
    .roulette-container {
        padding: 20px 10px;
        margin-top: 30px;
    }

    .roulette-header {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
    }

    .roulette-lights {
        gap: 6px;
    }

    .light {
        width: 10px;
        height: 10px;
    }

    .roulette-status {
        font-size: 1rem;
        padding: 12px 20px;
        letter-spacing: 1px;
    }

    .roulette-frame {
        border-radius: 15px;
        box-shadow: 
            inset 0 0 20px rgba(0, 0, 0, 0.5),
            0 0 0 3px #ffffff,
            0 0 15px rgba(255, 255, 255, 0.4);
    }

    .roulette-border-top,
    .roulette-border-bottom {
        height: 40px;
    }

    .pointer-arrow {
        font-size: 2rem;
        left: 15px;
    }

    .roulette-viewport {
        height: 240px;
        padding: 0 15px;
    }

    .roulette-item {
        padding: 18px 20px;
        font-size: 1.1rem;
        min-height: 70px;
    }

    .roulette-item.winner {
        font-size: 1.2rem;
    }
}

.results-section {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border: 3px solid #ff9800;
}

.winners-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.winner-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.winner-rank {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    min-width: 60px;
    text-align: center;
}

.winner-info {
    flex: 1;
}

.winner-username {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.winner-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

footer {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        padding: 20px 15px;
        margin-bottom: 20px;
        border-radius: 10px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    section {
        padding: 20px 15px;
        border-radius: 10px;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    .form-group {
        margin-bottom: 20px;
    }

    textarea {
        font-size: 1rem;
    }

    .method-card {
        padding: 15px;
        margin-bottom: 15px;
    }

    .btn {
        font-size: 1rem;
        padding: 14px;
        min-height: 50px;
    }

    .btn-primary {
        font-size: 1.2rem;
        padding: 16px;
        min-height: 56px;
    }

    .list-box {
        max-height: 250px;
        font-size: 1rem;
    }

    .participant-item {
        padding: 14px;
        font-size: 1rem;
    }

    .action-buttons {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .winner-item {
        flex-direction: row;
        padding: 15px;
        gap: 12px;
    }

    .winner-rank {
        font-size: 1.8rem;
        min-width: 50px;
    }

    .winner-username {
        font-size: 1.2rem;
    }

    footer {
        padding: 20px;
        font-size: 0.9rem;
    }
}

/* Scrollbar Styling */
.list-box::-webkit-scrollbar {
    width: 8px;
}

.list-box::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.list-box::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.list-box::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}
