/* css/queue.css (Updated for Vertical Posters) */

:root {
    --light-blue: #00b4d8;
    --dark-blue: #03045e;
    --neon-blue: #90e0ef;
    --black-bg: #000814;
    --glass: rgba(255, 255, 255, 0.03);
    --card-bg: rgba(255, 255, 255, 0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--black-bg);
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Background Effects */
.neon-sphere, .neon-sphere-2 {
    position: fixed;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 180, 216, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    filter: blur(100px);
    z-index: -1;
}
.neon-sphere { top: -10%; left: -10%; }
.neon-sphere-2 { bottom: -10%; right: -10%; }

.back-home {
    position: absolute;
    top: 20px;
    left: 20px;
    color: var(--neon-blue);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 2px;
    opacity: 0.6;
    transition: 0.3s;
    z-index: 10;
}
.back-home:hover { opacity: 1; text-shadow: 0 0 10px var(--neon-blue); }

/* --- Container Style --- */
.container {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    
    /* แก้ตรงนี้! ขยายให้เกือบเต็มจอ */
    max-width: 95%;  /* ของเดิม 900px */
    
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
    margin-top: 40px;
}

.header-box { text-align: center; margin-bottom: 2rem; }
.tagline { color: var(--light-blue); letter-spacing: 3px; font-size: 0.7rem; margin-bottom: 10px; }
/* --- แก้ไขส่วน Title ให้ไม่ล้นจอ --- */
.title { 
    font-family: 'Orbitron', sans-serif;
    
    /* 1. ปรับขนาดขั้นต่ำให้เล็กลงนิดนึง (จาก 2rem -> 1.8rem) เพื่อให้พอดีจอมือถือเล็กๆ */
    font-size: clamp(1.8rem, 6vw, 2.5rem); 
    
    font-weight: 900;
    letter-spacing: 2px;
    
    background: linear-gradient(to bottom, #fff, var(--light-blue));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    
    /* 2. หัวใจสำคัญ: สั่งให้ตัดบรรทัดเมื่อที่เต็ม */
    display: flex;
    flex-wrap: wrap;         /* อนุญาตให้คำตกบรรทัดได้ */
    justify-content: center; /* จัดให้อยู่กึ่งกลางเสมอ */
    align-items: center;
    gap: 8px;                /* เว้นระยะห่างระหว่าง QUEUE กับ .SYSTEM */
    line-height: 1.2;
    width: 100%;             /* บังคับความกว้างเต็มพื้นที่ */
}
.title span { 
    background: none;
    -webkit-text-fill-color: var(--neon-blue);
    color: var(--neon-blue); 
    opacity: 1;
    text-shadow: 0 0 15px rgba(144, 224, 239, 0.6);
    
    /* 3. สั่งห้ามตัดคำว่า .SYSTEM ขาดออกจากกัน */
    white-space: nowrap; 
}

/* --- Input Section --- */
.input-section { margin-bottom: 2rem; }
.section-label { 
    display: block; 
    margin-bottom: 15px; 
    font-size: 0.8rem; 
    letter-spacing: 2px; 
    color: var(--light-blue);
    font-weight: bold;
    border-bottom: 1px solid rgba(0, 180, 216, 0.3);
    padding-bottom: 5px;
}

.name-input {
    width: 100%;
    padding: 15px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: 0.3s;
}
.name-input:focus {
    outline: none;
    border-color: var(--light-blue);
    box-shadow: 0 0 15px rgba(0, 180, 216, 0.2);
}

/* --- Game Grid System (ปรับจูนใหม่สำหรับ Poster แนวตั้ง) --- */
.game-grid {
    display: grid;
    /* Mobile: โชว์ทีละ 1-2 รูปเหมือนเดิม */
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); 
    gap: 15px;
}

/* Desktop: ปรับ minmax ให้เล็กลงหน่อย (160px) เพื่อให้เรียงได้ 3-4 รูป ไม่ใหญ่เกินไป */
@media (min-width: 600px) {
    .game-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

/* Desktop: เมื่อจอใหญ่กว่า 1024px (จอคอมทั่วไป) ให้บังคับเรียง 5 ช่อง */
@media (min-width: 1024px) {
    .game-grid {
        /* บังคับแบ่งเป็น 5 คอลัมน์เท่ากันเป๊ะๆ */
        grid-template-columns: repeat(5, 1fr); 
        gap: 20px; /* เพิ่มช่องว่างระหว่างรูปนิดนึง */
    }
}

/* Radio Button Styling */
.game-card { cursor: pointer; position: relative; }
.game-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.card-content {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* --- แก้ไขรูปภาพให้เป็นแนวตั้ง A4/Poster --- */
.card-content img {
    width: 100%;
    height: auto; /* ปล่อยให้สูงตามสัดส่วน */
    
    /* สัดส่วนแนวตั้ง (เลือกอันใดอันหนึ่ง) */
    aspect-ratio: 2 / 3; /* สัดส่วน Poster หนังมาตรฐาน (แนะนำ ⭐) */
    /* aspect-ratio: 210 / 297;  <-- ถ้าอยากได้ A4 เป๊ะๆ ใช้บรรทัดนี้แทน */

    object-fit: cover; /* ครอบรูปให้เต็มพื้นที่โดยไม่เบี้ยว */
    transition: 0.3s;
    opacity: 0.7;
}

.game-info {
    padding: 15px;
    text-align: center;
}

.game-info h3 { font-size: 0.9rem; margin-bottom: 5px; color: white; }
.game-info span { font-size: 0.7rem; color: #888; text-transform: uppercase; letter-spacing: 1px; }

/* Interaction States */
.game-card:hover .card-content {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px); /* ขยับขึ้นเยอะหน่อยให้ดูเด้ง */
}
.game-card:hover img { opacity: 1; }

/* ✅ STATE: CHECKED */
.game-card input[type="radio"]:checked + .card-content {
    border-color: var(--neon-blue);
    background: rgba(0, 180, 216, 0.1);
    box-shadow: 0 0 25px rgba(0, 180, 216, 0.5); /* เพิ่มเงาให้ฟุ้งขึ้น */
    transform: scale(1.03); /* ขยายขึ้นอีกนิด */
}

.game-card input[type="radio"]:checked + .card-content img {
    opacity: 1;
}

.game-card input[type="radio"]:checked + .card-content .game-info h3 {
    color: var(--neon-blue);
    text-shadow: 0 0 10px rgba(0, 180, 216, 0.8);
}

/* --- Submit Button --- */
button {
    width: 100%;
    padding: 20px;
    margin-top: 2rem;
    background: #ffffff;
    border: none;
    color: #000;
    border-radius: 12px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.4s;
    position: relative;
    overflow: hidden;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(144, 224, 239, 0.6);
}

.btn-glow {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--light-blue);
    filter: blur(20px);
    z-index: -1;
    opacity: 0;
    transition: 0.4s;
}
button:hover .btn-glow { opacity: 0.6; }

button:disabled { opacity: 0.5; cursor: wait; }

#status { 
    text-align: center; 
    margin-top: 1.5rem; 
    font-size: 0.9rem;
    font-weight: bold;
    min-height: 24px;
}