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

:root {
    --primary-color: #1976d2;
    --primary-dark: #1565c0;
    --primary-light: #64b5f6;
    --secondary-color: #d32f2f;
    --accent-color: #ffb300;
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --text-primary: #212121;
    --text-secondary: #757575;
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --border-color: #e0e0e0;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-glow: none;
    --shadow-glow-gold: none;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-gold: linear-gradient(135deg, #f093fb 0%, #f5576c 50%, #4facfe 100%);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    animation: fadeIn 0.4s ease-in;
}

.screen.active {
    display: block;
}

/* File Upload Screen */
.upload-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
}

.upload-card {
    background: var(--bg-primary);
    border: none;
    border-radius: 24px;
    padding: 48px 32px;
    max-width: 600px;
    width: 100%;
    text-align: center;
    box-shadow: none;
    animation: slideUp 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.upload-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.upload-card h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.upload-card p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

.drop-zone {
    border: 3px dashed var(--border-color);
    border-radius: 16px;
    padding: 40px 24px;
    margin-bottom: 24px;
    transition: all var(--transition-normal);
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.drop-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(25, 118, 210, 0.05);
    transform: scale(1.02);
    box-shadow: none;
}

.drop-zone-content {
    position: relative;
    z-index: 1;
}

.drop-zone-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.drop-zone-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.drop-zone-subtext {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 16px 0;
}

.btn-primary {
    width: 100%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: none;
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    z-index: 10;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    user-select: none;
}

/* Make label work like button */
label.btn-primary {
    margin: 0;
    box-sizing: border-box;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover:not(:disabled)::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: none;
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #bdbdbd;
    cursor: not-allowed;
    box-shadow: none;
}

.file-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
}

.file-status.has-file {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
    font-weight: 500;
}

.file-status-icon {
    font-size: 18px;
}

.upload-progress {
    margin-top: 16px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

/* App Bar */
.app-bar {
    background: var(--bg-primary);
    box-shadow: none;
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.app-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    gap: 16px;
}

.logo-container {
    display: flex;
    align-items: center;
    transition: transform var(--transition-fast);
}

.logo-container:hover {
    transform: scale(1.05);
}

.logo-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--border-color);
    object-fit: cover;
    box-shadow: none;
    transition: all var(--transition-normal);
}

.logo-img:hover {
    box-shadow: none;
    transform: rotate(5deg);
}

.logo-text {
    display: flex;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
}

.water {
    color: var(--primary-color);
}

.tec {
    color: var(--secondary-color);
}

.app-title {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    text-align: center;
    letter-spacing: 2px;
}

.participant-count-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gradient-primary);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: none;
    animation: slideInRight 0.3s ease-out;
}

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

.badge-icon {
    font-size: 18px;
}

/* Participants Grid */
.participants-container {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.participants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    padding-bottom: 32px;
}

@media (max-width: 600px) {
    .participants-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (min-width: 601px) and (max-width: 1024px) {
    .participants-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1025px) {
    .participants-grid {
        grid-template-columns: repeat(10, 1fr);
    }
}

.participant-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 12px;
    text-align: center;
    transition: border-width 0.3s ease, background 0.3s ease;
    cursor: default;
    position: relative;
    overflow: visible;
    box-shadow: none;
    animation: cardEntrance 0.4s ease-out backwards;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    transform: scale(1) !important;
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.participant-card:hover {
    border-color: var(--primary-light);
    background: rgba(25, 118, 210, 0.03);
}

.participant-card.selected {
    border: 6px solid var(--primary-color);
    box-shadow: none;
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.15) 0%, rgba(255, 255, 255, 1) 100%);
    z-index: 10;
    position: relative;
    animation: selectedBorderPulse 0.8s ease-in-out infinite;
}

@keyframes selectedBorderPulse {
    0%, 100% {
        border-width: 5px;
    }
    50% {
        border-width: 7px;
    }
}

.participant-card.winner {
    border: 4px solid var(--accent-color);
    box-shadow: none;
    animation: winnerGlow 1s ease-in-out infinite;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
    transform: scale(1.1);
}

@keyframes winnerGlow {
    0%, 100% {
        box-shadow: none;
    }
    50% {
        box-shadow: none;
    }
}

.participant-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: white;
    background: var(--gradient-primary);
    box-shadow: none;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.participant-card:hover .participant-avatar {
    border-color: var(--primary-light);
}

.participant-card.selected .participant-avatar {
    animation: avatarPulse 1s ease-in-out infinite;
    border: 4px solid var(--primary-color);
}

@keyframes avatarPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.participant-card.winner .participant-avatar {
    background: var(--gradient-gold);
    animation: avatarSpin 2s ease-in-out infinite;
}

@keyframes avatarSpin {
    0%, 100% { transform: rotate(0deg) scale(1.1); }
    50% { transform: rotate(180deg) scale(1.2); }
}

.participant-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.4;
    transition: color var(--transition-fast);
}

.participant-card:hover .participant-name {
    color: var(--primary-color);
}

.participant-card.selected .participant-name {
    color: var(--primary-color);
    font-weight: 800;
    font-size: 15px;
}

/* Start Button */
.start-button-container {
    padding: 24px;
    text-align: center;
    margin-top: 24px;
    margin-bottom: 24px;
}

.start-button {
    max-width: 400px;
    width: 100%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 20px 32px;
    border-radius: 16px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: none;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;
}

.start-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.start-button:hover:not(:disabled)::before {
    width: 400px;
    height: 400px;
}

.start-button:hover:not(:disabled) {
    transform: translateY(-4px) scale(1.02);
    box-shadow: none;
}

.start-button:active:not(:disabled) {
    transform: translateY(-2px) scale(1);
}

.start-button:disabled {
    background: #bdbdbd;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.start-button.loading {
    pointer-events: none;
}

.start-button .spinner-inline {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Video Overlay */
.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.video-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease-in;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: default;
    outline: none;
    pointer-events: none;
    user-select: none;
}

/* Winner Dialog */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.3s ease-in;
}

.dialog-overlay.active {
    display: flex;
}

.dialog-content {
    background: #ffffff;
    border-radius: 12px;
    border: 2px solid #ffb300;
    padding: 32px;
    max-width: 450px;
    width: 100%;
    position: relative;
    z-index: 1;
    animation: dialogEntrance 0.4s ease-out;
    box-shadow: none;
}

@keyframes dialogEntrance {
    0% {
        opacity: 0;
        transform: scale(0.7) translateY(-30px);
    }
    50% {
        transform: scale(1.05) translateY(5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dialog-header {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 2;
}

.dialog-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: #000000;
    letter-spacing: 2px;
    margin: 0;
    line-height: 1.2;
    text-transform: uppercase;
    word-break: break-word;
    padding: 0 8px;
}

/* Removed excessive animations and decorations for simplicity */

.sparkles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.sparkle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #FFD700 0%, transparent 70%);
    border-radius: 50%;
    animation: sparkle 2s ease-in-out infinite;
    box-shadow: none;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(2) rotate(180deg);
    }
}

.winner-info-section {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    border-left: 4px solid #757575;
    position: relative;
    z-index: 2;
}

.info-row {
    display: flex;
    margin-bottom: 12px;
    align-items: flex-start;
    font-size: 16px;
    line-height: 1.5;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-row strong {
    margin-right: 8px;
    color: #000000;
    font-weight: 700;
    min-width: 80px;
}

.info-row span {
    color: #000000;
    font-weight: 500;
    flex: 1;
}

.info-block {
    background: transparent;
    border-radius: 16px;
    padding: 0;
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 2;
}

.info-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: none;
    transition: all var(--transition-normal);
    border-left: 4px solid var(--primary-color);
}

.info-card:hover {
    transform: translateX(4px);
    box-shadow: none;
}

.info-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: 12px;
    flex-shrink: 0;
}

.info-content {
    flex: 1;
}

.info-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.info-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
}

.btn-close {
    width: 100%;
    background: #1976d2;
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    transition: all var(--transition-normal);
    box-shadow: none;
    position: relative;
    z-index: 2;
    cursor: pointer;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.btn-close:hover {
    background: #1565c0;
}

.btn-close:active {
    transform: scale(0.98);
}

/* Confetti Canvas */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in;
}

.loading-content {
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: white;
    font-size: 16px;
    font-weight: 500;
    animation: pulse 2s ease-in-out infinite;
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10002;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.3s ease-out;
    pointer-events: all;
    border-left: 4px solid var(--primary-color);
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: var(--gradient-primary);
    animation: toastProgress 3s linear forwards;
}

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

@keyframes toastProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--error-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.toast-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

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

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

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .upload-card {
        padding: 32px 24px;
    }
    
    .dialog-content {
        padding: 32px 24px;
        max-width: 90%;
    }
    
    .dialog-header h2 {
        font-size: 18px;
        letter-spacing: 1px;
        padding: 0 4px;
        line-height: 1.3;
    }
    
    .dialog-content {
        padding: 24px 16px;
    }
    
    .info-row {
        font-size: 14px;
    }
    
    .info-row strong {
        min-width: 70px;
    }
    
    .winner-info-section {
        padding: 16px;
    }
    
    .toast-container {
        left: 16px;
        right: 16px;
        max-width: none;
    }
    
    .start-button {
        font-size: 18px;
        padding: 18px 24px;
    }
    
    .start-button-container {
        padding: 16px;
        margin-top: 16px;
        margin-bottom: 16px;
    }
    
    .participants-container {
        padding: 16px;
    }
    
    .btn-close {
        padding: 14px 20px;
        font-size: 14px;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .dialog-header h2 {
        font-size: 16px;
        letter-spacing: 0.5px;
        padding: 0 2px;
    }
    
    .dialog-content {
        padding: 20px 12px;
        max-width: 95%;
    }
    
    .info-row {
        font-size: 13px;
    }
    
    .info-row strong {
        min-width: 60px;
        font-size: 13px;
    }
}
