@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
    font-weight: 100 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2");
    font-weight: 600 900;
    font-style: normal;
    font-display: swap;
}

body {
    margin: 0;
    font-family: "Vazirmatn", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f4f6fb;
    color: #111827;
    direction: rtl;
    text-align: right;
    font-size: small;
}

.questions-section-modern{
    margin-top:2rem;
    background:#fff;
    border-radius:20px;
    padding:1.2rem;
    box-shadow:0 10px 25px rgba(0,0,0,.08);
}

/* Header */
.qs-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:1.2rem;
}

.player{
    display:flex;
    align-items:center;
    gap:.6rem;
}

.player.right{ flex-direction:row-reverse }

.avatar{
    width:38px;height:38px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#fff;
    font-weight:700;
}

.avatar.blue{ background:#3b82f6 }
.avatar.orange{ background:#fb923c }

.name{ font-weight:700;font-size:.9rem }
.sub{ font-size:.75rem;color:#10b981 }

.vs{
    font-weight:800;
    color:#e5e7eb;
}

/* Rows */
.qs-row{
    display:grid;
    grid-template-columns:50px 1fr 50px;
    align-items:center;
    padding:.9rem;
    border-radius:14px;
    border:1px solid #f1f5f9;
    margin-bottom:.7rem;
}

.qs-title{
    text-align:center;
}

.q-title{
    font-weight:700;
    font-size:.9rem;
}

.q-sub{
    font-size:.75rem;
    color:#94a3b8;
}

/* Status */
.qs-status{
    display:flex;
    align-items:center;
    justify-content:center;
}

.icon{
    width:28px;height:28px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:900;
    color:#fff;
}

.icon.success{ background:#22c55e }
.icon.fail{ background:#ef4444 }
.icon.neutral{ background:#e5e7eb;color:#64748b }

/* Footer */
.qs-footer{
    display:grid;
    grid-template-columns:1fr 1fr;
    margin-top:1.5rem;
    gap:1rem;
}

.stat{
    text-align:center;
    background:#f0fdf4;
    padding:.8rem;
    border-radius:14px;
}

.stat span{
    font-size:1.6rem;
    font-weight:800;
    display:block;
    color:#22c55e;
}

.stat small{
    font-size:.8rem;
    color:#64748b;
}

/* Button */
.qs-button{
    margin-top:1.3rem;
    display:block;
    text-align:center;
    padding:1rem;
    border-radius:14px;
    background:#020617;
    color:#fff;
    font-weight:700;
    text-decoration:none;
}


button,
input,
select,
textarea {
    font-family: "Vazirmatn", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: #111827;
}

.topbar .logo {
    font-weight: 700;
    color: #0ea5e9;
}

.topbar .nav-links a {
    color: #4b5563;
    margin-inline-start: 1rem;
    text-decoration: none;
    font-size: 0.9rem;
}

.container {
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 1rem 3rem;
}

.card {
    background: #ffffff;
    border-radius: 1.25rem;
    padding: 1.75rem 2rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    border: 1px solid #e5e7eb;
    margin-bottom: 1.25rem;
    text-align: center;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    text-align: center;
}

.btn.primary {
    background: linear-gradient(135deg, #0369a1, #0ea5e9);
    color: #ffffff;
}

.btn.secondary {
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

.btn.ghost {
    background: transparent;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

.hero {
    text-align: center;
    padding: 4rem 1rem;
}

.auth-wrapper {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.auth-icon {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0f2fe;
    color: #0284c7;
    font-size: 1.5rem;
}

.auth-icon svg {
    width: 100%;
    height: 100%;
}

.w-full {
    width: 100%;
}
.w-80per{
    width: 80%;  
}

.small {
    font-size: 0.8rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
}

.nav-links {
    display: flex;
    align-items: center;
}

@media (max-width: 640px) {
    .nav-links {
        position: absolute;
        top: 56px;
        inset-inline: 0;
        background: #ffffff;
        border-bottom: 1px solid #e5e7eb;
        padding: 0.75rem 1.5rem 1rem;
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        z-index: 20;
    }

    .nav-links.open {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.hero-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.grid.stats {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    overflow-x: auto;
}

.grid.stats .card {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 0.75rem 1rem;
}

.rank-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.rank-stat .star {
    color: #eab308;
}

.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.dash-actions-left {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
}

.dash-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: right;
}

.dash-greeting {
    font-size: 0.8rem;
    color: #6b7280;
}

.dash-name {
    font-weight: 600;
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #0ea5e9;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.game-card {
    background: linear-gradient(135deg, #e0f2fe, #eff6ff);
    border: none;
}

.game-card.secondary {
    background: linear-gradient(135deg, #f5f3ff, #fdf2ff);
}

.bottom-tabs {
    display: flex;
    gap: 0.75rem;
}

.bottom-tab {
    flex: 1;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    padding: 0.75rem 1rem;
    background: #fff;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    color: #4b5563;
}

.bottom-tab.active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}

.bottom-tab-icon {
    font-size: 1.1rem;
    opacity: 0.8;
}

.dash-main {
    max-width: 32rem;
    margin: 1.5rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0ea5e9;
}

.question-card .question-text {
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
    line-height: 1.8;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #6b7280;
}

.question-page {
    max-width: 640px;
    margin: 0 auto;
}

.question-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #6b7280;
}

.question-title {
    text-align: center;
    flex: 1;
}

.question-subtitle {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
}

.question-close {
    text-decoration: none;
    color: #9ca3af;
    font-size: 1rem;
}

.question-card-wrapper {
    margin-top: 0.5rem;
}

.question-tag {
    display: inline-block;
    margin-bottom: 0.5rem;
    padding: 0.15rem 0.75rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.75rem;
}

.options {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.options li {
    margin: 0;
}

.options label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: right;
    font-size: 0.95rem;
    color: #111827;
    position: relative;
}

.options label:hover {
    border-color: #0ea5e9;
    background: #f0f9ff;
}

.options input[type="radio"] {
    margin: 0;
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #0ea5e9;
}

.options input[type="radio"]:checked + span,
.options input[type="radio"]:checked ~ span {
    color: #0ea5e9;
    font-weight: 600;
}

.options label:has(input[type="radio"]:checked) {
    border-color: #0ea5e9;
    background: #f0f9ff;
}

/* حالت فیدبک */
.options.feedback-mode label {
    cursor: default;
    position: relative;
}

.options.feedback-mode label:hover {
    border-color: inherit;
    background: inherit;
}

.options.feedback-mode input[type="radio"] {
    cursor: default;
}

.correct-option {
    background: #dcfce7 !important;
    border-color: #22c55e !important;
}

.wrong-option {
    background: #fee2e2 !important;
    border-color: #ef4444 !important;
}

.check-icon {
    position: absolute;
    right: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    background: #22c55e;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: bold;
}

.cross-icon {
    position: absolute;
    right: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: bold;
}

.explanation-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.explanation-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #1e40af;
    font-size: 0.9rem;
}

.explanation-icon {
    font-size: 1rem;
}

.explanation-text {
    color: #1e3a8a;
    line-height: 1.6;
    margin: 0;
    font-size: 0.9rem;
}

.timer {
    margin: 0.75rem 0 1rem;
    font-weight: 600;
    color: #ef4444;
}

.messages {
    list-style: none;
    padding: 0;
}

.messages .msg {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.msg.success {
    background: #ecfdf3;
    border: 1px solid #bbf7d0;
}

.msg.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.form-card .field {
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
}

.form-field-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

.form-card .input-wrapper {
    position: relative;
    width: 100%;
}

.form-card input {
    background: #f9fafb;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    padding: 0.75rem 1rem;
    padding-right: 2.5rem;
    color: #111827;
    width: 100%;
    box-sizing: border-box;
}

.form-card .input-wrapper .input-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #9ca3af;
    pointer-events: none;
    z-index: 1;
}

.leaderboard {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.leaderboard th,
.leaderboard td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.leaderboard tr.me {
    background: #eef2ff;
}

.muted {
    color: #6b7280;
    font-size: 0.85rem;
}

/* صفحه جدول امتیازات */
.leaderboard-page {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

.leaderboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.leaderboard-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    flex: 1;
    text-align: center;
}

/* بخش برترین‌ها */
.top-leaders-section {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-radius: 1.5rem;
    padding: 2rem 1.5rem 3rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.top-leaders-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.trophy-icon {
    font-size: 1.5rem;
}

.top-leaders-title {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.top-3-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1rem;
    position: relative;
}

.top-3-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.top-3-item.first-place {
    order: 2;
    z-index: 3;
}

.top-3-item.second-place {
    order: 3;
    z-index: 2;
}

.top-3-item.third-place {
    order: 1;
    z-index: 1;
}

.top-3-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 2rem;
    border: 3px solid;
    margin-bottom: 0.5rem;
}

.top-3-avatar.first {
    background: #fbbf24;
    border-color: #f59e0b;
    width: 100px;
    height: 100px;
    font-size: 2.5rem;
}

.top-3-avatar.second {
    background: #60a5fa;
    border-color: #3b82f6;
}

.top-3-avatar.third {
    background: #60a5fa;
    border-color: #3b82f6;
}

.avatar-letter {
    color: #ffffff;
    font-weight: 800;
}

.top-3-avatar.first .avatar-letter {
    color: #78350f;
}

.rank-badge {
    width: 32px;
    height: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.rank-badge.first-badge {
    background: #fbbf24;
}

.rank-badge.second-badge {
    background: #60a5fa;
}

.rank-badge.third-badge {
    background: #fb923c;
}

.top-3-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    text-align: center;
}

.top-3-score {
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
}

.leaderboard-table-card {
    margin-top: 0;
}

@media (max-width: 600px) {
    .top-3-container {
        gap: 0.5rem;
    }
    
    .top-3-avatar.first {
        width: 90px;
        height: 90px;
        font-size: 2.2rem;
    }
    
    .top-3-avatar.second,
    .top-3-avatar.third {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    .top-leaders-section {
        padding: 1.5rem 1rem 2.5rem;
    }
    
    .top-leaders-title {
        font-size: 1.25rem;
    }
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.back-btn {
    font-size: 1.5rem;
    color: #4b5563;
    text-decoration: none;
    cursor: pointer;
}

.profile-card {
    background: #ffffff;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    max-width: 500px;
    margin: 0 auto;
}

.profile-avatar {
    text-align: center;
    margin-bottom: 2rem;
}

.avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 999px;
    background: linear-gradient(135deg, #a78bfa, #c084fc);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 2rem;
    margin: 0 auto 0.75rem;
}

.profile-username {
    color: #9ca3af;
    font-size: 0.9rem;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-field label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    right: 0.75rem;
    font-size: 1rem;
    color: #9ca3af;
    pointer-events: none;
}

.profile-form input[type="text"],
.profile-form input[type="email"],
.profile-form input[type="password"] {
    width: 100%;
    background: #ffffff;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    color: #111827;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.profile-form input:focus {
    outline: none;
    border-color: #0ea5e9;
}

.profile-form .errorlist {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0;
    color: #ef4444;
    font-size: 0.875rem;
}

/* صفحه نتیجه آزمون */
.result-page {
    min-height: 100vh;
    background: #f8fafc;
}

.result-header {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: #fff;
    padding: 2rem 1.5rem 3rem;
    border-bottom-right-radius: 3rem;
    border-bottom-left-radius: 3rem;
    text-align: center;
}

.result-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.result-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.score-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.score-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.result-info {
    display: flex;
    gap: 2rem;
}

.info-item {
    text-align: center;
}

.info-label {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.result-content {
    background: #ffffff;
    margin: -1.5rem 1rem 0;
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.review-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.review-icon {
    font-size: 1.25rem;
}

.review-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.review-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 0;
}

.review-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.status-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
}

.status-icon.correct {
    background: #22c55e;
    color: #fff;
}

.status-icon.incorrect {
    background: #ef4444;
    color: #fff;
}

.status-text {
    font-size: 0.75rem;
    font-weight: 500;
}

.correct-text {
    color: #22c55e;
}

.incorrect-text {
    color: #ef4444;
}

.review-question {
    flex: 1;
    color: #374151;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: right;
}

.result-actions {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.result-actions .btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    text-align: center;
    font-weight: 600;
}

.result-actions .btn.secondary {
    background: #ffffff;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}

.result-actions .btn.secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* صفحه شروع بازی دو نفره */
.multi-start-page {
    min-height: calc(100vh - 100px);
    padding: 1.5rem 0.5rem 2rem;
    max-width: 640px;
    margin: 0 auto;
}

.multi-start-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.multi-start-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.multi-description {
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.waiting-status {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0ea5e9;
    animation: pulse 1.5s ease-in-out infinite;
}

.multi-start-button {
    width: 100%;
    margin-bottom: 1rem;
}

.multi-game-list {
    margin-top: 0.5rem;
}

.multi-game-row {
    background: #ffffff;
    border-radius: 1.25rem;
    padding: 0.75rem 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.multi-game-info {
    text-align: right;
}

.multi-game-vs {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
}

.multi-game-status {
    font-size: 0.8rem;
    color: #9ca3af;
}

.multi-game-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #f97316;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

@media (max-width: 600px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .profile-card {
        padding: 1.5rem;
    }
    
    .result-header {
        padding: 1.5rem 1rem 2.5rem;
    }
    
    .result-stats {
        gap: 1.5rem;
    }
    
    .score-circle {
        width: 100px;
        height: 100px;
    }
    
    .score-number {
        font-size: 2rem;
    }
    
    .result-info {
        gap: 1.5rem;
    }
    
    .result-content {
        margin: -1.5rem 0.75rem 0;
        padding: 1.25rem;
    }
    
    .result-actions {
        flex-direction: column;
        padding: 1rem;
    }
}

/* History Page Styles */
.history-page {
    padding: 1rem 0;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.history-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.back-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111827;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.back-btn:hover {
    background-color: #f3f4f6;
}

.back-btn svg {
    width: 20px;
    height: 20px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-card-wrapper {
    margin-bottom: 0.75rem;
}

.history-card-details {
    display: block;
}

.history-card-summary {
    list-style: none;
    cursor: pointer;
}

.history-card-summary::-webkit-details-marker {
    display: none;
}

.history-card {
    background: #ffffff;
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.history-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.chevron-icon {
    transition: transform 0.3s ease;
    color: #9ca3af;
}

.history-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.history-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #111827;
}

.history-card-date {
    font-size: 0.8rem;
    color: #9ca3af;
}

.history-card-score {
    background: #fed7aa;
    color: #ea580c;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    min-width: 40px;
    text-align: center;
}

.history-card-expanded {
    background: #ffffff;
    border-radius: 0 0 1rem 1rem;
    padding: 1rem 1.25rem;
    margin-top: -1rem;
    padding-top: 1.75rem;
    border: 1px solid #e5e7eb;
    border-top: none;
}

.history-details-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
}

.history-questions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-question-card {
    background: #ffffff;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.question-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.question-text-header {
    font-weight: 700;
    color: #111827;
    font-size: 0.95rem;
    flex: 1;
    line-height: 1.5;
}

.question-status-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.question-status-icon.status-correct {
    background: #dcfce7;
    color: #16a34a;
}

.question-status-icon.status-incorrect {
    background: #fee2e2;
    color: #dc2626;
}

.question-status-icon svg {
    width: 18px;
    height: 18px;
}

.answer-box {
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.answer-box-user {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
}

.answer-box-correct {
    background: #16a34a;
    border: 1px solid #15803d;
}

.answer-label {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.answer-box-correct .answer-label {
    color: #ffffff;
}

.answer-text {
    font-size: 0.9rem;
    color: #111827;
    font-weight: 500;
}

.answer-box-correct .answer-text {
    color: #ffffff;
}

.question-explanation-box {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.875rem;
    background: #f9fafb;
    border-radius: 0.5rem;
}

.explanation-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.explanation-icon svg {
    width: 12px;
    height: 12px;
}

.explanation-text {
    font-size: 0.85rem;
    color: #4b5563;
    line-height: 1.6;
    flex: 1;
}

.history-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

@media (max-width: 600px) {
    .history-card {
        padding: 0.875rem 1rem;
        gap: 0.75rem;
    }

    .history-card-title {
        font-size: 0.9rem;
    }

    .history-card-date {
        font-size: 0.75rem;
    }

    .history-card-score {
        font-size: 0.85rem;
        padding: 0.35rem 0.65rem;
    }
}


