.container {
    width: 100% !important;
    max-width: 800px !important;
    max-height: 600px !important;
    height: 100vh; /* ปรับสูงสุดตามหน้าจอ; แก้เป็น px ได้ */
    transform-style: preserve-3d;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    margin-inline: auto;
    padding: 16px;
    gap: 16px;
}

.speaker-cards {
    position: relative;
    width: 100%;
    height: 100%;
    margin-bottom: 8px;
}

.speaker-card {
    position: absolute;
    width: 60%;
    height: 100%;
    left: 0;
    right: 0;
    margin: auto;
    transition:
        transform 0.4s ease,
        opacity 0.4s ease,
        z-index 0.4s ease;
    cursor: pointer;
    will-change: transform, opacity;
}

.speaker-card img {
    width: 100%;
    height: 100% !important;
    border-radius: 20px !important;
    object-fit: cover;
    aspect-ratio: 500 / 750;
    display: block;
    background-color: #141414;
    border: 1px solid #aff467 !important;
}

/* สถานะหลัก 5 ใบ */
.speaker-card.prev2 {
    transform: translateX(-100%) scale(0.8);
    filter: grayscale(100%);
    opacity: 0.6;
    z-index: 0;
    width: 230px;
    left: -95%;
}
.speaker-card.prev1 {
    transform: translateX(-60%) scale(0.9);
    filter: grayscale(100%);
    z-index: 1;
}
.speaker-card.active {
    transform: translateX(0) scale(1);
    opacity: 1;
    z-index: 2;
}
.speaker-card.active img {
    box-shadow: 0 0 5px 3px #aff467;
    border: 7px solid #aff467 !important;
    background-image: url('../images/specker-bg.png');
}
.speaker-card.next1 {
    transform: translateX(60%) scale(0.9);
    filter: grayscale(100%);
    z-index: 1;
}
.speaker-card.next2 {
    transform: translateX(100%) scale(0.8);
    filter: grayscale(100%);
    opacity: 0.6;
    z-index: 0;
    width: 230px;
    right: -95%;
}

/* ใบที่ไม่ใช่ 5 ใบหลัก – ซ่อนไว้ให้ลื่นไหล */
.speaker-card.hidden-left {
    transform: translateX(-80%) scale(0.6);
    opacity: 0;
    z-index: -1;
    pointer-events: none;
}
.speaker-card.hidden-right {
    transform: translateX(80%) scale(0.6);
    opacity: 0;
    z-index: -1;
    pointer-events: none;
}
.speaker-selection {
    margin-top: 20px;
    width: -webkit-fill-available;
    justify-items: center;
}
.speaker-selection-container {
    text-align: center;
    width: fit-content;
    padding: 0 30px;
    border-left: 10px solid #a9eb63;
    border-right: 10px solid #a9eb63;
}
#speakerSelectionTitle {
    font-size: 36px;
    font-weight: 700;
    color: #a9eb63;
	line-height: 1.5;
}
#speakerSelectionPosition {
    font-size: 36px;
    font-weight: 500;
    line-height: 1.5;
    color: white;
}
.speaker-content {
    margin-top: 30px;
    width: -webkit-fill-available;
}
.speaker-container {
    padding: 20px 30px;
    margin: 50px 98px;
    border: 3px solid #aff467;
    border-radius: 20px;
    box-shadow: 0 0 7px 4px #aff467;
    text-align: center;
	color: white;
}
.speaker-title {
    font-size: 20px;
    font-weight: bold;
}

@media screen and (max-width: 767px) {
    .container {
        max-height: 400px !important;
    }
    #speakerSelectionTitle {
        font-size: 24px;
    }
    #speakerSelectionPosition {
        font-size: 24px;
    }
    .speaker-container {
        padding: 15px 15px;
        margin: 15px 10px;
    }
	.speaker-card.active img {
        background-size: cover;
        background-position: center center;
        background-repeat: no-repeat;
    }
}
