@media (max-width: 600px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (max-width: 600px) {
    .slot-machine-container:not(.slot-machine-main) {
        display: none !important;
    }
}

@media (max-width: 600px) {
    .slot-machines-wrapper {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 4px;
        margin-top: 0;
        align-items: stretch;
    }

    .slot-machine-container {
        width: 98vw;
        min-width: unset;
        max-width: 100vw;
        padding: 0 1vw 1vw 1vw;
        background: rgba(255, 255, 255, 0.93);
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
        margin-bottom: 1vw;
        height: calc(68px * 9 + 40px) !important;
    }

    .slot-row {
        font-size: 0.98em;
        height: 34px;
        margin: 1.5px 0 0 0;
        padding-left: 3px;
        padding-right: 3px;
        border-radius: 7px;
        background: linear-gradient(90deg, #fff 0%, #f7f7f7 100%);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
        border: 1px solid #f0f0f0;
    }

    .spin-button-container {
        margin-top: 4px;
        margin-bottom: 4px;
    }

    .spin-button {
        width: 60px;
        height: 60px;
        font-size: 1em;
        border-width: 2px;
        padding: 0;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.13), 0 0 0 3px #fff3 inset;
        background: linear-gradient(135deg, #ED1C24 0%, #720407 100%);
        transition: background 0.2s, box-shadow 0.2s;
            margin-left: 19px !important;

    }

    .spin-button:disabled {
        background: linear-gradient(90deg, #ED1C24 0%, #B61F24 100%);
        opacity: 0.7;
    }

    .header-title {
        font-size: 1em;
        padding: 4px 1vw 4px 13vw;
        margin-top: 2px;
        margin-bottom: 2px;
        gap: 1vw;
        border-radius: 8px;

        min-height: 40px;
        align-items: center;
    }

    .header-logo-left {
        position: static;
        display: block;
        margin: 0 auto 0 auto;
        width: 38vw !important;
        min-width: 70px !important;
        max-width: 120px !important;
        height: auto;
        z-index: 2;
    }

    .header-title {
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        padding-left: 0;
        margin-right: -238px;
    }

    .modal-content {
        padding: 8px 2vw 12px 2vw;
        border-radius: 10px;
        width: 98vw;
        max-width: 99vw;
        font-size: 0.98em;
        background: #fff;
        box-shadow: 0 2px 16px rgba(0, 0, 0, 0.13);
    }

    .modal-content h2 {
        font-size: 1.1em;
        margin-top: 24px;
        margin-bottom: 8px;
    }

    .modal-content p {
        font-size: 1em;
        margin: 8px 0;
    }

    .modal-content .prize {
        animation: prizeFlash 1.2s cubic-bezier(.36, .07, .19, .97) both;
        color: #e53935;
        font-size: 3.2em;
        font-weight: bold;
        text-shadow: 0 0 16px #ffd700, 0 0 8px #e53935;
    }

    .close-button {
        font-size: 1.3em;
        top: 6px;
        right: 8px;
        color: #888;
    }

    .text-input,
    .prize-textarea,
    .action-button,
    input[type="file"] {
        font-size: 1em;
        padding: 8px 8px;
        width: 95vw;
        max-width: 99vw;
        margin: 6px auto;
        border-radius: 8px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
        border: 1px solid #e0e0e0;
        background: #fafbfc;
    }

    .action-button {
        background: linear-gradient(90deg, #2196f3 0%, #21cbf3 100%);
        color: #fff;
        font-weight: 600;
        box-shadow: 0 2px 8px rgba(33, 150, 243, 0.10);
        border: none;
    }

    .action-button:disabled {
        background: #cccccc;
        color: #fff;
        opacity: 0.7;
    }

    .input-label {
        font-size: 1em;
        margin-bottom: 2px;
        color: #333;
        font-weight: 600;
    }
}

@media (max-width: 600px) {
    .slot-machine-container .slot-row {
        display: block;
    }

    .slot-machine-container .slot-row:nth-child(n+11) {
        display: none !important;
    }
}

/* ใช้ Minion Variable Concept เฉพาะภาษาอังกฤษ */
.en,
.en * {
    font-family: 'Minion Variable Concept', serif !important;
}

/* โลโก้ซ้ายสุดใน header */
.header-title {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.header-logo-left {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 14%;
    min-width: 60px;
    max-width: 120px;
    height: auto;
}

.header-title .title-text {
    margin: 0 auto;
    display: block;
}

body {

    font-family: 'Minion Variable Concept', sans-serif, 'Noto Sans Lao', sans-serif;
    text-align: center;
    background:
        url('./img/bg33.jpg') no-repeat center top;
    background-size: cover;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;

}

/* Header Styles - Unchanged */
.header-title {
    color: #0d47a1;
    font-family: 'Minion Variable Concept', 'Noto Sans Lao', sans-serif;
    font-size: 3.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 40px;
    padding: 10px 25px;
    border-radius: 15px;
    max-width: 100%;
    width: 90%;

}

.header-logo {
    height: 2.8em;
    width: auto;
    filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.4));
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.08) rotate(7deg);
}

.header-title .title-text {
    font-weight: 700;
    letter-spacing: 2px;
    color: #ED1C24;
    /* ขอบขาวและเงาแดง */
    text-shadow:
        -2px -2px 0 #fff,
        2px -2px 0 #fff,
        -2px 2px 0 #fff,
        2px 2px 0 #fff,
        0 0 6px #fff,
        0 2px 6px #d00,
        1px 1px 2px #d00;
}

.emojis {
    font-size: 1.2em;
}

/* NEW: Wrapper for multiple slot machines to sit side-by-side */
.slot-machines-wrapper {
    display: flex;
    /* Use flexbox */
    justify-content: center;
    /* Center the machines */
    align-items: flex-start;
    /* Align them to the top if heights vary, or 'center' */
    gap: 30px;
    /* Space between the two slot machines */
    flex-wrap: wrap;
    /* Allow wrapping on smaller screens */
    margin-bottom: 30px;
    /* Space below the machines */
}

/* Slot Machine Container - Adjusted for 9 slots each */
.slot-machine-container {
    position: relative;
    width: 300px;
    /* Width of each slot machine body */
    height: calc(218px * 9 + 40px);
    /* Height for 9 slots (9 * 80px + 40px padding) */

    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.slot-row {
    height: 70px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgb(0, 0, 0);
    font-size: 1.2em;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
    transition: background-color 0.3s ease;
    margin: 5px;
    border-radius: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-left: 8px;
    padding-right: 8px;
}

.slot-row:last-child {
    border-bottom: none;
}

/* Specific colors for slot rows - repeated for visual variety */
.blue {
    background-color: #4fc3f7;
}

/* Light Blue */
.red {
    background-color: #ee4a47;
}

/* Red */
.green {
    background-color: #66bb6a;
}

/* Green */
.orange {
    background-color: #ff9800;
}

/* Orange */
.purple {
    background-color: #ab47bc;
}

/* Purple */
.teal {
    background-color: #009688;
}

/* Teal */
.pink {
    background-color: #e91e63;
}

/* Pink */
.indigo {
    background-color: #3f51b5;
}

/* Indigo */
.brown {
    background-color: #795548;
}

/* Brown */


/* SPIN Button - positioned relative to its parent .slot-machine-container */
/* SPIN Button - now static for flexbox alignment */
.spin-button {
    position: static;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: #ff001e;
    color: white;
    font-family: 'Kanit', sans-serif, 'Noto Sans Lao', sans-serif;
    font-size: 2.2em;
    font-weight: 700;
    border: 5px solid #fc3232;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3), inset 0 0 15px rgba(255, 255, 255, 0.4);
    cursor: pointer;
    /* transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease; */
    z-index: 5;
    /* Ensure it's above the slots */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    transform: translate(-3%, -50%) scale(1);
    margin-left: 19px !important;
}

.spin-button:hover {
    background-color: #ff8f00;
    transform: translate(-3%, -50%) scale(1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(255, 255, 255, 0.6);
}

.spin-button:active {
    transform: translate(-3%, -50%) scale(0.98);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2), inset 0 0 10px rgba(255, 255, 255, 0.2);
}

.spin-button:disabled {
    background: linear-gradient(90deg, #ED1C24 0%, #B61F24 100%);
    border-color: #fc3535;
    cursor: not-allowed;
    transform: translate(-3%, -50%) scale(1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2), inset 0 0 10px rgba(255, 255, 255, 0.2);
    text-shadow: none;
}


/* Input Area - Unchanged */
.input-label {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 5px;
    display: block;
    font-weight: bold;
}

.prize-textarea {
    width: 80%;
    max-width: 500px;
    height: 100px;
    margin: 10px auto 20px auto;
    font-family: 'Kanit', sans-serif, 'Noto Sans Lao', sans-serif;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #ccc;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    resize: vertical;
    font-size: 1.1em;
}

.action-button {
    padding: 12px 25px;
    background-color: #4caf50;
    color: white;
    font-size: 1.2em;
    font-family: 'Kanit', sans-serif, 'Noto Sans Lao', sans-serif;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin: 10px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.action-button:hover {
    background-color: #4caf50;
    transform: translateY(-2px);
}

.action-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


/* Modal (Popup) Styles - Unchanged */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fefefe;
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    width: 90%;
    max-width: 550px;
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    position: relative;
    font-family: 'Kanit', sans-serif;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-content h2 {
    color: #d84315;
    margin-top: 150px;
    font-size: 2.5em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    font-family: 'Noto Sans Lao', sans-serif;
}

.modal-content p {
    font-size: 1.8em;
    margin: 20px 0;
    color: #333;
    font-weight: 500;
}

.modal-content .prize {
    color: #e65100;
    font-size: 1.5em !important;
    display: block;
    margin-top: 15px;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
    text-align: center;
    animation: prizeFlash 1.2s cubic-bezier(.36, .07, .19, .97) both;
    color: #e53935;
  
    font-family: 'Minion Variable Concept', sans-serif, 'Noto Sans Lao', sans-serif;
    font-weight: bold;
    text-shadow: 0 0 16px #ffd700, 0 0 8px #e53935;
}

@media (max-width: 600px) {
    .modal-content .prize {
        font-size: 1.3em;
    }
}

/* ลดขนาดฟอนต์อัตโนมัติเมื่อข้อความยาวมาก */
.modal-content .prize {
    font-size: clamp(1.2em, 6vw, 2.5em);
}

.close-button {
    color: #9e9e9e;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
}

.close-button:hover,
.close-button:focus {
    color: #333;
    transform: rotate(90deg);
}

/* ... (existing CSS code) ... */

/* Adjusting the file input appearance */
input[type="file"] {
    /* Style it like a button */
    padding: 12px 25px;
    background-color: #4CAF50;
    /* A different color for file upload */
    color: white;
    font-size: 1.2em;
    font-family: 'Kanit', sans-serif;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    /* Make it look like a button */
    display: inline-block;
    /* Or block, based on layout preference */
    text-align: center;
    vertical-align: middle;
    -webkit-appearance: none;
    /* Remove default styling for some browsers */
    -moz-appearance: none;
    appearance: none;
}

input[type="file"]::-webkit-file-upload-button {
    visibility: hidden;
    /* Hide default button in Webkit browsers */
}

input[type="file"]::before {
    content: 'เลือกไฟล์ Excel';
    /* Custom text for the button */
    display: inline-block;
    background: #4CAF50;
    color: white;
    border-radius: 8px;
    padding: 10px 20px;
    outline: none;
    white-space: nowrap;
    -webkit-user-select: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1em;
    font-family: 'Kanit', sans-serif, 'Noto Sans Lao', sans-serif;
    transition: background-color 0.3s ease;
}

input[type="file"]:hover::before {
    background-color: #45a049;
}

input[type="file"]:active::before {
    background-color: #3e8e41;
}

input[type="file"]:disabled::before {
    background-color: #cccccc;
    cursor: not-allowed;
}

.action-button {
    padding: 12px 25px;
    background-color: #2196f3;
    /* Blue for action buttons */
    color: white;
    font-size: 1.2em;
    font-family: 'Kanit', sans-serif, 'Noto Sans Lao', sans-serif;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin: 10px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.action-button:hover {
    background-color: #1976d2;
    /* Darker blue on hover */
    transform: translateY(-2px);
}

.action-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.text-input {
    width: 80%;
    max-width: 500px;
    margin: 10px auto;
    font-family: 'Kanit', sans-serif, 'Noto Sans Lao', sans-serif;
    padding: 12px 15px;
    border-radius: 10px;
    border: 2px solid #ccc;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    font-size: 1.1em;
    display: block;
    /* Make it a block element to take full width and add margins */
}

.text-input:focus {
    border-color: #2196f3;
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 5px rgba(33, 150, 243, 0.5);
}

/* Ensure the wrapper handles responsiveness */
@media (max-width: 1000px) {
    .slot-machines-wrapper {
        flex-direction: column;
        /* Stack them vertically on smaller screens */
        align-items: center;
        /* Center them when stacked */
    }
}