/**
 * Hypixel BedWars Dashboard 样式
 * 深色星空 + 蓝紫科技感 + 毛玻璃卡片
 */

/* ==================== CSS 变量 ==================== */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.65);
    --bg-card-hover: rgba(30, 41, 59, 0.75);

    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;

    --gradient-main: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
    --gradient-glow: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(139, 92, 246, 0.3));

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border-color: rgba(148, 163, 184, 0.12);
    --border-glow: rgba(59, 130, 246, 0.3);

    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.15);

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== 基础重置 ==================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-blue);
}

img {
    max-width: 100%;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

/* ==================== 星空背景 ==================== */
.stars-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle var(--duration, 3s) ease-in-out infinite;
    opacity: var(--opacity, 0.6);
}

@keyframes twinkle {
    0%, 100% { opacity: var(--opacity, 0.6); transform: scale(1); }
    50% { opacity: 0.2; transform: scale(0.8); }
}

.gradient-overlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 50% at 20% 20%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 50% 30% at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
}

/* ==================== 布局容器 ==================== */
.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

/* ==================== 顶部导航 ==================== */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding: 16px 24px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 700;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cache-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 4px 10px;
    background: rgba(100, 116, 139, 0.15);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.refresh-btn svg {
    width: 16px;
    height: 16px;
}

.refresh-btn:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

.refresh-btn:active {
    transform: translateY(0);
}

.refresh-btn.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== 毛玻璃卡片 ==================== */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
}

.glass-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transform: translateY(-2px);
}

/* ==================== 加载 / 错误状态 ==================== */
[hidden] {
    display: none !important;
}

.loading-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    gap: 16px;
}

.loader {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-state p,
.error-state p {
    color: var(--text-secondary);
}

.error-hint {
    max-width: 520px;
    font-size: 0.8125rem !important;
    line-height: 1.7;
    color: var(--text-muted) !important;
    padding: 12px 16px;
    background: rgba(100, 116, 139, 0.1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: left;
    white-space: pre-line;
}

.error-icon {
    font-size: 3rem;
    opacity: 0.8;
}

.error-state h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.retry-btn {
    margin-top: 8px;
    padding: 10px 24px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--gradient-main);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.retry-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

/* ==================== 玩家资料卡 ==================== */
.player-card {
    margin-bottom: 24px;
    overflow: hidden;
}

.player-card-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 32px;
}

.player-skin {
    position: relative;
    flex-shrink: 0;
}

.skin-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.skin-image {
    position: relative;
    width: 140px;
    height: auto;
    image-rendering: pixelated;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
    transition: transform var(--transition);
}

.player-card:hover .skin-image {
    transform: scale(1.05);
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-name {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.player-rank {
    display: inline-block;
    font-size: 1rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 20px;
    background: rgba(100, 116, 139, 0.2);
    border: 1px solid var(--border-color);
}

/* Rank 颜色 */
.rank-default { color: #94a3b8; }
.rank-vip { color: #55ff55; background: rgba(85, 255, 85, 0.1); border-color: rgba(85, 255, 85, 0.3); }
.rank-vipplus { color: #55ff55; background: rgba(85, 255, 85, 0.1); border-color: rgba(85, 255, 85, 0.3); }
.rank-mvp { color: #55ffff; background: rgba(85, 255, 255, 0.1); border-color: rgba(85, 255, 255, 0.3); }
.rank-mvpplus { color: #55ffff; background: rgba(85, 255, 255, 0.1); border-color: rgba(85, 255, 255, 0.3); }
.rank-mvpplusplus { color: #ffaa00; background: rgba(255, 170, 0, 0.1); border-color: rgba(255, 170, 0, 0.3); }
.rank-admin { color: #ff5555; background: rgba(255, 85, 85, 0.1); border-color: rgba(255, 85, 85, 0.3); }
.rank-helper { color: #5555ff; background: rgba(85, 85, 255, 0.1); border-color: rgba(85, 85, 255, 0.3); }
.rank-youtube { color: #ff5555; background: rgba(255, 85, 85, 0.1); border-color: rgba(255, 85, 85, 0.3); }
.rank-special { color: #ff55ff; background: rgba(255, 85, 255, 0.1); border-color: rgba(255, 85, 255, 0.3); }

.player-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.highlight {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== BedWars 星级 ==================== */
.star-section {
    margin-bottom: 24px;
    padding: 32px;
    text-align: center;
}

.star-header {
    margin-bottom: 24px;
}

.section-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.star-number {
    display: block;
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    transition: color var(--transition);
}

/* 星级颜色 */
.star-gray { color: #aaaaaa; text-shadow: 0 0 30px rgba(170, 170, 170, 0.3); }
.star-blue { color: #5555ff; text-shadow: 0 0 30px rgba(85, 85, 255, 0.4); }
.star-green { color: #55ff55; text-shadow: 0 0 30px rgba(85, 255, 85, 0.4); }
.star-gold-prestige { color: #ffaa00; text-shadow: 0 0 30px rgba(255, 170, 0, 0.4); }
.star-ruby { color: #ff5555; text-shadow: 0 0 30px rgba(255, 85, 85, 0.4); }
.star-sapphire { color: #5555ff; text-shadow: 0 0 30px rgba(85, 85, 255, 0.4); }
.star-diamond { color: #55ffff; text-shadow: 0 0 30px rgba(85, 255, 255, 0.4); }
.star-emerald { color: #55ff55; text-shadow: 0 0 30px rgba(85, 255, 85, 0.4); }
.star-white { color: #ffffff; text-shadow: 0 0 30px rgba(255, 255, 255, 0.4); }
.star-gold { color: #ffaa00; text-shadow: 0 0 30px rgba(255, 170, 0, 0.5); }
.star-red { color: #ff5555; text-shadow: 0 0 30px rgba(255, 85, 85, 0.5); }
.star-dark-red { color: #aa0000; text-shadow: 0 0 30px rgba(170, 0, 0, 0.5); }
.star-black { color: #333333; text-shadow: 0 0 30px rgba(100, 100, 100, 0.5); }

.star-progress-wrap {
    max-width: 500px;
    margin: 0 auto;
}

.star-progress-bar {
    height: 12px;
    background: rgba(100, 116, 139, 0.2);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

.star-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-main);
    border-radius: 6px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.star-exp-text {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.star-exp-text span:first-child {
    color: var(--accent-cyan);
    font-weight: 600;
}

.star-exp-text span:nth-child(3) {
    color: var(--text-primary);
    font-weight: 600;
}

.exp-separator {
    margin: 0 4px;
    color: var(--text-muted);
}

.exp-label {
    margin-left: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==================== 统计卡片网格 ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-main);
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    font-size: 1.75rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.stat-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    transition: transform var(--transition);
}

.stat-card:hover .stat-value {
    transform: scale(1.05);
}

.stat-desc {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* 各统计卡片 hover 色调 */
.stat-card[data-stat="fkdr"]:hover { box-shadow: var(--shadow-lg), 0 0 30px rgba(239, 68, 68, 0.15); }
.stat-card[data-stat="kdr"]:hover { box-shadow: var(--shadow-lg), 0 0 30px rgba(59, 130, 246, 0.15); }
.stat-card[data-stat="winrate"]:hover { box-shadow: var(--shadow-lg), 0 0 30px rgba(34, 197, 94, 0.15); }
.stat-card[data-stat="bblr"]:hover { box-shadow: var(--shadow-lg), 0 0 30px rgba(139, 92, 246, 0.15); }

/* ==================== 详细数据表格 ==================== */
.details-section {
    margin-bottom: 24px;
    padding: 28px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.title-icon {
    font-size: 1.125rem;
}

.details-table-wrap {
    overflow-x: auto;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
}

.details-table th,
.details-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.details-table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(100, 116, 139, 0.08);
}

.details-table tbody tr {
    transition: background var(--transition);
}

.details-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.details-table td:first-child {
    color: var(--text-secondary);
    font-weight: 500;
}

.details-table td:last-child {
    font-weight: 700;
    font-size: 1.0625rem;
    color: var(--text-primary);
    text-align: right;
}

.details-table td:last-child .num-highlight {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== 页脚 ==================== */
.site-footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.site-footer a {
    color: var(--accent-purple);
}

/* ==================== 入场动画 ==================== */
.dashboard > section,
.dashboard > .stats-grid {
    animation: fadeInUp 0.6s ease-out backwards;
}

.dashboard > section:nth-child(1) { animation-delay: 0.05s; }
.dashboard > section:nth-child(2) { animation-delay: 0.1s; }
.dashboard > .stats-grid { animation-delay: 0.15s; }
.dashboard > section:nth-child(4) { animation-delay: 0.2s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 响应式 - 平板 ==================== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .player-meta-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .star-number {
        font-size: 4rem;
    }
}

/* ==================== 响应式 - 手机 ==================== */
@media (max-width: 640px) {
    .container {
        padding: 16px 12px 32px;
    }

    .site-header {
        padding: 12px 16px;
        margin-bottom: 20px;
    }

    .logo-text {
        font-size: 1rem;
    }

    .refresh-btn span {
        display: none;
    }

    .player-card-inner {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
        gap: 20px;
    }

    .skin-image {
        width: 120px;
    }

    .player-name {
        font-size: 2rem;
    }

    .player-meta-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .meta-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid var(--border-color);
    }

    .meta-item:last-child {
        border-bottom: none;
    }

    .star-section {
        padding: 24px 16px;
    }

    .star-number {
        font-size: 3.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .details-section {
        padding: 20px 16px;
    }

    .details-table th,
    .details-table td {
        padding: 12px;
        font-size: 0.875rem;
    }
}

@media (max-width: 380px) {
    .player-name {
        font-size: 1.75rem;
    }

    .star-number {
        font-size: 3rem;
    }
}

/* ==================== 导航链接 ==================== */
.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 6px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

.nav-link.active {
    color: var(--accent-cyan);
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}


/* ==================== 页面切换动画 ==================== */
.page-enter .page-content,
.page-enter .dashboard {
    animation: pageFadeIn 0.45s ease-out;
}

body.page-exit .page-content,
body.page-exit .dashboard {
    animation: pageFadeOut 0.28s ease-in forwards;
}

@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pageFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-8px); }
}

.page-content.visible {
    opacity: 1;
}

/* ==================== 在线状态与热力图 ==================== */
.online-badge {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    z-index: 2;
    white-space: nowrap;
}

.online-badge.online {
    color: #4ade80;
    background: rgba(10, 14, 26, 0.9);
    border: 1px solid rgba(74, 222, 128, 0.4);
}

.online-badge.offline {
    color: var(--text-muted);
    background: rgba(10, 14, 26, 0.9);
    border: 1px solid var(--border-color);
}

.player-game {
    font-size: 0.9375rem;
    color: var(--accent-cyan);
    margin-bottom: 16px;
}

.update-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.section-hint {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 8px;
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}

.status-badge.online {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.status-badge.offline {
    color: var(--text-muted);
    background: rgba(100, 116, 139, 0.15);
    border: 1px solid var(--border-color);
}

.heatmap-section {
    margin-bottom: 24px;
    padding: 28px;
}

.heatmap-note {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.heatmap-legend-cell {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.heatmap-wrap {
    overflow: hidden;
}

.heatmap-scroll {
    overflow-x: auto;
    padding-bottom: 8px;
}

.heatmap-inner {
    min-width: 720px;
}

.heatmap-hour-header {
    display: grid;
    grid-template-columns: 52px repeat(24, 1fr);
    gap: 3px;
    margin-bottom: 4px;
}

.heatmap-corner {
    display: block;
}

.heatmap-hour-label {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-align: center;
}

.heatmap-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.heatmap-row {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 3px;
    align-items: center;
}

.heatmap-day-label {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    text-align: right;
    padding-right: 6px;
}

.heatmap-cells {
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    gap: 3px;
}

.heatmap-cell {
    aspect-ratio: 1;
    min-width: 0;
    border-radius: 3px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.heatmap-cell:hover {
    transform: scale(1.2);
    z-index: 2;
    position: relative;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
}

.heatmap-cell.level-0 {
    background: rgba(241, 245, 249, 0.08);
}

.heatmap-cell.level-1 {
    background: rgba(74, 222, 128, 0.25);
}

.heatmap-cell.level-2 {
    background: rgba(74, 222, 128, 0.45);
}

.heatmap-cell.level-3 {
    background: rgba(74, 222, 128, 0.65);
}

.heatmap-cell.level-4 {
    background: rgba(34, 197, 94, 0.85);
}

.heatmap-tooltip {
    position: fixed;
    z-index: 1000;
    padding: 10px 14px;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    pointer-events: none;
}

.analytics-section {
    margin-bottom: 24px;
    padding: 28px;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.analytics-card {
    padding: 20px;
    background: rgba(100, 116, 139, 0.08);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.analytics-card:hover {
    border-color: var(--border-glow);
    background: rgba(59, 130, 246, 0.06);
}

.analytics-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.analytics-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}


@media (max-width: 1024px) {
    .analytics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .site-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .header-nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .heatmap-section,
    .analytics-section {
        padding: 20px 16px;
    }

    .heatmap-inner {
        min-width: 600px;
    }

    .heatmap-hour-label {
        font-size: 0.5rem;
    }
}
