/* ==============================================================
   สไตล์ชีทสื่อการสอนวิชาประวัติศาสตร์ ป.2 (Fun History Quiz)
   สดใส น่ารัก เหมาะกับเด็ก ป.2 รองรับหน้าจอมือถือ แท็บเล็ต และคอมพิวเตอร์
   ============================================================== */

@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;600;700;800&family=Mali:wght@400;600;700&display=swap');

:root {
    --primary: #FF6B6B;
    --primary-hover: #FA5252;
    --secondary: #4ECDC4;
    --accent: #FFE66D;
    --success: #51CF66;
    --warning: #FCC419;
    --purple: #845EC2;
    --bg-main: #F7FFF7;
    --text-dark: #2D3748;
    --text-muted: #718096;
    --card-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    --btn-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

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

body {
    font-family: 'Kanit', 'Mali', sans-serif;
    background: linear-gradient(135deg, #FFF9E6 0%, #E8F5E9 50%, #E1F5FE 100%);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
}

/* พื้นหลังอนิเมชั่นเมฆและดาว */
.bg-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50px;
    filter: blur(1px);
    animation: floatCloud 25s linear infinite;
}

.cloud-1 { top: 12%; left: -100px; width: 140px; height: 50px; animation-duration: 32s; }
.cloud-2 { top: 40%; left: -150px; width: 200px; height: 65px; animation-duration: 45s; animation-delay: 5s; }
.cloud-3 { top: 75%; left: -120px; width: 160px; height: 55px; animation-duration: 38s; animation-delay: 12s; }

@keyframes floatCloud {
    0% { transform: translateX(-150px); }
    100% { transform: translateX(110vw); }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* แถบหัวเว็บด้านบน */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    margin-bottom: 25px;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-dark);
}

.logo-badge {
    font-size: 36px;
    background: #FFF3CD;
    border-radius: 50%;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(255, 193, 7, 0.3);
    animation: bounceLogo 3s ease-in-out infinite;
}

@keyframes bounceLogo {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.logo-title {
    font-size: 22px;
    font-weight: 800;
    color: #E65100;
    line-height: 1.2;
}

.logo-sub {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-icon {
    background: #FFFFFF;
    border: 2px solid #E2E8F0;
    border-radius: 18px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.btn-icon:hover {
    transform: scale(1.08);
    border-color: #CBD5E0;
}

.btn-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #FFFFFF;
    border: 2px solid #E2E8F0;
    border-radius: 30px;
    font-weight: 700;
    font-size: 15px;
    color: var(--text-dark);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.btn-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

.btn-pill-primary {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    color: #FFFFFF;
    border: none;
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.35);
}

.btn-pill-primary:hover {
    box-shadow: 0 8px 22px rgba(255, 107, 107, 0.5);
}

/* การ์ดเนื้อหาหลัก */
.card-main {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 32px;
    padding: 36px 30px;
    box-shadow: var(--card-shadow);
    border: 3px solid #FFF0C2;
    position: relative;
    overflow: hidden;
}

/* ป้ายหัวข้อ */
.hero-header {
    text-align: center;
    margin-bottom: 30px;
}

.hero-tag {
    display: inline-block;
    background: #FFF3CD;
    color: #E65100;
    font-size: 14px;
    font-weight: 700;
    padding: 6px 18px;
    border-radius: 20px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(230, 81, 0, 0.15);
}

.hero-title {
    font-size: 40px;
    font-weight: 800;
    color: #2D3748;
    margin-bottom: 10px;
}

.hero-title span {
    color: #FF6B6B;
}

.hero-desc {
    font-size: 20px;
    color: var(--text-muted);
}

/* ฟอร์มกรอกชื่อเข้าเล่น */
.player-form-card {
    max-width: 580px;
    margin: 0 auto;
    background: #FFFFFF;
    border-radius: 28px;
    padding: 28px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    border: 2px solid #EDF2F7;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 19px;
    font-weight: 800;
    color: #4A5568;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 16px 22px;
    font-family: inherit;
    font-size: 20px;
    border: 2.5px solid #E2E8F0;
    border-radius: 20px;
    outline: none;
    transition: all 0.2s ease;
    background: #F8FAFC;
}

.form-control:focus {
    border-color: #4ECDC4;
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(78, 205, 196, 0.2);
}

/* เลือกตัวละครอวาตาร์ */
.avatar-selection-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.avatar-option {
    cursor: pointer;
    text-align: center;
}

.avatar-option input[type="radio"] {
    display: none;
}

.avatar-box {
    background: #F8FAFC;
    border: 3px solid #E2E8F0;
    border-radius: 22px;
    padding: 16px 12px;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.avatar-emoji {
    font-size: 52px;
    display: block;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.avatar-name {
    font-size: 15px;
    font-weight: 800;
    color: #4A5568;
}

.avatar-option input[type="radio"]:checked + .avatar-box {
    border-color: #FF6B6B;
    background: #FFF5F5;
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 10px 20px rgba(255, 107, 107, 0.25);
}

/* ปุ่มใหญ่เริ่มเกม */
.btn-start-game {
    width: 100%;
    padding: 22px 28px;
    font-family: inherit;
    font-size: 24px;
    font-weight: 800;
    color: #FFFFFF;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    border: none;
    border-radius: 26px;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(255, 107, 107, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.25s ease;
    margin-top: 24px;
}

.btn-start-game:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(255, 107, 107, 0.55);
}

.btn-start-game:active {
    transform: translateY(1px);
}

/* แผนที่ด่าน (Stage Grid) */
.stage-map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
    margin-top: 25px;
}

.stage-card {
    background: #FFFFFF;
    border-radius: 28px;
    padding: 26px 22px;
    border: 3px solid #EDF2F7;
    box-shadow: var(--card-shadow);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stage-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
}

.stage-icon-circle {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
}

.stage-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 13px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 14px;
    background: #FFF3CD;
    color: #B7791F;
}

.stage-title {
    font-size: 21px;
    font-weight: 800;
    color: #2D3748;
    margin-bottom: 8px;
}

.stage-desc {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 16px;
    min-height: 44px;
}

.stage-stars {
    font-size: 20px;
    margin-bottom: 14px;
    color: #FFC107;
}

/* บล็อกทำแบบทดสอบ (Quiz UI) */
.quiz-wrapper {
    max-width: 780px;
    margin: 0 auto;
}

.quiz-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.progress-track {
    flex-grow: 1;
    height: 18px;
    background: #EDF2F7;
    border-radius: 20px;
    margin: 0 16px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ECDC4, #51CF66);
    border-radius: 20px;
    transition: width 0.4s ease;
}

.q-badge {
    background: #EBF8FF;
    color: #2B6CB0;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 15px;
}

.question-box {
    background: #FFFFFF;
    border-radius: 28px;
    padding: 26px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    border: 3px solid #E2E8F0;
    margin-bottom: 24px;
    text-align: center;
}

.question-text {
    font-size: 32px;
    font-weight: 800;
    color: #2D3748;
    margin-bottom: 20px;
    line-height: 1.45;
}

.btn-tts-speak {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #FFF9DB;
    color: #D9480F;
    border: 3px solid #FFE066;
    border-radius: 25px;
    padding: 10px 24px;
    font-family: inherit;
    font-size: 19px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 18px;
    box-shadow: 0 4px 10px rgba(255, 224, 102, 0.4);
}

.btn-tts-speak:hover {
    background: #FFE066;
    transform: scale(1.06);
}

.cartoon-art-container {
    margin: 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    filter: drop-shadow(0 14px 28px rgba(0,0,0,0.12));
    animation: gentleWobble 4s ease-in-out infinite alternate;
}

.cartoon-art-container svg {
    width: 290px;
    height: 290px;
    max-width: 90vw;
    height: auto;
}

@keyframes gentleWobble {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-8px) rotate(1.8deg); }
}

/* ปุ่มตัวเลือกคำตอบ ก ข ค */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 18px;
    background: #FFFFFF;
    border: 3.5px solid #E2E8F0;
    border-radius: 26px;
    padding: 18px 24px;
    font-family: inherit;
    font-size: 22px;
    font-weight: 700;
    color: #2D3748;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
    min-height: 74px;
}

.option-btn:hover:not(:disabled) {
    border-color: #4ECDC4;
    background: #F0FDFA;
    transform: translateX(8px);
}

.opt-prefix {
    background: #EDF2F7;
    color: #2D3748;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.option-btn.correct {
    border-color: #51CF66 !important;
    background: #EBFBEE !important;
    color: #2B8A3E !important;
}

.option-btn.correct .opt-prefix {
    background: #51CF66;
    color: #FFFFFF;
}

.option-btn.wrong {
    border-color: #FF6B6B !important;
    background: #FFF5F5 !important;
    color: #C92A2A !important;
}

.option-btn.wrong .opt-prefix {
    background: #FF6B6B;
    color: #FFFFFF;
}

/* กล่องอธิบายเฉลย */
.explanation-card {
    margin-top: 22px;
    padding: 22px 26px;
    border-radius: 24px;
    background: #FFFBEA;
    border: 3px dashed #F59F00;
    text-align: left;
    display: none;
    animation: fadeIn 0.3s ease;
}

.explanation-header {
    font-weight: 800;
    font-size: 20px;
    color: #D9480F;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.explanation-text {
    font-size: 20px;
    font-weight: 600;
    color: #4A5568;
    line-height: 1.5;
}

/* ปุ่มถัดไป */
.btn-next-question {
    display: none;
    margin-top: 24px;
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #4ECDC4 0%, #20BF6B 100%);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 24px;
    font-weight: 800;
    border: none;
    border-radius: 26px;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(32, 191, 107, 0.4);
    transition: all 0.2s ease;
}

.btn-next-question:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(32, 191, 107, 0.45);
}

/* กล่องสรุปผลคะแนนด่าน */
.stage-summary-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.stage-summary-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content-card {
    background: #FFFFFF;
    border-radius: 36px;
    padding: 40px 30px;
    max-width: 520px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
    border: 4px solid #FFE066;
    transform: scale(0.85);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stage-summary-modal.active .modal-content-card {
    transform: scale(1);
}

.celebrate-badge {
    font-size: 64px;
    margin-bottom: 10px;
    animation: heartBeat 1.5s infinite;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.modal-stars {
    font-size: 38px;
    color: #FFC107;
    margin: 14px 0;
}

/* หน้าสรุปผลคะแนนรวม (Result Page) */
.result-card {
    text-align: center;
    background: #FFFFFF;
    border-radius: 36px;
    padding: 45px 30px;
    border: 4px solid #FFE066;
    box-shadow: var(--card-shadow);
}

.trophy-badge {
    font-size: 80px;
    filter: drop-shadow(0 8px 16px rgba(255, 193, 7, 0.4));
    animation: bounceTrophy 2.5s infinite;
}

@keyframes bounceTrophy {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.score-circle-display {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B6B 0%, #FFD166 100%);
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 25px auto;
    box-shadow: 0 12px 28px rgba(255, 107, 107, 0.35);
}

.score-big-num {
    font-size: 54px;
    font-weight: 800;
    line-height: 1;
}

.score-max-sub {
    font-size: 17px;
    opacity: 0.9;
}

/* ใบประกาศนียบัตรน่ารัก (Certificate) */
.certificate-box {
    background: #FFFDF7;
    border: 8px double #D4AF37;
    border-radius: 28px;
    padding: 30px 20px;
    margin: 30px auto;
    max-width: 650px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

.cert-corner-star {
    position: absolute;
    font-size: 24px;
    color: #D4AF37;
}

.cert-tl { top: 10px; left: 10px; }
.cert-tr { top: 10px; right: 10px; }
.cert-bl { bottom: 10px; left: 10px; }
.cert-br { bottom: 10px; right: 10px; }

.cert-school-title {
    font-size: 16px;
    font-weight: 700;
    color: #8C6D1F;
    letter-spacing: 1px;
}

.cert-title {
    font-size: 28px;
    font-weight: 800;
    color: #B25E00;
    margin: 8px 0;
}

.cert-recipient {
    font-size: 26px;
    font-weight: 700;
    color: #1A365D;
    text-decoration: underline;
    text-decoration-color: #FFD166;
    margin: 12px 0;
}

.cert-detail {
    font-size: 16px;
    color: #4A5568;
    max-width: 480px;
    margin: 0 auto 15px;
}

.cert-seal {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #D4AF37;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto;
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.4);
}

/* แดชบอร์ด & ตารางประวัติ (Dashboard UI) */
.stats-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    background: #FFFFFF;
    border-radius: 24px;
    padding: 20px;
    border: 2px solid #EDF2F7;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-icon-box {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #2D3748;
    line-height: 1.1;
}

.stat-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

/* กระดานเกียรติยศ (Leaderboard Podium) */
.leaderboard-top-section {
    background: #FFFFFF;
    border-radius: 28px;
    padding: 26px;
    border: 2px solid #EDF2F7;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
}

.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
    margin: 25px 0 10px;
}

.podium-step {
    flex: 1;
    max-width: 170px;
    text-align: center;
}

.podium-avatar {
    font-size: 44px;
    margin-bottom: 6px;
}

.podium-name {
    font-size: 15px;
    font-weight: 700;
    color: #2D3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.podium-pillar {
    border-radius: 20px 20px 0 0;
    color: #FFFFFF;
    padding: 16px 8px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.pillar-1 { height: 140px; background: linear-gradient(180deg, #FFD700 0%, #FFA000 100%); }
.pillar-2 { height: 110px; background: linear-gradient(180deg, #C0C0C0 0%, #78909C 100%); }
.pillar-3 { height: 85px; background: linear-gradient(180deg, #CD7F32 0%, #8D6E63 100%); }

/* ตารางประวัติการเล่น (History Table) */
.table-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
    align-items: center;
    justify-content: space-between;
}

.search-input {
    flex: 1;
    min-width: 220px;
    padding: 12px 18px;
    border: 2px solid #E2E8F0;
    border-radius: 16px;
    font-family: inherit;
    font-size: 15px;
    outline: none;
    background: #F8FAFC;
}

.search-input:focus {
    border-color: #4ECDC4;
    background: #FFFFFF;
}

.filter-select {
    padding: 12px 18px;
    border: 2px solid #E2E8F0;
    border-radius: 16px;
    font-family: inherit;
    font-size: 15px;
    background: #FFFFFF;
    outline: none;
    cursor: pointer;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 22px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    border: 2px solid #EDF2F7;
    background: #FFFFFF;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.history-table th {
    background: #F8FAFC;
    padding: 16px 18px;
    font-weight: 700;
    font-size: 14px;
    color: #4A5568;
    border-bottom: 2px solid #EDF2F7;
}

.history-table td {
    padding: 16px 18px;
    font-size: 15px;
    color: #2D3748;
    border-bottom: 1px solid #EDF2F7;
    vertical-align: middle;
}

.history-table tr:hover {
    background: #F7FAFC;
}

.badge-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

.badge-pass {
    background: #EBFBEE;
    color: #2B8A3E;
}

.badge-room {
    background: #EDF2F7;
    color: #4A5568;
}

/* มาสคอตพูด */
body.mascot-speaking .cartoon-art-container {
    animation: talkingMascot 0.3s ease-in-out infinite alternate !important;
}

@keyframes talkingMascot {
    0% { transform: scale(1) translateY(0); }
    100% { transform: scale(1.06) translateY(-8px); }
}

/* ป้ายแสดงข้อความว่างเปล่า */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 54px;
    margin-bottom: 10px;
}

/* สำหรับพิมพ์รายงาน / เกียรติบัตร */
@media print {
    body {
        background: #FFFFFF !important;
    }
    .top-nav, .nav-actions, .btn-pill, .btn-start-game, .bg-decorations, .table-filter-bar, .no-print {
        display: none !important;
    }
    .certificate-box {
        border-width: 4px !important;
        box-shadow: none !important;
        margin: 0 auto !important;
        page-break-inside: avoid;
    }
    .card-main {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }
}

/* หน้าจอขนาดเล็ก (Mobile) */
@media (max-width: 640px) {
    .container {
        padding: 12px;
    }
    .card-main {
        padding: 24px 16px;
        border-radius: 24px;
    }
    .hero-title {
        font-size: 30px;
    }
    .hero-desc {
        font-size: 18px;
    }
    .avatar-selection-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .question-text {
        font-size: 24px;
    }
    .option-btn {
        font-size: 19px;
        padding: 16px 18px;
    }
    .opt-prefix {
        width: 44px;
        height: 44px;
        font-size: 19px;
    }
    .cartoon-art-container svg {
        width: 240px;
        height: 240px;
    }
    .podium-container {
        flex-direction: column;
        align-items: center;
    }
    .podium-step {
        width: 100%;
        max-width: 240px;
    }
    .podium-pillar {
        height: auto !important;
        border-radius: 16px;
        margin-top: 6px;
    }
}
