/* Also hide the main login gate while attempting auto-login */
        html.has-local-user:not(.auto-login-failed) #diemdanh-login-gate {
            display: none !important;
        }
/* Login overlay (extracted from order.css) */
.login-overlay{position:fixed;inset:0;background:rgba(6,3,11,.9);backdrop-filter:blur(12px);display:flex;align-items:center;justify-content:center;z-index:10000;transition:opacity .3s ease,visibility .3s ease}
.login-overlay.hidden{opacity:0;visibility:hidden;pointer-events:none}
#diemdanh-login-gate.hidden,#diemdanh-content.hidden{display:none!important}
.login-card{background:var(--surface);border-radius:32px;padding:48px 40px;width:min(420px,90vw);text-align:center;border:1px solid rgba(255,255,255,.1);box-shadow:0 20px 60px rgba(0,0,0,.5);position:relative}
.login-avatar{width:120px;height:120px;border-radius:24px;overflow:hidden;margin:0 auto 16px;border:4px solid rgba(232,165,209,.4);box-shadow:0 12px 32px rgba(232,165,209,.35);background:rgba(255,255,255,.05)}
.login-avatar img{width:100%;height:100%;object-fit:cover;image-rendering:pixelated}
.login-card input{width:100%;margin-top:16px;border-radius:16px;border:1px solid rgba(255,255,255,.2);background:rgba(255,255,255,.05);color:var(--text);padding:14px 16px;font-size:1rem;text-align:center}
.login-card>button#login-submit{margin-top:16px;width:100%;border:none;border-radius:16px;background:var(--accent);color:#fff;font-weight:700;font-size:1rem;padding:14px 16px;min-height:44px;cursor:pointer;transition:transform .2s ease,box-shadow .2s ease}
.login-card>button#login-submit:hover{transform:translateY(-2px);box-shadow:0 12px 24px rgba(232,165,209,.4)}
.login-status{margin-top:12px;font-size:.9rem;color:var(--muted);min-height:20px}
.login-status.error{color:#ff9db0;font-weight:600}
.login-status.success{color:#7dcea0;font-weight:600}
.login-card>button#login-submit:disabled{opacity:.55;cursor:not-allowed;transform:none;box-shadow:none}

/* ── Page container ── */
main .container { max-width: 1200px; }

/* ── Page Header ── */
.page-header { text-align: center; padding: 40px 0 28px; }
.page-header h1 {
    font-size: 2.2rem; font-weight: 800; margin: 0 0 10px; line-height: 1.15;
    background: linear-gradient(120deg, var(--accent), var(--accent-2), var(--mint));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-size: 200% auto; animation: gradientShift 8s ease-in-out infinite;
}
@keyframes gradientShift { 0%,100%{background-position:0% 50%} 50%{background-position:100% 50%} }
.page-header p { color: var(--muted); margin: 0; font-size: .95rem; }

/* ── Login Gate ── */
.login-gate {
    max-width: 460px; margin: 24px auto 40px; padding: 36px 32px;
    background: var(--surface); border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,.08); text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

/* ── Layout ── */
.dd-outer-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.dd-main-col { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.dd-sidebar { position: sticky; top: 80px; }

/* Player Bar removed - player info is now in top-bar */

/* ── Hero Card ── */
.dd-hero-card {
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, rgba(232,165,209,.08), rgba(168,232,240,.05) 50%, rgba(245,184,122,.08));
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius);
    padding: 32px 28px;
}
.dd-hero-card::before {
    content: ''; position: absolute; inset: -50%;
    background: radial-gradient(circle at 30% 20%, rgba(232,165,209,.18), transparent 50%),
                radial-gradient(circle at 75% 80%, rgba(168,232,240,.15), transparent 55%);
    pointer-events: none; z-index: 0;
}
.dd-hero-grid {
    position: relative; z-index: 1;
    display: flex; flex-wrap: nowrap; align-items: center; gap: 28px;
}

/* Streak ring */
.streak-ring-wrap {
    position: relative; flex: 0 0 160px;
    width: 160px; height: 160px;
}
.streak-ring-svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.streak-ring-bg { fill: none; stroke: rgba(255,255,255,.06); stroke-width: 6; }
.streak-ring-fill {
    fill: none; stroke: url(#streakGrad); stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s cubic-bezier(.34,1.2,.64,1);
}
.streak-ring-avatar {
    position: absolute; inset: 14px;
    border-radius: 50%; overflow: hidden;
    background: var(--surface); display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(232,165,209,.25);
}
.streak-ring-avatar img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.streak-ring-flame {
    position: absolute; bottom: -4px; right: -4px;
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex; align-items: center; justify-content: center;
    color: #fff; box-shadow: 0 6px 18px rgba(245,184,122,.45);
    border: 3px solid var(--bg); animation: flamePulse 2.4s ease-in-out infinite;
}
.streak-ring-flame svg { width: 20px; height: 20px; }
@keyframes flamePulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.06)} }

.hero-info { min-width: 0; flex: 1 1 auto; word-wrap: break-word; }
.hero-greeting { font-size: .82rem; color: var(--muted); margin: 0 0 4px; letter-spacing: .04em; }
.hero-streak {
    font-size: 2.6rem; font-weight: 800; line-height: 1; margin: 0 0 4px;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    font-variant-numeric: tabular-nums;
}
.hero-streak-label { font-size: .9rem; color: var(--text); margin: 0 0 16px; opacity: .85; }
.hero-progress-text { font-size: .82rem; color: var(--muted); margin: 0 0 6px; }
.hero-progress-text strong { color: var(--accent); font-weight: 700; }
.hero-progress-bar {
    height: 8px; border-radius: 99px; background: rgba(255,255,255,.06);
    overflow: hidden; margin-bottom: 18px;
}
.hero-progress-fill {
    height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    width: 0%; transition: width 1s cubic-bezier(.34,1.2,.64,1);
    box-shadow: 0 0 12px rgba(232,165,209,.5);
}
.dd-hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.checkin-btn {
    font-size: 1rem; padding: 14px 32px; font-weight: 700;
    position: relative; overflow: hidden;
    min-height: 44px;
}
.checkin-btn:not(:disabled)::after {
    content: ''; position: absolute; top: 50%; left: 50%;
    width: 0; height: 0; border-radius: 50%;
    background: rgba(255,255,255,.3); transform: translate(-50%,-50%);
    animation: ctaPulse 2.4s ease-out infinite;
}
@keyframes ctaPulse {
    0% { width: 0; height: 0; opacity: .5; }
    100% { width: 220%; height: 220%; opacity: 0; }
}
.checkin-done {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 28px; border-radius: 999px; font-weight: 700;
    background: rgba(184,232,197,.12); border: 1px solid rgba(184,232,197,.3);
    color: var(--lime); font-size: .95rem;
}

/* ── Stats Row ── */
.stats-row {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.stat-card {
    padding: 16px 14px; border-radius: 16px;
    background: var(--surface); border: 1px solid rgba(255,255,255,.06);
    transition: transform .2s, border-color .2s;
    display: flex; flex-direction: column; gap: 6px;
}
.stat-card:hover { transform: translateY(-2px); border-color: rgba(232,165,209,.2); }
.stat-card-head { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.stat-card-head svg { opacity: .8; flex-shrink: 0; }
.stat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-value.streak { color: var(--accent); }
.stat-value.total  { color: var(--mint); }
.stat-value.max    { color: var(--accent-2); }

/* ── Reward Track ── */
.section-card {
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: var(--radius);
    padding: 22px 22px 26px;
}
.dd-section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 18px;
}
.section-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 1rem; font-weight: 700; color: var(--text); margin: 0;
}
.section-title svg { opacity: .7; }
.section-sub { font-size: .8rem; color: var(--muted); }

.reward-track-wrap { position: relative; padding: 8px 4px 0; overflow-x: auto; }
.reward-track {
    display: flex; gap: 0; position: relative;
    min-width: 100%;
}
.reward-track-line {
    position: absolute; top: 28px; left: 32px; right: 32px;
    height: 4px; border-radius: 99px;
    background: rgba(255,255,255,.06); overflow: hidden;
}
.reward-track-line-fill {
    height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    width: 0%; transition: width 1s cubic-bezier(.34,1.2,.64,1);
}
.reward-node {
    flex: 1; min-width: 90px; text-align: center;
    position: relative; padding: 0 4px; z-index: 1;
}
.reward-dot {
    width: 56px; height: 56px; border-radius: 50%;
    margin: 0 auto 10px; position: relative;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-alt); border: 2px solid rgba(255,255,255,.08);
    color: var(--muted); font-weight: 800; font-size: .92rem;
    letter-spacing: -.02em; font-variant-numeric: tabular-nums;
    transition: all .35s cubic-bezier(.34,1.2,.64,1);
}
.reward-dot-num { line-height: 1; font-size: 1.05rem; }
.reward-dot-suffix { font-size: .58rem; font-weight: 600; opacity: .55; margin-top: 1px; letter-spacing: .04em; }
.reward-node.claimed .reward-dot {
    background: linear-gradient(135deg, rgba(184,232,197,.22), rgba(168,232,240,.16));
    border-color: rgba(184,232,197,.5); color: var(--lime);
    box-shadow: 0 4px 16px rgba(184,232,197,.18);
}
.reward-node.claimed .reward-dot::after {
    content: ''; position: absolute; top: -2px; right: -2px;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--lime); border: 2px solid var(--surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23051c0d' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: 11px; background-position: center; background-repeat: no-repeat;
}
.reward-node.active .reward-dot {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: rgba(255,255,255,.25); color: #fff;
    box-shadow: 0 6px 22px rgba(232,165,209,.45);
    transform: scale(1.08);
}
.reward-node.active .reward-dot::before {
    content: ''; position: absolute; inset: -4px;
    border-radius: 50%; border: 1px dashed rgba(232,165,209,.6);
    animation: rewardPulse 3s linear infinite;
}
@keyframes rewardPulse { to { transform: rotate(360deg); } }
.reward-node.locked .reward-dot { opacity: .42; }
.reward-label { font-size: .73rem; color: var(--muted); font-weight: 600; line-height: 1.2; }
.reward-node.claimed .reward-label { color: var(--text); }
.reward-node.active .reward-label { color: var(--text); font-weight: 700; }

/* ── Rewards Inbox ── */
.rewards-tabs {
    display: inline-flex; gap: 4px; padding: 4px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px; margin-bottom: 14px;
}
.rewards-tab {
    padding: 7px 14px; border: none; cursor: pointer;
    background: transparent; color: var(--muted);
    font-size: .82rem; font-weight: 700; border-radius: 8px;
    font-family: inherit; transition: all .2s;
    display: inline-flex; align-items: center; gap: 6px;
}
.rewards-tab:hover { color: var(--text); }
.rewards-tab.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.rewards-tab-badge {
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(232,165,209,.15); color: var(--accent);
    border-radius: 99px; font-size: .68rem; padding: 1px 6px;
    min-width: 18px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.rewards-pane { display: none; }
.rewards-pane.active { display: block; }
.rewards-list { display: flex; flex-direction: column; gap: 8px; }
.reward-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 12px;
    background: rgba(255,255,255,.025);
    border: 1px solid rgba(255,255,255,.05);
    transition: background .15s, transform .15s;
}
.reward-item:hover { background: rgba(255,255,255,.04); }
.reward-item.pending {
    background: linear-gradient(90deg, rgba(232,165,209,.08), rgba(255,255,255,.02));
    border-color: rgba(232,165,209,.18);
}
.reward-item-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
    color: var(--muted);
}
.reward-item-icon svg { width: 20px; height: 20px; }
.reward-item.pending .reward-item-icon {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: rgba(255,255,255,.18);
    box-shadow: 0 4px 14px rgba(232,165,209,.3);
    color: #fff;
}
.reward-item.claimed .reward-item-icon {
    background: rgba(184,232,197,.1);
    border-color: rgba(184,232,197,.22);
    color: var(--lime);
}
.reward-item-body { flex: 1; min-width: 0; }
.reward-item-name {
    font-size: .9rem; font-weight: 700; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.reward-item-meta {
    font-size: .74rem; color: var(--muted); margin-top: 2px;
    display: flex; gap: 8px; flex-wrap: wrap;
}
.reward-item-meta strong { color: var(--text); font-weight: 600; }
.reward-status-pill {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .7rem; font-weight: 700;
    padding: 4px 10px 4px 8px; border-radius: 99px; flex-shrink: 0;
    white-space: nowrap;
}
.reward-status-pill svg { width: 12px; height: 12px; flex-shrink: 0; }
.reward-status-pill.pending {
    background: rgba(232,165,209,.13);
    color: var(--accent);
    border: 1px solid rgba(232,165,209,.28);
}
.reward-status-pill.claimed {
    background: rgba(184,232,197,.1);
    color: var(--lime);
    border: 1px solid rgba(184,232,197,.22);
}
.rewards-empty {
    padding: 36px 16px; text-align: center;
    color: var(--muted); font-size: .85rem;
    background: rgba(255,255,255,.02);
    border: 1px dashed rgba(255,255,255,.08);
    border-radius: 12px; line-height: 1.5;
}
.rewards-empty-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255,255,255,.04); margin-bottom: 10px;
    color: var(--muted); opacity: .8;
}
.rewards-empty-icon svg { width: 22px; height: 22px; }

/* Light mode */
body.light-mode .rewards-tabs { background: #F8F2E8; border-color: rgba(24,20,16,.08); }
body.light-mode .rewards-tab.active { background: var(--surface); box-shadow: 0 1px 3px rgba(24,20,16,.08); }
body.light-mode .reward-item { background: #FFFFFF; border-color: rgba(24,20,16,.08); }
body.light-mode .reward-item:hover { background: #F8F2E8; }
body.light-mode .reward-item-icon { background: #F8F2E8; border-color: rgba(24,20,16,.08); }
body.light-mode .rewards-empty { background: #F8F2E8; border-color: rgba(24,20,16,.10); }

/* ── Heatmap ── */
.heatmap-head { margin-bottom: 14px; }
.heatmap-wrap {
    overflow-x: auto; padding: 4px 0 12px;
    -webkit-overflow-scrolling: touch;
}
.heatmap-grid {
    display: grid; grid-auto-flow: column;
    grid-template-rows: repeat(7, 16px);
    gap: 4px; padding-left: 28px;
    position: relative;
}
.heatmap-row-labels {
    position: absolute; left: 0; top: 0; bottom: 0;
    display: grid; grid-template-rows: repeat(7, 16px); gap: 4px;
    font-size: .62rem; color: var(--muted); font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em;
    align-items: center;
}
.heatmap-cell {
    width: 16px; height: 16px; border-radius: 4px;
    background: rgba(255,255,255,.04);
    transition: transform .15s, box-shadow .15s;
    cursor: default;
}
.heatmap-cell.empty { visibility: hidden; }
.heatmap-cell.future { background: rgba(255,255,255,.015); }
.heatmap-cell.checked-low {
    background: rgba(184,232,197,.35);
}
.heatmap-cell.checked-mid {
    background: linear-gradient(135deg, rgba(232,165,209,.55), rgba(184,232,197,.55));
}
.heatmap-cell.checked-high {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 6px rgba(232,165,209,.35);
}
.heatmap-cell.today {
    outline: 2px solid var(--accent); outline-offset: 1px;
}
.heatmap-cell:hover {
    transform: scale(1.4); z-index: 5;
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.heatmap-month-row {
    display: flex; padding-left: 28px;
    margin-bottom: 6px; font-size: .68rem; color: var(--muted);
    font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    height: 16px; align-items: center;
}
.heatmap-month-label {
    flex-shrink: 0; box-sizing: border-box;
}
.heatmap-legend {
    display: flex; align-items: center; gap: 6px; justify-content: flex-end;
    font-size: .72rem; color: var(--muted); margin-top: 12px;
}
.heatmap-legend-cell { width: 12px; height: 12px; border-radius: 3px; }
.heatmap-stats {
    display: flex; gap: 18px; flex-wrap: wrap;
    font-size: .82rem; color: var(--muted); margin-top: 10px;
}
.heatmap-stats strong { color: var(--text); font-weight: 700; }

/* ── Sidebar ── */
.sidebar-card {
    background: var(--surface); border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,.06); overflow: hidden;
}
.sidebar-tabs {
    display: flex; padding: 6px; gap: 4px;
    background: rgba(255,255,255,.025);
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-tab {
    flex: 1; padding: 9px 10px; border: none; cursor: pointer;
    background: transparent; color: var(--muted);
    font-size: .82rem; font-weight: 700; border-radius: 10px;
    font-family: inherit; transition: all .2s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.sidebar-tab:hover { color: var(--text); }
.sidebar-tab.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.sidebar-tab-badge {
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(232,165,209,.15); color: var(--accent);
    border-radius: 99px; font-size: .7rem; padding: 1px 7px; min-width: 20px;
    font-weight: 800;
}
.sidebar-pane { display: none; }
.sidebar-pane.active { display: block; }

.panel-list { overflow-y: auto; max-height: 500px; }
.panel-loading, .panel-empty {
    padding: 36px 16px; text-align: center;
    color: var(--muted); font-size: .85rem;
}

/* Podium for top 3 */
.podium {
    display: flex; align-items: flex-end; justify-content: center;
    gap: 12px; padding: 20px 14px 10px;
}
.podium-item {
    flex: 1; max-width: 92px; text-align: center;
    display: flex; flex-direction: column; align-items: center;
    position: relative;
}
.podium-rank-badge {
    position: absolute; top: -2px; right: 50%; transform: translateX(28px);
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .68rem; font-weight: 800; color: #1a1024;
    border: 2px solid var(--surface); z-index: 2;
    font-variant-numeric: tabular-nums;
}
.podium-item.r1 .podium-rank-badge { background: linear-gradient(135deg, #ffd86b, #f0b429); box-shadow: 0 2px 8px rgba(240,180,41,.5); }
.podium-item.r2 .podium-rank-badge { background: linear-gradient(135deg, #e1e6f0, #b8bdc9); }
.podium-item.r3 .podium-rank-badge { background: linear-gradient(135deg, #d99466, #c47f40); }
.podium-avatar {
    width: 46px; height: 46px; border-radius: 12px;
    image-rendering: pixelated; border: 2px solid transparent;
    margin-bottom: 8px;
}
.podium-item.r1 .podium-avatar { border-color: #f0b429; box-shadow: 0 4px 16px rgba(240,180,41,.32); width: 54px; height: 54px; }
.podium-item.r2 .podium-avatar { border-color: #c0c5d0; }
.podium-item.r3 .podium-avatar { border-color: #c47f40; }
.podium-name {
    font-size: .78rem; font-weight: 700;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 100%; color: var(--text);
}
.podium-streak {
    font-size: .78rem; font-weight: 800; color: var(--accent);
    font-variant-numeric: tabular-nums; margin-top: 3px;
    display: inline-flex; align-items: center; gap: 4px;
}
.podium-streak svg { width: 11px; height: 11px; }
.podium-base {
    margin-top: 8px; height: 6px; width: 100%;
    border-radius: 4px 4px 0 0;
    background: rgba(255,255,255,.05);
}
.podium-item.r1 .podium-base { background: linear-gradient(180deg, #f0b429, rgba(240,180,41,.4)); height: 14px; }
.podium-item.r2 .podium-base { background: linear-gradient(180deg, #c0c5d0, rgba(192,197,208,.4)); height: 10px; }
.podium-item.r3 .podium-base { background: linear-gradient(180deg, #c47f40, rgba(196,127,64,.4)); height: 8px; }

/* List entry */
.panel-entry {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; transition: background .15s;
}
.panel-entry:hover { background: rgba(255,255,255,.03); }
.entry-rank {
    width: 24px; height: 24px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 700; color: var(--muted);
    background: rgba(255,255,255,.04); border-radius: 8px;
    font-variant-numeric: tabular-nums;
}
.entry-rank.r1 { background: linear-gradient(135deg, rgba(240,180,41,.25), rgba(255,216,107,.15)); color: #f0b429; }
.entry-rank.r2 { background: linear-gradient(135deg, rgba(192,197,208,.22), rgba(225,230,240,.12)); color: #c0c5d0; }
.entry-rank.r3 { background: linear-gradient(135deg, rgba(196,127,64,.22), rgba(217,148,102,.12)); color: #c47f40; }
.entry-avatar {
    width: 30px; height: 30px; border-radius: 8px;
    flex-shrink: 0; image-rendering: pixelated;
}
.entry-body { flex: 1; min-width: 0; }
.entry-name {
    font-size: .83rem; font-weight: 600; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.entry-streak-pill {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: .72rem; font-weight: 700; color: var(--accent);
    background: rgba(232,165,209,.1); border-radius: 99px;
    padding: 3px 9px 3px 7px; flex-shrink: 0; white-space: nowrap;
}
.entry-streak-pill svg { width: 10px; height: 10px; }
.entry-streak-num {
    font-size: .9rem; font-weight: 800; color: var(--accent);
    flex-shrink: 0; min-width: 26px; text-align: right;
    font-variant-numeric: tabular-nums;
}
.entry-streak-bar {
    height: 3px; border-radius: 2px;
    background: rgba(255,255,255,.07); overflow: hidden; margin-top: 4px;
}
.entry-streak-fill {
    height: 100%; border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .4s ease;
}
.entry-self {
    background: linear-gradient(90deg, rgba(232,165,209,.08), transparent);
    border-left: 2px solid var(--accent);
}

/* ── Toast ── */
.toast {
    position: fixed; top: 24px; left: 50%; transform: translateX(-50%) translateY(-150%);
    padding: 14px 28px; border-radius: 14px; font-weight: 600; font-size: .9rem;
    z-index: 9999; pointer-events: none;
    transition: transform .4s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
    box-shadow: 0 12px 40px rgba(0,0,0,.4); opacity: 0;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { background: rgba(184,232,197,.2); border: 1px solid rgba(184,232,197,.4); color: var(--lime); backdrop-filter: blur(12px); }
.toast.error { background: rgba(231,76,60,.2); border: 1px solid rgba(231,76,60,.4); color: #e74c3c; backdrop-filter: blur(12px); }
.toast.info { background: rgba(168,232,240,.2); border: 1px solid rgba(168,232,240,.4); color: var(--mint); backdrop-filter: blur(12px); }

/* ── Confetti ── */
.confetti-container { position: fixed; inset: 0; pointer-events: none; z-index: 9998; overflow: hidden; }
.confetti-piece {
    position: absolute; top: -10px; width: 8px; height: 14px;
    opacity: 0; border-radius: 1px;
    animation: confettiFall 2.4s cubic-bezier(.42,0,.58,1) forwards;
}
@keyframes confettiFall {
    0%   { transform: translateY(-20vh) rotate(0); opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ── Animations ── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeInUp .5s ease-out both; }

/* ── Light Mode ── */
body.light-mode .stat-card,
body.light-mode .section-card,
body.light-mode .sidebar-card,
body.light-mode .login-gate {
    background: #FFFFFF;
    border-color: rgba(24,20,16,.08);
    box-shadow: 0 2px 8px rgba(24,20,16,.05);
}
body.light-mode .dd-hero-card {
    background: linear-gradient(135deg, rgba(212,74,44,.06), rgba(27,122,142,.05) 50%, rgba(224,136,33,.07));
    border-color: rgba(24,20,16,.10);
}
body.light-mode .heatmap-cell { background: rgba(24,20,16,.06); }
body.light-mode .heatmap-cell.future { background: rgba(24,20,16,.025); }
body.light-mode .heatmap-cell.checked-low { background: rgba(30,138,63,.35); }
body.light-mode .heatmap-cell.checked-mid { background: linear-gradient(135deg, rgba(212,74,44,.55), rgba(30,138,63,.55)); }
body.light-mode .heatmap-cell.checked-high { background: linear-gradient(135deg, var(--accent), #B53A1F); }
body.light-mode .reward-dot { background: #F8F2E8; border-color: rgba(24,20,16,.15); }
body.light-mode .reward-track-line { background: rgba(24,20,16,.10); }
body.light-mode .sidebar-tabs { background: #F8F2E8; border-bottom-color: rgba(24,20,16,.08); }
body.light-mode .sidebar-tab.active { background: var(--surface); box-shadow: 0 1px 3px rgba(24,20,16,.08); }
body.light-mode .panel-entry:hover { background: #F8F2E8; }
body.light-mode .entry-streak-pill { background: rgba(212,74,44,.10); }
body.light-mode .entry-streak-bar { background: rgba(24,20,16,.10); }
body.light-mode .checkin-done { background: rgba(30,138,63,.10); border-color: rgba(30,138,63,.30); color: #176D31; }
body.light-mode .stat-value.streak, body.light-mode .stat-value.max { color: var(--accent); }
body.light-mode .stat-value.total { color: #1B7A8E; }
body.light-mode .login-gate input { border-color: rgba(24,20,16,.16); background: #FFFFFF; color: #181410; }

/* ── Responsive ── */
@media (max-width: 980px) {
    .dd-outer-layout { grid-template-columns: 1fr; }
    .dd-sidebar { position: static; }
    .panel-list { max-height: 360px; }
}
@media (max-width: 640px) {
    .page-header h1 { font-size: 1.7rem; }
    .dd-hero-card { padding: 24px 18px; }
    .dd-hero-grid { flex-direction: column; gap: 18px; text-align: center; align-items: center; }
    .hero-info { width: 100%; }
    .dd-hero-cta { justify-content: center; }
    .hero-streak { font-size: 2.2rem; }
    .dd-hero-cta { justify-content: center; }
    .streak-ring-wrap { width: 130px; height: 130px; }
    .stats-row { gap: 8px; }
    .stat-card { padding: 12px 10px; }
    .stat-value { font-size: 1.35rem; }
    .stat-card-head .stat-label { font-size: .65rem; }
    .reward-dot { width: 46px; height: 46px; font-size: 1.1rem; }
    .reward-node { min-width: 72px; }
    .checkin-btn { padding: 12px 24px; font-size: .92rem; }
    .heatmap-cell { width: 14px; height: 14px; }
    .heatmap-grid { grid-template-rows: repeat(7, 14px); gap: 3px; }
    .heatmap-row-labels { grid-template-rows: repeat(7, 14px); gap: 3px; font-size: .56rem; }
}
