/* ============================================================
   TrueTime - 초정밀 서버시간 동기화
   Premium Dark Theme with Glassmorphism
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ============ CSS Variables ============ */
:root {
    --bg-primary: #0c0f1a;
    --bg-secondary: #141829;
    --bg-tertiary: #1c2038;
    --glass-bg: rgba(20, 24, 41, 0.75);
    --glass-border: rgba(99, 102, 241, 0.15);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);

    --accent-primary: #6366f1;
    --accent-secondary: #a855f7;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --accent-glow: 0 0 20px rgba(99, 102, 241, 0.2), 0 0 40px rgba(99, 102, 241, 0.08);
    --accent-glow-strong: 0 0 30px rgba(99, 102, 241, 0.35), 0 0 60px rgba(168, 85, 247, 0.15);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --success: #34d399;
    --warning: #fbbf24;
    --error: #f87171;

    --border-radius: 20px;
    --border-radius-sm: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ Light Theme ============ */
[data-theme="light"] {
    --bg-primary: #f0f2f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8ebf3;
    --glass-bg: rgba(255, 255, 255, 0.92);
    --glass-border: rgba(99, 102, 241, 0.18);
    --glass-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);

    --accent-primary: #6366f1;
    --accent-secondary: #a855f7;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --accent-glow: 0 0 15px rgba(99, 102, 241, 0.1);
    --accent-glow-strong: 0 0 25px rgba(99, 102, 241, 0.15);

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --success: #059669;
    --warning: #d97706;
    --error: #dc2626;
}

[data-theme="light"] .bg-gradient {
    background:
        radial-gradient(ellipse at 15% 15%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 85%, rgba(168, 85, 247, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 40%, rgba(236, 72, 153, 0.03) 0%, transparent 60%);
}

/* Light mode: glass card borders */
[data-theme="light"] .glass-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

/* Light mode: input fields */
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="time"],
[data-theme="light"] input[type="number"],
[data-theme="light"] .hero-input-group input,
[data-theme="light"] #nickname-input,
[data-theme="light"] #comment-input {
    background: #f8f9fc !important;
    color: #1e293b !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light"] input::placeholder {
    color: #94a3b8 !important;
}

/* Light mode: site items */
[data-theme="light"] .site-item {
    background: rgba(0, 0, 0, 0.02);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .site-item:hover {
    background: rgba(99, 102, 241, 0.04);
}

/* Light mode: comment avatars */
[data-theme="light"] .comment-avatar {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Light mode: stat cards */
[data-theme="light"] .stat-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

/* Light mode: visitors badge */
[data-theme="light"] .visitors-badge {
    background: rgba(99, 102, 241, 0.08);
    color: #475569;
}

/* Light mode: tab buttons */
[data-theme="light"] .tab-btn {
    background: rgba(0, 0, 0, 0.04);
    color: #475569;
}

[data-theme="light"] .tab-btn.active {
    background: var(--accent-primary);
    color: #fff;
}

/* Light mode: sync history */
[data-theme="light"] .history-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

/* Light mode: alarm settings */
[data-theme="light"] .alarm-card {
    border-color: rgba(0, 0, 0, 0.08);
}

/* Light mode: footer */
[data-theme="light"] .footer {
    border-top-color: rgba(0, 0, 0, 0.06);
}

/* Light mode: buttons */
[data-theme="light"] .btn-fight {
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.25);
}

/* Light mode: ad space */
[data-theme="light"] .ad-placeholder {
    background: rgba(0, 0, 0, 0.03);
    color: #94a3b8;
    border-color: rgba(0, 0, 0, 0.06);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-btn:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--accent-glow);
    transform: scale(1.05);
}

/* ============ Reset & Base ============ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* ============ Animated Background ============ */
.bg-gradient {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    background: 
        radial-gradient(ellipse at 15% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 85%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 40%, rgba(236, 72, 153, 0.04) 0%, transparent 60%);
    animation: bgPulse 10s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* ============ Container ============ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============ Header ============ */
.header {
    padding: 24px 0 16px;
    text-align: center;
    position: relative;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--accent-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: var(--accent-glow);
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { box-shadow: var(--accent-glow); }
    50% { box-shadow: var(--accent-glow-strong); }
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.tagline {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 1px;
}

/* ============ Glass Card ============ */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--glass-shadow);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: var(--glass-shadow), 0 0 30px rgba(99, 102, 241, 0.06);
}

/* ============ Main Time Display ============ */
.time-section {
    padding: 20px 0;
}

.time-card {
    text-align: center;
    padding: 40px 24px 32px;
    position: relative;
    overflow: hidden;
}

.time-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: var(--accent-gradient);
    opacity: 0.8;
}

.date-display {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.time-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 72px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: 8px;
    text-shadow: 0 0 40px rgba(0, 212, 255, 0.15);
    position: relative;
}

.time-display .milliseconds {
    font-size: 36px;
    color: var(--accent-primary);
    font-weight: 500;
    opacity: 0.9;
    vertical-align: baseline;
}

.time-display .separator {
    color: var(--text-muted);
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Sync Status Bar */
.sync-status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: syncPulse 2s ease-in-out infinite;
}

.sync-dot.syncing {
    background: var(--warning);
    animation: syncPulse 0.5s ease-in-out infinite;
}

.sync-dot.error {
    background: var(--error);
    animation: none;
}

@keyframes syncPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.sync-status-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.accuracy-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--success);
    font-family: 'JetBrains Mono', monospace;
}

/* ============ Sync Stats Grid ============ */
.sync-stats-section {
    padding: 12px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.stat-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.stat-item:hover {
    border-color: rgba(0, 212, 255, 0.25);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    margin-bottom: 6px;
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px;
    font-weight: 600;
    color: var(--accent-primary);
}

.stat-unit {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 2px;
}

/* Manual Sync Button */
.sync-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(124, 58, 237, 0.15) 100%);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    padding: 10px 24px;
    color: var(--accent-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 16px;
}

.sync-btn:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.25) 0%, rgba(124, 58, 237, 0.25) 100%);
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: var(--accent-glow);
    transform: translateY(-1px);
}

.sync-btn:active {
    transform: translateY(0);
}

.sync-btn.syncing {
    opacity: 0.7;
    pointer-events: none;
}

.sync-btn .icon {
    transition: transform 0.3s;
}

.sync-btn.syncing .icon {
    animation: spin 1s linear infinite;
}

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

/* ============ URL Checker ============ */
.url-checker-section {
    padding: 12px 0;
}

.url-checker-card h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}

.input-group input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.btn-check {
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 12px 28px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-check:hover {
    opacity: 0.9;
    box-shadow: var(--accent-glow);
    transform: translateY(-1px);
}

.btn-check:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.url-result {
    margin-top: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: none;
}

.url-result.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

.url-result .result-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 4px;
}

.url-result .result-info {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============ Two Column Layout ============ */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 12px 0;
}

/* ============ Rankings Section ============ */
.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.site-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-sm);
    border: 1px solid transparent;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.site-item:hover {
    background: rgba(0, 212, 255, 0.05);
    border-color: rgba(0, 212, 255, 0.15);
    transform: translateX(4px);
}

.site-rank {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.1);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.site-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.site-url {
    font-size: 11px;
    color: var(--text-muted);
}

.site-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 10px;
    border-radius: 12px;
    flex-shrink: 0;
}

/* University Tab */
.tab-buttons {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-sm);
    padding: 3px;
}

.tab-btn {
    flex: 1;
    padding: 8px 16px;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn.active {
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-primary);
}

.tab-btn:hover:not(.active) {
    color: var(--text-secondary);
}

/* ============ Comments Section ============ */
.visitors-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #a78bfa;
    margin-bottom: 16px;
}

.visitors-count {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #c4b5fd;
}

.comment-list {
    max-height: 600px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    padding-right: 4px;
}

/* Custom Scrollbar */
.comment-list::-webkit-scrollbar {
    width: 4px;
}
.comment-list::-webkit-scrollbar-track {
    background: transparent;
}
.comment-list::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.2);
    border-radius: 2px;
}

.comment-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--border-radius-sm);
    animation: fadeIn 0.3s ease;
    border: 1px solid transparent;
    transition: var(--transition);
}

.comment-item:hover {
    border-color: rgba(255, 255, 255, 0.05);
}

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

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.comment-nickname {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-primary);
}

.comment-time {
    font-size: 11px;
    color: var(--text-muted);
}

.comment-text {
    font-size: 13px;
    color: var(--text-secondary);
    word-break: break-word;
    line-height: 1.5;
}

/* Comment Input */
.comment-input-area {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.comment-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

.comment-input-area input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.1);
}

.comment-input-area input::placeholder {
    color: var(--text-muted);
}

#nickname-input {
    max-width: 100px;
}

.btn-send {
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 10px 20px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-send:hover {
    opacity: 0.9;
    box-shadow: var(--accent-glow);
}

.btn-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============ Sync History ============ */
.sync-history-section {
    padding: 12px 0;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.history-item {
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 11px;
}

.history-item .h-label {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.history-item .h-value {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 13px;
}

.history-item.used {
    border-color: rgba(16, 185, 129, 0.2);
}

.history-item.filtered {
    border-color: rgba(239, 68, 68, 0.2);
    opacity: 0.5;
}

/* ============ Ad Space ============ */
.ad-space {
    padding: 16px 0;
    text-align: center;
}

.ad-placeholder {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius);
    padding: 40px;
    color: var(--text-muted);
    font-size: 12px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============ Footer ============ */
.footer {
    padding: 32px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 20px;
}

.footer p {
    color: var(--text-muted);
    font-size: 13px;
}

.footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 8px;
}

.footer .footer-links a {
    color: var(--text-muted);
    font-size: 12px;
    text-decoration: none;
    transition: var(--transition);
}

.footer .footer-links a:hover {
    color: var(--accent-primary);
}

/* ============ Loading Overlay ============ */
.loading-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(0, 212, 255, 0.1);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.loading-progress {
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    margin-top: 8px;
}

/* ============ Toast Notification ============ */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    padding: 14px 20px;
    color: var(--text-primary);
    font-size: 13px;
    backdrop-filter: blur(20px);
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--glass-shadow);
    max-width: 320px;
}

.toast.show {
    transform: translateX(0);
}

.toast.success { border-left: 3px solid var(--success); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.error { border-left: 3px solid var(--error); }

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .time-display {
        font-size: 44px;
    }
    .time-display .milliseconds {
        font-size: 22px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .two-column {
        grid-template-columns: 1fr;
    }
    .input-group {
        flex-direction: column;
    }
    .btn-check {
        width: 100%;
    }
    .date-display {
        font-size: 15px;
    }
    .time-card {
        padding: 28px 16px 24px;
    }
}

@media (max-width: 480px) {
    .time-display {
        font-size: 34px;
    }
    .time-display .milliseconds {
        font-size: 18px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .stat-value {
        font-size: 16px;
    }
    .logo h1 {
        font-size: 22px;
    }
    .glass-card {
        padding: 16px;
    }
    .comment-input-area {
        flex-direction: column;
    }
    #nickname-input {
        max-width: 100%;
    }
}

/* ============ Sync Progress Bar ============ */
.sync-progress-container {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-top: 12px;
    overflow: hidden;
}

.sync-progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

/* ============ Alarm Section ============ */
.alarm-section {
    padding: 12px 0;
}

.alarm-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.alarm-time-input {
    display: flex;
    align-items: center;
    gap: 4px;
}

.alarm-time-input input {
    width: 56px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    text-align: center;
    outline: none;
    transition: var(--transition);
}

.alarm-time-input input:focus {
    border-color: var(--accent-primary);
}

.alarm-time-input span {
    color: var(--text-muted);
    font-size: 18px;
    font-weight: 500;
}

.btn-alarm {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--border-radius-sm);
    padding: 8px 20px;
    color: var(--warning);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-alarm:hover {
    background: rgba(245, 158, 11, 0.2);
}

.btn-alarm.active {
    background: var(--warning);
    color: #000;
    font-weight: 600;
}

.alarm-status {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
}

.alarm-status.active {
    color: var(--warning);
}

/* ============ Hero Search (Fight!) ============ */
.hero-section {
    padding: 8px 0;
}

.hero-card {
    padding: 16px 20px;
}

.hero-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.hero-input-group input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 20px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    outline: none;
    transition: var(--transition);
}

.hero-input-group input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.1);
}

.hero-input-group input::placeholder {
    color: var(--text-muted);
}

.btn-fight {
    background: linear-gradient(135deg, #ff6b35 0%, #f72585 100%);
    border: none;
    border-radius: 12px;
    padding: 14px 32px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(247, 37, 133, 0.3);
}

.btn-fight:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(247, 37, 133, 0.5);
}

.btn-fight:active {
    transform: translateY(0);
}

.btn-fight:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============ Site Indicator ============ */
.site-indicator {
    text-align: center;
    padding: 12px 0 0;
    font-size: 15px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

.site-indicator #site-indicator-name {
    font-weight: 700;
    color: var(--accent-primary);
    font-size: 17px;
}

.btn-back-standard {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 5px 14px;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 8px;
}

.btn-back-standard:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* ============ Display Options ============ */
.display-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 14px;
    margin-top: 14px;
    padding: 10px 0;
}

.display-options label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 6px;
    transition: var(--transition);
    user-select: none;
}

.display-options label:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.display-options input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.display-options input[type="checkbox"]:checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.display-options input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: -1px;
    left: 1px;
    font-size: 10px;
    color: #000;
    font-weight: 700;
}

/* ============ Chart Section ============ */
.chart-section {
    padding: 12px 0;
}

.chart-section canvas {
    width: 100% !important;
    border-radius: 8px;
}

/* ============ Ranking Subtitle ============ */
.ranking-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.ranking-subtitle span {
    color: var(--accent-primary);
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

/* Site item with click count highlight */
.site-item .site-click-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: 3px 10px;
    border-radius: 12px;
    flex-shrink: 0;
}

.site-item.active {
    background: rgba(0, 212, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.25);
}

.btn-edit-name {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    transition: var(--transition);
    opacity: 0;
}

.site-item:hover .btn-edit-name {
    opacity: 0.7;
}

.btn-edit-name:hover {
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
}

/* ============ Edit Modal ============ */
.edit-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.edit-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 28px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), var(--accent-glow);
}

.edit-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.edit-modal-current {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.edit-modal-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 14px 16px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    outline: none;
    transition: var(--transition);
    margin-bottom: 20px;
}

.edit-modal-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.edit-modal-btns {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.edit-modal-cancel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 24px;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.edit-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

.edit-modal-confirm {
    background: var(--accent-gradient);
    border: none;
    border-radius: 10px;
    padding: 10px 28px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.edit-modal-confirm:hover {
    opacity: 0.9;
    box-shadow: var(--accent-glow);
}

/* Time display in red mode */
.time-display.red-mode {
    color: var(--text-primary);
    text-shadow: none;
}

/* Responsive for hero */
@media (max-width: 768px) {
    .hero-input-group {
        flex-direction: column;
    }
    .btn-fight {
        width: 100%;
    }
    .display-options {
        gap: 4px 8px;
    }
    .display-options label {
        font-size: 11px;
    }
    .site-indicator {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .hero-input-group input {
        font-size: 14px;
    }
    .btn-fight {
        font-size: 16px;
        padding: 12px 24px;
    }
}

/* ============ Alarm Red Flash ============ */
.alarm-flash-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
    animation: alarmFlash 3s ease-out forwards;
}

@keyframes alarmFlash {
    0%   { background: rgba(239, 68, 68, 0.35); }
    15%  { background: rgba(239, 68, 68, 0); }
    25%  { background: rgba(239, 68, 68, 0.3); }
    40%  { background: rgba(239, 68, 68, 0); }
    50%  { background: rgba(239, 68, 68, 0.2); }
    65%  { background: rgba(239, 68, 68, 0); }
    100% { background: rgba(239, 68, 68, 0); }
}

/* ============ Mascot Character ============ */
.mascot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    cursor: grab;
    user-select: none;
    transition: filter 0.3s;
}

.mascot-container:hover {
    filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.5));
}

.mascot-container:active {
    cursor: grabbing;
}

.mascot-svg {
    width: 80px;
    height: 100px;
    animation: mascotFloat 4s ease-in-out infinite;
}

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

.mascot-arm-left {
    animation: armWaveLeft 2.5s ease-in-out infinite;
    transform-origin: 17px 50px;
}

.mascot-arm-right {
    animation: armWaveRight 2.5s ease-in-out infinite 0.3s;
    transform-origin: 63px 50px;
}

@keyframes armWaveLeft {
    0%, 100% { transform: rotate(-15deg); }
    50% { transform: rotate(-35deg); }
}

@keyframes armWaveRight {
    0%, 100% { transform: rotate(15deg); }
    50% { transform: rotate(35deg); }
}

.mascot-eye {
    animation: mascotBlink 4s ease-in-out infinite;
}

@keyframes mascotBlink {
    0%, 45%, 55%, 100% { ry: 3.5px; }
    50% { ry: 0.5px; }
}

/* Speech Bubble */
.mascot-bubble {
    position: absolute;
    bottom: 105px;
    right: 0;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px 16px 4px 16px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(10px);
    animation: bubblePop 0.3s ease-out;
    max-width: 200px;
}

.mascot-bubble.countdown {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
    font-size: 20px;
    font-family: 'JetBrains Mono', monospace;
}

.mascot-bubble.excited {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--accent-primary);
}

@keyframes bubblePop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Mobile: smaller mascot */
@media (max-width: 768px) {
    .mascot-svg { width: 60px; height: 75px; }
    .mascot-container { bottom: 15px; right: 15px; }
    .mascot-bubble { font-size: 11px; padding: 6px 10px; bottom: 80px; }
    .mascot-bubble.countdown { font-size: 16px; }
}
