/* =============================================================
   Contest Platform — Public site styles
   Layered on top of Bootstrap 5. Mobile-first: ~80% of traffic
   is on phones, so touch targets, font sizes and spacing here
   are tuned for small screens first, then enhanced upward.
   ============================================================= */

:root {
    /* TurnOn Talent brand palette — navy wordmark, sunset gradient mark (orange -> magenta -> purple), gold star */
    --brand-primary: #e5257e;
    --brand-primary-dark: #b0176a;
    --brand-primary-light: #f0559e;
    --brand-accent: #f7941d;
    --brand-purple: #8e2ba6;
    --brand-gold: #fbbf24;
    --brand-gradient: linear-gradient(135deg, #f7941d, #e5257e 55%, #8e2ba6);
    --brand-dark: #1b2a4a;
    --brand-muted: #6b7280;
    --brand-bg: #f7f7fb;
    --brand-border: #e5e7eb;

    --radius-sm: 0.5rem;
    --radius-md: 0.85rem;
    --radius-lg: 1.25rem;

    --shadow-sm: 0 2px 8px rgba(17, 24, 39, 0.06);
    --shadow-md: 0 6px 20px rgba(17, 24, 39, 0.09);
    --shadow-lg: 0 16px 40px rgba(17, 24, 39, 0.14);

    --font-heading: "Poppins", "Segoe UI", sans-serif;
    --font-body: "Inter", "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { -webkit-tap-highlight-color: transparent; }

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--brand-bg);
    color: var(--brand-dark);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.section-heading, .fw-bold, .fw-semibold {
    font-family: var(--font-heading);
}

a { text-decoration: none; }

img { max-width: 100%; height: auto; }

/* Larger tap targets + 16px inputs everywhere (prevents iOS auto-zoom-on-focus) */
.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.form-control, .form-select {
    font-size: 1rem;
    min-height: 46px;
    border-radius: var(--radius-sm);
    border-color: var(--brand-border);
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand-primary-light);
    box-shadow: 0 0 0 0.2rem rgba(67, 56, 202, 0.15);
}

textarea.form-control { min-height: 90px; }

a:focus-visible, button:focus-visible, .btn:focus-visible {
    outline: 2px solid var(--brand-primary-light);
    outline-offset: 2px;
}

/* ---------- Navbar ---------- */
.app-navbar {
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-dark));
    box-shadow: var(--shadow-sm);
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.app-navbar .navbar-brand {
    font-family: var(--font-heading);
    font-size: 1.15rem;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: #fff;
    font-size: 0.7rem;
    margin-right: 0.4rem;
    flex-shrink: 0;
    vertical-align: -3px;
}

.brand-mark-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    margin-right: 0.4rem;
    flex-shrink: 0;
    vertical-align: -7px;
}

.brand-logo-full {
    max-width: 220px;
    width: 100%;
    height: auto;
    margin: 0 auto 1.25rem;
    display: block;
}

.app-navbar .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    padding: 0.5rem 0.9rem !important;
    border-radius: 999px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.app-navbar .nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.12);
}

.app-navbar .nav-link.active {
    color: #fff !important;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.18);
}

.app-navbar .icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9) !important;
    transition: background-color 0.15s ease;
    padding: 0 !important;
}

.app-navbar .icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff !important;
}

.app-navbar .avatar-btn {
    border-radius: 999px;
    padding: 0.3rem 0.75rem 0.3rem 0.3rem !important;
    transition: background-color 0.15s ease;
}

.app-navbar .avatar-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff !important;
}

.app-navbar .nav-icon-divider {
    width: 1px;
    align-self: stretch;
    margin: 0.5rem 0;
    background: rgba(255, 255, 255, 0.18);
}

@media (min-width: 992px) {
    .app-navbar {
        padding-top: 0.85rem;
        padding-bottom: 0.85rem;
    }
}

.app-navbar .dropdown-menu {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

/* ---------- Hero ---------- */
.hero-section {
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.16) 0, transparent 45%),
        linear-gradient(135deg, var(--brand-accent), var(--brand-primary) 55%, var(--brand-purple));
    color: #fff;
    padding: 3rem 0 3.5rem;
    position: relative;
    overflow: hidden;
}

.hero-section h1 {
    font-weight: 800;
    font-size: clamp(1.75rem, 6vw, 3.25rem);
    line-height: 1.15;
}

.hero-section .lead {
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(0.95rem, 2.2vw, 1.15rem);
}

.hero-section .btn {
    width: 100%;
}

@media (min-width: 576px) {
    .hero-section .btn { width: auto; }
}

.hero-stats .stat-box {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-md);
    padding: 1rem 0.75rem;
    backdrop-filter: blur(6px);
}

.hero-stats .stat-box .stat-number {
    font-size: clamp(1.35rem, 4vw, 1.7rem);
    font-weight: 800;
    font-family: var(--font-heading);
}

/* ---------- How it works ---------- */
.how-it-works-step {
    text-align: center;
    padding: 1.5rem 1rem;
}

.how-it-works-step .step-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto 1rem;
    box-shadow: var(--shadow-md);
}

.how-it-works-step .step-number {
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--brand-primary-light);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ---------- Cards ---------- */
.contest-card {
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    height: 100%;
    background: #fff;
}

.contest-card:hover, .contest-card:focus-within {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.contest-card .card-img-top {
    height: 170px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
}

.contest-card .category-pill {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(17, 24, 39, 0.65);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
}

.contest-card .card-img-wrap {
    position: relative;
}

.contest-card .fee-tag {
    font-weight: 700;
    color: var(--brand-primary);
}

/* ---------- Performance gallery ---------- */
.gallery-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-sm);
    height: 100%;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.gallery-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.gallery-card-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    display: block;
}

/* ---------- Facebook-style like/comment bar ---------- */
.fb-summary-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--brand-muted);
    padding-bottom: 0.5rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--brand-border);
    min-height: 1.5rem;
}

.fb-like-summary {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.fb-like-icon-badge {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
}

.fb-dislike-summary {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.fb-comment-summary-link {
    margin-left: auto;
    background: none;
    border: none;
    padding: 0;
    color: var(--brand-muted);
    font-size: 0.8rem;
}

.fb-comment-summary-link:hover {
    text-decoration: underline;
}

.fb-action-bar {
    display: flex;
    border-bottom: 1px solid var(--brand-border);
    padding-bottom: 0.35rem;
    margin-bottom: 0.5rem;
    gap: 0.25rem;
}

.fb-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.25rem;
    color: var(--brand-muted);
    font-weight: 600;
    font-size: 0.85rem;
    min-height: 38px;
}

.fb-action-btn:hover {
    background: var(--brand-bg);
}

.fb-action-btn.active-like {
    color: var(--brand-primary);
}

.fb-action-btn.active-dislike {
    color: #dc2626;
}

/* ---------- Avatars ---------- */
.fb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fb-avatar-sm {
    width: 26px;
    height: 26px;
    font-size: 0.7rem;
}

/* ---------- Comments (Facebook style) ---------- */
.comments-list {
    max-height: 320px;
    overflow-y: auto;
}

.fb-comment {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.fb-comment-body {
    flex: 1;
    min-width: 0;
}

.fb-comment-bubble {
    display: inline-block;
    max-width: 100%;
    background: #f0f2f5;
    border-radius: 1rem;
    padding: 0.45rem 0.8rem;
}

.fb-comment-name {
    font-weight: 700;
    font-size: 0.78rem;
    line-height: 1.2;
}

.comment-text {
    word-break: break-word;
    font-size: 0.85rem;
    margin: 0;
}

.fb-comment-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.72rem;
    color: var(--brand-muted);
    margin: 0.25rem 0 0 0.8rem;
}

.fb-comment-action {
    background: none;
    border: none;
    padding: 0;
    font-weight: 700;
    font-size: inherit;
    color: inherit;
}

.fb-comment-action:hover {
    text-decoration: underline;
}

.fb-reply-composer {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-left: 2rem;
}

.fb-view-replies-toggle {
    background: none;
    border: none;
    padding: 0;
    color: var(--brand-muted);
    font-weight: 700;
    font-size: 0.72rem;
    margin: 0.35rem 0 0 2rem;
    display: block;
}

.fb-view-replies-toggle:hover {
    text-decoration: underline;
}

.fb-replies-list {
    margin: 0.5rem 0 0 1.5rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--brand-border);
}

.fb-comment-input {
    border-radius: 999px;
    background: #f0f2f5;
    border: none;
    padding: 0.5rem 1rem;
}

.fb-comment-input:focus {
    background: #fff;
    box-shadow: 0 0 0 1px var(--brand-primary-light) inset;
}

.participant-placeholder {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 0.75rem;
    height: 100%;
}

.participant-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--brand-bg);
    color: var(--brand-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* ---------- Section headings ---------- */
.section-heading {
    font-weight: 800;
    color: var(--brand-dark);
    font-size: clamp(1.4rem, 4vw, 1.9rem);
}

.section-subheading {
    color: var(--brand-muted);
}

/* ---------- Category filter chips ---------- */
.category-chip-row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    gap: 0.5rem;
    padding-bottom: 0.35rem;
    /* bleed to the screen edge: matches the container's side padding */
    margin: 0 calc(var(--bs-gutter-x, 1.5rem) * -0.5);
    padding-left: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
    padding-right: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
    scrollbar-width: thin;
}

@media (min-width: 768px) {
    .category-chip-row {
        flex-wrap: wrap;
        justify-content: center;
        overflow-x: visible;
        margin: 0;
        padding-left: 0;
        padding-right: 0;
    }
}

.category-chip {
    scroll-snap-align: start;
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--brand-border);
    color: var(--brand-dark);
    background: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    min-height: 44px;
}

.category-chip.active,
.category-chip:hover {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

/* ---------- Badges / statuses ---------- */
.badge-status {
    font-size: 0.75rem;
    padding: 0.4em 0.75em;
    border-radius: 999px;
}

/* ---------- Forms ---------- */
.auth-card {
    max-width: 480px;
    margin: 2.5rem auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: none;
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-brand {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
    font-weight: 600;
}

.btn-brand:hover, .btn-brand:focus {
    background-color: var(--brand-primary-dark);
    border-color: var(--brand-primary-dark);
    color: #fff;
}

/* ---------- QR / payment box ---------- */
.qr-box {
    background: #fff;
    border: 2px dashed var(--brand-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
}

.qr-box img {
    max-width: 240px;
    width: 100%;
    border-radius: var(--radius-sm);
}

/* ---------- Winner podium ---------- */
.winner-card {
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
    text-align: center;
    padding: 1.5rem 1rem;
}

.winner-card .rank-badge {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 0.75rem;
}

.rank-1 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.rank-2 { background: linear-gradient(135deg, #9ca3af, #6b7280); }
.rank-3 { background: linear-gradient(135deg, #b45309, #92400e); }
.rank-other { background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark)); }

/* ---------- Dashboard ---------- */
.dashboard-stat-card {
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    color: #fff;
    box-shadow: var(--shadow-md);
}

.dashboard-stat-card .stat-icon {
    font-size: 1.75rem;
    opacity: 0.85;
}

.mobile-table-wrap {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
}

@media (max-width: 767.98px) {
    .mobile-table-wrap {
        background: transparent;
        box-shadow: none;
        padding: 0;
    }
}

/* ---------- Responsive "card" tables ----------
   Applied via class="table-mobile-cards" on a <table>. Each row
   becomes a self-contained card below the tablet breakpoint; each
   <td> needs a data-label="Column Name" attribute. Desktop/tablet
   is untouched (renders as a normal table). */
@media (max-width: 767.98px) {
    .table-mobile-cards thead { display: none; }
    .table-mobile-cards, .table-mobile-cards tbody, .table-mobile-cards tr, .table-mobile-cards td {
        display: block;
        width: 100%;
    }
    .table-mobile-cards tr {
        background: #fff;
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
        margin-bottom: 0.9rem;
        padding: 0.85rem 1rem;
    }
    .table-mobile-cards td {
        border: none !important;
        padding: 0.4rem 0 !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        text-align: right;
    }
    .table-mobile-cards td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--brand-muted);
        text-align: left;
        flex-shrink: 0;
    }
    .table-mobile-cards td:empty { display: none; }
}

/* ---------- Notifications ---------- */
.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #dc2626;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 999px;
    padding: 0 3px;
}

.notification-dropdown-menu {
    width: 340px;
    max-width: 90vw;
    max-height: 420px;
    overflow-y: auto;
    padding: 0;
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.notification-item {
    white-space: normal;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--brand-border);
    font-size: 0.85rem;
    color: var(--brand-dark);
}

.notification-item.unread {
    background: #eef2ff;
}

.notification-item:hover {
    background: var(--brand-bg);
}

.notification-row {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--brand-border);
    color: var(--brand-dark);
}

.notification-row:last-child {
    border-bottom: none;
}

.notification-row.unread {
    background: #eef2ff;
}

.notification-row:hover {
    background: var(--brand-bg);
}

.notification-row-icon {
    font-size: 1.25rem;
    width: 1.75rem;
    text-align: center;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.nav-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-photo-preview {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.profile-photo-placeholder {
    width: 88px;
    height: 88px;
    font-size: 2rem;
    flex-shrink: 0;
}

.profile-view-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-view-placeholder {
    width: 140px;
    height: 140px;
    font-size: 3rem;
    flex-shrink: 0;
}

/* ---------- Social sharing ---------- */
.share-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.share-btn-facebook { background: #1877f2; }
.share-btn-whatsapp { background: #25d366; }
.share-btn-instagram { background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af, #515bd4); }
.share-btn-copy { background: var(--brand-muted); }

.share-toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translate(-50%, 12px);
    background: var(--brand-dark);
    color: #fff;
    padding: 0.65rem 1.25rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 2000;
    max-width: 90vw;
    text-align: center;
}

.share-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- Mobile app shell ---------- */
@media (max-width: 991.98px) {
    body {
        padding-bottom: calc(58px + env(safe-area-inset-bottom));
    }
}

.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    display: flex;
    background: #fff;
    border-top: 1px solid var(--brand-border);
    box-shadow: 0 -2px 16px rgba(17, 24, 39, 0.08);
    padding-bottom: env(safe-area-inset-bottom);
}

.app-bottom-nav-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.5rem 0.15rem 0.4rem;
    color: var(--brand-muted);
    text-decoration: none;
    font-size: 0.66rem;
    font-weight: 600;
    min-height: 56px;
    min-width: 0;
}

.app-bottom-nav-icon {
    position: relative;
    font-size: 1.35rem;
    line-height: 1;
}

.app-bottom-nav-item.active {
    color: var(--brand-primary);
}

.app-bottom-nav-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.app-bottom-nav-badge {
    position: absolute;
    top: -5px;
    right: -9px;
    background: #dc2626;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 15px;
    height: 15px;
    line-height: 15px;
    text-align: center;
    border-radius: 999px;
    padding: 0 3px;
}

/* Compact app-style top bar on mobile: no wrapping, tighter brand text */
@media (max-width: 991.98px) {
    .app-navbar .navbar-brand {
        font-size: 1rem;
    }
}

/* ---------- PWA install banner ---------- */
.pwa-install-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: calc(70px + env(safe-area-inset-bottom));
    z-index: 1035;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pwa-install-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
}

.pwa-install-banner-text {
    flex: 1;
    min-width: 0;
}

@media (min-width: 992px) {
    .pwa-install-banner {
        left: auto;
        right: 1.5rem;
        bottom: 1.5rem;
        max-width: 380px;
    }
}

/* ---------- Professional file upload field ---------- */
.file-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.file-upload-dropzone {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border: 1.5px dashed var(--brand-border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    background: var(--brand-bg);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    margin: 0;
    min-height: 44px;
}

.file-upload-dropzone:hover {
    border-color: var(--brand-primary-light);
    background: #eef2ff;
}

.file-upload-input:focus-visible + .file-upload-dropzone {
    outline: 2px solid var(--brand-primary-light);
    outline-offset: 2px;
}

.file-upload-icon {
    font-size: 1.4rem;
    color: var(--brand-primary);
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-upload-thumb {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.file-upload-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.file-upload-title {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--brand-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-upload-hint {
    font-size: 0.75rem;
    color: var(--brand-muted);
}

.file-upload-chevron {
    color: var(--brand-muted);
    flex-shrink: 0;
}

.admin-feedback-note {
    font-size: 0.75rem;
    color: var(--brand-muted);
    font-style: italic;
    max-width: 240px;
}

/* ---------- Q&A chat thread ---------- */
.chat-thread {
    max-height: 520px;
    overflow-y: auto;
    padding: 0.5rem 0.25rem;
}

.chat-bubble-row {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1rem;
    align-items: flex-end;
}

.chat-bubble-row-mine {
    flex-direction: row-reverse;
}

.chat-bubble-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.chat-bubble-content {
    max-width: 75%;
    display: flex;
    flex-direction: column;
}

.chat-bubble-row-mine .chat-bubble-content {
    align-items: flex-end;
}

.chat-bubble {
    padding: 0.6rem 0.9rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    word-break: break-word;
}

.chat-bubble-admin {
    background: #f0f2f5;
    color: var(--brand-dark);
    border-bottom-left-radius: 0.25rem;
}

.chat-bubble-mine {
    background: var(--brand-primary);
    color: #fff;
    border-bottom-right-radius: 0.25rem;
}

.chat-bubble-meta {
    font-size: 0.7rem;
    color: var(--brand-muted);
    margin-top: 0.25rem;
    padding: 0 0.25rem;
}

/* ---------- Footer ---------- */
.app-footer {
    background: var(--brand-dark);
}

.footer-link {
    color: rgba(255, 255, 255, 0.65);
}

.footer-link:hover {
    color: #fff;
}

/* ---------- Utilities ---------- */
.rounded-xl { border-radius: var(--radius-lg); }
.shadow-soft { box-shadow: var(--shadow-sm); }

@media (max-width: 575.98px) {
    .hero-section { padding: 2.25rem 0 3rem; }
    .auth-card { margin: 1rem auto; border-radius: var(--radius-md); }
    .auth-card .card-body { padding: 1.5rem !important; }
    h1 { word-break: break-word; }
}

/* ---------- Live chat widget ---------- */
.chat-launcher {
    position: fixed;
    right: 1rem;
    bottom: calc(70px + 0.75rem + env(safe-area-inset-bottom));
    z-index: 1034;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: #fff;
    font-size: 1.45rem;
    box-shadow: 0 8px 24px rgba(229, 37, 126, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.chat-launcher:hover {
    transform: scale(1.06);
}

.chat-launcher-close,
.chat-widget.is-open .chat-launcher-open {
    display: none;
}

.chat-widget.is-open .chat-launcher-close {
    display: inline;
}

.chat-launcher-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #dc2626;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    border-radius: 999px;
    padding: 0 5px;
    border: 2px solid #fff;
}

.chat-panel {
    position: fixed;
    z-index: 1045;
    inset: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.chat-panel[hidden] {
    display: none;
}

.chat-panel-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: var(--brand-gradient);
    color: #fff;
    flex-shrink: 0;
}

.chat-panel-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.chat-panel-title {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

.chat-panel-subtitle {
    font-size: 0.75rem;
    opacity: 0.9;
}

.chat-online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    margin-right: 0.35rem;
}

.chat-panel-close {
    border: 0;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chat-panel-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem;
    background: var(--brand-bg);
    overscroll-behavior: contain;
}

.chat-msg {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.chat-msg-mine {
    align-items: flex-end;
}

.chat-msg-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--brand-muted);
    margin: 0 0 0.2rem 0.25rem;
}

.chat-msg-bubble {
    max-width: 85%;
    padding: 0.55rem 0.85rem;
    border-radius: 1rem;
    font-size: 0.88rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    background: #fff;
    color: var(--brand-dark);
    border: 1px solid var(--brand-border);
    border-bottom-left-radius: 0.3rem;
}

.chat-msg-bot .chat-msg-bubble {
    background: #fdf2f8;
    border-color: #fbcfe8;
}

.chat-msg-mine .chat-msg-bubble {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 0.3rem;
}

.chat-msg-time {
    font-size: 0.65rem;
    color: var(--brand-muted);
    margin: 0.2rem 0.25rem 0;
}

.chat-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    border-top: 1px solid var(--brand-border);
    background: #fff;
    flex-shrink: 0;
}

.chat-chip {
    border: 1px solid var(--brand-primary-light);
    background: #fff;
    color: var(--brand-primary);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.chat-chip:hover:not(:disabled) {
    background: var(--brand-primary);
    color: #fff;
}

.chat-intro {
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--brand-border);
    background: #fff;
    flex-shrink: 0;
}

.chat-compose {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border-top: 1px solid var(--brand-border);
    background: #fff;
    flex-shrink: 0;
}

.chat-compose[hidden],
.chat-intro[hidden],
.chat-quick-replies[hidden] {
    display: none;
}

.chat-compose textarea {
    resize: none;
    border-radius: 1.25rem;
    padding: 0.5rem 0.9rem;
    max-height: 120px;
    font-size: 16px; /* prevents iOS zoom on focus */
}

.chat-send-btn {
    border: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #fff;
    flex-shrink: 0;
}

.chat-send-btn:disabled {
    opacity: 0.6;
}

.chat-error {
    background: #fef2f2;
    color: #b91c1c;
    font-size: 0.78rem;
    padding: 0.4rem 1rem;
    flex-shrink: 0;
}

/* Full-screen panel on phones; hide the launcher behind it. */
@media (max-width: 575.98px) {
    body.chat-open {
        overflow: hidden;
    }

    .chat-widget.is-open .chat-launcher {
        display: none;
    }
}

@media (min-width: 576px) {
    .chat-panel {
        inset: auto;
        right: 1rem;
        bottom: calc(70px + 0.75rem + 56px + 0.75rem + env(safe-area-inset-bottom));
        width: 370px;
        height: min(560px, calc(100vh - 180px));
        border-radius: 1.1rem;
        box-shadow: var(--shadow-lg);
        overflow: hidden;
        padding: 0;
    }
}

@media (min-width: 992px) {
    .chat-launcher {
        right: 1.5rem;
        bottom: 1.5rem;
    }

    .chat-panel {
        right: 1.5rem;
        bottom: calc(1.5rem + 56px + 0.75rem);
        height: min(580px, calc(100vh - 120px));
    }

    /* Keep the install banner clear of the chat launcher. */
    .pwa-install-banner {
        right: calc(1.5rem + 56px + 1rem);
    }
}

.min-w-0 {
    min-width: 0;
}

/* ---------- How It Works tutorial video ---------- */
.text-brand {
    color: var(--brand-primary);
}

.btn-outline-brand {
    color: var(--brand-primary);
    border: 1px solid var(--brand-primary-light);
    background: #fff;
    font-weight: 600;
}

.btn-outline-brand:hover,
.btn-outline-brand:focus {
    color: #fff;
    background: var(--brand-primary);
    border-color: var(--brand-primary);
}

.tutorial-player {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #0f172a;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 16 / 9;
}

.tutorial-player video {
    width: 100%;
    height: 100%;
    display: block;
}

.tutorial-chapters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.tutorial-chapter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--brand-border);
    background: #fff;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--brand-dark);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tutorial-chapter:hover {
    border-color: var(--brand-primary-light);
}

.tutorial-chapter.active {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(229, 37, 126, 0.15);
}

.tutorial-chapter-num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tutorial-card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.tutorial-guide {
    scroll-margin-top: 90px;
}

.tutorial-guide-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.step-icon-sm {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.tutorial-guide ol {
    padding-left: 1.2rem;
    margin-bottom: 1.25rem;
}

.tutorial-guide li {
    margin-bottom: 0.6rem;
    font-size: 0.92rem;
    line-height: 1.5;
}

/* Small "watch the video" hint used on contest, payment, winners pages */
.tutorial-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand-primary);
    text-decoration: none;
}

.tutorial-hint:hover {
    color: var(--brand-primary-dark);
    text-decoration: underline;
}

.tutorial-hint i {
    font-size: 1.15rem;
}

.tutorial-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border: 1px solid #fbcfe8;
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    color: var(--brand-dark);
    text-decoration: none;
}

.tutorial-banner:hover {
    border-color: var(--brand-primary-light);
    color: var(--brand-dark);
}

.tutorial-banner-thumb {
    flex-shrink: 0;
    width: 96px;
    aspect-ratio: 16 / 9;
    border-radius: 0.5rem;
    background-size: cover;
    background-position: center;
    position: relative;
}

.tutorial-banner-thumb::after {
    content: "\F4F2"; /* bi-play-circle-fill */
    font-family: "bootstrap-icons";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.6rem;
    background: rgba(15, 23, 42, 0.35);
    border-radius: 0.5rem;
}

@media (max-width: 575.98px) {
    .tutorial-chapters {
        grid-template-columns: 1fr;
    }
}

.chat-msg-bubble a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}

/* ---------- Language switcher & multilingual typography ---------- */
.lang-switch-btn {
    gap: 0.35rem;
    color: #fff;
    flex-shrink: 0;
}

.lang-menu-native {
    font-family: "Inter", "Noto Sans Devanagari", "Noto Sans Bengali", "Noto Sans Telugu", "Noto Sans Tamil", "Noto Naskh Arabic",
        "Noto Sans Gujarati", "Noto Sans Kannada", "Noto Sans Oriya", "Noto Sans Malayalam", "Noto Sans Gurmukhi",
        "Noto Sans Ol Chiki", "Noto Sans Meetei Mayek", sans-serif;
}

.lang-switch-code {
    font-size: 0.78rem;
    font-weight: 700;
    max-width: 7rem;
    overflow: hidden;
    flex-shrink: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lang-menu {
    width: min(92vw, 380px);
    padding: 0;
    overflow: hidden;
}

.lang-menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-height: min(70vh, 460px);
    overflow-y: auto;
    padding: 0.35rem;
}

.lang-menu-item {
    display: flex;
    flex-direction: column;
    border-radius: 0.5rem;
    padding: 0.45rem 0.75rem;
    white-space: normal;
    line-height: 1.3;
}

.lang-menu-item.active,
.lang-menu-item:active {
    background: var(--brand-primary);
    color: #fff;
}

.lang-menu-native {
    font-weight: 600;
    font-size: 0.95rem;
}

.lang-menu-english {
    font-size: 0.72rem;
    opacity: 0.7;
}

.lang-menu-item[lang="ur"], .lang-menu-item[lang="ks"], .lang-menu-item[lang="sd"] {
    text-align: right;
}

/* Indic & Perso-Arabic scripts: no letter-spacing / forced capitals (they break
   conjuncts and shaping), and a little more line height for tall glyphs. */
html:not([lang="en"]) body * {
    letter-spacing: normal !important;
}

html:not([lang="en"]) .text-uppercase,
html:not([lang="en"]) .step-number {
    text-transform: none !important;
}

html:not([lang="en"]) body {
    line-height: 1.6;
}

html[dir="rtl"] body {
    line-height: 1.8;
}

/* ---------- Right-to-left (Urdu, Kashmiri, Sindhi) fixes ---------- */
/* Numbers like "9+" and prices keep left-to-right order. */
html[dir="rtl"] .stat-number,
html[dir="rtl"] .fee-tag {
    direction: ltr;
    unicode-bidi: isolate;
}

/* Admin-entered content (usually English) lays itself out by its own
   first strong character, so English text stays LTR inside RTL pages. */
html[dir="rtl"] .card-title,
html[dir="rtl"] .card-text,
html[dir="rtl"] .contest-description,
html[dir="rtl"] .chat-msg-bubble,
html[dir="rtl"] .comment-text {
    unicode-bidi: plaintext;
}

/* ---------- Reels (full-screen vertical performances) ---------- */
body.reels-page {
    background: #000;
    overscroll-behavior: none;
}

body.reels-page .app-footer,
body.reels-page .chat-widget,
body.reels-page .pwa-install-banner,
body.reels-page main:empty {
    display: none !important;
}

body.reels-page .app-bottom-nav {
    background: #000;
    border-top-color: #1f2937;
}

body.reels-page .app-bottom-nav-item { color: #9ca3af; }
body.reels-page .app-bottom-nav-item.active { color: #fff; }

.reels-shell {
    --reels-top: 0px;
    --reels-bottom: calc(56px + env(safe-area-inset-bottom));
    position: relative;
    height: calc(100dvh - var(--reels-top) - var(--reels-bottom));
    background: #000;
    color: #fff;
}

@media (max-width: 991.98px) {
    body.reels-page .app-navbar { display: none; }
}

@media (min-width: 992px) {
    .reels-shell {
        --reels-top: 68px;
        --reels-bottom: 0px;
    }
}

.reels-topbar {
    position: absolute;
    z-index: 20;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, calc((100dvh - var(--reels-top) - var(--reels-bottom)) * 9 / 16));
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: calc(0.6rem + env(safe-area-inset-top)) 0.75rem 1.5rem;
    background: linear-gradient(rgba(0, 0, 0, 0.55), transparent);
    pointer-events: none;
}

.reels-topbar > * { pointer-events: auto; }

.reels-title {
    flex: 1;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
}

.reels-icon-btn {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    text-decoration: none;
}

.reels-icon-btn:hover { color: #fff; background: rgba(0, 0, 0, 0.55); }

.reels-feed {
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    overscroll-behavior: contain;
}

.reels-feed::-webkit-scrollbar { display: none; }

.reel {
    position: relative;
    height: 100%;
    width: min(100%, calc((100dvh - var(--reels-top) - var(--reels-bottom)) * 9 / 16));
    margin: 0 auto;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: hidden;
    background: #111;
}

.reel-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #111;
}

.reel-tap {
    position: absolute;
    inset: 0;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.reel-state {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    width: 84px;
    height: 84px;
    margin: -42px 0 0 -42px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
}

.reel.is-paused .reel-state { opacity: 1; transform: scale(1); }

.reel-shade {
    position: absolute;
    inset: auto 0 0 0;
    height: 45%;
    z-index: 3;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    pointer-events: none;
}

.reel-info {
    position: absolute;
    z-index: 4;
    left: 0.9rem;
    right: 4.6rem;
    bottom: 1.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.reel-user,
.reel-contest {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.reel-user:hover, .reel-contest:hover { color: #fff; }

.reel-avatar {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #fff;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
}

.reel-name { font-weight: 700; font-size: 1rem; }
.reel-city { opacity: 0.85; font-size: 0.9rem; white-space: nowrap; }

.reel-contest {
    font-size: 0.88rem;
    opacity: 0.95;
    flex-wrap: wrap;
    row-gap: 0;
}

.reel-dot { opacity: 0.7; }

.reel-badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #3b1d00;
    text-shadow: none;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
}

.reel-actions {
    position: absolute;
    z-index: 4;
    right: 0.55rem;
    bottom: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.reel-action {
    border: 0;
    background: none;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    font-size: 1.85rem;
    line-height: 1;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
    padding: 0;
    min-width: 48px;
}

.reel-action .reel-count { font-size: 0.75rem; font-weight: 700; }
.reel-like.is-liked i { color: #ff3b5c; animation: reel-pop 0.3s ease; }

@keyframes reel-pop {
    50% { transform: scale(1.3); }
}

.reel-heart-burst {
    position: absolute;
    z-index: 5;
    font-size: 6rem;
    color: #ff3b5c;
    transform: translate(-50%, -50%) scale(0);
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.4));
    animation: reel-heart 0.9s ease forwards;
    pointer-events: none;
}

@keyframes reel-heart {
    15% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    30% { transform: translate(-50%, -50%) scale(0.95); }
    45%, 70% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -80%) scale(1.1); opacity: 0; }
}

.reel-progress {
    position: absolute;
    z-index: 4;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.25);
}

.reel-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: #fff;
}

.reels-empty {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
    padding: 2rem;
    color: #d1d5db;
}

.reels-empty i { font-size: 3.5rem; color: var(--brand-primary-light); }

/* Comments bottom sheet */
.reels-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.reels-sheet-backdrop.is-open { opacity: 1; }

.reels-sheet {
    position: fixed;
    z-index: 1051;
    left: 50%;
    bottom: 0;
    width: min(100%, 520px);
    max-height: 72dvh;
    display: flex;
    flex-direction: column;
    background: #fff;
    color: var(--brand-dark);
    border-radius: 1.25rem 1.25rem 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    transform: translate(-50%, 100%);
    transition: transform 0.25s ease;
}

.reels-sheet.is-open { transform: translate(-50%, 0); }

.reels-sheet-handle {
    width: 42px;
    height: 5px;
    border-radius: 3px;
    background: #d1d5db;
    margin: 0.6rem auto 0;
}

.reels-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem 0.75rem;
    border-bottom: 1px solid var(--brand-border);
}

.reels-sheet-header h2 { font-size: 1rem; font-weight: 700; margin: 0; }

.reels-sheet-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    min-height: 160px;
}

.reels-sheet-empty {
    text-align: center;
    color: var(--brand-muted);
    padding: 2rem 0;
}

.reels-comment {
    display: flex;
    gap: 0.65rem;
    margin-bottom: 0.9rem;
}

.reels-comment.is-reply { margin-left: 2.6rem; }

.reels-comment-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reels-comment-head { display: flex; gap: 0.5rem; align-items: baseline; font-size: 0.85rem; }
.reels-comment-head span { color: var(--brand-muted); font-size: 0.75rem; }
.reels-comment-text { font-size: 0.9rem; word-break: break-word; }

.reels-comment-reply {
    border: 0;
    background: none;
    padding: 0;
    color: var(--brand-muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.reels-sheet-form,
.reels-sheet-login {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--brand-border);
}

.reels-sheet-form input { font-size: 16px; }

.reels-reply-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--brand-muted);
    margin-bottom: 0.4rem;
}

.reels-reply-chip[hidden] { display: none; }

.reels-toast {
    position: fixed;
    z-index: 1060;
    left: 50%;
    bottom: calc(80px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    background: rgba(17, 24, 39, 0.92);
    color: #fff;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
}

.reels-toast[hidden] { display: none; }

/* Reels strip on the home page */
.reels-strip {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}

.reels-strip-item {
    position: relative;
    flex: 0 0 auto;
    width: 150px;
    aspect-ratio: 9 / 16;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #111 center / cover no-repeat;
    scroll-snap-align: start;
    color: #fff;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.reels-strip-item::after {
    content: "";
    position: absolute;
    inset: 40% 0 0 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
}

.reels-strip-item:hover { color: #fff; transform: translateY(-2px); }

.reels-strip-play {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 1;
    font-size: 1.1rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.reels-strip-meta {
    position: absolute;
    z-index: 1;
    left: 0.6rem;
    right: 0.6rem;
    bottom: 0.55rem;
    font-size: 0.78rem;
    line-height: 1.3;
}

.reels-strip-meta strong { display: block; font-size: 0.85rem; }
.reels-strip-meta span { opacity: 0.85; display: flex; align-items: center; gap: 0.25rem; }

/* Reels in right-to-left languages: mirror the action rail and back arrow. */
html[dir="rtl"] .reel-actions { right: auto; left: 0.55rem; }
html[dir="rtl"] .reel-info { left: 4.6rem; right: 0.9rem; }
html[dir="rtl"] .reels-topbar .bi-arrow-left { transform: scaleX(-1); }

/* Language switcher: icon + label, so it can't use the fixed 40px icon-button
   width (the label used to spill over the Login button). */
.app-navbar .icon-btn.lang-switch-btn {
    width: auto;
    min-width: 40px;
    padding: 0 0.7rem !important;
    border-radius: 999px;
    gap: 0.4rem;
    white-space: nowrap;
}

/* Keep the desktop menu on one line, even in languages with long words. */
.app-navbar .navbar-nav .nav-link {
    white-space: nowrap;
}

@media (min-width: 992px) and (max-width: 1399.98px) {
    .app-navbar .navbar-nav .nav-link {
        font-size: 0.88rem;
        padding-left: 0.55rem !important;
        padding-right: 0.55rem !important;
    }
    .app-navbar .navbar-brand {
        font-size: 1.05rem;
    }
}

/* Push notification prompt */
.push-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: #fff;
    border: 1px solid #fbcfe8;
    border-radius: var(--radius-md);
    padding: 0.9rem 1rem;
    box-shadow: var(--shadow-sm);
}

.push-card[hidden] { display: none; }

.push-card-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

@media (max-width: 575.98px) {
    .push-card { flex-wrap: wrap; }
    .push-card .btn-brand, .push-card [data-push-toggle] { width: 100%; }
}

/* ⓘ info buttons + popovers */
.info-tip {
    border: 0;
    background: none;
    padding: 0 0.2rem;
    margin-inline-start: 0.15rem;
    color: var(--brand-primary);
    font-size: 1rem;
    line-height: 1;
    vertical-align: middle;
    cursor: pointer;
}

.info-tip:hover, .info-tip:focus-visible { color: var(--brand-primary-dark); }

.info-popover {
    --bs-popover-max-width: 320px;
    --bs-popover-header-bg: #fdf2f8;
    --bs-popover-header-color: var(--brand-dark);
    --bs-popover-body-padding-y: 0.75rem;
    font-size: 0.86rem;
    box-shadow: var(--shadow-md);
}

.info-popover .popover-header { font-weight: 700; font-size: 0.9rem; }
.info-popover p { margin-bottom: 0.5rem; }
.info-popover p:last-child { margin-bottom: 0; }

.info-steps {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0;
    counter-reset: step;
}

.info-steps li {
    position: relative;
    padding-inline-start: 1.9rem;
    padding-bottom: 0.7rem;
    counter-increment: step;
}

.info-steps li:last-child { padding-bottom: 0; }

.info-steps li::before {
    content: counter(step);
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* connector line */
.info-steps li:not(:last-child)::after {
    content: "";
    position: absolute;
    inset-inline-start: 0.65rem;
    top: 1.45rem;
    bottom: 0.15rem;
    width: 2px;
    background: #e5e7eb;
}

.info-steps li.done::before { content: "✓"; background: #16a34a; color: #fff; }
.info-steps li.current::before { background: #f59e0b; color: #fff; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25); }
.info-steps li strong { display: block; }
.info-steps li span { display: block; color: var(--brand-muted); font-size: 0.8rem; }
.info-steps li.current strong { color: #b45309; }

/* ---------- Legal pages ---------- */
.footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 1.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.legal-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.legal-crumbs a {
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--brand-border);
    background: #fff;
    color: var(--brand-dark);
    text-decoration: none;
}

.legal-crumbs a.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

.legal-card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    line-height: 1.7;
    font-size: 0.95rem;
}

@media (min-width: 768px) {
    .legal-card { padding: 2.25rem 2.5rem; }
}

.legal-intro { font-size: 1rem; }

.legal-toc {
    background: var(--brand-bg);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin: 1.25rem 0 1.5rem;
}

.legal-toc ol { margin: 0; padding-left: 1.25rem; columns: 2 220px; column-gap: 2rem; }
.legal-toc li { margin-bottom: 0.25rem; break-inside: avoid; }
.legal-toc a { text-decoration: none; }

.legal-section { scroll-margin-top: 90px; padding-top: 0.5rem; }
.legal-section h2, .legal-contact h2 { font-size: 1.15rem; font-weight: 700; margin: 1.25rem 0 0.6rem; }
.legal-section ul, .legal-section ol { padding-left: 1.25rem; }
.legal-section li { margin-bottom: 0.4rem; }

.legal-table { font-size: 0.88rem; }
.legal-table th { background: var(--brand-bg); white-space: nowrap; }
.legal-table td:first-child { font-weight: 600; width: 30%; }

.legal-contact {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--brand-border);
}

/* Navbar dropdowns on phones/tablets: the language, notification and account
   menus sit near the right edge, so anchoring them to their icon pushed them
   off the left side of small screens. Below lg they open full-width under
   the header instead. */
.app-navbar .dropdown-menu[data-bs-popper="static"],
.app-navbar .dropdown-menu-end {
    right: 0;
    left: auto;
}

@media (max-width: 991.98px) {
    .app-navbar .lang-menu,
    .app-navbar .notification-dropdown-menu {
        position: fixed !important;
        top: var(--app-navbar-h, 64px) !important;
        left: 0.5rem !important;
        right: 0.5rem !important;
        width: auto !important;
        max-width: none !important;
        margin-top: 0 !important;
        transform: none !important;
    }
    .app-navbar .notification-dropdown-menu {
        max-height: calc(100vh - var(--app-navbar-h, 64px) - 90px);
    }
    .app-navbar .lang-menu-grid {
        max-height: calc(100vh - var(--app-navbar-h, 64px) - 150px);
    }
}

/* Logo image in the header and footer (uploaded in Admin → Settings). The
   white rounded plate keeps any logo readable on the pink/navy backgrounds. */
.app-navbar .navbar-brand {
    display: flex;
    align-items: center;
    padding: 0;
    min-width: 0;
}
.brand-logo-header {
    display: block;
    height: 48px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    background: #fff;
    border-radius: 10px;
    padding: 4px 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.brand-logo-footer {
    height: 64px;
    max-width: 240px;
    padding: 6px 14px;
    border-radius: 12px;
}
.footer-tagline {
    font-family: var(--font-heading);
    font-size: 1rem;
}
@media (max-width: 575.98px) {
    .app-navbar .brand-logo-header {
        height: 42px;
        max-width: 130px;
        padding: 3px 8px;
    }
}

/* ---------- Prize promotion (home page + contest cards) ---------- */
.contest-card .card-prize-tag {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    background: var(--brand-gold);
    color: #3b2500;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.hero-stats .stat-box-prize {
    background: rgba(251, 191, 36, 0.22);
    border-color: rgba(251, 191, 36, 0.55);
}
.hero-stats .stat-box-prize .stat-number {
    color: #ffe08a;
    white-space: nowrap;
}

.prize-spotlight {
    background: linear-gradient(180deg, #fff8e6 0%, var(--brand-bg) 100%);
}
.prize-eyebrow {
    display: inline-block;
    background: var(--brand-gold);
    color: #3b2500;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
}
.prize-gold {
    background: linear-gradient(90deg, #f59e0b, #e5257e);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

.prize-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md, 0 6px 24px rgba(17, 24, 39, 0.08));
    border: 1px solid rgba(251, 191, 36, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.prize-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(17, 24, 39, 0.12);
}
.prize-card-media {
    position: relative;
    display: block;
    aspect-ratio: 2 / 1;
    background: var(--brand-gradient) center / cover no-repeat;
}
.prize-card-media .category-pill {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(17, 24, 39, 0.65);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
}
.prize-card-badge {
    position: absolute;
    right: 0.75rem;
    bottom: -1.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    color: #3b2500;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-md);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.45);
    border: 2px solid #fff;
}
.prize-card-badge small {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.prize-card-badge strong {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    white-space: nowrap;
}
.prize-card h3 {
    padding-right: 7.5rem;
}
.prize-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0;
    border-bottom: 1px dashed var(--brand-border);
}
.prize-list li:last-child {
    border-bottom: 0;
}
.prize-list .bi-trophy-fill { font-size: 1rem; }
.prize-rank-1 .bi-trophy-fill { color: #f59e0b; }
.prize-rank-2 .bi-trophy-fill { color: #9ca3af; }
.prize-rank-3 .bi-trophy-fill { color: #b45309; }
.prize-rank-4 .bi-trophy-fill { color: var(--brand-purple); }
.prize-rank-1 strong { color: #b45309; font-size: 1.05rem; }
.prize-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
}
@media (max-width: 575.98px) {
    .prize-card h3 { padding-right: 0; margin-top: 0.6rem; }
}
