/* จัดการพื้นหลังหลัก */
body,
html {
    margin: 0;
    padding: 0;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-family: 'Kanit', sans-serif;
    background: radial-gradient(circle, #1a4a1a 0%, #0a2a0a 100%);
    /* พื้นหลังสีเขียวโต๊ะโป๊กเกอร์ */
    overflow: hidden;
}

/* Container หลักที่คลุมหน้า Login/Register */
.auth-wrapper {
    display: flex;
    justify-content: center;
    /* จัดกลางแนวนอน */
    align-items: center;
    /* จัดกลางแนวตั้ง */
    height: 100vh;
    /* เต็มความสูงหน้าจอ */
    width: 100vw;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
        url('https://images.unsplash.com/photo-1511193311914-0346f16efe90?q=80&w=2073');
    background-size: cover;
    background-position: center;
}

/* กล่องสีขาว/เทาที่ใส่เนื้อหา */
.auth-box {
    background: rgba(0, 0, 0, 0.85);
    /* พื้นหลังดำโปร่งแสง */
    padding: 40px;
    border-radius: 20px;
    border: 2px solid #ffcc00;
    /* ขอบสีทอง */
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 400px;
    /* ขนาดกล่องไม่เกิน 400px */
    text-align: center;
    color: white;
}

/* ตกแต่ง Input */
input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border-radius: 8px;
    border: 1px solid #444;
    background: #222;
    color: white;
    box-sizing: border-box;
    /* สำคัญมาก: เพื่อให้ padding ไม่ดันขนาด input */
}

/* ตกแต่งปุ่ม */
.btn-primary {
    width: 100%;
    padding: 12px;
    background: #ffcc00;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

.btn-primary:hover {
    background: #e6b800;

}

/*
body {
    margin: 0;
    font-family: 'Kanit', sans-serif;
}*/

.main-bg {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* แนะนำให้หาภาพ Poker สวยๆ จาก Unsplash มาใส่ตรงนี้ครับ */
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
        url('https://images.unsplash.com/photo-1511193311914-0346f16efe90?q=80&w=2073');
    background-size: cover;
    background-position: center;
}

.auth-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-align: center;
    width: 350px;
}

.title {
    color: #d32f2f;
    margin-bottom: 5px;
    font-weight: 600;
}

.subtitle {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 25px;
}

/*
input {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}*/

.auth-links {
    margin-top: 15px;
    font-size: 14px;
    color: #ccc;
}

.auth-links a {
    color: #ffcc00;
    text-decoration: none;
    transition: 0.3s;
}

.auth-links a:hover {
    color: #fff;
    text-decoration: underline;
}

/*.btn-primary { background: #d32f2f; color: white; border: none; width: 100%; padding: 12px; cursor: pointer; border-radius: 5px; margin-top: 10px; }*/
.btn-secondary {
    background: #555;
    color: white;
    border: none;
    width: 100%;
    padding: 12px;
    cursor: pointer;
    border-radius: 5px;
    margin-top: 5px;
}

.divider {
    margin: 20px 0;
    border-bottom: 1px solid #ddd;
    position: relative;
}

.divider span {
    background: #fff;
    padding: 0 10px;
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8em;
    color: #999;
}

.social-login {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-facebook {
    background: #1877F2;
    color: white;
    border: none;
    flex: 1;
    padding: 10px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
}

.btn-google {
    background: white;
    color: #444;
    border: 1px solid #ddd;
    flex: 1;
    padding: 10px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
}

.password-container {
    position: relative;
    width: 100%;
}

.password-container input {
    padding-right: 40px !important;
    /* เว้นที่ว่างท้ายช่องไม่ให้ตัวหนังสือทับไอคอน */
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #888;
    transition: 0.2s;
    z-index: 10;
}

.toggle-password:hover {
    color: #ffcc00;
}

/* สีขอบช่อง Input */
.input-error {
    border: 2px solid #ff4d4d !important;
    /* แดง */
}

.input-success {
    border: 2px solid #2ecc71 !important;
    /* เขียว */
}

/* แถบสีแสดงความยากของรหัสผ่าน */
.strength-meter {
    height: 5px;
    width: 100%;
    background-color: #ddd;
    margin-top: 5px;
    border-radius: 3px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-text {
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.notification-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    /* เพื่อไม่ให้ขวางการคลิกเมนูหลังข้อความ */
}

.notification-toast {
    background-color: #ff4d4d;
    /* สีแดงสำหรับ Error */
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    font-weight: 100;
    font-size: 16px;
    animation: slideDown 0.5s ease forwards, fadeOut 0.5s ease 2.5s forwards;
    min-width: 250px;
    text-align: center;
}

/* สีเขียวสำหรับความสำเร็จ (เผื่อใช้ตอนสมัครผ่าน) */
.notification-toast.success {
    background-color: #2ecc71;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ตัวหุ้ม input */
.input-group {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}

.input-group input {
    width: 100%;
    padding-right: 40px;
    /* เว้นที่ว่างด้านขวาไว้สำหรับไอคอน */
}

/* สไตล์ของไอคอนแจ้งเตือน */
.status-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    display: none;
    /* ซ่อนไว้ก่อน */
}

.status-icon.success {
    color: #2ecc71;
    display: block;
    pointer-events: none;
    /* เครื่องหมายถูกไม่ต้องให้กดได้ */
}

.status-icon.error {
    color: #ff4d4d;
    display: block;
    pointer-events: auto;
    cursor: pointer;
}

/*------------------------------*/
.dashboard-box {
    background: rgba(0, 0, 0, 0.85);
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    border-radius: 20px;
    border: 2px solid #f1c40f;
    padding: 20px;
    color: white;
}

.player-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chip-status {
    background: #1a1a1a;
    padding: 10px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #f1c40f;
}

.game-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.mode-card {
    background: linear-gradient(145deg, #2c3e50, #000);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
    border: 1px solid #34495e;
}

.mode-card:hover {
    transform: scale(1.05);
    border-color: #f1c40f;
}

/*------------------------*/

/* พื้นหลังของทั้งหน้าจอ */
.lobby-page-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /*background: radial-gradient(circle, #1a472a 0%, #06110a 100%); /* หรือใส่รูปพื้นหลังคาสิโน */
    background: linear-gradient(rgba(78, 78, 78, 0), rgba(5, 0, 48, 0.9)),
        url('/img/lobby.jpg');
    background-size: cover;
    background-position: center;
    margin: 0;
    overflow: hidden;
}

/* คอนเทนเนอร์หลักของ Lobby */
.lobby-container {
    max-width: 90%;
    min-width: 90%;
    /* ขนาดมาตรฐานที่นิยม */
    height: 95vh;
    max-height: 95vh;
    min-height: 95vh;
    /* ความสูงพอดีตา */
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #f1c40f;
    border-radius: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* ป้องกันเนื้อหาล้นขอบมน */
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.lobby-main{
    display: block;
    text-align: center;
    max-width: 90%;
    min-width: 90%;
    /* ขนาดมาตรฐานที่นิยม */
    height: 95vh;
    max-height: 95vh;
    min-height: 95vh;    
}

/* ส่วน Header ภายใน Lobby */
.lobby-header {    
    min-width: 80%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: rgba(20, 20, 29, 0.8);
    border-bottom: 2px solid rgba(241, 196, 15, 0.9);
}

/* ตกแต่ง Dashboard */
.avatar-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #f1c40f;
    object-fit: cover;
}

/* หน้าห้องเล่น (Grid) */
.game-modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* นาฬิกาทราย */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    /* พื้นหลังดำโปร่งแสง */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    /* ให้อยู่บนสุดเสมอ */
    backdrop-filter: blur(3px);
}

.spinner-container {
    text-align: center;
    color: #f1c40f;
    /* สีทอง */
}

.spinner-icon {
    font-size: 50px;
    margin-bottom: 15px;
    animation: hourglass-spin 2s linear infinite;
}

@keyframes hourglass-spin {
    0% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(180deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/*----- Classic lobby ----*/

.table-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid transparent;
    transition: 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.table-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

/* แบ่งสีตามระดับ */
.table-card.beginner {
    border-color: #2ecc71;
}

.table-card.intermediate {
    border-color: #3498db;
}

.table-card.expert {
    border-color: #e74c3c;
}

.table-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.blind-badge {
    background: #f1c40f;
    color: #000;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}

.btn-join {
    width: 100%;
    margin-top: 10px;
    background: #f1c40f;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.skew-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 20px;
    perspective: 1000px;
    height: 250px;
}

.skew-card {
    position: relative;
    width: 120px;
    height: 280px;
    background: #222;
    border: 2px solid #444;
    overflow: hidden;
    transform: skewX(-10deg);
    /* ทำให้การ์ดเฉียง */
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
}

/* แก้ไขเนื้อหาข้างในไม่ให้เฉียงตาม */
.skew-content {
    position: relative;
    z-index: 2;
    transform: skewX(10deg);
    /* เฉียงกลับในองศาที่เท่ากัน */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: white;
    text-align: center;
}

.mode-icon {
    font-size: 40px;
    margin-bottom: 15px;
    color: #f1c40f;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

.skew-card h3 {
    margin: 0;
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 1px;
}

.skew-card p {
    font-size: 12px;
    color: #aaa;
}

/* รูปพื้นหลังของการ์ด */
.card-bg-image {
    position: absolute;
    top: 0;
    left: -50%;
    /* เผื่อที่สำหรับตอนโดน skew */
    width: 200%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    transition: 0.5s;
    filter: grayscale(100%);
}

/* Hover Effect */
.skew-card:hover {
    width: 150px;
    /* ขยายความกว้าง */
    border-color: #f1c40f;
    box-shadow: 0 0 30px rgba(241, 196, 15, 0.3);
    z-index: 10;
}

.skew-card:hover .card-bg-image {
    opacity: 0.6;
    filter: grayscale(0%);
    transform: scale(1.1) skewX(0deg);
    /* ซูมรูปเล็กน้อยตอน hover */
}

/* สีขอบตามประเภทโหมด */
.skew-card.classic:hover {
    border-color: #2ecc71;
}

.skew-card.sng:hover {
    border-color: #3498db;
}

.skew-card.tournament:hover {
    border-color: #e67e22;
}

.skew-card.vip:hover {
    border-color: #f1c40f;
}

/* ปุ่มย้อนกลับทรงกลม */
.btn-back-circle1 {
    background: none;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-color: rgba(231, 231, 233, 0.2);
    width: 150px;
    height: 50px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
    align-content: center;
    text-align: center;
}

.btn-back-circle1:hover {
    background: rgba(231, 231, 233, 0.2);
    color: rgb(253, 186, 0);
    transform: translateY(-2px);
}

.btn-back-circle2 {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}

.btn-back-circle2:hover {
    background: none;
    color: #000;
    transform: translateX(5px);
}

/* แถบเลือกประเภทห้อง */
.room-categories {
    display: flex;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-radius: 50px;
    margin-bottom: 25px;
    border: 1px solid #333;
}

.cat-tab {
    background: transparent;
    border: none;
    color: #888;
    padding: 10px 20px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
}

.cat-tab.active {
    background: linear-gradient(to bottom, #f1c40f, #d4af37);
    color: #000;
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.3);
}

/* การ์ดห้องแบบแนวนอน (Horizontal Card) */
.room-horizontal-card {
    background: linear-gradient(90deg, #1e1e1e 0%, #2a2a2a 100%);
    border-left: 5px solid #f1c40f;
    margin-bottom: 12px;
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
}

.room-horizontal-card:hover {
    transform: scale(1.02);
    background: #333;
}

.room-main-info h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
}

.room-main-info span {
    color: #f1c40f;
    font-size: 14px;
    font-weight: bold;
}

.room-stats {
    text-align: right;
    color: #ccc;
    font-size: 14px;
}

.btn-play-now {
    background: #2ecc71;
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 15px;
}

.sub-lobby-page {
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-back-circle {
    background: rgba(255, 77, 77, 0.1);
    /* สีแดงจางๆ */
    border: 2px solid #ff4d4d;
    /* ขอบแดง */
    color: #ff4d4d;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    /* เปลี่ยนจากวงกลมเป็นทรงเหลี่ยมมนๆ เหมือนป้ายทางออก */
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
}

.btn-back-circle:hover {
    background: #ff4d4d;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 77, 77, 0.5);
    transform: translateX(-5px);
    /* เลื่อนซ้ายนิดนึงตอน hover ให้ดูเหมือนกำลังจะเดินออก */
}

/* SNG Card Style */
.sng-card {
    border-left: 5px solid #3498db !important;
}

.speed-badge {
    background: #e67e22;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    text-transform: uppercase;
}

/* Tournament Card Style */
.tourney-card {
    border-left: 5px solid #9b59b6 !important;
    background: linear-gradient(90deg, #2c1a33 0%, #2a2a2a 100%) !important;
}

.tourney-time {
    color: #f1c40f;
    font-weight: bold;
    font-size: 18px;
    padding-right: 20px;
    border-right: 1px solid #444;
    margin-right: 20px;
}

.prize-gtd {
    color: #2ecc71;
    font-weight: bold;
    font-size: 16px;
}

.status-tag {
    background: #444;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    display: inline-block;
    margin-bottom: 5px;
}

.poker-canvas {
    position: relative;
    width: 100%;
    height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

#player-seats-container {
    position: absolute;
    width: 50px;
    height: 50px;
    top: 0;
    left: 0;
    pointer-events: none;
    /* เพื่อให้คลิกทะลุไปที่โต๊ะได้ */
}

.btn-seat-opt {
    background: #222;
    border: 1px solid #444;
    color: #888;
    padding: 5px 15px;
    border-radius: 5px;
    margin: 0 5px;
    cursor: pointer;
    font-size: 13px;
    transition: 0.3s;
}

.btn-seat-opt.active {
    border-color: #f1c40f;
    color: #f1c40f;
    background: rgba(241, 196, 15, 0.1);
}

.seat-badge {
    background: #444;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.player-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.anim-card {
    position: absolute;
    font-size: 50px;
    color: white;
    z-index: 100;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

.dealer-button {
    position: absolute;
    right: -5px;
    top: -5px;
    background: white;
    color: black;
    border: 2px solid #333;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    line-height: 18px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* สไตล์พิเศษสำหรับที่นั่งที่เป็น P4U */
.p4u-active {
    border: 2px solid #f1c40f;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.4);
}

.p4u-name {
    color: #f1c40f !important;
    font-weight: bold;
}

.in-lobby-main{
    display: flex;
    justify-content: center;
}

/* กรอบลีดเดอร์บอร์ดหลัก */
.leaderboard-panel {
    display:flex;    
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #444;
    border-radius: 15px;
    padding: 15px;
    flex-direction: column;  
    text-align: left;  
    margin-top: 10px;
    margin-left: 5px;
    /* หรือกำหนดความสูงตามต้องการ */
    width: 250px;
    min-width: 250px;
}

.leaderboard-title {
    color: #f1c40f;
    text-align: center;
    font-size: 18px;
    margin-bottom: 15px;
    border-bottom: 2px solid #f1c40f;
    padding-bottom: 10px;
}

/* รายการแต่ละแถวใน Top 10 */
.leaderboard-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    color: #fff;
}

/* ตกแต่งตัวเลขลำดับ */
.leaderboard-item .rank {
    color: #f1c40f;
    font-weight: bold;
    width: 30px;
}

/* ตกแต่งจำนวนชิป */
.leaderboard-item .chips {
    color: #2ecc71;
    font-weight: bold;
}

/* ส่วนแสดงอันดับของเรา (กรณีอยู่ด้านล่าง) */
.my-rank-divider {
    color: #555;
    text-align: center;
    margin: 10px 0;
    font-size: 12px;
}

.leaderboard-item.my-rank {
    background: rgba(241, 196, 15, 0.3);
    border: 1px solid #f1c40f;
    border-radius: 8px;
    margin-top: 5px;
}

.game-selection {
    margin-left: 20px;
    justify-items: center;
    width: 100%;
}

.side-extras {
    display: flex;
    position: absolute;
    width: 10%;
    max-width: 10%;
    margin-left: 90%;
    margin-top: 10%;
    flex-direction: column; gap: 20px;
}

.game-room {
    display: flex;
    justify-items: center;
}

.lobby-box {
    background: rgba(8, 8, 8, 0.3);
    width: 100%;
    max-width: 800px !important;
}

.lobby-section {
    margin-top: 20px;
    text-align: left;
}

.lobby-section p {
    margin-bottom: 10px;
    font-weight: bold;
    color: #fff;
}

.option-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.level-btn,
.seat-btn {
    background: #333;
    border: 2px solid #444;
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.level-btn span {
    font-size: 0.7em;
    color: #aaa;
}

.level-btn.active,
.seat-btn.active {
    border-color: #ffca28;
    background: #443300;
}

.user-chips-info {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 5px;
    margin: 15px 0;
    color: #ffca28;
    font-weight: bold;
}


/* แถบบนสุด */
.top-nav {
    position: fixed;
    top: 40px;
    right: 20px;
    z-index: 1001;
}

/* ปุ่ม Hamburger */
.hamburger-menu {
    width: 35px;
    height: 25px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-menu span {
    display: block;
    height: 4px;
    width: 100%;
    background: #f1c40f;
    border-radius: 4px;
    transition: 0.3s;
}

/* เมนูที่ซ่อนอยู่ */
.side-menu {
    position: fixed;
    top: 0;
    right: -400px;
    /* ซ่อนไว้ทางขวา */
    width: 280px;
    height: 100%;
    background: #1a1a1a;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    transition: 0.4s ease;
    z-index: 1002;
    padding: 20px;
    border-left: 2px solid #f1c40f;
}

.side-menu.active {
    right: 0;
    /* เลื่อนออกมา */
}

/* สไตล์ภายในเมนู */
.menu-header {
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.menu-items {
    list-style: none;
    padding: 0;
}

.menu-items li {
    padding: 15px;
    color: #fff;
    cursor: pointer;
    transition: 0.3s;
    border-radius: 8px;
    margin-bottom: 5px;
}

.menu-items li:hover {
    background: rgba(241, 196, 15, 0.1);
    color: #f1c40f;
}

.menu-divider {
    height: 1px;
    background: #333;
    margin: 15px 0 !important;
}

.logout-item {
    color: #e74c3c !important;
    font-weight: bold;
}

.logout-item:hover {
    background: rgba(231, 76, 60, 0.1) !important;
}

.timer-container {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #222;
    /* พื้นหลังวงกลม */
}

.timer-bar {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    /* ใช้ conic-gradient เพื่อวาดวงกลมตามเปอร์เซ็นต์ */
    background: conic-gradient(#4caf50 100%, transparent 0);
    z-index: 1;
    transition: background 0.2s linear;
}



.seat {
    position: absolute;
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.336);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
}

/* คอนเทนเนอร์หลักของโต๊ะ */
.poker-table {
    width: 1000px; 
    height: 400px;
    
    /* ล็อกขนาดขั้นต่ำไว้ด้วย เพื่อป้องกัน Flexbox บีบ */
    min-width: 1000px;
    min-height: 400px;

    /* ป้องกันการบีบตัวเมื่ออยู่ใน Flex Container */
    flex-shrink: 0; 

    position: relative;
    margin: 0 auto; /* จัดกลางโต๊ะ */
    margin-top: 20px;
    background: url('/img/table-green.png') no-repeat center center;
    background-size: contain;
    /*border-radius: 300px; /* สำหรับโต๊ะวงรี */
}

/* สไตล์พื้นฐานของทุกที่นั่ง */
.seat-pos {
    position: absolute;
    width: 100px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* ปุ่ม "ว่าง" หรือ "นั่งที่นี่" ภายในที่นั่ง */
.seat-pos button {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid #555;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    font-size: 12px;
}

.seat-pos button:hover {
    background: #d4af37;
    color: black;
}

/* ข้อมูลผู้เล่นเมื่อมีคนนั่งแล้ว */

.player-info-container {
    text-align: center;
    background: none;
    border-radius: 10px;
    /*padding: 5px;*/
    width: 80px;
    margin-top: -30px;
    position: relative;
    z-index: 11;          /* อยู่เหนืออวาตาร์เล็กน้อย */
    color: white;
    text-shadow: 1px 1px 2px black;
}

.player-info-container .name {
    color: #fff;
    font-size: 15px;
    margin: 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-info-container .chips {
    color:rgba(255, 255, 255, 0.95);
    font-size: 10px;
    font-weight: bold;
}

/* ปรับตำแหน่งข้อมูลผู้เล่นบนโต๊ะให้นิ่ง */
.player-avatar {
    width: 60px;          /* ปรับขนาดกล่องตามความเหมาะสม */
    height: 60px;
    border: 3px solid rgba(5, 5, 5, 0.034);
    border-radius: 50%;
    overflow: hidden;     /* ✅ สำคัญ: ตัดส่วนที่ล้นวงกลมทิ้ง */
    background: #222;
    position: relative;
    z-index: 10;          /* ✅ ดันขึ้นมาอยู่ด้านบนสุด */
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ✅ เพิ่มส่วนนี้เพื่อล็อกขนาดรูปภาพข้างใน */
.player-avatar img {
    width: 100%;          /* บังคับกว้างเท่ากล่อง */
    height: 100%;         /* บังคับสูงเท่ากล่อง */
    object-fit: cover;    /* ยืดรูปให้เต็มโดยไม่เสียสัดส่วน */
    display: block;
}

.my-avatar-glow {
    box-shadow: 0 0 7px 5px rgba(255, 215, 0, 0.5); /* สีทองเรืองแสง */
    border: 3px solid #d6b703 !important;
    animation: glow-pulse 2s infinite;
}
/*
@keyframes glow-pulse {
    0% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 25px rgba(255, 215, 0, 1); }
    100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
}*/

/* 2. เอาเคอร์เซอร์รูปมือออก ให้เป็นลูกศรปกติ */
.poker-table, .chair, .player-avatar, .seat {
    cursor: default !important;
}

/* ปรับแต่งปุ่มนั่งให้ไม่มีรูปมือ (ถ้าต้องการ) */
.btn-sit {
    cursor: default;
}

/*
.player-info-container-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 15px;
}*/

/* --- พิกัด 9 ที่นั่ง --- */
#seat-0 {left: 47%; top: 79%;}
#seat-1 {left: 32%; top: 78%;}
#seat-2 {left: 20%; top: 55%;}
#seat-3 {left: 20%; top: 25%;}
#seat-4 {left: 32%; top: 2%;}
#seat-5 {left: 60%; top: 2%;}
#seat-6 {left: 72%; top: 25%;}
#seat-7 {left: 72%; top: 55%;}
#seat-8 {left: 60%; top: 78%;}

/* จัดการไพ่ในมือ */
.hole-cards {
    position: absolute;
    top: -40px;
    /* ให้ไพ่ลอยอยู่เหนือหัว */
    display: flex;
    justify-content: center;
    width: 100%;
}

.card-sprite {
    width: 40px;
    height: 60px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    margin: 0 -10px;
    /* ให้ไพ่เกยกันเล็กน้อย */
    background-color: white;
}

/* แผงปุ่มสั่งการด้านล่าง */
.action-panel {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    padding: 15px 25px;
    border-radius: 50px;
    border: 2px solid #d4af37;
    display: flex;
    gap: 15px;
    align-items: center;
    z-index: 100;
}

.action-panel button {
    padding: 10px 20px;
    border-radius: 20px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    color: white;
}

.btn-fold {
    background: #b22222;
}

.btn-call {
    background: #2e8b57;
}

.btn-raise {
    background: #d4af37;
    color: black !important;
}

.active-player {
    border: 3px solid #ffcc00;
    /* สีทอง */
    box-shadow: 0 0 15px #ffcc00;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.seat-container.active-player {
    border: 4px solid #ffcc00 !important;
    /* สีทอง */
    box-shadow: 0 0 20px #ffcc00, inset 0 0 10px #ffcc00;
    border-radius: 50%;
    z-index: 10;
    transition: all 0.3s ease-in-out;
}


/* กำหนดขนาดไพ่กองกลาง */
.community-card {
    width: 30px;
    /* ปรับขนาดความกว้างตามความเหมาะสมของโต๊ะ */
    height: 45px;
    margin: 0 -2px;
    margin-top: 200px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

/* จัดกึ่งกลางพื้นที่วางไพ่ */
#community-cards {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    min-height: 80px;
    /* พื้นที่จองไว้สำหรับวางไพ่ */
}

.card-community {
    width: 40px;
    height: 60px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    margin: 0 -10px;
    /* ให้ไพ่เกยกันเล็กน้อย */
    background-color: white;
}

/* แอนิเมชันตอนไพ่โผล่ออกมา (ถ้าต้องการ) */
.animate-card {
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* จัดการ Layout ของ Lobby */
.lobby-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.lobby-content {
    background: #1a1a1a;
    width: 90%;
    max-width: 800px;
    border: 2px solid #d4af37;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

/* การเลือกที่นั่งแบบ Dot */
.dot-selection-group {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.dot-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 18px;
    color: #fff;
    user-select: none;
}

.dot-container input {
    display: none;
}

.dot-checkmark {
    height: 20px;
    width: 20px;
    background-color: #333;
    border: 2px solid #555;
    border-radius: 50%;
    margin-right: 10px;
    display: inline-block;
    position: relative;
    transition: 0.3s;
}

.dot-container:hover .dot-checkmark {
    border-color: #00ff00;
}

.dot-container input:checked~.dot-checkmark {
    background-color: #00ff00;
    border-color: #00ff00;
    box-shadow: 0 0 10px #00ff00;
}

.dot-container input:checked~.dot-checkmark::after {
    content: "";
    position: absolute;
    top: 5px;
    left: 5px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
}

/* กล่องด้านนอกที่ทำหน้าที่เป็นหน้าต่างมอง */
.room-slider-container {
    width: 100%;
    overflow-x: auto;
    /* ต้องเปิด auto หรือ hidden เพื่อให้เลื่อนได้ */
    white-space: nowrap;
    /* ห้ามให้เนื้อหาภายในขึ้นบรรทัดใหม่ */
    cursor: grab;
    user-select: none;
    /* ป้องกันการลากคลุมตัวหนังสือขณะลากเมาส์ */

    /* ซ่อนแถบ Scrollbar เพื่อความสวยงาม */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.room-slider-container::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

/* กล่องด้านในที่เก็บการ์ดทั้งหมด */
.room-grid-horizontal {
    display: flex;
    /* จัดการ์ดเรียงแนวนอน */
    flex-wrap: nowrap;
    /* บังคับให้การ์ดเรียงต่อกันไปเรื่อยๆ ไม่ตัดบรรทัด */
    width: max-content;
    /* สำคัญมาก: ให้ความกว้างยืดตามจำนวนการ์ด */
    padding: 20px 50px;
    gap: 20px;
}

.room-card {
    flex: 0 0 auto;
    /* ป้องกันไม่ให้การ์ดถูกบีบขนาด (width จะคงที่เสมอ) */
    width: 250px;
    height: 350px;
    min-width: 220px;
    height: 300px;
    background: linear-gradient(145deg, #222, #111);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s;
    cursor: pointer;
    border: 1px solid #333;
}

/* เอฟเฟกต์เลื่อนซ้ายขวาเมื่อชี้ขอบ */
.room-card:hover {
    transform: scale(1.08) translateY(-10px);
    border-color: #00ff00;
    box-shadow: 0 15px 30px rgba(0, 255, 0, 0.2);
    z-index: 10;
}

/* เมื่อ Card โดน Hover ให้ Card ข้างๆ ขยับหนีเล็กน้อย */
.room-grid-horizontal:hover .room-card:not(:hover) {
    transform: scale(0.90);
    filter: brightness(0.5);
}

.btn-sit {
    position: absolute;
    background-color: transparent;
    border: none;
    margin-left: 10px;
    cursor: pointer;
}
.sit-here {
    width: 50px;
    background: none;
}

.chair {
    width: 80px;
    position: absolute;
}
.chair-0 {
    transform: rotate(180deg);
}
.chair-1 {
    transform: rotate(190deg);
}
.chair-2 {
    transform: rotate(-110deg);
}
.chair-3 {
    transform: rotate(-80deg);
}
.chair-4 {
    transform: rotate(-10deg);
}
.chair-5 {
    transform: rotate(10deg);
}
.chair-6 {
    transform: rotate(80deg);
}
.chair-7 {
    transform: rotate(110deg);
}
.chair-8 {
    transform: rotate(170deg);
}

.table-menu {
    display: flex;
    position: fixed;
    top: 100px;
    right: 80px;
    z-index: 1001;    
    flex-direction: column; gap: 5px;
}

.player-bet-container {
    position: absolute;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    padding: 2px 8px;
    z-index: 15;
    pointer-events: none; /* เพื่อไม่ให้ขวางการคลิกเก้าอี้ */
}

.bet-chip-icon {
    width: 20px;
    height: 20px;
    margin-right: 4px;
}

.bet-text {
    color: #f1c40f;
    font-weight: bold;
    font-size: 14px;
}

/* ปรับตำแหน่งเฉพาะจุดของแต่ละเก้าอี้ (ตัวอย่าง) */
.seat-0 .player-bet-container { left: 47%; top: 40%; }
.seat-1 .player-bet-container { left: 35%; top: 40%; }
.seat-2 .player-bet-container { left: 30%; top: 55%; }
.seat-3 .player-bet-container { left: 30%; top: 25%; }
.seat-4 .player-bet-container { left: 33%; top: 10%; }
.seat-5 .player-bet-container { left: 59%; top: 10%; }
.seat-6 .player-bet-container { left: 62%; top: 25%; }
.seat-7 .player-bet-container { left: 62%; top: 55%; }
.seat-8 .player-bet-container { left: 57%; top: 40%; }

.control-panel {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    padding: 15px;
    border-radius: 15px;
    border: 2px solid #f1c40f;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 100;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-action {
    padding: 10px 20px;
    font-weight: bold;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    color: white;
    min-width: 80px;
}

.fold { background: #c0392b; }
.check, .call { background: #27ae60; }
.raise { background: #2980b9; }
.allin { background: #e67e22; }

.bet-slider-container {
    width: 100%;
    text-align: center;
    color: #f1c40f;
}

#bet-slider { width: 250px; cursor: pointer; }

/* ตกแต่งปุ่มล่วงหน้า */
.advance-panel {
    border: 2px dashed #95a5a6; /* เปลี่ยนเป็นเส้นประเพื่อให้ดูต่างจาก Panel หลัก */
    background: rgba(0, 0, 0, 0.7);
}

.adv-btn input {
    display: none; /* ซ่อน checkbox จริง */
}

.adv-btn span {
    opacity: 0.5; /* ปกติจะดูจางๆ */
    filter: grayscale(0.5);
    transition: 0.3s;
}

/* เมื่อเลือก (Checked) ให้สว่างขึ้น */
.adv-btn input:checked + span {
    opacity: 1;
    filter: grayscale(0);
    box-shadow: 0 0 15px #f1c40f;
    border: 2px solid #fff;
}