
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600&family=Plus+Jakarta+Sans:wght@400;500;600&display=swap');

:root {
    --bg-color: #f7f9fc;
    --card-bg: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --vector-circle: #e0e7ff;
    --vector-square: #fef3c7;
    --border-radius: 20px;
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 20px 40px -15px rgba(99, 102, 241, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    font-family: 'Kanit', 'Plus Jakarta Sans', sans-serif;
    color: var(--text-primary);
    line-height: 1.7;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}


.box, .box2, .box3 {
    background: var(--card-bg);
    width: 100%;
    max-width: 800px;
    border-radius: var(--border-radius);
    padding: 35px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.4s ease, 
                border-color 0.4s ease;
    border: 2px solid transparent;
    cursor: pointer;
    will-change: transform;
}

.box:hover, .box2:hover, .box3:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: var(--shadow-hover);
    border-color: rgba(99, 102, 241, 0.3);
}


.picture, .picture2, .picture3 {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #a5b4fc, #818cf8);
    border-radius: 50%;
    margin-bottom: 20px;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.6);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}


.picture::after, .picture2::after, .picture3::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: #ffffff;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    animation: morph 6s ease-in-out infinite alternate;
}

@keyframes morph {
    0% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
    100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

.box:hover .picture, 
.box2:hover .picture2, 
.box3:hover .picture3 {
    transform: rotate(15deg) scale(1.1);
}


h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

h2 {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--accent-color);
    margin-bottom: 15px;
}

h3 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-top: 15px;
    margin-bottom: 8px;
    border-left: 4px solid var(--accent-color);
    padding-left: 10px;
}

h5 {
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--text-secondary);
    background: #f8fafc;
    padding: 15px;
    border-radius: 12px;
    border: 1px dashed #e2e8f0;
    line-height: 1.8;
}

.bio, .bio2, .bio3 {
    margin-top: 20px;
    font-size: 0.98rem;
    color: #4a5568;
    background: #ffffff;
}


.bar, .bar2, .bar3 {
    position: absolute;
    right: 20px;
    top: 20px;
    pointer-events: none;
}

.cicle, .cicle2, .cicle3 {
    width: 60px;
    height: 60px;
    background-color: var(--vector-circle);
    border-radius: 50%;
    position: absolute;
    right: 0;
    top: 0;
    opacity: 0.6;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.square, .square2, .square3 {
    width: 45px;
    height: 45px;
    background-color: var(--vector-square);
    border-radius: 12px;
    position: absolute;
    right: 35px;
    top: 30px;
    opacity: 0.7;
    transform: rotate(12deg);
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}


.box:hover .cicle, .box2:hover .cicle2, .box3:hover .cicle3 {
    transform: translate(-15px, 15px) scale(1.2);
}

.box:hover .square, .box2:hover .square2, .box3:hover .square3 {
    transform: translate(10px, -10px) rotate(45deg);
}


.underbar {
    width: 100%;
    max-width: 800px;
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.contact {
    display: flex;
    gap: 20px;
}

.contactfacebook, .contactig {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.contactfacebook::before { content: 'FB'; font-weight: bold; color: #1877f2; }
.contactig::before { content: 'IG'; font-weight: bold; color: #e4405f; }

.contactfacebook:hover, .contactig:hover {
    transform: translateY(-50px) scale(1.15);
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}


.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.25);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}


@media (max-width: 600px) {
    body { padding: 15px 10px; }
    .box, .box2, .box3 { padding: 20px; }
    h1 { font-size: 1.5rem; }
    .square, .square2, .square3 { display: none; } 
}
.picture, .picture2, .picture3 {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden; 
    border: 4px solid #ffffff; 
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15); 
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55), box-shadow 0.3s ease;
    background-color: #e0e7ff; 
}
.picture::after, .picture2::after, .picture3::after {
    display: none;
}

.picture img, .picture2 img, .picture3 img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    object-position: center 20%; 
    display: block;
    transition: transform 0.5s ease;
}

.box:hover .picture, 
.box2:hover .picture2, 
.box3:hover .picture3 {
    transform: scale(1.08) rotate(3deg);
    box-shadow: 0 12px 25px rgba(99, 102, 241, 0.25);
}

.box:hover .picture img, 
.box2:hover .picture2 img, 
.box3:hover .picture3 img {
    transform: scale(1.1); 
}
html {
    scroll-behavior: smooth;
    
    scroll-padding-top: 90px; 
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 15px 0;
}

body {
    padding-top: 100px;
}

.nav-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-dot {
    width: 10px;
    height: 10px;
    background-color: var(--accent-color);
    border-radius: 50%;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-color);
}

.nav-link.highlight-btn {
    background: #e0e7ff;
    color: var(--accent-color);
    padding: 6px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-link.highlight-btn:hover {
    background: var(--accent-color);
    color: #ffffff;
}

.lang-dropdown {
    border: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 8px;
    padding: 4px 8px;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1002;
}

.hamburger {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    position: relative;
    transition: background 0.3s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

.hamburger::before { top: -6px; }
.hamburger::after { top: 6px; }


.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: none !important;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -280px; 
        width: 260px;
        height: 100vh;
        background: #ffffff;
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 25px 30px;
        gap: 20px;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
        transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        z-index: 1001;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        isolation: isolate;

    }

    .nav-menu.active {
        right: 0; 
    }

    .nav-toggle.active .hamburger { background: transparent; }
    .nav-toggle.active .hamburger::before { transform: rotate(45deg); top: 0; }
    .nav-toggle.active .hamburger::after { transform: rotate(-45deg); top: 0; }
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; 
}

#bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; 
    pointer-events: none; 
}
.contactfacebook, .contactig {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-decoration: none; 
}

.contactfacebook::before { 
    content: 'FB'; 
    font-weight: bold; 
    color: #1877f2; 
}

.contactig::before { 
    content: 'IG'; 
    font-weight: bold; 
    color: #e4405f; 
}

.contactfacebook:hover, .contactig:hover {
    transform: translateY(-5px) scale(1.15); 
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}
.diff-selector {
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.game-status {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.checkers-board-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.checkers-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 320px;
    height: 320px;
    border: 4px solid var(--accent-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    user-select: none;
}

.cell {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.cell.white-cell {
    background-color: #f8fafc;
}

.cell.dark-cell {
    background-color: #cbd5e1;
}

.cell.highlight {
    background-color: #fef08a !important; /* ช่องที่สามารถเดินได้ */
    cursor: pointer;
}

.cell.selected {
    background-color: #a7f3d0 !important; /* ช่องที่เลือก */
}

.piece {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.piece:hover {
    transform: scale(1.1);
}

.piece.red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    border: 2px solid #ffffff;
}

.piece.blue {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #ffffff;
    border: 2px solid #ffffff;
}

.piece.king::after {
    content: '👑';
    font-size: 0.75rem;
}

@media (max-width: 400px) {
    .checkers-board {
        width: 280px;
        height: 280px;
    }
    .cell {
        width: 35px;
        height: 35px;
    }
    .piece {
        width: 24px;
        height: 24px;
    }
}
.slider-wrapper {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 40px auto;
  overflow: hidden;
}

.card-container {
  display: flex;
  align-items: center;
  gap: 30px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 40px calc(50% - 160px); 
  scrollbar-width: none; 
  -ms-overflow-style: none; 
}

.card-container::-webkit-scrollbar {
  display: none; 
}

.vector-card {
  flex: 0 0 320px;
  height: 480px;
  background: #ffffff;
  border: 2px solid #1a1a1a;
  border-radius: 20px;
  padding: 28px 24px;
  box-sizing: border-box;
  box-shadow: 6px 6px 0px #1a1a1a;
  display: flex;
  flex-direction: column;
  position: relative;
  
  transform: scale(0.85);
  filter: blur(4px);
  opacity: 0.5;
  transition: transform 0.3s ease, filter 0.3s ease, opacity 0.3s ease;
  user-select: none;
}

.vector-card.active {
  transform: scale(1.05);
  filter: blur(0px);
  opacity: 1;
  z-index: 2;
}

.card-badge {
  position: absolute;
  top: -14px;
  right: 20px;
  background: #f4d03f;
  color: #1a1a1a;
  font-weight: 800;
  font-size: 14px;
  padding: 4px 12px;
  border: 2px solid #1a1a1a;
  border-radius: 20px;
}

.headlaw p {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 16px 0;
  padding-bottom: 10px;
  border-bottom: 2px dashed #e0e0e0;
}

.law {
  flex: 1;
  overflow-y: auto;
  padding-right: 6px;
}

.law p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #4a4a4a;
  margin: 0;
}

.law::-webkit-scrollbar {
  width: 4px;
}
.law::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

.pdf-container-wrapper {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 40px auto;
    background: #f4f4f9;
    border-radius: 12px;
    padding: 20px 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
  }

  .pdf-warning-banner {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    background-color: #e63946;
    color: #ffffff;
    padding: 6px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
  }

  .flipbook-viewport {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
  }

  #flipbook {
    margin: 0 auto;
  }

  #flipbook .page {
    background-color: white;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
  }

  .flipbook-controls {
    text-align: center;
    margin-top: 15px;
  }

  .flipbook-btn {
    background: #1d3557;
    color: white;
    border: none;
    padding: 8px 18px;
    margin: 0 5px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
  }

  .flipbook-btn:hover {
    background: #457b9d;
  }
  #flipbook {
    width: 800px !important; 
    height: 560px !important; 
    margin: 0 auto;
    display: block !important;
}

#flipbook .page {
    width: 400px !important;
    height: 560px !important;
    background-color: #ffffff;
    overflow: hidden;
}

#flipbook canvas {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}
#flipbook {
    width: 800px !important;
    height: 560px !important;
    margin: 20px auto;
    display: block !important;
}

#flipbook-pages .page {
    width: 400px !important;
    height: 560px !important;
    background-color: #222;
}

#flipbook-pages img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}
.flipbook-viewport {
    width: 100%;
    min-height: 600px; 
    display: flex;
    justify-content: center;
    align-items: center;
}

#flipbook {
    min-height: 560px;
}

.pdf-download-container {
    text-align: center;
    margin-top: 25px;
    padding-bottom: 20px;
}

.download-pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(0, 114, 255, 0.3);
    transition: all 0.3s ease;
}

.download-pdf-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 114, 255, 0.5);
    background: linear-gradient(135deg, #0072ff, #00c6ff);
}

.download-pdf-btn svg {
    stroke: #ffffff;
}

.music-control {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.music-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.music-btn:hover {
    background: rgba(30, 41, 59, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.music-btn.muted {
    background: rgba(225, 29, 72, 0.85); /* เปลี่ยนเป็นสีแดงเมื่อปิดเสียง */
    border-color: rgba(255, 255, 255, 0.3);
}