* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    zoom: 100%;
    -moz-transform: scale(1);
    -webkit-transform: scale(1);
    transform: scale(1);
}

body {
    font-family: 'Kanit', sans-serif;
    width: 100%;
    height: 100vh;
    overflow: auto;
    background: #000;
    zoom: 100%;
    -moz-transform: scale(1);
    -webkit-transform: scale(1);
    transform: scale(1);
    transform-origin: 0 0;
}

/* Wrapper - กล่องหลักขนาดตายตัว 1920x1080 */
.wrapper {
    position: relative;
    width: 1920px;
    height: 1080px;
    margin: 0 auto;
    overflow: hidden;
    background: #000;
}

/* Background - z-index: 1 */
.background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/indexb.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    animation: backgroundFadeIn 1s ease-in;
}

@keyframes backgroundFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Main Container - z-index: 2 */
.main-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* Video Frame Container - z-index: 0 (อยู่หลัง background) */
.video-frame-container {
    position: absolute;
    top: 160px;
    left: 180px;
    width: 1300px;
    height: 650px;
    z-index: 0;
    pointer-events: none;
}

.video-black-box {
    position: relative;
    background: #000;
    border: 3px solid #222;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    width: 100%;
    height: 100%;
}

.video-black-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

/* ================================================================== */
/* ========== VIDEO CONTROLS (Layer แยก - z-index: 100) ========== */
/* ================================================================== */
.video-controls {
    position: absolute;
    bottom: 300px;
    /* ← ปรับตำแหน่งจากขอบล่าง */
    left: 600px;
    /* ← ปรับตำแหน่งจากขอบซ้าย */
    z-index: 100;
    pointer-events: auto;
}

/* กรอบ control-inner - ปรับขนาดได้ที่นี่ */
.control-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 300px;
    /* ← ปรับความกว้างกรอบ */
    height: 70px;
    /* ← ปรับความสูงกรอบ */
    padding: 10px 18px;
    background: transparent;
}

/* vdo.png อยู่หน้าปุ่ม (z-index: 10) */
.control-inner::before {
    content: '';
    position: absolute;
    top: -135px;
    left: -40px;
    width: 400px;
    /* ← ปรับความกว้างรูป */
    height: 350px;
    /* ← ปรับความสูงรูป */
    background: url('images/vdo.png') center/contain no-repeat;
    z-index: 10;
    /* ← อยู่หน้าปุ่ม */
    pointer-events: none;
}

.control-btn {
    width: 42px;
    height: 42px;
    background: linear-gradient(180deg, rgba(60, 45, 20, 0.9) 0%, rgba(35, 25, 10, 0.95) 100%);
    border: 2px solid #b8860b;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1;
    /* ← อยู่หลังรูป vdo.png */
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 215, 0, 0.3);
}

.control-btn:hover {
    background: linear-gradient(180deg, rgba(80, 60, 25, 0.95) 0%, rgba(50, 35, 15, 0.95) 100%);
    border-color: #ffd700;
    transform: scale(1.1);
    box-shadow:
        0 0 20px rgba(255, 215, 0, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 215, 0, 0.4);
}

.control-btn:active {
    transform: scale(1.05);
}

.control-btn.active {
    border-color: #32cd32;
    box-shadow:
        0 0 15px rgba(50, 205, 50, 0.5),
        0 2px 8px rgba(0, 0, 0, 0.4);
}

.control-icon {
    font-size: 18px;
    line-height: 1;
    user-select: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.volume-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 8px;
    border-left: 1px solid rgba(184, 134, 11, 0.4);
    z-index: 1;
    /* ← อยู่หลังรูป vdo.png */
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 6px;
    background: linear-gradient(90deg, #3d2b0f 0%, #5a4015 100%);
    border-radius: 3px;
    cursor: pointer;
    border: 1px solid rgba(184, 134, 11, 0.5);
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(180deg, #ffd700 0%, #b8860b 50%, #8b6914 100%);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffd700;
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.4),
        0 0 10px rgba(255, 215, 0, 0.4);
    transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(255, 215, 0, 0.6);
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(180deg, #ffd700 0%, #b8860b 50%, #8b6914 100%);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffd700;
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.4),
        0 0 10px rgba(255, 215, 0, 0.4);
}

.volume-label {
    font-size: 12px;
    font-weight: 500;
    color: #ffd700;
    min-width: 35px;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* ================================================================== */
/* ========== BUTTON CONTAINER (Layer แยก - z-index: 10) ========== */
/* ================================================================== */
.button-container {
    position: absolute;
    bottom: 100px;
    left: 220px;
    display: flex;
    gap: 30px;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    animation: slideUp 0.8s ease-out 0.3s backwards;
    z-index: 10;
    pointer-events: auto;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-button {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    text-decoration: none;
    width: auto;
    height: 85px;
}

.game-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 30%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: -1;
}

.game-button:hover::before {
    width: 130%;
    height: 130%;
}

.game-button:hover {
    transform: translateY(-4px) scale(1.05);
    filter: drop-shadow(0 8px 16px rgba(255, 215, 0, 0.4)) brightness(1.08);
}

.game-button:active {
    transform: translateY(-2px) scale(1.02);
    transition: all 0.1s ease;
}

.game-button img {
    height: 85px;
    width: auto;
    display: block;
    transition: all 0.3s ease;
}

.game-button:hover img {
    filter: brightness(1.1) saturate(1.1);
}

@keyframes buttonGlow {

    0%,
    100% {
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    }

    50% {
        filter: drop-shadow(0 4px 12px rgba(255, 215, 0, 0.3));
    }
}

.game-button {
    animation: buttonGlow 4s ease-in-out infinite;
}

.game-button:hover {
    animation: none;
}

/* Loading Overlay - z-index: 9999 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 215, 0, 0.2);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Individual Button Sizes */
#downloadBtn img {
    height: 85px;
}

#enterBtn img {
    height: 85px;
}

#registerBtn img {
    height: 85px;
}