/* ===== THEME TOKENS ===== */
:root {
    --bg: #0b0f17;
    --card: #111827;
    --muted: #94a3b8;
    --text: #e5e7eb;
    --border: #1f2937;
    --btn: #2563eb;
    --btn2: #0b1220;
    --ok: #22c55e;
    --bad: #f97316;
}

/* Light theme */
[data-theme="light"] {
    --bg: #f8fafc;
    --card: #ffffff;
    --muted: #475569;
    --text: #394665;
    --border: #e5e7eb;
    --btn: #222938;
    --btn2: #eef2ff;
}

/* ===== THEME TRANSITION ===== */
html,
body {
    transition: background-color .25s ease, color .25s ease;
}
.app,
.card,
.tile,
.screen,
.answer,
.btn {
    transition:
        background-color .25s ease,
        color .25s ease,
        border-color .25s ease,
        box-shadow .25s ease;
}

.card {
    background: rgba(10, 15, 30, 0.65);
    backdrop-filter: blur(10px);
}

:root[data-theme="light"] .card {
    background: rgba(255, 255, 255, 0.75);
}

/* :root[data-theme="light"] body {
    width: 100vh;
    background:
        radial-gradient(circle at 20% 30%, #ffffffcc 0 60px, transparent 70px),
        radial-gradient(circle at 70% 40%, #ffffffcc 0 80px, transparent 90px),
        radial-gradient(circle at 40% 60%, #ffffffcc 0 70px, transparent 80px),
        linear-gradient(180deg, #cfe9ff, #f7fbff);
    background-size: cover;
    background-attachment: fixed;
}

:root[data-theme="dark"] body {
    width: 100vh;
    background:
        radial-gradient(1px 1px at 20% 30%, #fff, transparent),
        radial-gradient(1px 1px at 80% 40%, #fff, transparent),
        radial-gradient(1px 1px at 60% 70%, #fff, transparent),
        radial-gradient(1px 1px at 30% 80%, #fff, transparent),
        linear-gradient(180deg, #0b1020, #020617);
    background-size:
        200px 200px,
        250px 250px,
        300px 300px,
        350px 350px,
        cover;
    background-attachment: fixed;
} */

* {
    box-sizing: border-box;
    font-family: Calibri, 'Trebuchet MS', sans-serif;
}

body {
    width: 100%;
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: radial-gradient(1200px 600px at 20% 0%, #8097cb 0%, var(--bg) 55%);
    color: var(--text);
}

.app {
    height: 100vh;
    max-width: 1240px;
    margin: 0 auto;
    padding: 20px;
}

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0 18px;
    border-bottom: 1px solid var(--border);
}

.tile {
    transition: transform .2s ease, box-shadow .2s ease;
}

.tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

.top-inner {

    display: flex;
    align-items: center;
    gap: 25px;
    font-weight: bold;
}

#themeToggle {
    transition: transform .35s ease;
}

#themeToggle.rotate {
    transform: rotate(180deg);
}

/* Dark/Light mode text fix */
.tile,
.card,
.question {
    color: var(--text);
}

textarea {
    width: 100%;
    background: rgba(255, 255, 255, .02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--text);
    font-family: inherit;
    resize: vertical;
}

input {
    width: 100%;
    background: rgba(255, 255, 255, .02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--text);
    font-family: inherit;
    margin-bottom: 10px;
}

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

.stars {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0;
}

.star {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .02);
    color: var(--muted);
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.star.active {
    color: var(--text);
    border-color: #60a5fa;
}

textarea::placeholder {
    color: var(--muted);
}

.answer {
    color: var(--text);
    /* <-- MUHIM */
    background: rgba(255, 255, 255, .02);
    border: 1px solid var(--border);
}

.answer:hover {
    color: var(--text);
}

.logo {
    color: rgb(230, 214, 0);
    text-decoration: none;
    font-weight: bolder;
    margin: 0;
    font-size: 40px;
    letter-spacing: .3px
}


.sub {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px
}

.screen {
    display: none;
    padding: 18px 0
}

.screen.active {
    display: block
}

.title {
    margin: 0 0 14px;
    font-size: 20px
}

.row {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .01));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

.tile {
    border: 2px solid var(--border);
    background: rgba(255, 255, 255, .06);
    border-radius: 16px;
    padding: 14px;
    cursor: pointer;
    transition: .15s transform, .15s border;
}

.about-text {
    color: var(--muted);
    line-height: 1.6;
    font-size: 15px;
}

.tile:hover {
    transform: translateY(-2px);
    border-color: #334155
}

.tile h3 {
    margin: 0 0 6px;
    font-size: 16px
}

.tile p {
    margin: 0;
    color: var(--muted);
    font-size: 13px
}

.btn {
    border: 0;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--btn);
    color: white;
    cursor: pointer;
    font-weight: 600;
}

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

.btn.ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.hint {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 13px
}

.quizTop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px
}

.meta {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px
}

.qrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px
}

.badge {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 10px;
    color: var(--muted);
    font-size: 12px;
}

.bar {
    flex: 1;
    height: 10px;
    border-radius: 999px;
    background: #0b1220;
    border: 1px solid var(--border);
    overflow: hidden
}

.barIn {
    height: 100%;
    width: 0%
}

.question {
    margin: 10px 0 14px;
    font-size: 18px;
    line-height: 1.35
}

.answers {
    display: grid;
    gap: 10px
}

.answer {
    text-align: left;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .02);
    border-radius: 14px;
    padding: 12px 12px;
    cursor: pointer;
    transition: .12s transform, .12s border;
}

.answer:hover {
    transform: translateY(-1px);
    border-color: #334155
}

.answer.selected {
    border-color: #60a5fa
}

.answer.correct {
    border-color: rgba(34, 197, 94, .7)
}

.answer.wrong {
    border-color: rgba(249, 115, 22, .7)
}

.actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 14px;
    flex-wrap: wrap
}

.score {
    font-size: 40px;
    margin: 8px 0 0;
    font-weight: 800
}

.feedback {
    margin: 6px 0 0;
    color: var(--muted)
}

.mini {
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px
}

.mini .chip {
    display: inline-block;
    margin: 6px 6px 0 0;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .02);
}

.foot {
    margin-top: 18px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    opacity: .85
}

.bobur-link {
    color: var(--muted);
}

/* Page load smoothness */
html {
    background-color: var(--bg);
}