:root {
    --red-main: #a10f1a;
    --red-hover: #c1121f;
    --white: #ffffff;
    --nav-height-desktop: 70px;
    --nav-height-mobile: 56px;
}

/* --- Fixed Navbar (ชุดเดียวจบทุกหน้า) --- */
.main-navbar-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height-desktop);
    background: var(--red-main);
    z-index: 1000;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.cv-navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px; /* เพิ่ม Gap ให้ดูพรีเมียมบน Desktop */
    contain: content;
}

.cv-navbar a {
    color: #ffffff;
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 16px; 
    font-weight: 500;
    white-space: nowrap;
}

.cv-navbar a:hover,
.cv-navbar a.cv-active {
    background: #ffffff;
    color: var(--red-main);
}

    .container {
        max-width: 1100px;
        margin: 30px auto;
        padding: 0 20px;
    }

    .bebas-font {
        font-family: 'Bebas Neue', cursive;
        font-size: 2.2rem;
        margin-bottom: 10px;
    }

    .card {
        background: linear-gradient(135deg, #a10f1a, #c1121f);
        color: white;
        border-radius: 20px;
        padding: 30px 20px;
        text-align: center;
        margin-bottom: 30px;
    }

    .profile-img {
        width: 180px;
        height: 180px;
        object-fit: cover;
        border-radius: 50%;
        border: 3px solid white;
        margin: 10px 0;
    }

    .section-title {
        text-align: center;
        color: #a10f1a;
    }

    .stats-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }

    /* 🔥 เพิ่ม border แดง */
    .stat-card {
        background: white;
        border-radius: 12px;
        padding: 18px;
        border: 2px solid #a10f1a;
    }

    .stat-card h3 {
        margin-top: 0;
        font-size: 1.2rem;
    }

    .score-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 10px;
    }

    .score-table th {
        background: #a10f1a;
        color: white;
        padding: 8px;
    }

    .score-table td {
        padding: 8px;
        text-align: center;
        border-bottom: 1px solid #eee;
    }

    .highlight-row {
        background: #ffccd0;
        font-weight: bold;
    }

    .ppg {
        color: #a10f1a;
    }

    .btn-group {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin: 20px 0;
    }

    button {
        border: none;
        padding: 10px 20px;
        border-radius: 6px;
        cursor: pointer;
    }

    .btn-calc {
        background: #a10f1a;
        color: white;
    }

    .btn-reset {
        background: #555;
        color: white;
    }

    /* 🔥 Career Summary ใส่กรอบแดง */
    .career-summary {
        margin-top: 30px;
        background: white;
        padding: 20px;
        border-radius: 12px;
        text-align: center;
        border: 3px solid #a10f1a;
    }

    .ppg-highlight {
        font-size: 1.8rem;
        font-weight: bold;
        color: #a10f1a;
    }

    .main-footer {
        text-align: center;
        padding: 30px;
        color: #888;
    }

    @media (max-width: 768px) {
        .stats-grid {
            grid-template-columns: 1fr;
        }
    }



/* cv page only */
/* cv page only */
/* Container */
.cv-container {
    max-width: 800px;
    margin: 32px auto;
    padding: 0 16px;
    width: 100%;
}

/* Card */
.cv-card, .cv-section {
    background: #ffffff;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 20px;
    border: 2px solid #a10f1a;
    box-shadow: 0 4px 12px rgba(161, 15, 26, 0.12);
}

/* 🔥 พื้นหลังรูป (แก้จากแดง → ขาว + กรอบแดง) */
.profile-wrapper {
    background: #ffffff;
    padding: 15px;
    border-radius: 20px;
    width: fit-content;
    margin: 0 auto 15px auto;
}

/* Profile Image */
.cv-profile-img {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    border: 4px solid #a10f1a;
    transition: transform 0.3s ease;
}

.cv-profile-img:hover {
    transform: scale(1.05);
}

.cv-info {
    text-align: center;
    line-height: 1.8;
}

/* Title */
.cv-title {
    color: #a10f1a;
    margin-bottom: 15px;
    border-left: 5px solid #a10f1a;
    padding-left: 10px;
    font-weight: 700;
}

/* Skills */
.cv-skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    list-style: none;
    padding: 0;
}

.cv-skill-list li {
    background: #fff5f5;
    border: 1px solid #a10f1a;
    padding: 6px 18px;
    border-radius: 50px;
    color: #a10f1a;
    transition: 0.2s;
}

.cv-skill-list li:hover {
    background: #a10f1a;
    color: #fff;
}

/* 🔥 Contact Card */
.contact-card a {
    color: #a10f1a;
    font-weight: bold;
    text-decoration: none;
}

.contact-card a:hover {
    text-decoration: underline;
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 20px;
    color: #888;
}



/* Home Page Specific Styles */
/* --- Hero Section --- */
.hero-section {
    min-height: 600px;
    height: calc(100vh - var(--nav-height-desktop));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10%;
    background: linear-gradient(135deg, #ffffff 60%, var(--red-main) 40%);
    contain: layout;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 50px;
    width: 100%;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 50px;
    width: 100%;
}

.hero-text h2 {
    font-size: 1.2rem;
    color: var(--red-main);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 5px;
}

.hero-text h1 {
    font-family: 'Bebas Neue', cursive;
    font-size: clamp(3rem, 8vw, 5.5rem);
    line-height: 1.1; /* ปรับให้มากกว่า 1 เล็กน้อยเพื่อความปลอดภัย */
    color: #1a1a1a;
    /* ป้องกันการเปลี่ยนบรรทัดกะทันหัน */
    overflow-wrap: break-word;
}

.highlight {
    color: var(--red-main);
}

.hero-text .typing {
    font-size: 1.4rem;
    color: #555;
    margin-top: 10px;
    min-height: 1.6em;
}

/* Cursor Blink Animation */
.hero-text .typing::after {
    content: '|';
    animation: blink 0.7s infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 15px;
    margin-top: 35px;
}

.btn {
    padding: 14px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    /* ระบุเฉพาะสิ่งที่เปลี่ยนจริง */
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.btn-red {
    background: var(--red-main);
    color: white;
    border: 2px solid var(--red-main);
}

.btn-black {
    background: black;
    color: white;
    border: 2px solid gray;
}

.btn-outline {
    border: 2px solid var(--red-main);
    color: var(--red-main);
}

.btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(161, 15, 26, 0.3);
}

.btn-red:hover {
    background: var(--red-hover);
    border-color: var(--red-hover);
}

/* Image Wrapper */
.hero-img-wrapper {
    position: relative;
    z-index: 2;
}

/* --- Image Optimization (แก้ CLS รูปภาพ) --- */
.hero-img-wrapper img {
    aspect-ratio: 1 / 1; 
    width: 100%;
    max-width: 450px; /* ปรับให้ใหญ่ขึ้นตามที่คุณต้องการ */
    height: auto;
    border-radius: 25px;
    box-shadow: 25px 25px 0px rgba(255,255,255,0.15);
    display: block;
    transition: transform 0.3s ease;
}

/* --- Responsive (มือถือ) --- */
@media (max-width: 992px) {
    body {
        padding-top: var(--nav-height-mobile) !important;
    }
    .main-navbar-wrapper {
        height: var(--nav-height-mobile);
    }
    .cv-navbar {
        gap: 5px;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 0 10px;
    }
    .cv-navbar a {
        font-size: 14px;
        padding: 6px 10px;
    }
    .hero-section {
        background: #ffffff;
        height: auto;
        padding: 40px 5%;
    }
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-img-wrapper img {
        margin: 0 auto;
        max-width: 300px;
    }
}

.hero-img-wrapper:hover img {
    transform: translate(-10px, -10px);
    box-shadow: 35px 35px 0px rgba(255,255,255,0.2);
}
/* Container หลัก */
.hero-dropdown {
    position: relative;
    display: inline-block;
}

/* ปุ่มกด */
.hero-dropdown .dropbtn {
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    border: 2px solid #a10f1a;
    background: transparent;
    color: #a10f1a;
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* ✅ หัวใจสำคัญ: กล่องเมนู 
   เพิ่ม padding-top: 10px เพื่อให้มีพื้นที่ "สะพาน" เชื่อมระหว่างปุ่มกับเมนู 
   เมาส์จะได้ไม่หลุดระหว่างทาง
*/
.hero-dropdown-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 200px;
    box-shadow: 0px 10px 25px rgba(0,0,0,0.2);
    z-index: 100;
    border-radius: 12px;
    top: 100%; /* วางจ่อไว้ใต้ปุ่มพอดี */
    left: 0;
    margin-top: 0; /* เอา margin ออกแล้วใช้ช่องว่างข้างในแทน */
    border: 1px solid rgba(161, 15, 26, 0.1);
    overflow: hidden;
}

/* เพิ่มพื้นที่ Safe Zone ให้เมาส์เลื่อนผ่านได้ไม่หาย */
.hero-dropdown::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 15px; /* สร้างสะพานล่องหนหนา 15px */
    display: none;
}

.hero-dropdown:hover::after {
    display: block;
}

/* แสดงเมนูเมื่อ Hover */
.hero-dropdown:hover .hero-dropdown-content {
    display: block;
    animation: slideUp 0.3s ease-out;
}

.hero-dropdown:hover .dropbtn {
    background: #a10f1a;
    color: white;
}

/* รายการเมนูข้างใน */
.hero-dropdown-content a {
    color: #333;
    padding: 14px 20px;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    transition: 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.hero-dropdown-content a:last-child {
    border-bottom: none;
}

.hero-dropdown-content a:hover {
    background-color: #a10f1a;
    color: #ffffff !important;
    padding-left: 30px;
}

/* Animation ให้ดูพรีเมียม */
@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Responsive */
@media (max-width: 992px) {
    .hero-section {
        background: #ffffff;
        height: auto;
        padding: 60px 5%;
    }
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .btn-group {
        justify-content: center;
    }
    .hero-img-wrapper img {
        margin: 0 auto;
        max-width: 280px;
    }
}




/* Pink & White Theme Specific */
/* Theme */
.pink-theme-body {
    background-color: #fff5f7;
    color: #333;
}

/* Layout */
.pink-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Profile */
.pink-profile-card {
    background: #fff;
    border-radius: 30px;
    padding: 40px;
    border: 2px solid #ffdae0;
    box-shadow: 0 4px 12px rgba(255, 182, 193, 0.2);
    margin-bottom: 40px;
    text-align: center;
}

.pink-main-title {
    color: #ff4d6d;
    font-family: 'Montserrat', 'Kanit', sans-serif;
    font-size: 3rem;
    margin-bottom: 25px;
}

/* Flex */
.pink-profile-flex {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

/* Image */
.pink-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #ffccd5;
    will-change: transform;
}

/* Details */
.pink-details p {
    font-size: 1.05rem;
    margin: 8px 0;
    text-align: left;
    color: #444;
    border-bottom: 1px dashed #ffccd5;
}

/* Section */
.pink-section-title {
    text-align: center;
    color: #ff4d6d;
    margin-bottom: 30px;
}

/* Buttons */
.pink-button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.btn-pink-calc,
.btn-pink-reset {
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn-pink-calc {
    background: #ff4d6d;
    color: #fff;
    border: none;
}

.btn-pink-reset {
    background: #f8f8f8;
    color: #c9184a;
    border: 2px solid #ff4d6d;
}

/* Hover (เบาลง ลด repaint) */
.btn-pink-calc:hover,
.btn-pink-reset:hover {
    transform: scale(1.03);
}

/* Focus (Accessibility 100) */
.btn-pink-calc:focus,
.btn-pink-reset:focus {
    outline: 3px solid #ff4d6d;
}

/* Grid */
.pink-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* Card */
.pink-stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 20px;
    border: 1px solid #ffdae0;
}

/* Table */
.pink-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.pink-table th {
    background: #ff4d6d;
    color: #fff;
    padding: 10px;
}

.pink-table td {
    padding: 10px;
    text-align: center;
    color: #222;
}

/* Result */
.pink-res-row {
    background: #ffd6dc;
}

.pink-ppg-val {
    font-weight: 700;
    color: #c9184a;
}

/* Summary */
.pink-summary-container {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.pink-summary-box {
    background: #fff;
    border: 2px solid #ff4d6d;
    padding: 20px 40px;
    border-radius: 20px;
    text-align: center;
}

.pink-highlight-total {
    font-size: 2rem;
    font-weight: bold;
    color: #c9184a;
}

/* Responsive */
@media (max-width: 600px) {
    .pink-main-title {
        font-size: 2.2rem;
    }
}








/* Game */
.main-navbar-wrapper1 {
    position: fixed;   
    top: 0;            
    left: 0;           
    width: 100%;       
    z-index: 1000;     
    background-color: #333; 
    /* เพิ่มสิ่งนี้เพื่อ Performance: ลดการวาดใหม่ของ Browser */
    will-change: transform; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}


/* จัดรูปแบบเมนูภายใน */
.cv-navbar1 {
    display: flex;
    justify-content: center; 
    align-items: center;
    /* ลด Padding จาก 15px เหลือ 8px เพื่อให้แถบบางลง */
    padding: 8px 0; 
    font-family: 'Kanit', 'Montserrat', sans-serif;
}

.cv-navbar1 a {
    color: white;
    text-decoration: none;
    /* ลด Padding ปุ่มลงจาก 10px 20px เป็น 6px 15px */
    padding: 6px 15px; 
    /* ลดขนาด Font ลงเล็กน้อยเพื่อให้ดูทันสมัยและไม่เบียดกัน */
    font-size: 15px; 
    font-family: 'Kanit', sans-serif; /* ใช้ Font เดียวกันเพื่อลดการโหลด */
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cv-navbar1 a:hover {
    background-color: #555;
    border-radius: 4px;
}
:root {
    --nav-height: 70px;
    --red-main: #a10f1a;
    --gold: #ffcc00;
}

* {
    box-sizing: border-box;
}

/* --- 2. Layout สำหรับหน้าเกมพูล --- */
.pool-page {
    margin: 0;
    padding: 0;
    background: radial-gradient(circle, #1a1a1a, #000);
    min-height: 100vh;
    display: flex;
    flex-direction: column; /* เปลี่ยนจาก center เป็น column เพื่อให้เนื้อหาไหลลงมา */
    align-items: center;
    /* สำคัญ: เว้นที่ว่างด้านบนให้ Header เพื่อไม่ให้โดนบัง */
    padding-top: calc(var(--nav-height) + 20px) !important;
    font-family: 'Kanit', Arial, sans-serif;
}

/* --- 3. Game Container --- */
.game-container {
    width: 95%;
    max-width: 1000px;
    text-align: center;
    color: white;
}

.game-container h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.5rem;
    letter-spacing: 2px;
    margin-bottom: 15px;
    color: var(--white);
}

/* --- 4. HUD (Heads-Up Display) --- */
.hud {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 16px;
    border: 1px solid rgba(255,255,255,0.1);
}

.hud span {
    color: var(--gold);
    font-weight: bold;
}

/* --- 5. Canvas & Table Styling --- */
.canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    /* ล็อกสัดส่วนเพื่อ CLS เป็น 0 */
    aspect-ratio: 900 / 450; 
    background: #2e7d32;
    border: 12px solid #5a3e1b;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    overflow: hidden;
    touch-action: none;
}

canvas {
    width: 100% !important;
    height: auto !important;
    display: block;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

/* --- 6. Controls & Buttons --- */
.btn-reset {
    background: var(--red-main);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: bold;
    margin: 25px 0;
    box-shadow: 0 4px 15px rgba(161, 15, 26, 0.3);
}

.btn-reset:hover {
    background: #e63946;
    transform: scale(1.05);
}

/* --- 7. Instructions Card (Desktop 3 Columns) --- */
.instructions {
    margin-top: 20px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 40px;
}

.instructions h3 {
    color: var(--gold);
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.instruction-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 คอลัมน์บน Desktop */
    gap: 20px;
}

.inst-card {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: 0.3s;
}

.inst-card:hover {
    transform: translateY(-8px);
    background: rgba(0, 0, 0, 0.6);
    border-color: var(--red-main);
}

.inst-card .icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
    display: block;
}

.inst-card h4 {
    margin: 10px 0;
    color: #fff;
    font-size: 1.2rem;
}

.inst-card p {
    font-size: 0.9rem;
    color: #bbb;
    line-height: 1.5;
}

/* --- 8. Responsive Design --- */

/* สำหรับ Tablet & Mobile */
@media (max-width: 768px) {
    .pool-page {
        padding-top: 90px !important;
    }

    .instruction-grid {
        grid-template-columns: 1fr; /* ยุบเหลือ 1 คอลัมน์ */
    }

    .hud {
        flex-direction: column;
        gap: 8px;
    }

    .canvas-wrapper {
        border-width: 8px;
    }
}

/* สำหรับมือถือขนาดเล็กมาก */
@media (max-width: 480px) {
    .cv-navbar a {
        padding: 6px 8px;
        font-size: 12px;
    }

    .game-container h1 {
        font-size: 1.8rem;
    }
}