        * {
            font-family: "Be Vietnam Pro", Arial, sans-serif;
            box-sizing: border-box;
        }

        body {
            background: linear-gradient(135deg, #fef7cd 0%, #fef3c7 50%, #fde68a 100%);
            min-height: 100vh;
            margin: 0;
            padding: 0;
            overflow: hidden;
        }

        .main-container {
            height: 100vh;
            display: grid;
            grid-template-rows: auto 1fr auto;
            gap: 16px;
            padding: 12px;
        }

        /* Header Section - Optimized for kiosk */
        .header-section {
            position: relative;
            height: 120px;
            border-radius: 20px;
            overflow: hidden;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
            background-color: #7d2112;
        }

        .header-title {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: #f4d843;
            font-size: 28px;
            font-weight: 800;
            text-align: center;
            text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
            max-width: 95%;
            white-space: nowrap;
            line-height: 1.1;
        }

        /* Seating Section - Main focus area */
        .seating-section {
            background: white;
            border-radius: 25px;
            padding: 24px;
            box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
            border: 3px solid #f3f4f6;
            display: flex;
            flex-direction: column;
            min-height: 0;
        }

        .seatmap-frame {
            display: grid;
            grid-template-rows: auto 1fr auto;
            gap: 16px;
            height: 100%;
            min-height: 0;
        }

        .stage {
            background: linear-gradient(135deg, #fee2e2, #fecaca);
            color: #b91c1c;
            border: 3px dashed #f87171;
            border-radius: 15px;
            padding: 16px;
            text-align: center;
            font-weight: 800;
            font-size: 22px;
            letter-spacing: 1px;
            text-transform: uppercase;
            box-shadow: 0 4px 16px rgba(248, 113, 113, 0.2);
        }

        /* Seat Grid - Optimized for kiosk viewing */
        .seat-grid-container {
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 0;
            flex: 1;
        }

        .seat-grid {
            display: grid;
            grid-template-columns: repeat(13, 1fr);
            /* 12 seats + 1 aisle */
            gap: 8px;
            padding: 20px;
            background: #f8fafc;
            border-radius: 20px;
            border: 2px solid #e2e8f0;
            width: 100%;
            max-width: 900px;
            aspect-ratio: 4/3;
        }

        .seat {
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 12px;
            background: linear-gradient(145deg, #ffffff, #f1f5f9);
            border: 2px solid #cbd5e1;
            font-weight: 700;
            font-size: 16px;
            cursor: pointer;
            transition: all 0.3s ease;
            aspect-ratio: 1;
            min-height: 45px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .seat:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
        }

        .seat.vip {
            background: linear-gradient(145deg, #fff7ed, #fed7aa);
            border-color: #f59e0b;
            color: #92400e;
            font-weight: 800;
        }

        .seat.reserved {
            background: linear-gradient(145deg, #fee2e2, #fca5a5);
            border-color: #ef4444;
            color: #991b1b;
            font-weight: 800;
        }

        .seat.selected {
            background: linear-gradient(145deg, #dcfce7, #86efac);
            border-color: #22c55e;
            color: #166534;
            box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
            transform: scale(1.05);
        }

        .aisle {
            background: transparent;
            border: none;
            pointer-events: none;
        }

        /* Legend - Enhanced for kiosk */
        .legend {
            display: flex;
            gap: 24px;
            flex-wrap: wrap;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            font-weight: 600;
            padding: 16px;
            background: #f8fafc;
            border-radius: 15px;
            border: 2px solid #e2e8f0;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .legend .dot {
            width: 20px;
            height: 20px;
            border-radius: 8px;
            border: 2px solid #cbd5e1;
            background: linear-gradient(145deg, #ffffff, #f1f5f9);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        .legend .vip {
            background: linear-gradient(145deg, #fff7ed, #fed7aa);
            border-color: #f59e0b;
        }

        .legend .reserved {
            background: linear-gradient(145deg, #fee2e2, #fca5a5);
            border-color: #ef4444;
        }

        .legend .selected {
            background: linear-gradient(145deg, #dcfce7, #86efac);
            border-color: #22c55e;
        }

        /* Delegate Section - Bottom info panel */
        .delegate-section {
            height: 280px;
            display: flex;
            flex-direction: column;
        }

        .delegate-card {
            background: white;
            border-radius: 25px;
            padding: 0;
            box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
            position: relative;
            overflow: hidden;
            height: 100%;
            border: 3px solid #f3f4f6;
        }

        .delegate-bg {
            position: relative;
            width: 100%;
            height: 100%;
        }

        .delegate-bg img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 22px;
        }

        .delegate-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: center;
            padding: 16px 20px;
            background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5));
            backdrop-filter: blur(2px);
        }

        .welcome-text {
            font-size: 30px;
            font-weight: 800;
            color: #ffd700;
            text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
            text-align: center;
            letter-spacing: 1px;
            margin-top: 24px;
        }

        .delegate-info {
            text-align: center;
        }

        .delegate-name {
            font-size: 40px;
            font-weight: 800;
            margin-bottom: 8px;
            color: #ffd700;
            text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
        }

        .delegate-role {
            font-size: 30px;
            font-weight: 600;
            color: #ffffff;
            margin-bottom: 8px;
            text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
        }

        .delegate-seat {
            font-size: 32px;
            font-weight: 600;
            color: #ffffff;
            background: rgba(255, 215, 0, 0.2);
            padding: 8px 16px;
            border-radius: 12px;
            border: 2px solid rgba(255, 215, 0, 0.4);
        }

        .event-text {
            font-size: 30px;
            font-weight: 500;
            color: #ffffff;
            text-align: center;
            max-width: 90%;
            line-height: 1.4;
            text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
            margin-bottom: 24px;
        }

        .flex-layout {
            display: flex;
            flex-direction: column;
        }

        .flex-layout .seating-section {
            flex-grow: 1;
        }

        .mute-toggle {
            display: flex;
            align-items: center;
            font-size: 20px;
        }

        .mute-toggle input {
            margin-right: 8px;
            width: 24px;
            height: 24px;
        }

        /* LANDSCAPE OPTIMIZATIONS - Cải thiện cho màn hình ngang */
        @media (orientation: landscape) {
            .main-container {
                grid-template-columns: 2fr 1fr;
                grid-template-rows: auto 1fr;
                grid-template-areas:
                    "header header"
                    "seating delegate";
                gap: 20px;
                padding: 16px;
            }

            .header-section {
                grid-area: header;
                height: 90px;
            }

            .header-title {
                font-size: 22px;
                padding: 0 20px;
            }

            .seating-section {
                grid-area: seating;
                padding: 20px;
            }

            .delegate-section {
                grid-area: delegate;
                height: auto;
            }

            .flex-layout {
                display: contents;
                /* Bỏ flex layout cho landscape */
            }

            /* Tối ưu seatmap frame cho landscape */
            .seatmap-frame {
                display: grid;
                grid-template-rows: auto 1fr auto;
                gap: 12px;
                height: 100%;
            }

            /* Tối ưu seat grid container cho landscape */
            .seat-grid-container {
                display: flex;
                align-items: center;
                justify-content: center;
                width: 100%;
                height: 100%;
                overflow: hidden;
            }

            /* Tối ưu seat grid cho landscape */
            .seat-grid {
                display: grid;
                grid-template-columns: repeat(13, 1fr);
                gap: 6px;
                padding: 16px;
                background: #f8fafc;
                border-radius: 15px;
                border: 2px solid #e2e8f0;
                width: 100%;
                height: 100%;
                max-width: 100%;
                max-height: 100%;
                box-sizing: border-box;
            }

            .seat {
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 14px;
                font-weight: 700;
                min-height: 0;
                height: 100%;
                aspect-ratio: 1.2;
                box-sizing: border-box;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }

            .stage {
                font-size: 18px;
                padding: 12px;
            }

            .legend {
                font-size: 14px;
                gap: 20px;
                padding: 12px;
                flex-wrap: nowrap;
                /* Không wrap cho landscape */
            }

            .legend .dot {
                width: 16px;
                height: 16px;
            }

            /* Delegate section cho landscape */
            .welcome-text {
                font-size: 20px;
                margin-top: 12px;
            }

            .delegate-name {
                font-size: 28px;
            }

            .delegate-role {
                font-size: 18px;
                margin: 8px 0;
            }

            .delegate-seat {
                font-size: 20px;
                padding: 6px 12px;
            }

            .event-text {
                font-size: 18px;
                margin-bottom: 12px;
            }

            .delegate-overlay {
                padding: 12px 16px;
            }
        }

        .device-size {
            font-size: 14px;
            color: #333;
            margin-left: 10px;
        }

        .mute-container {
            display: flex;
            justify-content: space-between;
        }

        /* Màn hình landscape lớn (1920x1080) */
        @media (orientation: landscape) and (min-width: 1600px) {
            .main-container {
                padding: 20px;
                gap: 24px;
            }

            .header-section {
                height: 100px;
            }

            .header-title {
                font-size: 26px;
            }

            .seating-section {
                padding: 28px;
            }

            .seat {
                font-size: 16px;
                aspect-ratio: 1.3;
            }

            .seat-grid {
                gap: 8px;
                padding: 20px;
            }

            .stage {
                font-size: 20px;
                padding: 16px;
            }

            .legend {
                font-size: 16px;
                gap: 24px;
                padding: 16px;
            }

            .legend .dot {
                width: 18px;
                height: 18px;
            }

            .welcome-text {
                font-size: 24px;
                margin-top: 16px;
            }

            .delegate-name {
                font-size: 32px;
            }

            .delegate-role {
                font-size: 20px;
            }

            .delegate-seat {
                font-size: 24px;
                padding: 8px 16px;
            }

            .event-text {
                font-size: 20px;
                margin-bottom: 16px;
            }

            .delegate-overlay {
                padding: 16px 20px;
            }
        }

        /* Màn hình landscape nhỏ (1366x768) */
        @media (orientation: landscape) and (max-width: 1400px) {
            .main-container {
                padding: 12px;
                gap: 16px;
            }

            .header-section {
                height: 80px;
            }

            .header-title {
                font-size: 20px;
            }

            .seating-section {
                padding: 16px;
            }

            .seat {
                font-size: 12px;
                aspect-ratio: 1.1;
            }

            .seat-grid {
                gap: 4px;
                padding: 12px;
            }

            .stage {
                font-size: 16px;
                padding: 10px;
            }

            .legend {
                font-size: 12px;
                gap: 16px;
                padding: 10px;
            }

            .legend .dot {
                width: 14px;
                height: 14px;
            }

            .welcome-text {
                font-size: 18px;
                margin-top: 8px;
            }

            .delegate-name {
                font-size: 24px;
            }

            .delegate-role {
                font-size: 16px;
            }

            .delegate-seat {
                font-size: 18px;
                padding: 4px 8px;
            }

            .event-text {
                font-size: 16px;
                margin-bottom: 8px;
            }

            .delegate-overlay {
                padding: 8px 12px;
            }
        }

        /* Portrait mode (giữ nguyên như cũ) */
        @media (orientation: portrait) {

            /* Kiosk 1080x1920 specific optimizations */
            .main-container {
                display: flex;
                flex-direction: column;
                max-width: 100%;
                height: 100vh;
            }

            .header-section {
                height: 120px;
            }

            .header-title {
                font-size: 26px;
                padding: 16px 40px;
                white-space: nowrap;
            }

            .seating-section {
                padding: 32px;
            }

            .stage {
                font-size: 26px;
                padding: 20px;
            }

            .seat {
                font-size: 18px;
                min-height: 50px;
            }

            .legend {
                font-size: 18px;
                gap: 32px;
                padding: 20px;
            }

            .legend .dot {
                width: 24px;
                height: 24px;
            }

            .delegate-section {
                margin-top: 20px;
                height: 320px;
            }

            .delegate-name {
                font-size: 50px;
            }

            .delegate-seat {
                font-size: 32px;
            }

            .delegate-role {
                margin: 20px;
            }

            .flex-layout {
                display: flex;
                flex-direction: column;
                flex-grow: 1;
            }

            .flex-layout .seating-section {
                flex-grow: 1;
            }

            .flex-layout .delegate-section {
                height: 700px;
            }
        }

        /* Animation for seat selection */
        @keyframes seatSelect {
            0% {
                transform: scale(1);
            }

            50% {
                transform: scale(1.1);
            }

            100% {
                transform: scale(1.05);
            }
        }

        .seat.selected {
            animation: seatSelect 0.3s ease;
        }

        /* Smooth transitions */
        * {
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        /* Prevent text selection for kiosk */
        .seat,
        .stage,
        .legend {
            user-select: none;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
        }

        .checkin-row {
            display: flex;
            gap: 8px;
            justify-content: center;
            align-items: center;
            margin-top: 16px;
            flex-wrap: wrap;
            /* Cho phép xuống hàng nếu thiếu chỗ */
            width: 100%;
            box-sizing: border-box;
        }

        .checkin-input {
            flex: 1 1 200px;
            /* co giãn theo chiều rộng, min 200px */
            max-width: 100%;
            padding: 10px 12px;
            border-radius: 10px;
            border: 2px solid rgba(255, 255, 255, .4);
            color: #000;
            font-size: 18px;
            font-weight: 600;
            outline: none;
            min-width: 0;
            /* bắt buộc để flex co */
        }

        .checkin-btn {
            flex: 0 0 auto;
            padding: 10px 16px;
            border-radius: 10px;
            border: 2px solid rgba(255, 215, 0, .6);
            background: #ffd700;
            color: #000;
            font-weight: 800;
            font-size: 18px;
            cursor: pointer;
            white-space: nowrap;
            /* không xuống dòng chữ */
        }

        /* Buộc ô ghế khớp đúng kích thước ô grid do JS đặt, tránh bị đè khi giảm seatSize */
        #seatingChart {
            display: grid;
            /* phòng khi chưa có */
            gap: 6px;
            /* khớp gap đang dùng trong JS nếu có */
        }

        #seatingChart .seat {
            width: 100% !important;
            height: 100% !important;
            min-height: 0 !important;
            /* override các giá trị 45px/50px */
            aspect-ratio: auto !important;
            /* không ép tỷ lệ làm vỡ hàng */
            box-sizing: border-box;
        }