/* Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Colors - Dark Mode (default) */
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f26;
    --bg-tertiary: #242b33;
    --bg-card: #1e252d;
    
    --text-primary: #f0f2f5;
    --text-secondary: #8b9299;
    --text-muted: #5c6370;
    
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-green: #22c55e;
    --accent-green-bg: rgba(34, 197, 94, 0.1);
    --accent-red: #ef4444;
    --accent-red-bg: rgba(239, 68, 68, 0.1);
    --accent-yellow: #f59e0b;
    --accent-yellow-bg: rgba(245, 158, 11, 0.1);
    --accent-purple: #a855f7;
    --accent-purple-bg: rgba(168, 85, 247, 0.1);
    
    /* Teams colors */
    --teams-purple: #6264a7;
    --teams-purple-dark: #464775;
    --teams-bg: #292929;
    --teams-chat-bg: #1f1f1f;
    
    --border-color: #2d353f;
    --border-light: #3a424d;
    
    /* Overlay */
    --overlay-bg: rgba(15, 20, 25, 0.85);
    
    /* Typography */
    --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

/* Light Mode */
[data-theme="light"] {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8ecf0;
    --bg-card: #ffffff;
    
    --text-primary: #1a1f26;
    --text-secondary: #5c6370;
    --text-muted: #8b9299;
    
    --accent-blue: #2563eb;
    --accent-blue-hover: #1d4ed8;
    --accent-green: #16a34a;
    --accent-green-bg: rgba(22, 163, 74, 0.1);
    --accent-red: #dc2626;
    --accent-red-bg: rgba(220, 38, 38, 0.1);
    --accent-yellow: #d97706;
    --accent-yellow-bg: rgba(217, 119, 6, 0.1);
    --accent-purple: #9333ea;
    --accent-purple-bg: rgba(147, 51, 234, 0.1);
    
    /* Teams colors - Light */
    --teams-purple: #5b5fc7;
    --teams-purple-dark: #444791;
    --teams-bg: #f5f5f5;
    --teams-chat-bg: #ffffff;
    
    --border-color: #d1d5db;
    --border-light: #e5e7eb;
    
    /* Overlay */
    --overlay-bg: rgba(0, 0, 0, 0.5);
}

/* Light Mode - Teams specific overrides */
[data-theme="light"] .teams-window {
    border-color: var(--border-color);
}

[data-theme="light"] .teams-chat-header {
    border-bottom-color: var(--border-color);
}

[data-theme="light"] .teams-message.incoming .teams-message-bubble {
    background: #e8e8e8;
    color: #1a1a1a;
}

[data-theme="light"] .teams-message.outgoing .teams-message-bubble {
    background: #464eb8;
    color: white;
}

[data-theme="light"] .teams-reply-btn {
    border-color: var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="light"] .teams-reply-btn:hover {
    background: #464eb8;
    border-color: #464eb8;
    color: white;
}

[data-theme="light"] .teams-header {
    background: #464eb8;
}

[data-theme="light"] .teams-avatar {
    background: #464eb8;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: var(--space-md);
    right: var(--space-md);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 1000;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
    transform: scale(1.05);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.theme-toggle:hover svg {
    color: var(--text-primary);
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .moon-icon {
    display: none;
}

/* Name Validation Popup */
.name-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    z-index: 1001;
    animation: fadeIn 0.2s ease;
}

.name-popup {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    max-width: 340px;
    text-align: center;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.name-popup-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-md);
    background: var(--accent-yellow-bg);
    border: 2px solid var(--accent-yellow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.name-popup h3 {
    font-size: 1.125rem;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.name-popup p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--space-lg);
    line-height: 1.5;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    padding: var(--space-md);
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.btn-primary {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-sans);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.btn-primary:hover {
    background: var(--accent-blue-hover);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-sans);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--border-light);
}

.hidden {
    display: none !important;
}

/* ==================== START SCREEN ==================== */
.start-container {
    max-width: 440px;
    text-align: center;
}

.logo {
    margin-bottom: var(--space-xl);
}

.shield-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--space-md);
    color: var(--accent-blue);
}

.shield-icon svg {
    width: 100%;
    height: 100%;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-xs);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.start-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.agency-badge {
    display: inline-flex;
    flex-direction: column;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-md);
}

.badge-label {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--accent-blue);
}

.badge-subtitle {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.intro-text {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
    font-size: 0.9375rem;
}

.intro-text strong {
    color: var(--text-primary);
}

/* Name Input */
.name-input-container {
    margin-bottom: var(--space-lg);
    text-align: left;
}

.name-input-container label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.name-input-container input {
    width: 100%;
    padding: var(--space-md);
    font-size: 1rem;
    font-family: var(--font-sans);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}

.name-input-container input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.name-input-container input::placeholder {
    color: var(--text-muted);
}

/* ==================== BRIEFING SCREEN ==================== */
.briefing-container {
    max-width: 480px;
    width: 100%;
}

.briefing-header {
    margin-bottom: var(--space-lg);
}

.level-badge {
    display: inline-block;
    background: var(--accent-blue);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
}

.level-badge.tutorial {
    background: var(--accent-yellow);
    color: var(--bg-primary);
}

.briefing-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.briefing-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.briefing-content > p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    line-height: 1.6;
    font-size: 0.9375rem;
}

.briefing-objectives h3 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.action-guide {
    display: flex;
    gap: var(--space-sm);
}

.action-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
}

.action-item.safe {
    background: var(--accent-green-bg);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.action-item.report {
    background: var(--accent-red-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.action-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
}

.action-item.safe .action-icon {
    background: var(--accent-green);
    color: white;
}

.action-item.report .action-icon {
    background: var(--accent-red);
    color: white;
}

.action-item strong {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
}

.action-item p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ==================== GAME SCREEN ==================== */
.game-container {
    max-width: 600px;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--space-md) * 2);
    max-height: 700px;
}

.email-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: none;
}

.email-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.mail-icon {
    width: 20px;
    height: 20px;
    color: var(--accent-blue);
}

.game-stats {
    display: flex;
    gap: var(--space-md);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.5625rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

#timer-container.hidden {
    display: none;
}

#timer.warning {
    color: var(--accent-yellow);
}

#timer.danger {
    color: var(--accent-red);
    animation: pulse 0.5s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes timerShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.game-container.urgent {
    animation: borderPulse 1s ease infinite;
}

@keyframes borderPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
    50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.3); }
}

.timer-bar-container {
    height: 3px;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.timer-bar-container.hidden {
    display: none;
}

.timer-bar {
    height: 100%;
    background: var(--accent-blue);
    width: 100%;
    transition: width 1s linear, background-color 0.3s ease;
}

.timer-bar.warning {
    background: var(--accent-yellow);
}

.timer-bar.danger {
    background: var(--accent-red);
}

.email-viewer {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: none;
    padding: var(--space-md);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.email-meta {
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-md);
}

.email-meta > div {
    display: flex;
    margin-bottom: var(--space-xs);
}

.email-meta > div:last-child {
    margin-bottom: 0;
}

.email-meta .label {
    width: 55px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.email-meta .value {
    flex: 1;
    font-size: 0.8125rem;
}

.email-subject .value {
    font-weight: 600;
    color: var(--text-primary);
}

#email-from {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    word-break: break-all;
}

#email-from .sender-name {
    color: var(--text-primary);
    font-weight: 500;
    font-family: var(--font-sans);
}

#email-from .sender-email {
    color: var(--text-secondary);
}

.email-body {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.email-body p {
    margin-bottom: var(--space-sm);
}

.email-body p:last-child {
    margin-bottom: 0;
}

.email-body .signature {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.email-body a {
    color: var(--accent-blue);
    text-decoration: underline;
    cursor: pointer;
}

.email-attachment {
    margin-top: var(--space-sm);
}

.email-attachment:empty {
    display: none;
}

.attachment-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-sans);
    border: 2px solid;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-action svg {
    width: 18px;
    height: 18px;
}

.btn-inbox {
    background: transparent;
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.btn-inbox:hover {
    background: var(--accent-green);
    color: white;
}

.btn-report {
    background: transparent;
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.btn-report:hover {
    background: var(--accent-red);
    color: white;
}

/* Feedback Overlay */
.feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-bg);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    z-index: 100;
}

.feedback-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.feedback-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    max-width: 360px;
    text-align: center;
}

.feedback-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-sm);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.feedback-card.correct .feedback-icon {
    background: var(--accent-green-bg);
    color: var(--accent-green);
    border: 2px solid var(--accent-green);
}

.feedback-card.incorrect .feedback-icon {
    background: var(--accent-red-bg);
    color: var(--accent-red);
    border: 2px solid var(--accent-red);
}

.feedback-card h3 {
    font-size: 1.125rem;
    margin-bottom: var(--space-xs);
}

.feedback-card.correct h3 {
    color: var(--accent-green);
}

.feedback-card.incorrect h3 {
    color: var(--accent-red);
}

.feedback-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--space-md);
    line-height: 1.5;
}

/* Leaderboard Confirmation Popup */
.leaderboard-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-bg);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    z-index: 100;
}

.leaderboard-confirm-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.leaderboard-confirm-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    max-width: 360px;
    text-align: center;
}

.leaderboard-confirm-icon {
    font-size: 3rem;
    margin-bottom: var(--space-sm);
}

.leaderboard-confirm-title {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.leaderboard-confirm-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--space-lg);
    line-height: 1.5;
}

.leaderboard-confirm-text strong {
    color: var(--accent-blue);
}

.leaderboard-confirm-buttons {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
}

.leaderboard-confirm-buttons .btn-primary,
.leaderboard-confirm-buttons .btn-secondary {
    flex: 1;
    max-width: 140px;
}

/* Score popup */
.score-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.75rem;
    font-weight: 700;
    font-family: var(--font-mono);
    pointer-events: none;
    animation: scoreFloat 0.8s ease forwards;
    z-index: 200;
}

.score-popup.positive { color: var(--accent-green); }
.score-popup.negative { color: var(--accent-red); }

@keyframes scoreFloat {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity: 1; transform: translate(-50%, -80%) scale(1.1); }
    100% { opacity: 0; transform: translate(-50%, -120%) scale(1); }
}

/* Link warning popup */
.link-warning-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 20, 25, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    z-index: 300;
    animation: fadeIn 0.2s ease;
}

.link-warning-card {
    background: var(--bg-card);
    border: 2px solid var(--accent-yellow);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    max-width: 320px;
    text-align: center;
}

.link-warning-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
}

.link-warning-card p {
    color: var(--text-primary);
    font-size: 0.9375rem;
    margin-bottom: var(--space-md);
    line-height: 1.5;
}

/* ==================== TIMEOUT SCREEN ==================== */
.timeout-container {
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.timeout-icon {
    font-size: 3.5rem;
    margin-bottom: var(--space-md);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.timeout-container h2 {
    font-size: 1.75rem;
    color: var(--accent-red);
    margin-bottom: var(--space-sm);
}

.timeout-container > p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    font-size: 0.9375rem;
}

.timeout-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-2xl);
    margin-bottom: var(--space-md);
}

.timeout-stat {
    display: flex;
    flex-direction: column;
}

.timeout-stat-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.timeout-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.timeout-penalty {
    background: var(--accent-red-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-lg);
    display: inline-flex;
    gap: var(--space-sm);
    align-items: center;
}

.penalty-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.penalty-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent-red);
}

/* ==================== TEAMS MESSAGE SCREEN ==================== */
.teams-container {
    max-width: 440px;
    width: 100%;
}

.teams-window {
    background: var(--teams-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-md);
    border: 1px solid #3d3d3d;
}

.teams-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--teams-purple-dark);
}

.teams-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.teams-icon {
    width: 20px;
    height: 20px;
}

.teams-header-right {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
}

.teams-status {
    color: #92c353;
}

.teams-chat {
    background: var(--teams-chat-bg);
}

.teams-chat-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-bottom: 1px solid #3d3d3d;
}

.teams-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--teams-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: white;
}

.teams-chat-info {
    display: flex;
    flex-direction: column;
}

.teams-chat-name {
    font-weight: 600;
    font-size: 0.9375rem;
}

.teams-chat-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.teams-messages {
    padding: var(--space-md);
    min-height: 120px;
    max-height: 250px;
    overflow-y: auto;
}

.teams-message {
    margin-bottom: var(--space-sm);
    animation: messageSlide 0.3s ease;
}

.teams-message:last-child {
    margin-bottom: 0;
}

.teams-message.incoming {
    text-align: left;
}

.teams-message.outgoing {
    text-align: right;
}

.teams-message-bubble {
    display: inline-block;
    max-width: 85%;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    line-height: 1.4;
}

.teams-message.incoming .teams-message-bubble {
    background: #3d3d3d;
    border-bottom-left-radius: var(--radius-xs);
}

.teams-message.outgoing .teams-message-bubble {
    background: var(--teams-purple);
    border-bottom-right-radius: var(--radius-xs);
}

@keyframes messageSlide {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.teams-typing {
    display: none;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.teams-typing.active {
    display: flex;
}

.typing-indicator {
    display: flex;
    gap: 3px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

.teams-reply-options {
    padding: var(--space-sm) var(--space-md) var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.teams-reply-btn {
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: 1px solid #3d3d3d;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-family: var(--font-sans);
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-fast);
}

.teams-reply-btn:hover {
    background: var(--teams-purple);
    border-color: var(--teams-purple);
}

/* Lesson Box */
.lesson-box {
    background: var(--accent-yellow-bg);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.lesson-box.hidden {
    display: none;
}

.lesson-box h4 {
    color: var(--accent-yellow);
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.lesson-box p {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* ==================== INFECTION SCREEN ==================== */
.infection-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
    overflow: hidden;
}

.infection-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    animation: scanlines 0.1s linear infinite;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(2px); }
}

/* Glitch Overlay */
.glitch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
}

.glitch-overlay.active {
    opacity: 1;
    animation: glitchEffect 1.5s ease-in-out;
}

@keyframes glitchEffect {
    0% { 
        background: #000;
    }
    5% { 
        background: #ff0000;
        transform: translateX(-5px);
    }
    10% { 
        background: #000;
        transform: translateX(5px);
    }
    15% { 
        background: #00ff00;
        transform: translateX(-3px) skewX(2deg);
    }
    20% { 
        background: #000;
        transform: translateX(0);
    }
    25% {
        background: linear-gradient(#ff0000 33%, #00ff00 33%, #00ff00 66%, #0000ff 66%);
        transform: translateY(-2px);
    }
    30% {
        background: #000;
        transform: translateY(2px);
    }
    40% {
        background: #ff0000;
        opacity: 0.8;
        transform: skewX(-1deg);
    }
    45% {
        background: #000;
        transform: skewX(0);
    }
    55% {
        background: #0000ff;
        transform: translateX(3px);
    }
    60% {
        background: #000;
    }
    70% {
        background: linear-gradient(90deg, #000 0%, #ff0000 50%, #000 100%);
        transform: scaleY(1.02);
    }
    75% {
        background: #000;
        transform: scaleY(1);
    }
    85% {
        background: #00ff00;
        opacity: 0.5;
    }
    90% {
        background: #000;
        opacity: 1;
    }
    100% {
        background: #000;
    }
}

.infection-desktop {
    width: 100%;
    max-width: 500px;
    padding: var(--space-lg);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.infection-desktop.visible {
    opacity: 1;
    transform: scale(1);
}

.infection-files {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.infection-file {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid #333;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    opacity: 0.4;
    transition: opacity 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.infection-file.active {
    opacity: 1;
    border-color: var(--accent-red);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.infection-file.complete {
    opacity: 0.7;
}

.infection-file.interrupted {
    opacity: 0.8;
    border-color: var(--accent-yellow);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.file-icon {
    font-size: 1.25rem;
}

.infection-file.complete .file-icon::after {
    content: '🔒';
    margin-left: 4px;
}

.infection-file.interrupted .file-icon::after {
    content: '🛡️';
    margin-left: 4px;
}

.file-name {
    flex: 1;
    color: #ccc;
}

.file-status {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.infection-file.active .file-status {
    color: var(--accent-red);
}

.file-status.uploading {
    color: var(--accent-red);
    animation: pulse 0.5s ease infinite;
}

.infection-file.complete .file-status {
    color: var(--accent-green);
}

.infection-file.interrupted .file-status {
    color: var(--accent-yellow);
}

.infection-message {
    display: none;
    text-align: center;
    padding: var(--space-xl);
    animation: glitchIn 0.3s ease;
}

.infection-message.active {
    display: block;
}

@keyframes glitchIn {
    0% { opacity: 0; transform: scale(0.9) translateX(-10px); }
    50% { transform: scale(1.02) translateX(5px); }
    100% { opacity: 1; transform: scale(1) translateX(0); }
}

.infection-alert {
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid var(--accent-red);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

.infection-alert.quarantine {
    border-color: var(--accent-yellow);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.3);
}

.infection-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    animation: pulse 1s ease infinite;
}

.infection-alert h2 {
    color: var(--accent-red);
    font-size: 1.25rem;
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.infection-alert.quarantine h2 {
    color: var(--accent-yellow);
}

.infection-alert p {
    color: #aaa;
    font-size: 0.875rem;
    margin-bottom: var(--space-sm);
    line-height: 1.5;
}

.infection-alert p strong {
    color: var(--accent-yellow);
}

.infection-consequence {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid #333;
    color: var(--text-secondary);
}

/* ==================== COMPLETE SCREEN ==================== */
.complete-container {
    max-width: 440px;
    width: 100%;
}

.complete-header {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.complete-header h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-xs);
}

.complete-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.score-breakdown {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
}

.score-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.score-item:last-child {
    border-bottom: none;
}

.score-item.bonus {
    color: var(--accent-purple);
}

.score-item.bonus .score-value {
    color: var(--accent-purple);
}

.score-item.total {
    margin-top: var(--space-xs);
    padding-top: var(--space-sm);
    border-top: 2px solid var(--border-light);
    border-bottom: none;
}

.score-label {
    color: var(--text-secondary);
}

.score-value {
    font-weight: 600;
    font-family: var(--font-mono);
}

.score-item.total .score-label,
.score-item.total .score-value {
    font-size: 1rem;
    color: var(--text-primary);
}

.mistakes-review {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
}

.mistakes-review h3 {
    font-size: 0.875rem;
    margin-bottom: var(--space-sm);
}

.mistakes-review.hidden {
    display: none;
}

.mistake-item {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: var(--space-sm);
    margin-bottom: var(--space-xs);
    font-size: 0.8125rem;
}

.mistake-item:last-child {
    margin-bottom: 0;
}

.mistake-subject {
    font-weight: 600;
    margin-bottom: 2px;
}

.mistake-explanation {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* ==================== FINAL SCREEN ==================== */
.final-container {
    max-width: 440px;
    width: 100%;
    text-align: center;
}

.final-badge {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-md);
    background: var(--accent-green-bg);
    border: 3px solid var(--accent-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-green);
}

.final-badge svg {
    width: 44px;
    height: 44px;
}

.final-badge.warning {
    background: var(--accent-yellow-bg);
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
}

.final-container h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-xs);
}

.final-container > p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    font-size: 0.875rem;
}

.final-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-2xl);
    margin-bottom: var(--space-lg);
}

.final-stat {
    display: flex;
    flex-direction: column;
}

.final-stat-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent-blue);
}

.final-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Leaderboard */
.leaderboard {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    text-align: left;
}

.leaderboard h3 {
    font-size: 0.875rem;
    margin-bottom: var(--space-sm);
    text-align: center;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
}

.leaderboard-entry.current {
    background: var(--accent-blue);
    color: white;
}

.leaderboard-rank {
    font-size: 1rem;
    font-weight: 700;
    width: 24px;
    text-align: center;
}

.leaderboard-entry:nth-child(1) .leaderboard-rank { color: #ffd700; }
.leaderboard-entry:nth-child(2) .leaderboard-rank { color: #c0c0c0; }
.leaderboard-entry:nth-child(3) .leaderboard-rank { color: #cd7f32; }
.leaderboard-entry.current .leaderboard-rank { color: white; }

.leaderboard-loading {
    text-align: center;
    padding: var(--space-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.leaderboard-name {
    flex: 1;
    font-weight: 500;
}

.leaderboard-score {
    font-family: var(--font-mono);
    font-weight: 600;
}

.final-tips {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    text-align: left;
}

.final-tips h3 {
    font-size: 0.875rem;
    margin-bottom: var(--space-sm);
    text-align: center;
}

.final-tips ul {
    list-style: none;
}

.final-tips li {
    position: relative;
    padding-left: var(--space-md);
    margin-bottom: var(--space-xs);
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.final-tips li:last-child {
    margin-bottom: 0;
}

.final-tips li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent-blue);
    font-weight: 600;
}

.final-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    align-items: center;
    margin-top: var(--space-lg);
}

.final-buttons .btn-secondary {
    padding: var(--space-sm) var(--space-lg);
}

.final-buttons .btn-primary {
    width: 100%;
    max-width: 200px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 480px) {
    :root {
        --space-lg: 20px;
        --space-xl: 24px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .shield-icon {
        width: 56px;
        height: 56px;
    }
    
    .game-stats {
        gap: var(--space-sm);
    }
    
    .action-guide {
        flex-direction: column;
    }
    
    .teams-message-bubble {
        max-width: 90%;
    }
    
    /* Keep theme toggle at top right on mobile */
    .theme-toggle {
        width: 40px;
        height: 40px;
    }
}

/* ==================== CONTEXT SCREEN ==================== */
#context-screen {
    background: #000;
}

/* Light mode: context screen has light background, so use dark text */
[data-theme="light"] #context-screen {
    background: var(--bg-primary);
}

[data-theme="light"] #context-screen .context-line {
    color: #4a5568;
}

[data-theme="light"] #context-screen .context-line strong {
    color: var(--accent-blue);
}

[data-theme="light"] #context-screen .context-question {
    color: #1a1f26;
}

.context-container {
    max-width: 500px;
    text-align: center;
    padding: var(--space-xl);
}

.context-text {
    margin-bottom: var(--space-xl);
}

.context-line {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.7;
    opacity: 0;
    animation: fadeInLine 0.6s ease forwards;
    animation-delay: 0.3s;
}

.context-line strong {
    color: var(--accent-blue);
}

.context-question {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-top: var(--space-lg);
    opacity: 0;
    animation: fadeInLine 0.5s ease forwards;
    animation-delay: 1.0s;
}

@keyframes fadeInLine {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#context-btn {
    opacity: 0;
    animation: fadeInLine 0.5s ease forwards;
    animation-delay: 1.5s;
}

/* ==================== LOGIN SCREEN ==================== */
#login-screen {
    background: linear-gradient(135deg, #0a0e14 0%, #1a1f26 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: var(--space-md);
}

.login-window {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.login-header {
    background: var(--bg-tertiary);
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border-color);
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
}

.login-logo .logo-icon {
    width: 48px;
    height: 48px;
    color: var(--accent-blue);
}

.login-logo .logo-icon svg {
    width: 100%;
    height: 100%;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-company {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

.logo-tagline {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.login-form {
    padding: var(--space-xl);
}

.login-input-group {
    margin-bottom: var(--space-lg);
}

.login-input-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.login-input-wrapper {
    display: flex;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.login-input-wrapper input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    padding: var(--space-md);
    font-size: 1rem;
    font-family: var(--font-sans);
    color: var(--text-primary);
    outline: none;
}

.login-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.login-domain {
    display: flex;
    align-items: center;
    padding: 0 var(--space-sm);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    border-left: 1px solid var(--border-color);
    white-space: nowrap;
    flex-shrink: 0;
}

.login-password-display {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    font-size: 1rem;
    font-family: var(--font-sans);
    color: var(--text-muted);
    cursor: not-allowed;
    user-select: none;
}

.login-password-wrapper {
    position: relative;
    display: flex;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: visible;
}

.login-password-wrapper input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    padding: var(--space-md);
    padding-right: 44px;
    font-size: 1rem;
    font-family: var(--font-sans);
    color: var(--text-primary);
    outline: none;
}

.login-password-wrapper input::placeholder {
    color: var(--text-muted);
}

.password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}

.password-toggle:hover {
    background: var(--bg-secondary);
}

.password-toggle svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.password-toggle:hover svg {
    color: var(--text-secondary);
}

.password-toggle .eye-off-icon {
    display: none;
}

.password-toggle.showing .eye-icon {
    display: none;
}

.password-toggle.showing .eye-off-icon {
    display: block;
}

.password-hint-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text-secondary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    z-index: 10;
}

.password-hint-tooltip a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
}

.password-hint-tooltip a:hover {
    color: var(--accent-blue-hover);
    text-decoration: underline;
}

.password-hint-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--bg-card);
}

.login-password-wrapper:hover .password-hint-tooltip,
.login-password-wrapper:focus-within .password-hint-tooltip,
.password-hint-tooltip:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.login-input-group input[type="password"],
.login-input-group input[type="text"].password-visible {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    font-size: 1rem;
    font-family: var(--font-sans);
    color: var(--text-primary);
    outline: none;
}

.btn-login {
    width: 100%;
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: var(--space-md);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-sans);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-login:hover {
    background: var(--accent-blue-hover);
}

.login-footer {
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.login-hint {
    font-size: 0.75rem;
    color: var(--accent-green);
}
/* ==================== LOGIN BUTTON TOOLTIP ==================== */
.login-btn-wrapper {
    position: relative;
}

.login-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    pointer-events: none;
    border: 1px solid var(--border-color);
}

.login-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border-color);
}

.login-btn-wrapper:hover .login-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ==================== HIDDEN DOMAIN EXPAND ==================== */
.sender-expand {
    display: inline-block;
    margin-left: var(--space-xs);
    padding: 2px 6px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    font-size: 0.625rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
}

.sender-expand:hover {
    background: var(--accent-blue);
    color: white;
}

#email-from .sender-email.hidden {
    display: none;
}

/* ==================== BADGE REVEAL SCREEN ==================== */
#badge-reveal-screen {
    background: #000;
}

[data-theme="light"] #badge-reveal-screen {
    background: var(--bg-primary);
}

.badge-reveal-container {
    max-width: 1000px;
    width: 100%;
    text-align: center;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.badge-reveal-inbox {
    cursor: pointer;
    transition: transform var(--transition-normal);
}

.badge-reveal-inbox:hover {
    transform: scale(1.05);
}

.badge-reveal-inbox.hidden {
    display: none;
}

.badge-reveal-inbox.animate {
    animation: inboxPulse 1.5s ease infinite;
}

@keyframes inboxPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.inbox-icon-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    border: 2px solid var(--border-color);
}

.inbox-icon-wrapper svg {
    width: 60px;
    height: 60px;
    color: var(--accent-blue);
}

.inbox-notification {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent-red);
    color: white;
    font-size: 0.875rem;
    font-weight: 700;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: notificationBounce 0.6s ease infinite;
}

@keyframes notificationBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.badge-reveal-hint {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.badges-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.badges-list.hidden {
    display: none;
}

.badge-item {
    text-align: center;
    padding: var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    animation: badgeReveal 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    width: 170px;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.badge-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0, 0, 0, 0.15);
}

@keyframes badgeReveal {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.badge-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.badge-image {
    width: 80px;
    height: 70px;
    margin: 0 auto var(--space-xs);
    object-fit: contain;
    display: block;
}

.badge-condition {
    font-size: 0.7rem;
    color: var(--accent-blue);
    font-weight: 500;
    margin-bottom: var(--space-xs);
    padding: 2px 8px;
    background: var(--accent-blue-bg, rgba(59, 130, 246, 0.1));
    border-radius: var(--radius-sm);
    display: inline-block;
}

.badge-message {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.4;
    white-space: pre-line;
}

/* 5+ badges: smaller to fit in single row */
.badges-list.badges-many {
    max-width: 900px;
    gap: var(--space-sm);
    flex-wrap: nowrap;
}

.badges-list.badges-many .badge-item {
    width: 150px;
    min-width: 150px;
    padding: var(--space-sm);
}

/* Medium screens: allow wrap if needed */
@media (max-width: 900px) and (min-width: 601px) {
    .badges-list.badges-many {
        flex-wrap: wrap;
        max-width: 600px;
    }
    
    .badges-list.badges-many .badge-item {
        width: 140px;
        min-width: 140px;
    }
}

/* Badge Navigation Controls (Mobile) */
.badge-nav-controls {
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    margin-top: var(--space-md);
    margin-bottom: var(--space-md);
}

.badge-nav-controls.visible {
    display: flex;
}

.badge-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.badge-nav-btn:hover:not(:disabled) {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.badge-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.badge-nav-counter {
    font-size: 0.9rem;
    color: var(--text-muted);
    min-width: 50px;
    text-align: center;
}

/* Mobile: single badge view */
@media (max-width: 600px) {
    .badge-reveal-container {
        max-width: 100%;
        padding: var(--space-md);
    }
    
    .badges-list,
    .badges-list.badges-many {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--space-lg);
        max-width: 320px;
    }
    
    .badges-list .badge-item,
    .badges-list.badges-many .badge-item {
        width: 100%;
        max-width: 280px;
        flex: none;
        display: none; /* Hidden by default on mobile */
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .badges-list .badge-item.mobile-visible {
        display: flex;
    }
    
    .badge-item .badge-title {
        font-size: 1.1rem;
        margin-bottom: var(--space-sm);
    }
    
    .badge-item .badge-image {
        width: 120px;
        height: 105px;
        margin: 0 auto var(--space-sm);
        display: block;
    }
    
    .badge-item .badge-condition {
        margin-bottom: var(--space-xs);
    }
    
    .locked-badges-section {
        max-width: 100%;
        padding: 0 var(--space-sm);
        box-sizing: border-box;
    }
    
    .locked-badges-content {
        overflow: hidden;
        padding: var(--space-md);
    }
    
    .locked-badges-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
        gap: var(--space-sm);
    }
    
    .locked-badge-item {
        max-width: 100%;
        padding: var(--space-xs) var(--space-sm);
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .badges-list {
        max-width: 280px;
    }
    
    .badge-item {
        padding: var(--space-md);
    }
    
    .badge-image {
        width: 100px;
        height: 88px;
    }
}

/* Larger desktops / monitors */
@media (min-width: 1024px) {
    .badges-list {
        gap: var(--space-xl);
        max-width: 1000px;
    }
    
    .badge-item {
        padding: var(--space-lg);
    }
    
    .badge-title {
        font-size: 1rem;
    }
    
    .badge-image {
        width: 100px;
        height: 88px;
    }
    
    .badge-condition,
    .badge-message {
        font-size: 0.75rem;
    }
    
    .badges-list.badges-many {
        max-width: 700px;
    }
    
    .locked-badges-grid {
        max-width: 600px;
    }
    
    .locked-badge-item {
        max-width: 160px;
    }
    
    .locked-badge-item .badge-image-wrapper {
        width: 60px;
        height: 52px;
    }
}

/* Large monitors (1440p+) */
@media (min-width: 1440px) {
    .badges-list {
        gap: 2rem;
        max-width: 900px;
    }
    
    .badge-item {
        padding: var(--space-lg);
    }
    
    .badge-title {
        font-size: 1.1rem;
    }
    
    .badge-image {
        width: 110px;
        height: 96px;
    }
    
    .badge-condition {
        font-size: 0.8rem;
    }
    
    .badge-message {
        font-size: 0.8rem;
    }
    
    .badges-list.badges-many {
        max-width: 800px;
    }
    
    .badges-list.badges-many .badge-item {
        width: 160px;
        min-width: 160px;
    }
    
    .locked-badge-item {
        width: 150px;
        min-width: 150px;
    }
}

/* ==================== PLAY AGAIN POPUP ==================== */
.play-again-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-bg);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    z-index: 1000;
}

.play-again-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.play-again-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 380px;
    width: 100%;
    text-align: center;
    animation: slideUp 0.3s ease;
}

.play-again-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

.play-again-card > p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--space-lg);
}

.play-again-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.play-again-buttons .btn-primary,
.play-again-buttons .btn-secondary {
    width: 100%;
    padding: var(--space-md);
    line-height: 1.3;
}

.btn-subtitle {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 2px;
}

/* ==================== LEADERBOARD CONFIRM OVERLAY ==================== */
.leaderboard-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-bg);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    z-index: 1000;
}

.leaderboard-confirm-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.leaderboard-confirm-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 340px;
    text-align: center;
    animation: slideUp 0.3s ease;
}

.leaderboard-confirm-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

.leaderboard-confirm-card > p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.leaderboard-confirm-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    align-items: center;
}

.leaderboard-confirm-buttons .btn-primary,
.leaderboard-confirm-buttons .btn-secondary {
    width: 100%;
    max-width: 280px;
}
/* ==================== URL TOOLTIP (DECEPTIVE LINKS) ==================== */
.url-tooltip {
    position: fixed;
    z-index: 10000;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    max-width: 350px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    animation: tooltipFadeIn 0.2s ease;
}

.url-tooltip.mobile {
    max-width: calc(100vw - 32px);
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.url-tooltip-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: var(--space-xs);
}

.url-tooltip-row:last-of-type {
    margin-bottom: 0;
}

.url-tooltip-row .url-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.url-tooltip-row.display .url-value {
    color: var(--text-secondary);
}

.url-tooltip-row.actual .url-value {
    color: var(--accent-red);
    font-weight: 600;
}

.url-tooltip-row .url-value.suspicious {
    background: var(--accent-red-bg);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.url-tooltip-hint {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-color);
    font-family: var(--font-sans);
    font-size: 0.7rem;
    color: var(--accent-yellow);
}

.deceptive-link {
    position: relative;
}

/* ==================== LEADERBOARD NAVIGATION BUTTON ==================== */
.leaderboard-nav-btn {
    position: fixed;
    top: calc(var(--space-md) + 52px);
    right: var(--space-md);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 1000;
}

.leaderboard-nav-btn:hover {
    background: var(--accent-yellow);
    border-color: var(--accent-yellow);
}

.leaderboard-nav-btn:hover svg {
    stroke: var(--bg-primary);
}

.leaderboard-nav-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
    transition: stroke var(--transition-fast);
}

.leaderboard-nav-btn .tooltip {
    position: absolute;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.leaderboard-nav-btn:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

/* Leaderboard Leave Warning Modal */
.leaderboard-warning-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.leaderboard-warning-overlay.active {
    opacity: 1;
    visibility: visible;
}

.leaderboard-warning-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 340px;
    text-align: center;
    animation: slideUp 0.3s ease;
}

.leaderboard-warning-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
    color: var(--accent-yellow);
}

.leaderboard-warning-card > p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    font-size: 0.9rem;
}

.leaderboard-warning-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* ==================== BADGE SILHOUETTES (LOCKED BADGES) ==================== */
.locked-badges-section {
    margin-top: var(--space-xl);
    margin-bottom: var(--space-xl);
    width: 100%;
    max-width: 900px;
}

/* Mobile: locked badges section */
@media (max-width: 600px) {
    .locked-badges-section {
        max-width: 100%;
        padding: 0 var(--space-sm);
        box-sizing: border-box;
    }
}

.locked-badges-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    width: auto;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.locked-badges-toggle:hover {
    background: var(--bg-tertiary);
    border-style: solid;
    color: var(--text-secondary);
}

.locked-badges-toggle .toggle-icon {
    transition: transform var(--transition-fast);
    font-size: 0.7rem;
}

.locked-badges-toggle.expanded .toggle-icon {
    transform: rotate(180deg);
}

.locked-badges-content {
    display: none;
    padding: var(--space-lg);
    margin-top: var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

/* Mobile: locked badges content */
@media (max-width: 600px) {
    .locked-badges-content {
        padding: var(--space-md);
        overflow-x: hidden;
    }
}

.locked-badges-content.visible {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.locked-badges-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: var(--space-md);
    font-style: italic;
    line-height: 1.5;
}

.locked-badges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-items: center;
    gap: var(--space-md);
    max-width: 500px;
    margin: 0 auto;
}

/* Mobile: 2 columns for locked badges */
@media (max-width: 600px) {
    .locked-badges-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
        gap: var(--space-sm);
    }
}

.locked-badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    text-align: center;
    width: 100%;
    max-width: 140px;
    transition: transform 0.2s ease;
}

/* Mobile: full width locked badge items */
@media (max-width: 600px) {
    .locked-badge-item {
        max-width: 100%;
        padding: var(--space-xs) var(--space-sm);
    }
}

.locked-badge-item:hover {
    transform: scale(1.05);
}

.locked-badge-item .badge-image-wrapper {
    position: relative;
    width: 50px;
    height: 44px;
    margin-bottom: var(--space-xs);
}

.locked-badge-item .badge-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0);
    opacity: 0.25;
}

.locked-badge-item .badge-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0;
}

.locked-badge-item .badge-condition {
    display: none;
}

/* ==================== SHARE BADGES ==================== */
.share-badges-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding: var(--space-md) var(--space-xl);
    background: linear-gradient(135deg, #a855f7, #6366f1);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    animation: glowPulse 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5), 0 0 40px rgba(168, 85, 247, 0.3);
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(168, 85, 247, 0.5), 0 0 40px rgba(168, 85, 247, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(168, 85, 247, 0.8), 0 0 60px rgba(168, 85, 247, 0.5), 0 0 80px rgba(99, 102, 241, 0.3);
        transform: scale(1.02);
    }
}

.share-badges-btn:hover {
    animation: none;
    background: linear-gradient(135deg, #9333ea, #4f46e5);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.8), 0 0 80px rgba(168, 85, 247, 0.5);
}

.share-badges-btn svg {
    width: 22px;
    height: 22px;
}

/* Mobile adjustments for leaderboard nav and tooltip */
@media (max-width: 600px) {
    .leaderboard-nav-btn {
        top: calc(var(--space-sm) + 48px);
        right: var(--space-sm);
        width: 40px;
        height: 40px;
    }
    
    .leaderboard-nav-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .url-tooltip {
        font-size: 0.7rem;
    }
}

/* ==================== SHARE NOTIFICATION ==================== */
.share-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    z-index: 10002;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.share-notification.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==================== SHARE POPUP ==================== */
.share-popup-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    padding: var(--space-md);
}

.share-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.share-popup {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 360px;
    width: 100%;
    text-align: center;
    animation: slideUp 0.3s ease;
    position: relative;
}

.share-popup-close {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.share-popup-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.share-popup-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-md);
    background: linear-gradient(135deg, var(--accent-purple-bg), var(--accent-blue-bg));
    border: 2px solid var(--accent-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.share-popup h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.share-popup p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--space-lg);
    line-height: 1.5;
}

.share-popup p strong {
    color: var(--accent-purple);
}

.share-popup-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.btn-share {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: white;
}

.btn-share svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn-share.whatsapp {
    background: #25D366;
}

.btn-share.whatsapp:hover {
    background: #1fb855;
    transform: translateY(-2px);
}

.btn-share.teams {
    background: #5558AF;
}

.btn-share.teams:hover {
    background: #464996;
    transform: translateY(-2px);
}

/* ==================== CSC BRANDING ==================== */
.csc-branding {
    position: fixed;
    bottom: 4px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    color: #6b7280;
    z-index: 100;
    opacity: 0.7;
    pointer-events: none;
    font-family: var(--font-sans);
    padding: 0 var(--space-sm);
    white-space: nowrap;
}

/* Responsive adjustments for mobile */
@media (max-width: 600px) {
    .csc-branding {
        font-size: 11px;
        bottom: 2px;
    }
}

@media (max-width: 400px) {
    .csc-branding {
        font-size: 10px;
    }
}

/* ==================== HACKER SPEECH BUBBLE ==================== */
.hacker-leaderboard-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    margin-top: var(--space-xl);
}

.hacker-leaderboard-container.hidden {
    display: none;
}

.hacker-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.hacker-image {
    width: 70px;
    height: 70px;
    object-fit: contain;
    flex-shrink: 0;
}

/* WhatsApp-style notification badge */
.speech-notification {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.hacker-speech-bubble.expanded .speech-notification {
    display: none;
}

/* Hacker notification badge - hidden on desktop, shown on mobile */
.hacker-notification {
    display: none;
}

/* Hacker click hint - hidden on desktop, shown on mobile */
.hacker-click-hint {
    display: none;
}

/* Hacker backdrop - hidden on desktop, only used on mobile */
.hacker-backdrop {
    display: none;
}

.hacker-speech-bubble {
    position: relative;
    background: var(--bg-card);
    border: 2px solid var(--accent-purple);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    max-width: 280px;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}

.hacker-speech-bubble:hover {
    background: var(--accent-purple-bg);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(168, 85, 247, 0.3);
}

/* Speech bubble pointer - pointing LEFT to the hacker */
.hacker-speech-bubble::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 12px solid var(--accent-purple);
}

.hacker-speech-bubble::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 10px solid var(--bg-card);
}

.hacker-speech-bubble:hover::after {
    border-right-color: var(--accent-purple-bg);
}

.hacker-speech-bubble.expanded {
    cursor: default;
    max-width: 320px;
}

.hacker-speech-bubble.expanded:hover {
    transform: none;
}

.speech-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.speech-content .speech-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.speech-content .click-cursor {
    font-size: 1.2rem;
    display: inline-block;
    animation: cursorBounce 1s ease-in-out infinite;
    color: var(--accent-purple);
    font-weight: bold;
}

@keyframes cursorBounce {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(-3px, -3px);
    }
}

.speech-expanded {
    position: relative;
}

.speech-expanded p {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    line-height: 1.5;
    text-align: center;
}

.speech-expanded p:first-child {
    color: var(--accent-purple);
}

.speech-expanded p strong {
    color: var(--accent-purple);
}

.ai-resources-list {
    list-style: none;
    padding: 0;
    margin: var(--space-sm) 0;
}

.ai-resources-list li {
    padding: var(--space-xs) 0;
    padding-left: var(--space-md);
    position: relative;
}

.ai-resources-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-purple);
    font-weight: bold;
}

.ai-resources-list a {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color var(--transition-fast);
}

.ai-resources-list a:hover {
    color: var(--accent-blue-hover);
    text-decoration: underline;
}

.speech-close-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--accent-purple);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.speech-close-btn:hover {
    background: var(--accent-blue-hover);
    transform: scale(1.1);
}

/* Mobile adjustments for hacker */
@media (max-width: 600px) {
    .hacker-leaderboard-container {
        flex-direction: column;
        gap: var(--space-md);
        position: relative;
    }
    
    /* Floating hacker chat-head */
    .hacker-row {
        position: fixed;
        bottom: 80px;
        right: 16px;
        z-index: 200;
        gap: 0;
        pointer-events: none; /* Don't block clicks on elements behind */
    }
    
    .hacker-image {
        width: 60px;
        height: 60px;
        cursor: pointer;
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
        transition: transform var(--transition-fast);
        pointer-events: auto; /* Re-enable clicks on the hacker image */
    }
    
    .hacker-image:active {
        transform: scale(0.95);
    }
    
    /* Click hint for mobile - positioned above hacker's head */
    .hacker-click-hint {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        position: fixed;
        bottom: 145px;
        right: 16px;
        width: 60px;
        font-size: 0.85rem;
        font-weight: 500;
        color: var(--text-secondary);
        white-space: nowrap;
        animation: pulseText 1.5s ease-in-out infinite;
        z-index: 199;
        pointer-events: none; /* Don't block clicks */
    }
    
    .hacker-click-hint .click-arrow {
        font-size: 1.1rem;
        animation: arrowBounce 0.8s ease-in-out infinite;
    }
    
    @keyframes pulseText {
        0%, 100% {
            opacity: 0.6;
        }
        50% {
            opacity: 1;
        }
    }
    
    @keyframes arrowBounce {
        0%, 100% {
            transform: translateY(0);
        }
        50% {
            transform: translateY(4px);
        }
    }
    
    /* Hide click hint when bubble is open */
    .hacker-row.bubble-open .hacker-click-hint {
        display: none;
    }
    
    /* Hide click hint permanently after first click */
    .hacker-row.hacker-clicked .hacker-click-hint {
        display: none;
    }
    
    /* Mobile notification badge on hacker image */
    .hacker-row .speech-notification {
        position: absolute;
        top: -4px;
        right: -4px;
        left: auto;
    }
    
    /* Hide speech bubble by default on mobile */
    .hacker-speech-bubble {
        display: none;
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        right: auto !important;
        bottom: auto !important;
        max-width: calc(100vw - 48px);
        width: 300px;
        z-index: 301;
        padding: var(--space-lg);
        padding-top: var(--space-xl);
        overflow: visible;
    }
    
    /* Mobile close button - inside the bubble, top right corner */
    .hacker-speech-bubble .speech-close-btn {
        position: absolute;
        top: -12px;
        right: -12px;
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
        background: var(--accent-purple);
        border: 2px solid var(--bg-card);
    }
    
    /* Dark backdrop - hidden by default */
    .hacker-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.8);
        z-index: 300;
        pointer-events: auto; /* Allow clicks to close */
    }
    
    /* Show backdrop when bubble is open */
    .hacker-row.bubble-open .hacker-backdrop {
        display: block;
    }
    
    /* Show speech bubble when expanded */
    .hacker-speech-bubble.mobile-visible {
        display: block !important;
        animation: popIn 0.2s ease-out;
        pointer-events: auto; /* Allow interaction with bubble */
    }
    
    @keyframes popIn {
        from {
            opacity: 0;
            transform: translate(-50%, -50%) scale(0.9) !important;
        }
        to {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1) !important;
        }
    }
    
    /* Hide speech bubble pointer on mobile */
    .hacker-speech-bubble::before,
    .hacker-speech-bubble::after {
        display: none !important;
    }
    
    /* On mobile, hide the teaser text - show expanded directly */
    .hacker-speech-bubble.mobile-visible .speech-content {
        display: none !important;
    }
    
    .hacker-speech-bubble.mobile-visible .speech-expanded {
        display: block !important;
    }
    
    .hacker-speech-bubble.mobile-visible .speech-expanded.hidden {
        display: block !important;
    }
    
    .hacker-speech-bubble.expanded {
        max-width: calc(100vw - 48px);
    }
    
    .speech-content .speech-text {
        font-size: 0.85rem;
    }
    
    .speech-expanded p {
        font-size: 0.9rem;
        margin-bottom: var(--space-sm);
    }
    
    .ai-resources-list {
        margin-top: var(--space-md);
    }
    
    .ai-resources-list a {
        font-size: 0.85rem;
    }
    
    /* Hide notification on speech bubble itself on mobile (it's on the hacker image) */
    .hacker-speech-bubble .speech-notification {
        display: none;
    }
    
    /* Show notification badge on hacker image for mobile */
    .hacker-notification {
        display: flex;
        position: absolute;
        top: -4px;
        right: -4px;
        background: #ef4444;
        color: white;
        font-size: 0.7rem;
        font-weight: 700;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        z-index: 10;
        pointer-events: none;
    }
    
    /* Hide notification when speech bubble is open */
    .hacker-row.bubble-open .hacker-notification {
        display: none;
    }
}