/* ============================================================
   Annual Dinner Registration System — "Movie Night" theme
   Mobile-first, dark cinematic navy/charcoal with gold accents.
   ============================================================ */

:root {
    --bg-deep: #0d1321;
    --bg-card: #1b2436;
    --bg-card-alt: #232f47;
    --border-subtle: #2e3b56;
    --gold: #d4af37;
    --gold-bright: #f0c869;
    --text: #f5f5f0;
    --text-muted: #a7b0c3;
    --success: #4caf50;
    --success-bg: #16321c;
    --error: #e74c3c;
    --error-bg: #3a1a1a;
    --warning: #f0c869;
    --warning-bg: #3a3016;
    --radius: 14px;
    --tap-min: 48px;
}

* { box-sizing: border-box; }

/* The [hidden] attribute must always win over any component's own `display`
   value (flex/grid/etc.) - otherwise toggling `.hidden = true` in JS silently
   does nothing for elements styled with an explicit display type. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: radial-gradient(circle at 50% 0%, #16203a 0%, var(--bg-deep) 60%);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Layout
   ============================================================ */

.page-wrap {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 14px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.page-wrap-wide {
    max-width: 1000px;
    justify-content: flex-start;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 22px 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.card-narrow { max-width: 420px; margin: 0 auto; }

.card-header { text-align: center; margin-bottom: 20px; }
.header-logo {
    display: block;
    max-height: 72px;
    max-width: 220px;
    margin: 0 auto 10px;
    object-fit: contain;
}
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11px;
    color: var(--gold);
    margin: 0 0 6px;
    font-weight: 600;
}
.card-header h1 { margin: 0 0 8px; font-size: 22px; color: var(--text); }
.subtitle { color: var(--text-muted); margin: 0; font-size: 14px; }

.page-actions-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.page-links {
    margin-top: 18px;
    display: flex;
    justify-content: center;
}

/* ============================================================
   Stepper
   ============================================================ */

.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); }

/* ============================================================
   Forms
   ============================================================ */

label { display: block; font-weight: 600; margin: 16px 0 6px; font-size: 14px; color: var(--text); }

input[type="text"], input[type="tel"], input[type="password"], input[type="file"], select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    font-size: 16px;
    background: var(--bg-card-alt);
    color: var(--text);
    min-height: var(--tap-min);
}
input::placeholder { color: var(--text-muted); }
input:read-only {
    background: var(--bg-deep);
    color: var(--text-muted);
    cursor: default;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn-primary, .btn-secondary, .btn-link, .btn-choice, .btn-logout, .btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: var(--tap-min);
    margin-top: 20px;
    padding: 13px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    transition: transform 0.1s, opacity 0.2s;
}
.btn-primary:active, .btn-secondary:active, .btn-choice:active { transform: scale(0.98); }

.btn-primary { background: linear-gradient(135deg, var(--gold), var(--gold-bright)); color: #1a1408; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary { background: var(--bg-card-alt); color: var(--text); border: 1px solid var(--border-subtle); }
.btn-sm { width: auto; min-height: 40px; padding: 8px 14px; font-size: 13px; margin-top: 8px; }

.btn-danger { background: var(--error); color: #fff; }

.btn-link {
    background: none;
    color: var(--gold-bright);
    font-weight: 500;
    margin-top: 8px;
    width: auto;
    min-height: auto;
    padding: 8px 4px;
}

.btn-logout {
    width: auto;
    min-height: 40px;
    padding: 8px 14px;
    margin-top: 0;
    font-size: 13px;
    background: var(--bg-card-alt);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.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; }

/* ============================================================
   Alerts
   ============================================================ */

.alert {
    padding: 13px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-error { background: var(--error-bg); color: #ff8a80; border: 1px solid var(--error); }
.alert-success { background: var(--success-bg); color: #a5d6a7; border: 1px solid var(--success); }

/* ============================================================
   WhatsApp Worker Status
   ============================================================ */

.wa-status-box {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card-alt);
}
.wa-status-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--text-muted, #888);
}
.wa-status-connected .wa-status-dot {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}
.wa-status-disconnected .wa-status-dot {
    background: var(--error);
    box-shadow: 0 0 10px var(--error);
}
.wa-status-connected #wa-status-label { color: #a5d6a7; }
.wa-status-disconnected #wa-status-label { color: #ff8a80; }

.staff-details {
    background: var(--bg-card-alt);
    border: 1px solid var(--border-subtle);
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 8px;
}
.staff-details p { margin: 6px 0; font-size: 14px; }

/* ============================================================
   QR display
   ============================================================ */

.qr-box { text-align: center; margin: 20px 0; }
.qr-box img {
    max-width: 100%;
    width: 260px;
    background: #fff;
    padding: 10px;
    border: 3px solid var(--gold);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border-radius: 10px;
}

.qr-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.qr-actions .btn-primary, .qr-actions .btn-secondary { margin-top: 0; flex: 1; min-width: 140px; }

.checkin-status {
    margin-top: 20px;
    padding: 14px;
    background: var(--success-bg);
    color: #a5d6a7;
    border: 1px solid var(--success);
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.winner-status { margin-top: 20px; }
.winner-banner {
    background: linear-gradient(135deg, var(--gold), var(--gold-bright));
    padding: 24px;
    border-radius: var(--radius);
    text-align: center;
    color: #1a1408;
}
.winner-banner h2 { margin: 0 0 8px; font-size: 20px; }
.prize-name { font-size: 18px; font-weight: 700; margin: 8px 0; }
.prize-img { max-width: 150px; border-radius: 8px; margin-top: 8px; }

.thank-you { text-align: center; padding: 20px; color: var(--text-muted); }

/* ============================================================
   Admin
   ============================================================ */

.admin-nav {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: visible;
}
.admin-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}
.admin-nav-identity {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.admin-nav-appname {
    font-weight: 800;
    font-size: 14px;
    color: var(--gold-bright);
    letter-spacing: 0.02em;
}
.admin-nav-user { font-size: 13px; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.admin-nav-toggle {
    display: none;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-subtle);
    color: var(--text);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    min-height: var(--tap-min);
}
.admin-nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: 6px 10px;
}
.admin-nav-spacer { flex: 1; }
.admin-nav-link,
.admin-nav-group-btn {
    padding: 9px 13px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    min-height: 40px;
}
.admin-nav-link:hover,
.admin-nav-link.active,
.admin-nav-group-btn:hover,
.admin-nav-group.is-active > .admin-nav-group-btn,
.admin-nav-group.is-open > .admin-nav-group-btn {
    color: var(--gold-bright);
    background: var(--bg-card-alt);
}
.admin-nav-logout { color: var(--error); }
.admin-nav-logout:hover { color: #ff7b6e; background: var(--error-bg); }
.admin-nav-caret { font-size: 10px; opacity: 0.7; transition: transform 0.15s; }
.admin-nav-group { position: relative; }
.admin-nav-group.is-open .admin-nav-caret { transform: rotate(180deg); }
.admin-nav-group-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
    padding: 6px;
    z-index: 90;
}
.admin-nav-group.is-open .admin-nav-group-menu { display: block; }
.admin-nav-group-menu a {
    display: block;
    padding: 10px 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    border-radius: 8px;
    white-space: nowrap;
}
.admin-nav-group-menu a:hover,
.admin-nav-group-menu a.active {
    color: var(--gold-bright);
    background: var(--bg-card-alt);
}

/* Mobile: hamburger reveals the link strip; dropdown menus open inline
   (static position) so nothing overflows off-screen. */
@media (max-width: 860px) {
    .admin-nav-toggle { display: inline-flex; }
    .admin-nav-links { display: none; flex-direction: column; align-items: stretch; }
    .admin-nav-links.is-open { display: flex; }
    .admin-nav-link, .admin-nav-group-btn { width: 100%; justify-content: flex-start; min-height: var(--tap-min); }
    .admin-nav-group-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-left: 2px solid var(--border-subtle);
        border-radius: 0;
        margin-left: 14px;
        min-width: 0;
    }
    .admin-nav-spacer { display: none; }
}

.badge-viewer {
    background: #2b3a5c;
    color: #9db8e8;
    border: 1px solid #3d5382;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}
.stat-box {
    background: var(--bg-card-alt);
    border: 1px solid var(--border-subtle);
    padding: 16px;
    border-radius: 10px;
    text-align: center;
}
.stat-box-link {
    display: block;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
}
.stat-box-link:hover, .stat-box-link:focus-visible {
    border-color: var(--gold);
    transform: translateY(-2px);
}
.stat-num { display: block; font-size: 26px; font-weight: 800; color: var(--gold-bright); }
.stat-label { font-size: 12px; color: var(--text-muted); }

.stat-box-clickable {
    font: inherit;
    color: inherit;
    width: 100%;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
}
.stat-box-clickable:hover, .stat-box-clickable:focus-visible {
    border-color: var(--gold);
    transform: translateY(-2px);
}

.search-input {
    flex: 1;
    min-width: 200px;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-subtle);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    min-height: var(--tap-min);
}
.search-input:focus {
    outline: none;
    border-color: var(--gold);
}

.data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 10px; min-width: 480px; }
.data-table th, .data-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border-subtle); font-size: 13px; }
.data-table th { color: var(--gold-bright); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.text-muted { color: var(--text-muted); text-align: center; }
.text-muted-inline { color: var(--text-muted); font-weight: 400; font-size: 13px; }

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}
.section-header-row h2 { margin: 0; }

.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}
.toolbar input[type="search"], .toolbar input[type="text"] { flex: 1; min-width: 180px; }

/* --- Scan Attendance: full-viewport two-panel layout. The whole page fits
   the screen with no scrolling (door-duty speed matters), camera on the
   left, a big color-coded result card on the right that's readable from
   an arm's length away. --- */
.scan-wrap {
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    padding-top: 12px;
    padding-bottom: 12px;
}
.scan-layout {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(280px, 420px) 1fr;
    gap: 14px;
}
.scan-camera-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    overflow: hidden;
}
.scan-panel-title { margin: 0 0 10px; font-size: 18px; }
#reader {
    width: 100%;
    max-width: 380px;
    border-radius: 10px;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}
#reader video { object-fit: cover; }
.scan-sound-hint { font-size: 12px; margin: 8px 0 0; }

.scan-info-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 0;
    overflow: hidden;
    transition: background 0.2s, border-color 0.2s;
}
.scan-idle-icon { font-size: 56px; margin-bottom: 8px; }
.scan-idle p { margin: 4px 0; font-size: 18px; font-weight: 700; }
.scan-idle p.text-muted { font-size: 14px; font-weight: 400; }

.scan-outcome { width: 100%; }
.scan-outcome-icon { font-size: clamp(48px, 9vh, 84px); line-height: 1; }
.scan-outcome-title {
    font-size: clamp(20px, 3.4vh, 32px);
    font-weight: 800;
    letter-spacing: 0.08em;
    margin: 8px 0 4px;
}
.scan-outcome-name {
    font-size: clamp(22px, 4.2vh, 40px);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 14px;
    line-height: 1.15;
}
.scan-outcome-details {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    max-width: 420px;
    width: 100%;
}
.scan-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 7px 12px;
    background: rgba(0, 0, 0, 0.18);
    border-radius: 8px;
    font-size: clamp(13px, 1.9vh, 17px);
}
.scan-detail-label { color: var(--text-muted); font-weight: 600; }
.scan-detail-value { color: var(--text); font-weight: 700; text-align: right; }

.scan-state-success { background: var(--success-bg); border-color: var(--success); }
.scan-state-success .scan-outcome-title { color: #a5d6a7; }
.scan-state-warning { background: var(--warning-bg); border-color: var(--warning); }
.scan-state-warning .scan-outcome-title { color: var(--gold-bright); }
.scan-state-error { background: var(--error-bg); border-color: var(--error); }
.scan-state-error .scan-outcome-title { color: #ff8a80; }

@media (max-width: 860px) {
    .scan-wrap { height: auto; max-height: none; overflow: visible; }
    .scan-layout { grid-template-columns: 1fr; }
    .scan-info-panel { min-height: 300px; }
}

/* --- Filter tabs (staff_list.php) --- */
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.filter-tab {
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
}
.filter-tab:hover { color: var(--text); }
.filter-tab.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-bright));
    color: #1a1408;
    border-color: var(--gold);
}

/* --- Prizes admin --- */
.session-block { margin-bottom: 20px; border: 1px solid var(--border-subtle); border-radius: 10px; padding: 12px 16px; background: var(--bg-card-alt); }
.session-block summary { font-weight: 700; cursor: pointer; padding: 12px 0; color: var(--gold-bright); min-height: var(--tap-min); display: flex; align-items: center; }
.slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.slot-card {
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    padding: 12px;
    border-radius: 10px;
}
.slot-card label { margin: 0 0 6px; font-size: 12px; }
.slot-card input[type="text"] { font-size: 13px; padding: 8px; margin-bottom: 6px; min-height: 40px; }
.slot-thumb { width: 100%; border-radius: 6px; margin-top: 6px; }
.slot-winner { font-size: 12px; color: var(--success); font-weight: 600; margin-top: 6px; }

/* --- Vote Hero & Heroine --- */
.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-download-btn { display: block; margin-top: 8px; width: 100%; }

/* --- Photo Gallery: compact upload card --- */
.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;
}

/* --- Photo Gallery: social-feed / timeline layout --- */
.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 (zoom preview) --- */
.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; }

/* Admin table rows - separate class from .rundown-item so the table keeps
   normal <tr> layout instead of inheriting the flex-card styling above. */
.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: 15px; margin-top: 8px; }

.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; }

/* --- Tie result (2+ candidates share the top vote count) --- */
.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; }

/* --- Modals / forms panels --- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}
@media (min-width: 640px) {
    .form-grid.form-grid-2 { grid-template-columns: 1fr 1fr; gap: 0 16px; }
}

.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 4px;
}
@media (min-width: 640px) {
    .checkbox-grid { grid-template-columns: 1fr 1fr; }
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
}
.checkbox-item input[type="checkbox"] {
    width: auto;
    min-height: auto;
    margin: 0;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 16, 0.7);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 14px;
    overflow-y: auto;
    z-index: 100;
}
.modal-backdrop[hidden] {
    display: none;
}
/* Lightbox content is short enough to always fit on screen, unlike other
   modals (e.g. table layout) that can need top-anchored scrolling - so this
   one centers vertically instead of sticking to the top. */
.lightbox-modal {
    align-items: center;
}
.modal-box {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 20px;
    max-width: 480px;
    width: 100%;
    margin-top: 30px;
}
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn-primary, .modal-actions .btn-secondary { margin-top: 0; }

.modal-close-x {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    min-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);
}

.modal-box-wide {
    max-width: 700px;
}

/* On narrow phones, the floor-plan modal needs almost the full viewport
   (width AND height) to give the scrollable canvas enough room - the
   default centered modal-box with fixed padding leaves too little space
   and made the floor plan feel cramped/unscrollable. */
@media (max-width: 600px) {
    .modal-box-wide {
        max-width: 100%;
        width: 100%;
        margin: 0;
        height: 100vh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }
    #table-modal.modal-backdrop {
        padding: 0;
        align-items: stretch;
    }
}

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-new { background: var(--success-bg); color: #a5d6a7; }
.badge-conflict { background: var(--warning-bg); color: var(--gold-bright); }
.badge-invalid { background: var(--error-bg); color: #ff8a80; }
.badge-super { background: var(--gold); color: #1a1408; }
.badge-admin { background: var(--bg-card-alt); color: var(--text-muted); border: 1px solid var(--border-subtle); }

.import-row-invalid { opacity: 0.5; }
.import-row td { vertical-align: middle; }

.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.filter-bar select, .filter-bar input { min-width: 140px; }

.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; }

/* ============================================================
   Lucky Draw / Director Screen
   ============================================================ */
.draw-body {
    background: radial-gradient(circle at top, #16203a, #05070d);
    color: #fff;
    height: 100vh;
    overflow: hidden;
}
.draw-wrap {
    max-width: 1400px;
    height: 100vh;
    margin: 0 auto;
    padding: 16px 16px 10px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
.draw-header { text-align: center; margin-bottom: 10px; flex-shrink: 0; }
.draw-header h1 {
    font-size: clamp(20px, 3vw, 30px);
    margin: 0;
    background: linear-gradient(90deg, var(--gold), var(--gold-bright), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.draw-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    flex-direction: column;
    flex-shrink: 0;
}
.current-session-label {
    font-size: clamp(14px, 1.6vw, 18px);
    text-align: center;
    color: var(--text-muted);
}
.current-session-label strong {
    color: var(--gold-bright);
}
.session-progress {
    font-size: 14px;
    color: var(--text-muted);
}
.btn-spin {
    background: linear-gradient(135deg, var(--gold), var(--gold-bright));
    color: #1a1408;
    border: none;
    padding: 26px 32px;
    font-size: 32px;
    font-weight: 800;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    transition: transform 0.15s;
    min-height: var(--tap-min);
}
.btn-spin:hover { transform: scale(1.05); }
.btn-spin:disabled { opacity: 0.6; cursor: not-allowed; }

/* --- Big-screen "waiting for spin" element: replaces the SPIN button on
   director.php now that spins are triggered from the remote tablet. Idles
   as a slowly-turning, glowing wheel so the projector always has a living
   focal point between draws; when the remote fires, .is-launching plays a
   fast dramatic spin-up + shrink-away before the winner reveal begins. --- */
.spin-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
/* A pair of cartoon "googly eyes" that dart around as if scanning the
   audience for the next winner. Drawn in pure CSS (white ball, thick black
   ring, black pupil with a highlight dot); both pupils share one animation
   so they look in the same direction together, with held pauses between
   glances so it reads as deliberate searching, not random jitter. */
.spin-waiting-eyes {
    display: flex;
    gap: clamp(10px, 1.6vh, 18px);
    animation: spin-waiting-bob 3.2s ease-in-out infinite;
    filter: drop-shadow(0 0 14px rgba(212, 175, 55, 0.35));
}
.spin-waiting-eye {
    width: clamp(82px, 8.5vh, 90px);
    height: clamp(82px, 8.5vh, 90px);
    background: #fff;
    border: clamp(4px, 0.8vh, 8px) solid #000;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
}
.spin-waiting-pupil {
    position: absolute;
    width: 54%;
    height: 54%;
    background: #000;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    animation: spin-waiting-search 5.5s ease-in-out infinite;
}
.spin-waiting-pupil::after {
    content: '';
    position: absolute;
    width: 32%;
    height: 32%;
    background: #fff;
    border-radius: 50%;
    top: 14%;
    right: 12%;
}
@keyframes spin-waiting-search {
    0%, 7%    { transform: translate(-50%, -50%); }
    12%, 24%  { transform: translate(-105%, -62%); }
    29%, 41%  { transform: translate(6%, -62%); }
    46%, 56%  { transform: translate(-32%, -104%); }
    61%, 72%  { transform: translate(-86%, -6%); }
    77%, 88%  { transform: translate(-12%, -96%); }
    93%, 100% { transform: translate(-50%, -50%); }
}
@keyframes spin-waiting-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
.spin-waiting-label {
    margin: 0;
    font-size: clamp(13px, 1.5vw, 16px);
    font-weight: 600;
    color: var(--gold-bright);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.spin-waiting-dots span {
    animation: spin-waiting-dot 1.4s ease-in-out infinite;
    display: inline-block;
}
.spin-waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.spin-waiting-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes spin-waiting-dot {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}
.spin-waiting.is-launching .spin-waiting-eyes {
    animation: spin-waiting-launch 1.1s cubic-bezier(0.55, 0, 0.85, 0.36) forwards;
}
@keyframes spin-waiting-launch {
    0%   { transform: rotate(0deg) scale(1); opacity: 1; }
    45%  { transform: rotate(540deg) scale(1.45); opacity: 1; }
    100% { transform: rotate(1440deg) scale(0); opacity: 0; }
}
.spin-waiting.is-launching .spin-waiting-label {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.spin-status { text-align: center; font-size: clamp(14px, 1.6vw, 17px); margin-bottom: 10px; min-height: 22px; flex-shrink: 0; }

/* Admin-only control, kept visually low-key so it doesn't compete with the
   winner reveal on the big screen - guests should look at the results, not this. */
.director-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
    flex-shrink: 0;
}
.btn-next-session {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    padding: 6px 16px;
    font-size: 11px;
    border-radius: 20px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, color 0.2s, border-color 0.2s;
    min-height: 32px;
}
.btn-next-session:hover {
    opacity: 1;
    color: var(--gold-bright);
    border-color: var(--gold);
}
.btn-next-session:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.winners-stage {
    display: grid;
    /* --stage-cols/--stage-rows are set per-render by draw.js based on the
       actual number of winner cards for this session (sessions can have
       different slot counts, e.g. 10 vs 20) - the repeat(5,.../4,...) here is
       just the pre-JS fallback for a 20-slot session. */
    grid-template-columns: repeat(var(--stage-cols, 5), 1fr);
    grid-template-rows: repeat(var(--stage-rows, 4), 1fr);
    gap: 10px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    perspective: 800px;
    flex: 1;
    min-height: 0;
}

@media (max-width: 900px) {
    .winners-stage { grid-template-columns: repeat(min(var(--stage-cols, 5), 4), 1fr); }
}
@media (max-width: 700px) {
    .winners-stage { grid-template-columns: repeat(min(var(--stage-cols, 5), 2), 1fr); }
}

.winner-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 8px 6px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-subtle);
    overflow: hidden;
    min-height: 0;
    min-width: 0;
}

.winner-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.winner-card.spinning {
    border-color: var(--gold);
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.35);
    animation: card-scatter var(--scatter-duration, 0.5s) ease-in-out infinite;
    animation-delay: var(--scatter-delay, 0s);
    will-change: transform;
}
.winner-card.spinning .winner-card-inner {
    animation: spin-shake 0.12s infinite;
}
.spin-reel-icon { font-size: 30px; display: block; margin-bottom: 6px; }
.spin-reel-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
}
@keyframes spin-shake {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* Card "scatter" like shuffled playing cards: tumbling translate + rotate,
   each card takes a slightly different randomized path via CSS custom properties. */
@keyframes card-scatter {
    0% { transform: translate(0, 0) rotate(0deg); }
    20% { transform: translate(var(--sx1, 8px), var(--sy1, -10px)) rotate(var(--sr1, -8deg)); }
    40% { transform: translate(var(--sx2, -10px), var(--sy2, 6px)) rotate(var(--sr2, 10deg)); }
    60% { transform: translate(var(--sx3, 9px), var(--sy3, 8px)) rotate(var(--sr3, -6deg)); }
    80% { transform: translate(var(--sx4, -7px), var(--sy4, -8px)) rotate(var(--sr4, 8deg)); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

.winner-card.settling {
    animation: card-settle 0.35s ease-out forwards;
}
@keyframes card-settle {
    0% { transform: translate(var(--sx3, 6px), var(--sy3, 6px)) rotate(var(--sr3, 6deg)); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

.winner-card.revealed {
    background: linear-gradient(160deg, var(--bg-card-alt), var(--bg-card));
    border-color: var(--gold);
}
.winner-card.pop { animation: pop-in 0.4s ease-out; }
@keyframes pop-in {
    0% { transform: scale(0.3) rotate(0deg); opacity: 0; }
    70% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}
.winner-card.discarding {
    animation: card-discard 0.4s ease-in forwards;
}
@keyframes card-discard {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
    100% { transform: translate(var(--dsx, 40px), var(--dsy, 60px)) rotate(var(--dsr, 25deg)) scale(0.7); opacity: 0; }
}

.winner-prize-img { width: clamp(28px, 4vh, 48px); height: clamp(28px, 4vh, 48px); object-fit: cover; border-radius: 8px; margin-bottom: 4px; }
.winner-prize-icon { font-size: clamp(16px, 2.6vh, 26px); margin-bottom: 4px; }
.winner-name { font-weight: 700; margin: 1px 0; font-size: clamp(9px, 1.3vh, 12px); line-height: 1.15; overflow-wrap: break-word; }
.winner-dept { font-size: clamp(8px, 1.1vh, 10px); color: var(--text-muted); margin: 0 0 2px; }
.winner-prize-name { font-size: clamp(8px, 1.2vh, 11px); color: var(--gold-bright); font-weight: 600; margin: 0; line-height: 1.15; overflow-wrap: break-word; }

.confetti-piece {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 999;
    animation: confetti-fly 1.4s ease-out forwards;
}
@keyframes confetti-fly {
    to {
        transform: translate(var(--dx), var(--dy)) rotate(360deg);
        opacity: 0;
    }
}

/* --- Draw results page (staff) --- */
.session-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
}
.session-tabs button {
    flex: 1 1 calc(50% - 8px);
    max-width: calc(50% - 4px);
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card-alt);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    min-height: 44px;
    text-align: center;
}
.session-tabs button.active { background: var(--gold); color: #1a1408; border-color: var(--gold); }

@media (min-width: 560px) {
    .session-tabs button {
        flex: 0 1 auto;
        max-width: none;
        border-radius: 999px;
        padding: 10px 16px;
        min-height: 40px;
    }
}

.you-won-banner {
    background: linear-gradient(135deg, var(--gold), var(--gold-bright));
    color: #1a1408;
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 18px;
}
.you-won-banner h2 { margin: 0 0 6px; }
.winner-claim-info {
    margin: 10px 0 0;
    font-size: 13px;
    font-weight: 600;
    opacity: 0.85;
}

.winner-list { display: flex; flex-direction: column; gap: 8px; }
.winner-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 12px 14px;
    gap: 10px;
    flex-wrap: wrap;
}
.winner-list-item.is-you { border-color: var(--gold); background: rgba(212, 175, 55, 0.12); }
.winner-list-name { font-weight: 700; font-size: 14px; }
.winner-list-dept { font-size: 12px; color: var(--text-muted); }
.winner-list-prize { font-size: 13px; color: var(--gold-bright); font-weight: 600; }

/* ============================================================
   Responsive: tablet / desktop
   ============================================================ */
@media (min-width: 768px) {
    .page-wrap { padding: 40px 20px; }
    .card { padding: 32px; }
    .card-header h1 { font-size: 26px; }
    .stepper { font-size: 11px; }
    .attendance-choice { flex-wrap: nowrap; }
}

@media print {
    body { background: #fff; color: #000; }
    .qr-actions, .admin-nav, .stepper, .page-actions-top, .page-links { display: none !important; }
    .card { box-shadow: none; border: 1px solid #ccc; }
    .card::before { display: none; }
}

/* ============================================================
   Info pages (venue_info.php, theme_info.php)
   ============================================================ */

.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;
}

.menu-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.menu-links .btn-secondary {
    flex: 1;
    min-width: 140px;
    margin-top: 0;
}

/* ============================================================
   Table Layout (admin floor plan editor + staff floor plan viewer)
   ============================================================ */

.floor-plan-wrap {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    background: var(--bg-card-alt);
}

/* Fills the modal on mobile so there's maximum room to scroll/pan around
   an 80-table floor plan instead of a small cramped box. */
#table-modal .floor-plan-wrap {
    flex: 1;
    min-height: 0;
}

#table-modal h2 {
    padding-right: 40px;
    margin-top: 0;
}

.floor-plan-zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.btn-zoom {
    width: 36px;
    height: 36px;
    min-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: -6px 0 10px;
    text-align: left;
}

.floor-plan {
    position: relative;
    width: 100%;
    min-width: 600px;
    aspect-ratio: 16 / 10;
    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);
}

/* Admin drag-to-edit canvas at real-world scale (same virtual size as the
   staff read-only viewer below) so 80 tables have enough room to sit apart
   instead of being squeezed into a small responsive box. Zoomed via JS the
   same way as .floor-plan-view - resizing actual width/height, not
   transform: scale() - so the scrollable area always matches what's
   visible. */
.floor-plan-editor {
    width: 1400px;
    min-width: 0;
    height: 900px;
    aspect-ratio: unset;
}

.floor-plan-wrap-admin {
    max-height: 70vh;
}

.floor-plan-stats {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Staff's read-only floor plan viewer (as opposed to the admin drag-to-edit
   canvas) - needs a much wider/taller virtual canvas so tables with a
   large venue (e.g. 80 tables) get enough room not to overlap, and the
   wrapper is scrolled/pinch-zoomed with native touch gestures instead of
   drag-to-reposition, so touch-action must NOT be blocked here.
   Deliberately standalone (not combined with .floor-plan) so its own
   width/height - which JS resizes on every zoom step - aren't fighting an
   aspect-ratio/min-width from a shared base class. */
.floor-plan-view {
    position: relative;
    box-sizing: content-box;
    width: 1400px;
    height: 900px;
    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-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    text-align: center;
}

.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;
    cursor: grab;
    user-select: none;
    touch-action: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    transition: box-shadow 0.15s;
}

.floor-table:hover {
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.4);
}

.floor-table.dragging {
    cursor: grabbing;
    z-index: 10;
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.55);
}

.floor-table-no {
    font-weight: 700;
    font-size: 14px;
    color: var(--gold-bright);
}

.floor-table-count {
    font-size: 10px;
    color: var(--text-muted);
}

.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); }
}

.your-table-card {
    background: linear-gradient(135deg, var(--gold), var(--gold-bright));
    color: #1a1408;
    padding: 16px 20px;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 16px;
    cursor: pointer;
    border: none;
    width: 100%;
    font-family: inherit;
}

.your-table-card .your-table-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.75;
    display: block;
}

.your-table-card .your-table-no {
    font-size: 28px;
    font-weight: 800;
    display: block;
    margin: 4px 0;
}

.your-table-card .your-table-hint {
    font-size: 12px;
    opacity: 0.75;
}

/* ============================================================
   Table Assignment (per-table staff lists)
   ============================================================ */

.table-assignment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.assignment-table-block {
    background: var(--bg-card-alt);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 12px;
}

.assignment-table-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 14px;
}

.assignment-table-count {
    margin-left: auto;
    font-weight: 700;
    color: var(--gold-bright);
}

.assignment-staff-list {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
    min-height: 20px;
}

.assignment-staff-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
}

.assignment-staff-list li:last-child {
    border-bottom: none;
}

.assign-staff-select {
    width: 100%;
    margin-top: 4px;
}

/* ============================================================
   Floor plan markers (Stage, Buffet, Toilet, Prize Collection, etc.)
   ============================================================ */

.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;
    cursor: grab;
    user-select: none;
    touch-action: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.15s, border-color 0.15s;
}

.floor-marker:hover {
    border-color: var(--gold-bright);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.floor-marker.dragging {
    cursor: grabbing;
    z-index: 10;
    border-color: var(--gold-bright);
}

.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;
}
