:root {
    --bg: #0f1117;
    --bg-accent: radial-gradient(circle at 12% 14%, rgba(255, 161, 22, 0.2) 0%, transparent 34%), radial-gradient(circle at 88% 84%, rgba(75, 85, 99, 0.22) 0%, transparent 38%);
    --surface: rgba(26, 29, 37, 0.88);
    --surface-strong: #1f2430;
    --text: #f5f5f5;
    --muted: #b6bcc8;
    --stroke: rgba(245, 245, 245, 0.14);
    --accent: #ffa116;
    --accent-2: #ff7a00;
    --easy: #00b8a3;
    --medium: #ffc01e;
    --hard: #ff375f;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    --radius: 18px;
    --grid-line: rgba(255, 161, 22, 0.08);
    --grid-line-soft: rgba(148, 163, 184, 0.07);
    --vignette: rgba(0, 0, 0, 0.36);
}

body.dark {
    --bg: #090b10;
    --bg-accent: radial-gradient(circle at 10% 12%, rgba(255, 161, 22, 0.26) 0%, transparent 36%), radial-gradient(circle at 92% 82%, rgba(34, 197, 94, 0.18) 0%, transparent 40%);
    --surface: rgba(20, 23, 31, 0.92);
    --surface-strong: #181c27;
    --text: #f8fafc;
    --muted: #aab4c3;
    --stroke: rgba(248, 250, 252, 0.17);
    --shadow: 0 20px 46px rgba(0, 0, 0, 0.58);
    --grid-line: rgba(255, 161, 22, 0.12);
    --grid-line-soft: rgba(100, 116, 139, 0.13);
    --vignette: rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-accent), var(--bg);
    color: var(--text);
    line-height: 1.5;
    transition: background 0.3s ease, color 0.3s ease;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
    background:
        radial-gradient(circle at 18% 14%, rgba(255, 161, 22, 0.22) 0%, transparent 32%),
        radial-gradient(circle at 84% 76%, rgba(0, 184, 163, 0.17) 0%, transparent 34%),
        repeating-linear-gradient(90deg, transparent 0 44px, var(--grid-line) 44px 45px),
        repeating-linear-gradient(180deg, transparent 0 44px, var(--grid-line-soft) 44px 45px);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(circle at center, transparent 35%, var(--vignette) 100%);
}

.page {
    min-height: 100vh;
    padding: clamp(1rem, 2.4vw, 2rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
}

.container {
    width: min(900px, 100%);
}

.dashboard {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 161, 22, 0.16);
    padding: clamp(1rem, 2.4vw, 1.8rem);
    display: grid;
    gap: 1.2rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.9rem;
}

.eyebrow {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

h1 {
    font-size: clamp(1.35rem, 3vw, 2rem);
    line-height: 1.2;
}

.page-title {
    text-align: center;
    color: #ffe3b5;
    text-shadow: 0 10px 26px rgba(255, 161, 22, 0.22);
}

.subhead {
    color: var(--muted);
    font-size: 0.95rem;
    margin-top: 0.35rem;
}

.user-container {
    display: grid;
    gap: 0.6rem;
}

#heading {
    font-size: 0.95rem;
    font-weight: 600;
}

.user-input-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.6rem;
}

#user-input,
#search-btn {
    min-height: 44px;
    border-radius: 10px;
    font: inherit;
}

#user-input {
    border: 1px solid var(--stroke);
    background: var(--surface-strong);
    color: var(--text);
    padding: 0 0.8rem;
    outline: none;
}

#user-input:focus {
    border-color: color-mix(in srgb, var(--accent) 60%, var(--stroke));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

#search-btn {
    border: none;
    padding: 0 1rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

#search-btn:hover {
    transform: translateY(-1px);
    filter: saturate(1.2) brightness(1.05);
    box-shadow: 0 10px 24px rgba(255, 122, 0, 0.38);
}

.status-msg {
    min-height: 1.1rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.progress {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.circle {
    min-height: 120px;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: transparent;
    padding: 0.2rem;
    box-shadow: none;
    transition: transform 0.22s ease, filter 0.22s ease;
}

.circle span {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #ffffff;
    font-weight: 700;
    background: conic-gradient(var(--ring-color) var(--progress-degree, 0%), var(--track-color) 0%);
    margin-bottom: 0.45rem;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.03), 0 8px 18px rgba(0, 0, 0, 0.45);
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.easy-progress {
    --ring-color: var(--easy);
    --track-color: rgba(0, 184, 163, 0.28);
}

.medium-progress {
    --ring-color: var(--medium);
    --track-color: rgba(255, 192, 30, 0.3);
}

.hard-progress {
    --ring-color: var(--hard);
    --track-color: rgba(255, 55, 95, 0.3);
}

.circle p {
    display: block;
    font-weight: 700;
    color: #d9e1f0;
    margin-top: 0.05rem;
    transition: color 0.22s ease, text-shadow 0.22s ease;
}

.circle:hover {
    transform: translateY(-4px);
    filter: saturate(1.12);
}

.circle:hover span {
    transform: scale(1.04);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--ring-color) 20%, transparent),
        0 12px 24px color-mix(in srgb, var(--ring-color) 32%, rgba(0, 0, 0, 0.3));
    filter: brightness(1.05);
}

.circle:hover p {
    color: #f7fbff;
    text-shadow: 0 8px 18px color-mix(in srgb, var(--ring-color) 35%, transparent);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.external-summary {
    width: min(900px, 100%);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.card {
    border: 1px solid var(--stroke);
    background: var(--surface-strong);
    color: var(--text);
    border-radius: 12px;
    padding: 0.85rem;
    text-align: center;
    font-weight: 700;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.38);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease,
        filter 0.22s ease;
}

.card span {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.22s ease;
}

.card:hover {
    transform: translateY(-4px);
    filter: saturate(1.08);
}

#easy-card:hover {
    border-color: rgba(0, 184, 163, 0.82);
    box-shadow: 0 0 0 1px rgba(0, 184, 163, 0.34), 0 16px 30px rgba(0, 184, 163, 0.24);
}

#easy-card:hover span {
    color: #b4fff5;
}

#medium-card:hover {
    border-color: rgba(255, 192, 30, 0.82);
    box-shadow: 0 0 0 1px rgba(255, 192, 30, 0.34), 0 16px 30px rgba(255, 192, 30, 0.24);
}

#medium-card:hover span {
    color: #ffecb7;
}

#hard-card:hover {
    border-color: rgba(255, 55, 95, 0.82);
    box-shadow: 0 0 0 1px rgba(255, 55, 95, 0.34), 0 16px 30px rgba(255, 55, 95, 0.24);
}

#hard-card:hover span {
    color: #ffc4d2;
}

#total-card:hover,
#ranking-card:hover,
#contribution-card:hover {
    border-color: rgba(255, 161, 22, 0.96);
    box-shadow: 0 0 0 1px rgba(255, 161, 22, 0.46), 0 18px 34px rgba(255, 161, 22, 0.28);
}

#total-card:hover span,
#ranking-card:hover span,
#contribution-card:hover span {
    color: #fff0d3;
}

#total-card,
#ranking-card,
#contribution-card {
    position: relative;
    overflow: hidden;
    border-width: 2px;
    border-radius: 999px;
    border-color: rgba(255, 161, 22, 0.82);
    background: linear-gradient(155deg, rgba(255, 161, 22, 0.38), rgba(27, 31, 42, 0.9));
    box-shadow: 0 0 0 1px rgba(255, 161, 22, 0.36), 0 14px 28px rgba(255, 161, 22, 0.26);
}

#total-card::before,
#ranking-card::before,
#contribution-card::before {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    top: -70px;
    right: -62px;
    border-radius: 999px;
    opacity: 0.4;
    pointer-events: none;
    background: rgba(255, 161, 22, 0.9);
}

#easy-card {
    border-color: rgba(0, 184, 163, 0.55);
    background: linear-gradient(155deg, rgba(0, 184, 163, 0.2), rgba(27, 31, 42, 0.92));
}

#easy-card span {
    color: #9ff3e8;
}

#medium-card {
    border-color: rgba(255, 192, 30, 0.55);
    background: linear-gradient(155deg, rgba(255, 192, 30, 0.2), rgba(27, 31, 42, 0.92));
}

#medium-card span {
    color: #ffe39a;
}

#hard-card {
    border-color: rgba(255, 55, 95, 0.55);
    background: linear-gradient(155deg, rgba(255, 55, 95, 0.2), rgba(27, 31, 42, 0.92));
}

#hard-card span {
    color: #ffb0c2;
}

#total-card {
    border-radius: 999px;
}

#total-card span {
    color: #ffe6c0;
}

#ranking-card {
    border-radius: 999px;
}

#ranking-card span {
    color: #ffe6c0;
}

#contribution-card {
    border-radius: 999px;
}

#contribution-card span {
    color: #ffe6c0;
}

@media (max-width: 900px) {
    .progress,
    .metrics-grid,
    .external-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .dashboard-header {
        flex-direction: column;
    }

    .user-input-container {
        grid-template-columns: 1fr;
    }

    .progress,
    .metrics-grid,
    .external-summary {
        grid-template-columns: 1fr;
    }

    .circle {
        min-height: 114px;
    }
}

