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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1f3a;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0.5rem;
    padding-top: 0.5rem;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at top left, rgba(59, 130, 246, 0.15), transparent 50%),
        radial-gradient(ellipse at top right, rgba(139, 92, 246, 0.15), transparent 50%),
        radial-gradient(ellipse at bottom left, rgba(251, 191, 36, 0.1), transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(59, 130, 246, 0.1), transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: gradientShift 15s ease infinite;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
    opacity: 0.5;
}

/* Login Screen Styles */
.welcome-container {
    max-width: 500px;
    width: 100%;
    text-align: center;
    padding: 3rem 2rem;
    position: relative;
}

.welcome-logout-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid rgba(239, 68, 68, 0.5);
    color: #f87171;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.welcome-logout-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    color: #fca5a5;
    transform: scale(1.05);
}

.welcome-logo {
    margin-bottom: 2rem;
    animation: floatLogo 3s ease-in-out infinite;
    width: 200px;
    height: 200px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 20px rgba(139, 92, 246, 0.3));
}

.welcome-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #8b5cf6, #ec4899, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.5px;
    animation: fadeInUp 0.8s ease;
}

.welcome-subtitle {
    color: #94a3b8;
    font-size: 1.3rem;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

.welcome-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 4px solid rgba(139, 92, 246, 0.2);
    border-top: 4px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite, fadeInUp 0.8s ease 0.4s backwards;
}

.welcome-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
    animation: fadeInUp 0.8s ease 0.4s backwards;
}

.welcome-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.welcome-action-btn.primary {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.welcome-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.welcome-action-btn span {
    font-size: 1.3rem;
}

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

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

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

.login-container {
    max-width: 400px;
    width: 100%;
    text-align: center;
    background: rgba(15, 23, 42, 0.95);
    padding: 2rem 1.5rem;
    border-radius: 24px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.6s ease;
}

.login-title {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.login-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.social-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.google-btn {
    background: white;
    color: #1f2937;
}

.google-btn:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.facebook-btn {
    background: #1877F2;
    color: white;
}

.facebook-btn:hover {
    background: #166FE5;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(24, 119, 242, 0.3);
}

.email-btn {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    border: 2px solid rgba(139, 92, 246, 0.3);
}

.email-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.3);
}

.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1rem 0;
    color: #64748b;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.login-divider span {
    padding: 0 1rem;
    font-size: 0.875rem;
}

.email-login-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.6rem;
    animation: fadeInUp 0.3s ease;
}

.email-login-form input {
    padding: 0.7rem;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    font-size: 0.875rem;
    background: rgba(15, 23, 42, 0.5);
    color: #e2e8f0;
    outline: none;
    transition: all 0.3s ease;
}

.email-login-form input:focus {
    border-color: #8b5cf6;
    background: rgba(15, 23, 42, 0.8);
}

.email-login-form input::placeholder {
    color: #64748b;
}

.login-help {
    text-align: center;
    color: #94a3b8;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.login-help a {
    color: #8b5cf6;
    text-decoration: none;
    font-weight: 600;
}

.login-help a:hover {
    text-decoration: underline;
}

/* Dashboard Screen Styles */
.dashboard-container {
    max-width: 600px;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    padding: 2rem;
    border-radius: 24px;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2rem;
    color: #fbbf24;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.logout-btn svg {
    transition: transform 0.3s ease;
}

.logout-btn:hover svg {
    transform: translateX(3px);
}

.icon-btn {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #e2e8f0;
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    transform: scale(1.05);
}

.dashboard-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.primary-btn {
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.join-group-section {
    display: flex;
    gap: 0.5rem;
}

#join-group-input {
    flex: 1;
    padding: 0.875rem;
    font-size: 1rem;
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    outline: none;
    text-align: center;
    letter-spacing: 0.1rem;
    font-weight: 600;
}

#join-group-input:focus {
    border-color: #a78bfa;
}

.groups-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.group-card {
    background: rgba(30, 41, 59, 0.8);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.group-card:hover {
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateX(4px);
}

.group-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.group-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #fbbf24;
}

.group-id {
    color: #94a3b8;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
}

.group-role {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    font-size: 0.85rem;
    border-radius: 8px;
    margin-top: 0.5rem;
}

#group-name-input {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    outline: none;
    margin-bottom: 1.5rem;
}

#group-name-input:focus {
    border-color: #a78bfa;
}

/* Group Setup Screen */
.add-dishwasher-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

#dishwasher-name-input,
#dishwasher-photo-input {
    padding: 0.875rem;
    font-size: 1rem;
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    outline: none;
}

#dishwasher-name-input:focus,
#dishwasher-photo-input:focus {
    border-color: #a78bfa;
}

.dishwashers-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dishwasher-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(30, 41, 59, 0.8);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.dishwasher-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dishwasher-avatar {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.2);
    border-radius: 50%;
}

.dishwasher-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.dishwasher-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fbbf24;
}

.remove-dishwasher-btn {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-dishwasher-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

.file-upload-btn {
    padding: 0.875rem 1rem;
    background: rgba(139, 92, 246, 0.2);
    border: 2px solid rgba(139, 92, 246, 0.3);
    color: #a78bfa;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 0.9rem;
}

.file-upload-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: #a78bfa;
}



@keyframes gradientShift {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Environment Toggle */
.env-toggle {
    position: relative;
    top: auto;
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    z-index: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    pointer-events: auto !important;
    white-space: nowrap;
    min-width: fit-content;
}

.env-toggle:hover {
    transform: scale(1.05);
}

.env-label {
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    white-space: nowrap;
}

.test-env-toggle {
    background: rgba(255, 193, 7, 0.3);
    border: 2px solid rgba(255, 193, 7, 0.5);
}

.test-env-toggle:hover {
    background: rgba(255, 193, 7, 0.4);
}

.test-env-toggle .env-label {
    color: #FFD700;
}

.test-env-toggle.active {
    background: rgba(34, 197, 94, 0.5);
    border-color: #22c55e;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
}

.test-env-toggle.active .env-label {
    color: #4ade80;
}

.admin-toggle {
    background: rgba(139, 92, 246, 0.3);
    border: 2px solid rgba(139, 92, 246, 0.5);
}

.admin-toggle:hover {
    background: rgba(139, 92, 246, 0.4);
}

.admin-toggle .env-label {
    color: #a78bfa;
}

.mode-indicator {
    font-size: 0.65rem;
    color: #4ade80;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.mode-indicator.test-mode {
    color: rgba(255, 193, 7, 0.8);
}

/* Footer */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(26, 31, 58, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(139, 92, 246, 0.2);
    z-index: 9999;
}

.footer-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.footer-right {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-end;
}

.designer-credit {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: color 0.3s;
}

.designer-credit:hover {
    color: rgba(255, 255, 255, 0.9);
}

.env-toggle.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.env-toggle.disabled:hover {
    transform: none;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 24px;
    padding: 3rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: scaleIn 0.3s ease;
}

.modal-content h2 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.modal-content p {
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    font-weight: 600;
}

#admin-username-input,
#admin-password-input {
    padding: 1rem;
    border: 2px solid #8b5cf6;
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

#admin-username-input {
    margin-bottom: 1rem;
}

#admin-password-input {
    margin-bottom: 1.5rem;
}

#admin-username-input:focus,
#admin-password-input:focus {
    border-color: #a78bfa;
}

#admin-username-input::placeholder,
#admin-password-input::placeholder {
    color: #94a3b8;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-buttons .confirm-btn,
.modal-buttons .secondary-btn {
    flex: 1;
    max-width: 200px;
}

.security-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.security-option-btn {
    padding: 1.2rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.security-option-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.security-option-btn:active {
    transform: translateY(-1px);
}

.alert-modal-content {
    max-width: 450px;
}

.alert-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.alert-image {
    width: 100%;
    max-width: 350px;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.alert-image.hidden {
    display: none;
}

#alert-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

#alert-message {
    font-size: 1.1rem;
    line-height: 1.6;
    white-space: pre-line;
}

.admin-notice {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.5);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: #FFD700;
    font-weight: 500;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.log-entry.admin-mode {
    position: relative;
}

.admin-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.edit-entry-btn {
    background: rgba(251, 191, 36, 0.2);
    color: #3b82f6;
    border: 1px solid #3b82f6;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    flex: 1;
}

.edit-entry-btn:hover {
    background: #3b82f6;
    color: white;
}

.delete-entry-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid #ef4444;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    flex: 1;
}

.delete-entry-btn:hover {
    background: #ef4444;
    color: white;
}

.edit-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.edit-form label {
    font-weight: 600;
    color: #667eea;
    margin-top: 0.5rem;
}

.edit-form input,
.edit-form select {
    padding: 0.8rem;
    border: 2px solid #8b5cf6;
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(15, 23, 42, 0.5);
    color: #e2e8f0;
    outline: none;
}

.edit-form input:focus,
.edit-form select:focus {
    border-color: #a78bfa;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.group-stats-editor {
    margin-bottom: 2rem;
}

.group-stats-editor h3 {
    color: #a78bfa;
    margin-bottom: 1rem;
}

.stats-help {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.stats-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-edit-card {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.stat-brother-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 120px;
    min-width: 120px;
}

.stat-brother-img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(139, 92, 246, 0.5);
}

.stat-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid #8b5cf6;
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-btn:hover {
    background: #8b5cf6;
    color: white;
}

.stat-count-input {
    width: 50px;
    padding: 0.3rem;
    border: 2px solid #8b5cf6;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    background: rgba(15, 23, 42, 0.7);
    color: #e2e8f0;
    outline: none;
}

.stat-count-input:focus {
    border-color: #a78bfa;
}

.stat-times {
    color: #94a3b8;
    font-size: 0.9rem;
}

.answer-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.answer-btn {
    padding: 1.2rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.answer-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.answer-btn.correct {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.answer-btn.incorrect {
    background: #f44336;
    color: white;
    border-color: #f44336;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    pointer-events: auto;
    padding-bottom: 50px;
}

header {
    text-align: center;
    margin-bottom: 0.5rem;
    margin-top: 0;
    animation: fadeInDown 0.8s ease;
    position: relative;
    z-index: 1;
}

header h1 {
    font-size: 1.5rem;
    color: white;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-top: 0;
    margin-bottom: 0.2rem;
    font-weight: 700;
}

.subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

.friday-notice {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.4rem 1rem;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #a78bfa;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
    animation: pulse-notice 3s ease-in-out infinite;
}

.notice-icon {
    font-size: 1.2rem;
    animation: swing 2s ease-in-out infinite;
}

@keyframes pulse-notice {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
    }
    50% {
        box-shadow: 0 4px 25px rgba(139, 92, 246, 0.4);
    }
}

@keyframes swing {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    75% {
        transform: rotate(10deg);
    }
}

/* Brothers Selection Grid */
.brothers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.8s ease 0.3s both;
}

.brother-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 1.5rem 1rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.brother-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.05));
    opacity: 0;
    transition: opacity 0.3s;
}

.brother-card:hover {
    transform: translateY(-10px);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 20px 60px rgba(139, 92, 246, 0.3);
}

.brother-card:hover::before {
    opacity: 1;
}

.brother-card.selected {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.8);
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.4), 0 0 80px rgba(139, 92, 246, 0.2);
}

.card-inner {
    text-align: center;
    position: relative;
}

.avatar {
    font-size: 5rem;
    margin-bottom: 0.5rem;
    filter: grayscale(50%);
    transition: all 0.3s;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    margin-left: auto;
    margin-right: auto;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.brother-card.selected .avatar {
    filter: grayscale(0%);
    transform: scale(1.1);
}

.brother-card h2 {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.brother-subtitle {
    color: #a78bfa;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.5rem;
    text-align: center;
    opacity: 0.95;
}

.checkmark {
    position: absolute;
    top: -1rem;
    right: -1rem;
    background: #4CAF50;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.brother-card.selected .checkmark {
    opacity: 1;
    transform: scale(1);
}

/* Submit Button */
.submit-btn {
    display: block;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 1.5rem 3rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.4);
    animation: fadeInUp 0.8s ease 0.4s both, submitPulse 2s ease-in-out infinite;
    z-index: 10000;
    pointer-events: auto;
}

@keyframes submitPulse {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(139, 92, 246, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 10px 50px rgba(139, 92, 246, 0.7), 0 0 30px rgba(139, 92, 246, 0.5);
        transform: scale(1.02);
    }
}

.submit-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: scale(0.95);
}

.submit-btn:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 50px rgba(139, 92, 246, 0.6);
    animation: none;
}

.submit-btn:not(:disabled):active {
    transform: translateY(-1px);
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.submit-btn:not(:disabled):hover .btn-shine {
    left: 100%;
}

/* Result Screen */
#result-screen, #log-screen {
    animation: fadeInUp 0.8s ease;
}

.result-card, .log-card {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 32px;
    padding: 4rem 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.result-card h2 {
    font-size: 1.5rem;
    color: #a78bfa;
    margin-bottom: 1.5rem;
}

.winner-reveal {
    margin: 3rem 0;
    animation: scaleIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s both;
}

.winner-avatar {
    font-size: 8rem;
    margin-bottom: 1rem;
    width: 200px;
    height: 200px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid #8b5cf6;
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.8);
}

.winner-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.winner-name {
    font-size: 2.5rem;
    color: #8b5cf6;
    text-shadow: 0 0 40px rgba(139, 92, 246, 0.6);
    animation: pulse 2s infinite;
    margin-bottom: 1.5rem;
}

.winner-reveal .confirm-btn {
    margin-top: 1rem;
    font-size: 1.3rem;
    padding: 1.2rem 2.5rem;
}

.explanation {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    animation: fadeIn 0.8s ease 0.5s both;
}

.explanation h3 {
    color: #a78bfa;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.explanation .reason {
    color: #e2e8f0;
    font-size: 1.1rem;
    line-height: 1.6;
}

.stats {
    margin: 2rem 0;
    animation: fadeIn 0.8s ease 0.7s both;
}

.stats h3 {
    color: #a78bfa;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.stats-list {
    display: grid;
    gap: 1rem;
}

.stat-item {
    background: rgba(139, 92, 246, 0.1);
    border-left: 4px solid #8b5cf6;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
}

.stat-name {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.stat-brother-small-img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(139, 92, 246, 0.5);
}

.stat-count {
    background: #8b5cf6;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
}

.stat-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.stat-date {
    color: #94a3b8;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2rem;
}

.confirm-btn, .secondary-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
}

.confirm-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    animation: confirmPulse 2s ease-in-out infinite;
}

@keyframes confirmPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 4px 25px rgba(76, 175, 80, 0.6), 0 0 20px rgba(76, 175, 80, 0.4);
        transform: scale(1.02);
    }
}

.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
    animation: none;
}

.secondary-btn {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    border: 2px solid #8b5cf6;
}

.secondary-btn:hover {
    background: #8b5cf6;
    color: white;
}

/* Log Screen */
.log-card h2 {
    font-size: 1.2rem;
    color: #a78bfa;
    margin-bottom: 1rem;
}

.log-filters {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: nowrap;
}

#group-filter, #admin-group-filter, #admin-env-filter {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border: 2px solid #8b5cf6;
    border-radius: 50px;
    background: rgba(15, 23, 42, 0.9);
    color: #a78bfa;
    cursor: pointer;
    outline: none;
    flex: 1;
    min-width: 0;
}

.log-entries {
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 2rem;
}

.log-entry {
    background: rgba(139, 92, 246, 0.1);
    border-left: 4px solid #8b5cf6;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: left;
}

.log-entry-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.log-entry-name {
    font-weight: 600;
    color: #8b5cf6;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.log-brother-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(139, 92, 246, 0.5);
}

.log-entry-date {
    color: #94a3b8;
}

.log-entry-group {
    color: #a78bfa;
    font-size: 0.9rem;
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.8rem;
    }
    
    .friday-notice {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
    
    .env-toggle {
        padding: 0.5rem 0.8rem;
        font-size: 0.7rem;
        position: fixed;
        top: 10px !important;
    }
    
    .env-label {
        font-size: 0.7rem;
    }
    
    .admin-toggle {
        left: 10px !important;
        right: auto !important;
        top: 10px !important;
    }
    
    .test-env-toggle {
        right: 10px !important;
        top: 10px !important;
    }
    
    .mode-text {
        font-size: 0.8rem;
    }
    
    .site-footer {
        padding: 10px 15px;
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .footer-buttons {
        justify-content: center;
        order: 2;
        gap: 4px;
    }
    
    .footer-right {
        align-items: center;
        order: 1;
    }
    
    .env-toggle {
        padding: 0.35rem 0.5rem;
        font-size: 0.65rem;
        flex: 0 0 auto;
        white-space: nowrap;
    }
    
    .env-label {
        font-size: 0.6rem;
    }
    
    .designer-credit {
        font-size: 0.7rem;
        text-align: center;
    }
    
    .site-footer .mode-indicator {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
    }
    
    .brothers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        max-width: 100%;
    }
    
    .brother-card {
        padding: 1.2rem 0.8rem;
    }
    
    .avatar {
        width: 100px;
        height: 100px;
    }
    
    .brother-card h2 {
        font-size: 1.1rem;
    }
    
    .winner-avatar {
        width: 150px;
        height: 150px;
    }
    
    .winner-name {
        font-size: 2.5rem;
    }
    
    .winner-reveal .confirm-btn {
        font-size: 1.1rem;
        padding: 1rem 2rem;
    }
    
    .result-card, .log-card {
        padding: 2rem 1.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
        margin-bottom: 80px;
    }
    
    #submit-btn {
        width: 60%;
        margin: 0 auto;
        padding: 0.7rem 1.2rem;
        font-size: 0.95rem;
    }
    
    .confirm-btn, .secondary-btn {
        width: 60%;
        margin: 0 auto;
        padding: 0.7rem 1.2rem;
        font-size: 0.95rem;
    }
    
    .stat-brother-img,
    .log-brother-img {
        width: 30px;
        height: 30px;
    }
    
    .stat-brother-small-img {
        width: 28px;
        height: 28px;
    }
    
    .modal-content {
        width: 75%;
        padding: 1.2rem 1rem;
        max-height: none;
    }
    
    .modal-content h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .modal-content p {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .security-options {
        grid-template-columns: 1fr;
    }
    
    .alert-image {
        max-width: 100%;
    }
}

/* Icon Picker */
.icon-picker {
    display: flex;
    gap: 0.5rem;
}

.icon-option {
    width: 50px;
    height: 50px;
    font-size: 1.8rem;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.1);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-option:hover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.2);
    transform: scale(1.1);
}

.icon-option.selected {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}
