/* ============================================================
   qr_display.php — "Movie Character Night" staff pass
   Bootstrap 5.3 (dark) + tema sinematik. Halaman ini TIDAK memuatkan style.css
   (nama kelas seperti .btn-primary / .badge / .card bertembung dengan Bootstrap),
   jadi semua gaya yang diperlukan oleh table_picker.js & pelan dewan ada di sini.
   ============================================================ */

:root {
    --bg-deep: #0a0f1c;
    --bg-card: #151d30;
    --bg-card-alt: #1e2a44;
    --border-subtle: #2e3b56;
    --gold: #d4af37;
    --gold-bright: #f5d27a;
    --text: #f5f5f0;
    --text-muted: #a7b0c3;
    --success: #4caf50;
    --success-bg: #16321c;
    --error: #e74c3c;
    --error-bg: #3a1a1a;
    --warning-bg: #3a3016;
    --curtain: #7a1226;
    --bs-body-bg: var(--bg-deep);
    --bs-body-color: var(--text);
}

[hidden] { display: none !important; }

body.qr-page {
    min-height: 100vh;
    background:
        radial-gradient(ellipse 70% 38% at 50% 0%, rgba(245, 210, 122, 0.20) 0%, transparent 70%),
        radial-gradient(circle at 50% 100%, #131c36 0%, var(--bg-deep) 65%);
    background-attachment: fixed;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Tirai pawagam di kiri/kanan (hiasan, hanya pada skrin lebar) */
body.qr-page::before,
body.qr-page::after {
    content: '';
    position: fixed;
    top: 0;
    bottom: 0;
    width: 7vw;
    max-width: 90px;
    pointer-events: none;
    z-index: 0;
    background: repeating-linear-gradient(90deg, #5c0d1d 0 10px, var(--curtain) 10px 22px, #4a0a17 22px 30px);
    opacity: 0.55;
}
body.qr-page::before { left: 0; mask-image: linear-gradient(90deg, #000, transparent); -webkit-mask-image: linear-gradient(90deg, #000, transparent); }
body.qr-page::after { right: 0; mask-image: linear-gradient(270deg, #000, transparent); -webkit-mask-image: linear-gradient(270deg, #000, transparent); }
@media (max-width: 575.98px) {
    body.qr-page::before, body.qr-page::after { display: none; }
}

.qr-shell {
    position: relative;
    z-index: 1;
    max-width: 480px;
}

/* ---------- Top bar ---------- */
.qr-topbar .btn-logout {
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    background: rgba(21, 29, 48, 0.8);
    border-radius: 999px;
    font-size: 13px;
    padding: 6px 14px;
}
.qr-topbar .btn-logout:hover { border-color: var(--gold); color: var(--gold-bright); }

/* ---------- Hero header ---------- */
.header-logo {
    display: block;
    max-height: 72px;
    max-width: 220px;
    margin: 0 auto 10px;
    object-fit: contain;
}
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 11px;
    color: var(--gold);
    margin: 0 0 6px;
    font-weight: 700;
    text-align: center;
}
.qr-hero h1 {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    margin: 0 0 6px;
    background: linear-gradient(180deg, #fff6d6, var(--gold-bright) 55%, var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 30px rgba(245, 210, 122, 0.25);
}
.qr-hero .subtitle { color: var(--text-muted); font-size: 14px; margin: 0; }

/* ---------- Movie ticket (staff pass) ---------- */
.ticket {
    position: relative;
    background: linear-gradient(160deg, #1d2946 0%, var(--bg-card) 55%, #111828 100%);
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.4) inset;
    overflow: hidden;
}
/* Jalur filem di atas tiket */
.ticket::before {
    content: '';
    display: block;
    height: 14px;
    background:
        repeating-linear-gradient(90deg, transparent 0 8px, rgba(10, 15, 28, 0.95) 8px 16px) center / 100% 6px no-repeat,
        linear-gradient(var(--gold), #9c7d1f);
}
.ticket-head {
    padding: 18px 18px 12px;
    text-align: center;
}
.ticket-body { padding: 4px 18px 18px; }

/* Garis koyak tiket dengan takuk separuh bulatan */
.ticket-tear {
    position: relative;
    height: 22px;
    margin: 0;
}
.ticket-tear::before {
    content: '';
    position: absolute;
    left: 18px;
    right: 18px;
    top: 50%;
    border-top: 2px dashed rgba(212, 175, 55, 0.4);
}
.ticket-tear::after {
    content: '';
    position: absolute;
    left: -11px;
    right: -11px;
    top: 0;
    height: 22px;
    background:
        radial-gradient(circle 11px at 50% 50%, var(--bg-deep) 98%, transparent 100%) left / 22px 22px no-repeat,
        radial-gradient(circle 11px at 50% 50%, var(--bg-deep) 98%, transparent 100%) right / 22px 22px no-repeat;
}

/* ---------- Butiran staf ---------- */
.staff-details { margin: 0; }
.staff-details .row-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(46, 59, 86, 0.7);
    font-size: 14px;
}
.staff-details .row-item:last-child { border-bottom: 0; }
.staff-details .lbl {
    flex: 0 0 auto;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--gold);
    font-weight: 700;
}
.staff-details .val { text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.staff-details .val small { color: var(--text-muted); font-weight: 500; }
.staff-details .val.name { font-size: 1.1rem; font-weight: 800; }

.badge-new, .badge-invalid, .badge-super {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.badge-new { background: var(--success-bg); color: #a5d6a7; border: 1px solid rgba(76, 175, 80, 0.5); }
.badge-invalid { background: var(--error-bg); color: #ff8a80; border: 1px solid rgba(231, 76, 60, 0.5); }
.badge-super { background: linear-gradient(135deg, var(--gold), var(--gold-bright)); color: #1a1408; }

/* ---------- Kad "Your Table" ---------- */
.your-table-card {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 14px 18px;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
    color: #1a1408;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-bright) 50%, var(--gold) 100%);
    box-shadow: 0 8px 22px rgba(212, 175, 55, 0.25);
    position: relative;
    overflow: hidden;
    transition: transform 0.12s, box-shadow 0.12s;
}
.your-table-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%);
    transform: translateX(-120%);
    animation: qr-shine 4.5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes qr-shine { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.your-table-card:active { transform: scale(0.985); }
.your-table-card .your-table-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em; opacity: 0.75; font-weight: 700; }
.your-table-card .your-table-no { display: block; font-size: 2rem; font-weight: 900; line-height: 1.15; margin: 2px 0; }
.your-table-card .your-table-hint { font-size: 12px; opacity: 0.8; font-weight: 600; }

/* ---------- Kod QR ---------- */
.qr-box {
    text-align: center;
    margin: 6px 0 14px;
}
.qr-box img {
    display: block;
    width: 100%;
    max-width: 260px;
    height: auto;
    margin: 0 auto;
    padding: 12px;
    background: #fff;
    border-radius: 16px;
    border: 3px solid var(--gold);
    box-shadow: 0 0 0 5px rgba(212, 175, 55, 0.15), 0 10px 26px rgba(0, 0, 0, 0.5);
}
.qr-caption { text-align: center; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin-bottom: 8px; }

/* ---------- Butang ---------- */
.btn-primary, .btn-gold {
    --bs-btn-bg: var(--gold);
    --bs-btn-border-color: var(--gold);
    --bs-btn-color: #1a1408;
    --bs-btn-hover-bg: var(--gold-bright);
    --bs-btn-hover-border-color: var(--gold-bright);
    --bs-btn-hover-color: #1a1408;
    --bs-btn-active-bg: var(--gold-bright);
    --bs-btn-active-border-color: var(--gold-bright);
    --bs-btn-active-color: #1a1408;
    --bs-btn-disabled-bg: var(--gold);
    --bs-btn-disabled-border-color: var(--gold);
    --bs-btn-disabled-color: #1a1408;
    font-weight: 800;
    min-height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-secondary {
    --bs-btn-bg: rgba(30, 42, 68, 0.85);
    --bs-btn-border-color: var(--border-subtle);
    --bs-btn-color: var(--text);
    --bs-btn-hover-bg: var(--bg-card-alt);
    --bs-btn-hover-border-color: var(--gold);
    --bs-btn-hover-color: var(--gold-bright);
    --bs-btn-active-bg: var(--bg-card-alt);
    --bs-btn-active-border-color: var(--gold);
    --bs-btn-active-color: var(--gold-bright);
    font-weight: 700;
    min-height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Menu ---------- */
.menu-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(30, 42, 68, 0.7);
    border: 1px solid var(--border-subtle);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    transition: border-color 0.15s, transform 0.1s, background 0.15s;
}
.menu-tile:hover, .menu-tile:focus { border-color: var(--gold); color: var(--gold-bright); background: var(--bg-card-alt); }
.menu-tile:active { transform: scale(0.985); }
.menu-tile .ico {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: rgba(212, 175, 55, 0.14);
    border: 1px solid rgba(212, 175, 55, 0.35);
}
.menu-tile .txt small { display: block; font-weight: 500; font-size: 11.5px; color: var(--text-muted); }
.menu-tile .go { margin-left: auto; color: var(--gold); font-size: 18px; }
.menu-tile-star {
    background: linear-gradient(135deg, rgba(122, 18, 38, 0.55), rgba(30, 42, 68, 0.85));
    border-color: rgba(245, 210, 122, 0.55);
}

.qr-footer-note { text-align: center; font-size: 11px; color: var(--text-muted); letter-spacing: 0.08em; }

/* ---------- Modal (dikawal oleh JS melalui atribut hidden) ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(3, 6, 14, 0.78);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 14px;
    overflow-y: auto;
    z-index: 1080;
    opacity: 1;
}
.modal-box {
    position: relative;
    background: linear-gradient(160deg, #1d2946, var(--bg-card));
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 18px;
    padding: 20px;
    max-width: 480px;
    width: 100%;
    margin-top: 30px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.modal-box h2 { font-size: 1.2rem; font-weight: 800; color: var(--gold-bright); margin: 0 0 8px; padding-right: 40px; }
.modal-box-wide { max-width: 700px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }
.modal-close-x {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-subtle);
    color: var(--text);
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    padding: 0;
}
.modal-close-x:hover { border-color: var(--gold); color: var(--gold-bright); }
.text-muted { color: var(--text-muted) !important; }
@media (max-width: 600px) {
    .modal-box-wide {
        max-width: 100%;
        width: 100%;
        margin: 0;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }
    #table-modal.modal-backdrop { padding: 0; align-items: stretch; }
}

.alert-error { background: var(--error-bg); color: #ff8a80; border: 1px solid var(--error); border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-top: 12px; }

/* ---------- Pelan dewan ---------- */
.floor-plan-wrap {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    background: var(--bg-card-alt);
}
#table-modal .floor-plan-wrap { flex: 1; min-height: 0; }
.floor-plan-zoom-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.btn-zoom {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-subtle);
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.btn-zoom:hover { border-color: var(--gold); color: var(--gold-bright); }
.btn-zoom-reset { width: auto; padding: 0 12px; font-size: 12px; font-weight: 600; }
.floor-plan-zoom-level { font-size: 13px; font-weight: 700; color: var(--gold-bright); min-width: 44px; text-align: center; }
.floor-plan-hint { font-size: 12px; margin: -2px 0 10px; text-align: left; }

.floor-plan-view {
    position: relative;
    box-sizing: content-box;
    width: 900px;
    height: 920px;
    background:
        linear-gradient(var(--border-subtle) 1px, transparent 1px) 0 0 / 40px 40px,
        linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px) 0 0 / 40px 40px;
    background-color: var(--bg-card);
}
.floor-plan-view .floor-table, .floor-plan-view .floor-marker { touch-action: auto; cursor: default; }
.floor-plan-view .floor-table { width: 44px; height: 44px; }
.floor-plan-view .floor-table-no { font-size: 11px; }
.floor-plan-view.is-overview .floor-table-no { font-size: 13px; font-weight: 800; }
.floor-plan-view.is-overview .floor-marker-label { display: none; }

.floor-table {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-card-alt);
    border: 2px solid var(--gold);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.floor-table-no { font-weight: 700; font-size: 14px; color: var(--gold-bright); }
.floor-table.is-mine {
    border-color: var(--success);
    background: var(--success-bg);
    animation: floor-table-pulse 1.6s ease-in-out infinite;
}
.floor-table.is-mine .floor-table-no { color: #a5d6a7; }
@keyframes floor-table-pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(76, 175, 80, 0.35); }
    50% { box-shadow: 0 4px 20px rgba(76, 175, 80, 0.75); }
}
.floor-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    min-width: 56px;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1.5px dashed var(--text-muted);
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    user-select: none;
    text-align: center;
}
.floor-marker-icon { font-size: 18px; line-height: 1; }
.floor-marker-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; }
.btn-zoom-mine { margin-left: auto; }

/* ---------- Pemilih meja (dijana oleh table_picker.js) ---------- */
#table-picker-hint { margin-bottom: 10px; }
.table-picker-disclaimer {
    background: var(--warning-bg);
    color: var(--gold-bright);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
    margin: 0 0 14px;
}
.table-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.table-picker-card {
    background: var(--bg-card-alt);
    border: 1.5px solid var(--border-subtle);
    border-radius: 12px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
}
.table-picker-card:not(.is-vip):hover { border-color: var(--gold); transform: translateY(-1px); }
.table-picker-card-no { font-size: 18px; font-weight: 800; color: var(--gold-bright); }
.table-picker-card-name { font-size: 11px; color: var(--text-muted); }
.table-picker-card-count { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text); }
.table-picker-card-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gold-bright); }
.table-picker-card-badge-muted { color: var(--text-muted); }
.table-picker-card.is-full { opacity: 0.6; }
.table-picker-card.is-mine { border-color: var(--success); background: var(--success-bg); }
.table-picker-card.is-mine .table-picker-card-no { color: #a5d6a7; }
.table-picker-card.is-vip { cursor: default; border-style: dashed; border-color: #c48fe0; background: rgba(196, 143, 224, 0.08); opacity: 0.7; }
.table-picker-card.is-vip .table-picker-card-no { color: #c48fe0; }
.table-picker-card-badge-vip { color: #c48fe0; }
.table-picker-occupant-list { list-style: none; margin: 0 0 14px; padding: 0; max-height: 220px; overflow-y: auto; }
.table-picker-occupant-list li { padding: 6px 0; border-bottom: 1px solid var(--border-subtle); font-size: 14px; }
.table-picker-occupant-list li:last-child { border-bottom: none; }

@media (prefers-reduced-motion: reduce) {
    .your-table-card::after, .floor-table.is-mine { animation: none; }
}
@media print {
    body.qr-page::before, body.qr-page::after, .qr-topbar, .menu-grid { display: none !important; }
}


/* ============================================================
   Komponen halaman staf (diekstrak daripada style.css: galeri, undian, info, rundown, stepper, pilihan)
   ============================================================ */
.stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 22px;
    font-size: 10px;
    flex-wrap: wrap;
    gap: 4px;
}
.step {
    color: var(--text-muted);
    padding: 5px 7px;
    border-radius: 6px;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-subtle);
}
.step.active {
    background: var(--gold);
    color: #1a1408;
    font-weight: 700;
    border-color: var(--gold);
}
.step.done {
    color: var(--success);
    border-color: var(--success);
}
.btn-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(0, 0, 0, 0.25);
    border-top-color: currentColor;
    border-radius: 50%;
    flex-shrink: 0;
    animation: btn-spinner-rotate 0.7s linear infinite;
}
@keyframes btn-spinner-rotate { to { transform: rotate(360deg); } }
.attendance-choice {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.btn-choice {
    margin-top: 0;
    flex: 1;
    min-width: 140px;
}
.btn-hadir {
    background: var(--success);
    color: #fff;
}
.btn-tidak {
    background: var(--error);
    color: #fff;
}
.thank-you {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
}
.text-muted {
    color: var(--text-muted);
    text-align: center;
}
.text-muted-inline {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 13px;
}
.scan-idle p.text-muted {
    font-size: 14px;
    font-weight: 400;
}
.vote-start-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
}
.vote-start-controls select {
    width: auto;
    min-height: 44px;
    margin: 0;
}
.vote-start-controls .btn-primary {
    width: auto;
}
.vote-start-controls .btn-vote-big {
    min-height: 64px;
    padding: 0 36px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.04em;
}
.vote-start-controls input[type="number"] {
    width: 170px;
    min-height: 44px;
    margin: 0;
}
.vote-session-countdown {
    font-size: clamp(32px, 6vw, 56px);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--gold-bright);
    text-align: center;
    margin-top: 10px;
    letter-spacing: 0.02em;
}
.vote-not-started {
    text-align: center;
    padding: 30px 10px;
}
.vote-not-started-icon {
    font-size: 48px;
    margin-bottom: 10px;
}
.vote-spotlight-label {
    margin-top: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.vote-spotlight {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    transition: opacity 0.2s ease;
}
.vote-spotlight.is-changing {
    opacity: 0;
}
.vote-spotlight-category {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gold-bright);
}
.vote-spotlight-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-subtle);
    background: var(--bg-card-alt);
}
.vote-spotlight-photo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
}
.vote-spotlight-name {
    font-size: 17px;
    font-weight: 700;
    text-align: center;
}
.vote-spotlight-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}
.vote-spotlight-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border-subtle);
    transition: background 0.2s, transform 0.2s;
}
.vote-spotlight-dot.is-active {
    background: var(--gold-bright);
    transform: scale(1.3);
}
.vote-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.vote-slot-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}
.vote-slot-actions .btn-secondary, .vote-slot-actions .btn-danger {
    flex: 1;
}
.candidate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin: 12px 0 20px;
}
.candidate-card {
    position: relative;
    background: var(--bg-deep);
    border: 2px solid var(--border-subtle);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.candidate-card input[type="radio"] {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    min-height: auto;
    margin: 0;
}
.candidate-card.is-selected {
    border-color: var(--gold-bright);
    box-shadow: 0 0 0 2px var(--gold-bright);
}
.candidate-photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    background: var(--bg-card-alt);
}
.candidate-photo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}
.candidate-name {
    display: block;
    font-weight: 700;
    margin-top: 8px;
    font-size: 13px;
}
.candidate-card-static {
    cursor: default;
}
.gallery-caption {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.gallery-upload-card {
    margin-top: 14px;
    padding: 12px;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
}
input[type="file"].gallery-upload-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}
.gallery-upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 16px 12px;
    border: 1.5px dashed var(--border-subtle);
    border-radius: 10px;
    background: var(--bg-deep);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    min-height: 88px;
    text-align: center;
}
.gallery-upload-dropzone:hover,
.gallery-upload-file-input:focus-visible + .gallery-upload-dropzone {
    border-color: var(--gold);
    background: var(--bg-card-alt);
}
.gallery-upload-dropzone-icon {
    font-size: 24px;
    line-height: 1;
}
.gallery-upload-dropzone-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-top: 4px;
}
.gallery-upload-dropzone-hint {
    font-size: 11px;
    color: var(--text-muted);
}
.gallery-upload-dropzone.has-preview {
    padding: 0;
    border-style: solid;
    min-height: 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
.gallery-upload-dropzone.has-preview .gallery-upload-dropzone-icon,
.gallery-upload-dropzone.has-preview .gallery-upload-dropzone-hint {
    display: none;
}
.gallery-upload-dropzone.has-preview .gallery-upload-dropzone-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 6px 10px;
    font-size: 11px;
    text-align: left;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
    color: #fff;
}
.gallery-upload-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gallery-upload-controls {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.gallery-upload-caption {
    flex: 1;
    min-width: 0;
    margin: 0;
}
.gallery-upload-submit {
    flex-shrink: 0;
    width: auto;
    margin: 0;
    padding: 0 16px;
    font-size: 13px;
    white-space: nowrap;
}
.gallery-feed {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 12px;
}
.gallery-post {
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.gallery-post-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
}
.gallery-post-avatar {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    background: var(--gold);
    color: #1a1408;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
}
.gallery-post-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.gallery-post-name {
    font-weight: 700;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gallery-post-time {
    font-size: 9px;
    color: var(--text-muted);
}
.gallery-post-photo-btn {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    cursor: zoom-in;
}
.gallery-post-photo {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    max-height: none;
    object-fit: cover;
    background: var(--bg-card-alt);
}
.gallery-post-caption {
    padding: 6px 8px 0;
    margin: 0;
    font-size: 11px;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.gallery-post-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    margin-top: auto;
}
.gallery-like-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 4px 10px;
    min-height: auto;
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
}
.gallery-like-btn:active {
    transform: scale(0.95);
}
.gallery-like-btn.is-liked {
    border-color: var(--gold-bright);
    color: var(--gold-bright);
}
.gallery-like-icon {
    font-size: 13px;
    line-height: 1;
}
.lightbox-box {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius);
    max-width: 92vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.lightbox-photo {
    max-width: 92vw;
    max-height: 76vh;
    object-fit: contain;
    background: #000;
}
.lightbox-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
}
.lightbox-caption {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.rundown-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rundown-item {
    display: flex;
    flex-direction: column;
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 12px 14px;
}
.rundown-item.is-current {
    border-color: var(--gold-bright);
    box-shadow: 0 0 0 2px var(--gold-bright);
    background: var(--bg-card-alt);
}
.rundown-item-time {
    font-size: 12px;
    font-weight: 700;
    color: var(--gold-bright);
}
.rundown-item-title {
    font-size: 15px;
    font-weight: 700;
    margin-top: 2px;
}
.rundown-item-description {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}
.rundown-row.is-current {
    background: var(--bg-card-alt);
    box-shadow: inset 0 0 0 2px var(--gold-bright);
}
.vote-count-bar {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.vote-winner-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--bg-deep);
    border: 2px solid var(--gold-bright);
    box-shadow: 0 0 0 2px var(--gold-bright);
    border-radius: 12px;
    padding: 16px;
    margin: 12px auto 14px;
    max-width: 220px;
}
.winner-photo {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 10px;
    background: var(--bg-card-alt);
}
.winner-photo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}
.vote-winner-card .badge {
    margin-top: 10px;
}
.winner-name {
    display: block;
    font-weight: 700;
    font-size: clamp(13px, 2.2vh, 20px);
    margin: 1px 0;
    line-height: 1.2;
    overflow-wrap: break-word;
}
.runner-up-list {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.runner-up-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 8px 12px;
}
.runner-up-photo {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-card-alt);
}
.runner-up-photo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
}
.runner-up-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
}
.runner-up-list .vote-count-bar {
    margin-top: 0;
    flex-shrink: 0;
}
.vote-tie-banner {
    text-align: center;
    font-weight: 700;
    color: var(--gold-bright);
    margin: 12px 0 8px;
}
.vote-tie-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.vote-tie-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--bg-deep);
    border: 2px solid var(--gold-bright);
    box-shadow: 0 0 0 2px var(--gold-bright);
    border-radius: 12px;
    padding: 12px 8px;
}
.vote-tie-photo {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 10px;
    background: var(--bg-card-alt);
}
.vote-tie-photo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
}
.vote-tie-name {
    display: block;
    font-weight: 700;
    font-size: 13px;
    margin-top: 8px;
}
.lightbox-modal {
    align-items: center;
}
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--bg-card-alt);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
}
.pagination a.active, .pagination span.active {
    background: var(--gold);
    color: #1a1408;
    font-weight: 700;
}
.pagination-nice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 18px;
}
.pagination-nice-nav,
.pagination-nice-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-subtle);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.pagination-nice-nav:hover,
.pagination-nice-num:hover {
    background: var(--bg-card);
    border-color: var(--gold);
    transform: translateY(-1px);
}
.pagination-nice-num.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #1a1408;
    cursor: default;
    pointer-events: none;
}
.pagination-nice-nav.is-disabled {
    opacity: 0.35;
    pointer-events: none;
}
.pagination-nice-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 36px;
    color: var(--text-muted);
    font-size: 13px;
}
.pagination-nice-summary {
    text-align: center;
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}
@media (min-width: 768px) {
    .stepper {
        font-size: 11px;
    }
    .attendance-choice {
        flex-wrap: nowrap;
    }
}
.info-section {
    margin-top: 24px;
}
.info-section h2 {
    font-size: 17px;
    margin: 0 0 12px;
    color: var(--gold-bright);
}
.info-card {
    background: var(--bg-card-alt);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 18px;
}
.info-card p {
    margin: 0 0 12px;
    line-height: 1.6;
}
.info-card p:last-child {
    margin-bottom: 0;
}
.info-card-muted {
    text-align: center;
    background: var(--bg-card);
}
.info-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
}
.fact-chip {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 13px;
    color: var(--text-muted);
}
.info-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 14px 0;
}
.info-gallery img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    display: block;
}
@media (min-width: 480px) {
    .info-gallery img {
        height: 170px;
    }
}
.image-note {
    font-size: 12px;
    margin-top: -6px !important;
}
.btn-outline-link {
    display: inline-block;
    margin-top: 6px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid var(--gold);
    color: var(--gold-bright);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.btn-outline-link:hover {
    background: var(--gold);
    color: var(--bg-deep);
}
.tip-list {
    margin: 0;
    padding-left: 20px;
    line-height: 1.7;
}
.tip-list li {
    margin-bottom: 6px;
}
@keyframes floor-table-pulse { 0%, 100% { box-shadow: 0 2px 8px rgba(76, 175, 80, 0.35); }
    50% { box-shadow: 0 4px 20px rgba(76, 175, 80, 0.75); } }

/* ============================================================
   Tambahan tema staf (borang, stepper, makluman, butang pilihan,
   halaman maklumat). Dimuatkan SELEPAS komponen di atas supaya menang.
   ============================================================ */

:root {
    --radius: 14px;
    --tap-min: 48px;
    --bs-link-color: #f5d27a;
    --bs-link-color-rgb: 245, 210, 122;
    --bs-link-hover-color: #fff6d6;
    --bs-link-hover-color-rgb: 255, 246, 214;
    --bs-border-color: #2e3b56;
}
a { color: var(--gold-bright); }
a:hover { color: #fff6d6; }
.qr-shell-wide { max-width: 760px; }
h2 { font-size: 1.15rem; font-weight: 800; color: var(--gold-bright); }
.ticket-body h2 { margin: 18px 0 10px; }

/* Butang kembali / logout */
.btn-logout { text-decoration: none; display: inline-flex; align-items: center; }

/* ---------- Borang ---------- */
.form-label, label.form-label { font-weight: 700; font-size: 13px; letter-spacing: 0.03em; color: var(--gold-bright); margin: 14px 0 6px; }
.form-control, .form-select {
    background-color: var(--bg-card-alt);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: var(--text);
    font-size: 16px;
    min-height: var(--tap-min);
    padding: 12px 14px;
}
.form-control::placeholder { color: var(--text-muted); opacity: 0.8; }
.form-control:focus, .form-select:focus {
    background-color: var(--bg-card-alt);
    color: var(--text);
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.22);
}
.form-control:read-only { background-color: var(--bg-deep); color: var(--text-muted); }
.form-text-note { font-size: 13px; color: var(--text-muted); }

/* ---------- Butang ---------- */
.btn-primary:disabled, .btn-primary.disabled { opacity: 0.5; }
.btn-link, .btn.btn-link {
    color: var(--gold-bright);
    font-weight: 600;
    text-decoration: none;
    width: 100%;
    min-height: 44px;
}
.btn-link:hover { color: #fff6d6; text-decoration: underline; }
.btn-loading { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-spinner { border-color: rgba(0, 0, 0, 0.25); border-top-color: currentColor; }
.btn-outline-link {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 16px;
    border: 1px solid var(--gold);
    border-radius: 12px;
    color: var(--gold-bright);
    font-weight: 700;
    text-decoration: none;
}
.btn-outline-link:hover { background: rgba(212, 175, 55, 0.14); color: #fff6d6; }

/* ---------- Pilihan hadir / tidak hadir ---------- */
.attendance-choice { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.btn-choice {
    flex: 1;
    min-width: 140px;
    min-height: 64px;
    margin: 0;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 800;
    border: 2px solid transparent;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s, box-shadow 0.15s;
}
.btn-choice:active { transform: scale(0.98); }
.btn-hadir { background: linear-gradient(135deg, #2e7d32, #43a047); }
.btn-tidak { background: linear-gradient(135deg, #8e2a22, #c0392b); }
.btn-choice.is-selected { border-color: var(--gold-bright); box-shadow: 0 0 0 4px rgba(245, 210, 122, 0.25); }
.btn-choice:disabled { opacity: 0.6; }

/* ---------- Stepper (stesen tiket) ---------- */
.stepper { display: flex; gap: 6px; margin: 0 0 18px; flex-wrap: wrap; justify-content: center; font-size: 11px; }
.step {
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-weight: 600;
}
.step.active { background: linear-gradient(135deg, var(--gold), var(--gold-bright)); color: #1a1408; border-color: var(--gold); font-weight: 800; }
.step.done { color: #a5d6a7; border-color: rgba(76, 175, 80, 0.6); }

/* ---------- Makluman ---------- */
.alert { border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 0 0 14px; border: 1px solid transparent; }
.alert-error, .alert.alert-error { background: var(--error-bg); color: #ff8a80; border-color: var(--error); }
.alert-success, .alert.alert-success { background: var(--success-bg); color: #a5d6a7; border-color: var(--success); }
.alert-info, .alert.alert-info { background: var(--bg-card-alt); color: var(--text); border-color: var(--border-subtle); }
.thank-you { text-align: center; color: var(--text-muted); font-size: 15px; padding: 10px 0; }
.step-panel p { color: var(--text); }

/* ---------- Halaman maklumat / rundown ---------- */
.info-section { margin-top: 18px; }
.info-section h2 { margin: 0 0 10px; }
.info-card { background: rgba(30, 42, 68, 0.6); border: 1px solid var(--border-subtle); border-radius: 14px; padding: 14px 16px; }
.info-card-muted { background: rgba(122, 18, 38, 0.25); border-color: rgba(245, 210, 122, 0.4); }
.fact-chip { background: rgba(212, 175, 55, 0.12); border: 1px solid rgba(212, 175, 55, 0.4); color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.rundown-list { list-style: none; margin: 0; padding: 0; }
.rundown-item { border-left: 3px solid var(--border-subtle); background: rgba(30, 42, 68, 0.5); border-radius: 0 12px 12px 0; padding: 10px 14px; margin-bottom: 8px; }
.rundown-item.is-current { border-left-color: var(--gold); background: rgba(212, 175, 55, 0.14); }
.rundown-item-time { color: var(--gold); font-weight: 800; font-size: 13px; }
.rundown-item-title { font-weight: 700; }
.badge.badge-super { background: linear-gradient(135deg, var(--gold), var(--gold-bright)); color: #1a1408; }

/* ---------- Galeri & undian ---------- */
.gallery-upload-card, .gallery-post, .candidate-card, .vote-winner-card, .vote-tie-card, .runner-up-list li {
    border-color: var(--border-subtle);
}
.candidate-card.is-selected { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25); }
.vote-session-countdown { color: var(--gold-bright); }
.lightbox-box { position: relative; }

.gallery-feed > p, .gallery-feed > .text-muted { grid-column: 1 / -1; text-align: center; }
.gallery-upload-submit { min-height: var(--tap-min); border-radius: 12px; }
.gallery-upload-dropzone { background: rgba(10, 15, 28, 0.6); }
.info-card p { font-size: 14.5px; line-height: 1.6; }
.info-card p:last-child { margin-bottom: 0; }

/* ============================================================
   Galeri gaya Instagram - grid (hanya gallery.php: body.gallery-ig)
   CSS sahaja - penanda & JS tidak diubah.
   ============================================================ */
body.gallery-ig .qr-shell { max-width: 560px; }
body.gallery-ig .ticket-body { padding: 0 0 14px; }
body.gallery-ig .ticket-body > .gallery-upload-card,
body.gallery-ig .ticket-body > #gallery-limit-msg,
body.gallery-ig .ticket-body > h2,
body.gallery-ig .pagination { margin-left: 14px; margin-right: 14px; }

/* ---- Kad cipta pos: ruang foto kiri + kapsyen & butang kanan ---- */
body.gallery-ig .gallery-upload-card {
    position: relative;
    display: grid;
    grid-template-columns: 112px 1fr;
    grid-template-areas: "pick controls" "alert alert";
    gap: 12px 14px;
    align-items: stretch;
    margin-top: 4px;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid rgba(245, 210, 122, 0.25);
    background:
        radial-gradient(circle at 0% 0%, rgba(214, 41, 118, 0.22), transparent 55%),
        radial-gradient(circle at 100% 100%, rgba(79, 91, 213, 0.22), transparent 55%),
        rgba(21, 29, 48, 0.92);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}
body.gallery-ig .gallery-upload-card[hidden] { display: none; }
body.gallery-ig .gallery-upload-card::before { content: none; }
body.gallery-ig .gallery-upload-file-input { grid-area: pick; }
body.gallery-ig .gallery-upload-dropzone {
    grid-area: pick;
    position: relative;
    width: 112px;
    height: 112px;
    min-height: 0;
    aspect-ratio: 1 / 1;
    padding: 0;
    gap: 2px;
    border: 3px solid transparent;
    border-radius: 22px;
    background:
        linear-gradient(#18213a, #18213a) padding-box,
        linear-gradient(135deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5) border-box;
    overflow: hidden;
}
body.gallery-ig .gallery-upload-dropzone-icon { font-size: 30px; width: auto; height: auto; background: none; box-shadow: none; border-radius: 0; display: block; }
body.gallery-ig .gallery-upload-dropzone-text { font-size: 12px; font-weight: 800; margin: 0; color: #ffe08f; }
body.gallery-ig .gallery-upload-dropzone-hint { display: none; }
body.gallery-ig .gallery-upload-dropzone.has-preview { border-color: transparent; }
body.gallery-ig .gallery-upload-dropzone.has-preview .gallery-upload-dropzone-text { font-size: 10px; padding: 4px 6px; text-align: center; }
body.gallery-ig .gallery-upload-preview-img { object-fit: cover; }

body.gallery-ig .gallery-upload-controls { grid-area: controls; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; margin: 0; }
body.gallery-ig .gallery-upload-controls::before {
    content: '✨ Share a moment';
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(90deg, #feda75, #fa7e1e 45%, #d62976);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
body.gallery-ig .gallery-upload-caption {
    flex: 1;
    min-height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    padding: 0 14px;
    font-size: 15px;
}
body.gallery-ig .gallery-upload-caption::placeholder { color: rgba(255, 255, 255, 0.55); }
body.gallery-ig .gallery-upload-caption:focus { background: rgba(255, 255, 255, 0.1); border-color: #fa7e1e; box-shadow: 0 0 0 3px rgba(250, 126, 30, 0.25); }
body.gallery-ig .gallery-upload-submit {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 14px;
    padding: 0 16px;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #fa7e1e, #d62976 55%, #962fbf);
    box-shadow: 0 6px 16px rgba(214, 41, 118, 0.35);
}
body.gallery-ig .gallery-upload-submit:disabled { opacity: 0.4; box-shadow: none; }
body.gallery-ig #gallery-upload-alert { grid-area: alert; margin: 0; }
body.gallery-ig #gallery-upload-alert[hidden] { display: none; }

/* ---- Suapan: grid 3 lajur, petak kecil ---- */
body.gallery-ig .ticket-body > h2 {
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 18px 14px 8px !important;
}
body.gallery-ig .gallery-feed {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin: 0 4px;
}
body.gallery-ig .gallery-feed > p, body.gallery-ig .gallery-feed > .text-muted { grid-column: 1 / -1; text-align: center; padding: 20px 0; }

body.gallery-ig .gallery-post {
    position: relative;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-card-alt);
}
body.gallery-ig .gallery-post-photo-btn { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; cursor: zoom-in; }
body.gallery-ig .gallery-post-photo { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; transition: transform 0.25s; }
body.gallery-ig .gallery-post-photo-btn:hover .gallery-post-photo { transform: scale(1.05); }

/* Nama pemuat naik: jalur gelap di bawah petak (hanya bacaan) */
body.gallery-ig .gallery-post-header {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 2;
    display: flex;
    padding: 18px 6px 5px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent);
    pointer-events: none;
}
body.gallery-ig .gallery-post-avatar, body.gallery-ig .gallery-post-time { display: none; }
body.gallery-ig .gallery-post-meta { min-width: 0; }
body.gallery-ig .gallery-post-name { display: block; font-size: 10.5px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62%; }
body.gallery-ig .gallery-post-caption { display: none; }

/* Butang suka kekal berfungsi: pil kecil di penjuru kanan bawah */
body.gallery-ig .gallery-post-actions { position: absolute; right: 4px; bottom: 4px; z-index: 3; padding: 0; }
body.gallery-ig .gallery-like-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 26px;
    padding: 2px 8px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
}
body.gallery-ig .gallery-like-btn.is-liked { color: #ff6b8b; border: 0; }
body.gallery-ig .gallery-like-icon { font-size: 13px; line-height: 1; display: inline-block; }
body.gallery-ig .gallery-like-btn.is-liked .gallery-like-icon { animation: ig-pop 0.35s ease-out; }
@keyframes ig-pop { 0% { transform: scale(0.6); } 55% { transform: scale(1.4); } 100% { transform: scale(1); } }

/* ---- Lightbox: latar gelap penuh ---- */
body.gallery-ig .modal-backdrop.lightbox-modal { background: rgba(0, 0, 0, 0.94); }
body.gallery-ig .lightbox-box { background: #000; border-radius: 14px; }
body.gallery-ig .lightbox-caption { color: #f1f1f1; font-size: 14px; }

@media (min-width: 560px) { body.gallery-ig .gallery-feed { gap: 6px; } }
@media (max-width: 380px) {
    body.gallery-ig .gallery-upload-card { grid-template-columns: 92px 1fr; }
    body.gallery-ig .gallery-upload-dropzone { width: 92px; height: 92px; }
}
@media (prefers-reduced-motion: reduce) { body.gallery-ig .gallery-like-btn.is-liked .gallery-like-icon { animation: none; } body.gallery-ig .gallery-post-photo { transition: none; } }
