:root {
    --bg: #eef3fb;
    --text: #111827;
    --muted: #6b7280;
    --soft: #f8fafc;
    --white: #ffffff;

    --primary: #2563eb;
    --primary-2: #06b6d4;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;

    --glass: rgba(255, 255, 255, 0.78);
    --glass-border: rgba(255, 255, 255, 0.74);
    --line: rgba(148, 163, 184, 0.22);

    --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
    --shadow-soft: 0 14px 40px rgba(15, 23, 42, 0.08);

    --radius-xl: 34px;
    --radius-lg: 26px;
    --radius-md: 20px;
    --radius-sm: 16px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: Inter, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

body {
    position: relative;
    overflow-x: hidden;
}

.premium-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 10%, rgba(37, 99, 235, 0.14), transparent 28%),
        radial-gradient(circle at 80% 0%, rgba(6, 182, 212, 0.12), transparent 30%),
        linear-gradient(180deg, #eef3fb 0%, #f8fafc 100%);
    z-index: 0;
}

.orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(50px);
    opacity: 0.55;
}

.orb-one {
    width: 210px;
    height: 210px;
    background: rgba(37, 99, 235, 0.28);
    top: -70px;
    left: -70px;
}

.orb-two {
    width: 230px;
    height: 230px;
    background: rgba(6, 182, 212, 0.25);
    right: -80px;
    top: 80px;
}

.orb-three {
    width: 190px;
    height: 190px;
    background: rgba(245, 158, 11, 0.16);
    bottom: -70px;
    left: 20%;
}

.app-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 16px 14px 30px;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.97), rgba(6, 182, 212, 0.94)),
        linear-gradient(180deg, rgba(255,255,255,0.16), transparent);
    color: white;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.hero::before {
    content: "";
    position: absolute;
    width: 190px;
    height: 190px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    right: -60px;
    top: -70px;
}

.hero::after {
    content: "";
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    left: -40px;
    bottom: -60px;
}

.hero-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 18px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    letter-spacing: -0.5px;
    backdrop-filter: blur(8px);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-text span {
    font-size: 17px;
    font-weight: 800;
}

.brand-text small {
    color: rgba(255,255,255,0.78);
    margin-top: 2px;
}

.hero h1 {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 31px;
    line-height: 1.08;
    letter-spacing: -0.8px;
}

.hero p {
    position: relative;
    z-index: 1;
    margin: 12px 0 0;
    color: rgba(255,255,255,0.88);
    font-size: 14px;
    line-height: 1.55;
}

.hero-stats {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 18px;
}

.hero-stats div {
    padding: 11px 9px;
    border-radius: 18px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.20);
    backdrop-filter: blur(8px);
}

.hero-stats b {
    display: block;
    font-size: 14px;
}

.hero-stats span {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    line-height: 1.25;
    color: rgba(255,255,255,0.78);
}

.glass-card,
.quiz-glass,
.result-glass {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.glass-card {
    padding: 18px;
    margin-bottom: 14px;
}

.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.eyebrow {
    display: inline-block;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.card-head h2 {
    margin: 0;
    font-size: 23px;
    line-height: 1.15;
    letter-spacing: -0.4px;
}

.head-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(6,182,212,0.13));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.muted-text {
    margin: 12px 0 16px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.tests-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.subject-btn {
    width: 100%;
    border: 1px solid rgba(148,163,184,0.20);
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    padding: 16px;
    text-align: left;
    color: var(--text);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.055);
    cursor: pointer;
    transition: 0.22s ease;
    position: relative;
    overflow: hidden;
}

.subject-btn::after {
    content: "›";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 28px;
    color: rgba(37, 99, 235, 0.45);
}

.subject-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.09);
}

.subject-btn b {
    display: block;
    width: calc(100% - 28px);
    margin-bottom: 6px;
    font-size: 16px;
    line-height: 1.35;
}

.subject-btn span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.subject-btn small {
    display: block;
    color: #94a3b8;
    font-size: 12px;
    margin-top: 3px;
}

.upload-card {
    display: flex;
    gap: 14px;
    padding: 17px;
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(255,255,255,0.72);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(14px);
}

.upload-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(37,99,235,0.14), rgba(6,182,212,0.16));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.upload-card h3 {
    margin: 0 0 7px;
    font-size: 18px;
}

.upload-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.quiz-glass {
    padding: 18px;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.quiz-header h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.35;
    letter-spacing: -0.2px;
    word-break: break-word;
}

.question-counter {
    min-width: 56px;
    text-align: center;
    padding: 9px 12px;
    border-radius: 999px;
    color: var(--primary);
    background: rgba(37, 99, 235, 0.10);
    border: 1px solid rgba(37, 99, 235, 0.14);
    font-weight: 800;
    font-size: 13px;
}

.progress-area {
    margin-bottom: 16px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
}

.progress-info b {
    color: var(--primary);
}

.progress-track {
    width: 100%;
    height: 11px;
    border-radius: 999px;
    overflow: hidden;
    background: #e5edf7;
}

#progress-bar {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    transition: width 0.35s ease;
}

.question-card {
    padding: 17px;
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.95), rgba(248,250,252,0.95));
    border: 1px solid rgba(148, 163, 184, 0.16);
    margin-bottom: 14px;
}

.question-card h2 {
    margin: 5px 0 0;
    font-size: 22px;
    line-height: 1.43;
    letter-spacing: -0.2px;
}

.answers-box {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.answer-btn {
    width: 100%;
    min-height: 58px;
    border: 1px solid rgba(148,163,184,0.20);
    border-radius: 20px;
    background: rgba(255,255,255,0.92);
    padding: 13px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    color: var(--text);
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.045);
    transition: 0.22s ease;
}

.answer-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.30);
}

.answer-letter {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 13px;
    background: #edf4ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
}

.answer-text {
    flex: 1;
    font-size: 15px;
    line-height: 1.42;
}

.answer-status {
    width: 24px;
    min-width: 24px;
    text-align: right;
    font-size: 18px;
}

.answer-correct {
    background: linear-gradient(180deg, #ecfdf3 0%, #dcfce7 100%) !important;
    border: 2px solid rgba(22, 163, 74, 0.82) !important;
    color: #14532d !important;
    box-shadow: 0 14px 28px rgba(22, 163, 74, 0.13) !important;
}

.answer-correct .answer-letter {
    background: var(--success);
    color: white;
}

.answer-wrong {
    background: linear-gradient(180deg, #fff1f2 0%, #fee2e2 100%) !important;
    border: 2px solid rgba(220, 38, 38, 0.78) !important;
    color: #7f1d1d !important;
    box-shadow: 0 14px 28px rgba(220, 38, 38, 0.12) !important;
}

.answer-wrong .answer-letter {
    background: var(--danger);
    color: white;
}

.answer-disabled {
    cursor: not-allowed;
}

.result-glass {
    padding: 22px 18px 18px;
    text-align: center;
}

.result-circle {
    --percent: 0;
    width: 138px;
    height: 138px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
        conic-gradient(var(--primary) calc(var(--percent) * 1%), #e5edf7 0);
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.16);
    position: relative;
}

.result-circle::before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    background: white;
}

.result-circle div {
    position: relative;
    z-index: 1;
}

.result-circle b {
    display: block;
    font-size: 28px;
    color: var(--text);
}

.result-circle span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.result-glass h2 {
    margin: 0 0 8px;
    font-size: 26px;
    letter-spacing: -0.4px;
}

.result-title {
    margin: 0 auto 16px;
    max-width: 94%;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 11px;
    margin-bottom: 12px;
}

.result-item {
    padding: 14px;
    border-radius: 20px;
    background: rgba(255,255,255,0.86);
    border: 1px solid rgba(148,163,184,0.16);
    text-align: left;
}

.result-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 7px;
}

.result-item b {
    font-size: 24px;
    letter-spacing: -0.3px;
}

.result-item.success b {
    color: var(--success);
}

.result-item.danger b {
    color: var(--danger);
}

.result-item.primary b {
    color: var(--primary);
}

.result-percent-line {
    padding: 15px 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(37,99,235,0.10), rgba(6,182,212,0.10));
    border: 1px solid rgba(37,99,235,0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.result-percent-line span {
    color: var(--muted);
    font-size: 14px;
}

.result-percent-line b {
    font-size: 20px;
    color: var(--primary);
}

.action-group {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.primary-btn,
.secondary-btn {
    width: 100%;
    height: 54px;
    border: none;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 850;
    cursor: pointer;
    transition: 0.22s ease;
}

.primary-btn {
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
}

.primary-btn:hover {
    transform: translateY(-1px);
}

.secondary-btn {
    color: var(--text);
    background: #e9eff7;
}

.secondary-btn:hover {
    background: #dfe8f3;
}

.empty-box {
    padding: 16px;
    border-radius: 20px;
    background: rgba(248,250,252,0.88);
    border: 1px dashed rgba(148,163,184,0.45);
    color: var(--muted);
    line-height: 1.55;
    font-size: 14px;
}

.skeleton-card {
    padding: 16px;
    border-radius: 22px;
    background: white;
    border: 1px solid rgba(148,163,184,0.14);
}

.skeleton-card div,
.skeleton-card span,
.skeleton-card small {
    display: block;
    border-radius: 999px;
    background: linear-gradient(90deg, #eef2f7, #f8fafc, #eef2f7);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
}

.skeleton-card div {
    height: 18px;
    width: 70%;
    margin-bottom: 10px;
}

.skeleton-card span {
    height: 12px;
    width: 44%;
    margin-bottom: 8px;
}

.skeleton-card small {
    height: 10px;
    width: 32%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.hidden {
    display: none !important;
}

@media (max-width: 420px) {
    .app-shell {
        padding: 12px 10px 24px;
    }

    .hero {
        padding: 20px;
        border-radius: 30px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .hero-stats {
        gap: 7px;
    }

    .hero-stats div {
        padding: 10px 7px;
    }

    .glass-card,
    .quiz-glass,
    .result-glass {
        border-radius: 30px;
    }

    .question-card h2 {
        font-size: 20px;
    }

    .answer-text {
        font-size: 14.5px;
    }
}