/* IGNITE — dark "night out" brand. The heat scale (amber → orange → red → pink)
   IS the brand gradient: the same temperature idea that drives the reactions. */
:root {
    --ignite-amber: #F0B429;
    --ignite-orange: #F3701B;
    --ignite-red: #F5223C;
    --spark-pink: #E0348B;
    --ignite-gradient: linear-gradient(135deg, #F0B429 0%, #F3701B 38%, #F5223C 70%, #E0348B 100%);
    --ignite-gradient-soft: linear-gradient(135deg, #F3701B, #E0348B);

    --night-bg: #0E0C12;
    --night-surface: #1A1720;
    --night-surface-2: #221E2B;
    --night-surface-variant: #2A2632;
    --hairline: rgba(255, 255, 255, 0.07);

    --on-night: #F5F1F8;
    --on-night-muted: #ADA4BC;
    --error: #FF6B6B;

    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.55);
}

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

html, body { height: 100%; }

body {
    background: #050409;
    color: var(--on-night);
    font-family: 'Outfit', 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
    display: flex;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Phone-shaped container so the web app mirrors the Android layout. The warm
   top glow + pink bottom glow give the whole app depth and brand ambience. */
.phone {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(120% 55% at 50% -8%, rgba(243, 112, 27, 0.16), transparent 60%),
        radial-gradient(120% 45% at 50% 108%, rgba(224, 52, 139, 0.14), transparent 60%),
        var(--night-bg);
    display: flex;
    flex-direction: column;
    position: relative;
}

.content { flex: 1; display: flex; flex-direction: column; }
.phone.with-nav .content { padding-bottom: 72px; }

.screen { padding: 0 16px 16px; flex: 1; display: flex; flex-direction: column; }
.auth-screen { padding: 24px; gap: 16px; }

.hidden { display: none !important; }

.screen-title { font-size: 24px; font-weight: 800; letter-spacing: 0.2px; padding: 14px 0; }
.section-title { font-size: 18px; font-weight: 700; margin: 24px 0 8px; }

.muted { color: var(--on-night-muted); }
.small { font-size: 13px; }
.error { color: var(--error); }

/* ===== Brand logo (flame + gradient wordmark) ===== */
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}

.brand-flame {
    width: 26px;
    height: 26px;
    transform-origin: 50% 92%;
    animation: flame-flicker 2.8s ease-in-out infinite;
}

.brand-word-group { display: inline-flex; align-items: baseline; gap: 6px; }

.brand-word {
    font-weight: 800;
    letter-spacing: 3px;
    font-size: 20px;
    background: var(--ignite-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-sub {
    font-weight: 700;
    letter-spacing: 3px;
    font-size: 11px;
    color: var(--on-night-muted);
    text-transform: uppercase;
}

.brand-logo.lg { flex-direction: column; gap: 12px; }
.brand-logo.lg .brand-flame { width: 66px; height: 66px; }
.brand-logo.lg .brand-word { font-size: 42px; letter-spacing: 7px; }
.brand-logo.lg .brand-sub { font-size: 15px; letter-spacing: 4px; }

@keyframes flame-flicker {
    0%, 100% { transform: scale(1) rotate(-1.5deg); filter: drop-shadow(0 0 8px rgba(243, 112, 27, 0.55)); }
    25%      { transform: scale(1.07) rotate(1.5deg); filter: drop-shadow(0 0 15px rgba(245, 34, 60, 0.7)); }
    50%      { transform: scale(0.97) rotate(-1deg); filter: drop-shadow(0 0 11px rgba(240, 180, 41, 0.6)); }
    75%      { transform: scale(1.05) rotate(1deg); filter: drop-shadow(0 0 17px rgba(224, 52, 139, 0.65)); }
}

/* ===== Top app bar ===== */
.app-bar {
    display: flex;
    align-items: center;
    height: 56px;
    padding: 0 18px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: linear-gradient(180deg, rgba(14, 12, 18, 0.92), rgba(14, 12, 18, 0.5));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--hairline);
}

/* ===== Entrance animation (staggered via --d) ===== */
.rise {
    opacity: 0;
    transform: translateY(16px);
    animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
    animation-delay: calc(var(--d, 0) * 75ms);
}

@keyframes rise { to { opacity: 1; transform: none; } }

/* ===== Auth screens ===== */
.auth-brand { display: flex; justify-content: center; padding-top: 36px; margin-bottom: 6px; }
.auth-sub { text-align: center; color: var(--on-night-muted); font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
    .brand-flame { animation: none; }
    .rise { opacity: 1; transform: none; animation: none; }
}

/* ===== Forms ===== */
form { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--on-night-muted); }
.field small { font-size: 12px; }

input[type="text"], input[type="email"], input[type="password"], textarea {
    background: var(--night-surface);
    border: 1px solid var(--night-surface-variant);
    border-radius: 12px;
    color: var(--on-night);
    font-size: 16px;
    padding: 14px;
    outline: none;
    width: 100%;
    font-family: inherit;
}

input:focus, textarea:focus { border-color: var(--ignite-orange); }
textarea { resize: vertical; }

.btn-primary {
    background: var(--ignite-gradient-soft);
    border: none;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
    padding: 15px 28px;
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(243, 112, 27, 0.32);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
    transform: translateX(-120%);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(245, 34, 60, 0.42);
    filter: brightness(1.05);
}

.btn-primary:hover:not(:disabled)::after { animation: shimmer 0.9s ease; }
.btn-primary:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.btn-primary:disabled { background: var(--night-surface-variant); color: var(--on-night-muted); cursor: default; box-shadow: none; }

@keyframes shimmer { to { transform: translateX(120%); } }

.btn-outline {
    background: transparent;
    border: 1px solid var(--on-night-muted);
    border-radius: 24px;
    color: var(--on-night);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 24px;
}

.btn-inline { width: auto; align-self: center; }

.text-button {
    background: none;
    border: none;
    color: var(--ignite-orange);
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    text-decoration: none;
    padding: 8px;
}

/* ===== Bottom navigation ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 480px;
    background: linear-gradient(180deg, rgba(26, 23, 32, 0.82), rgba(16, 14, 22, 0.98));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--hairline);
    display: flex;
    height: 68px;
    z-index: 10;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--on-night-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    position: relative;
    transition: color 0.2s ease;
}

.nav-item svg { width: 24px; height: 24px; transition: transform 0.2s ease, filter 0.2s ease; }
.nav-item.active { color: var(--ignite-orange); }
.nav-item.active svg {
    transform: translateY(-2px) scale(1.08);
    filter: drop-shadow(0 4px 10px rgba(243, 112, 27, 0.55));
}

.nav-item.active::before {
    content: "";
    position: absolute;
    top: 7px;
    width: 26px;
    height: 3px;
    border-radius: 3px;
    background: var(--ignite-gradient);
    box-shadow: 0 0 10px rgba(243, 112, 27, 0.7);
}

/* ===== Empty / error / permission states ===== */
.center-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    padding: 24px;
}

.state-emoji { font-size: 48px; }

/* ===== Discover ===== */
.discover-screen { display: flex; flex-direction: column; }

#deck-area { flex: 1; display: flex; flex-direction: column; }

.discover-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.filter-toggle {
    position: relative;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--hairline);
    background: var(--night-surface);
    color: var(--on-night);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.15s ease;
}

.filter-toggle:hover { background: var(--night-surface-variant); transform: translateY(-1px); }
.filter-toggle svg { width: 20px; height: 20px; }

.filter-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--ignite-gradient-soft);
    border: 2px solid var(--night-surface);
}

.empty-actions { display: flex; flex-direction: column; gap: 10px; align-items: center; }

/* ===== Filter sheet ===== */
.filter-sheet { position: fixed; inset: 0; z-index: 60; }

.filter-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: fade-in 0.2s ease;
}

.filter-panel {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    max-height: 88dvh;
    overflow-y: auto;
    background: var(--night-surface);
    border-radius: 22px 22px 0 0;
    border-top: 1px solid var(--hairline);
    box-shadow: var(--shadow-lg);
    padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 22px;
    animation: sheet-up 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }

@media (prefers-reduced-motion: reduce) {
    .filter-backdrop, .filter-panel { animation: none; }
}

.filter-grabber {
    width: 40px;
    height: 4px;
    border-radius: 4px;
    background: var(--night-surface-variant);
    margin: 2px auto 4px;
}

.filter-header { display: flex; align-items: center; justify-content: space-between; }
.filter-title { font-size: 20px; font-weight: 800; }

.filter-close {
    background: none;
    border: none;
    color: var(--on-night-muted);
    font-size: 18px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.filter-close:hover { background: var(--night-surface-variant); color: var(--on-night); }

.filter-group { display: flex; flex-direction: column; gap: 12px; }

.filter-label { font-size: 13px; font-weight: 700; letter-spacing: 0.4px; color: var(--on-night-muted); }
.filter-label-row { display: flex; align-items: baseline; justify-content: space-between; }
.filter-value { font-size: 14px; font-weight: 800; color: var(--ignite-orange); }

.filter-select {
    background: var(--night-surface-variant);
    border: 1px solid var(--night-surface-variant);
    border-radius: 12px;
    color: var(--on-night);
    font-size: 16px;
    font-family: inherit;
    padding: 13px 14px;
    width: 100%;
    outline: none;
}

.filter-select:focus { border-color: var(--ignite-orange); }

/* Single range (distance) */
.single-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 6px;
    background: var(--night-surface-variant);
    outline: none;
}

.single-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid var(--ignite-orange);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.single-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid var(--ignite-orange);
    cursor: pointer;
}

/* Dual range (age band) */
.dual-range { position: relative; height: 28px; }

.dual-track {
    position: absolute;
    top: 12px;
    left: 0;
    right: 0;
    height: 6px;
    border-radius: 6px;
    background: var(--night-surface-variant);
}

.dual-fill {
    position: absolute;
    height: 100%;
    border-radius: 6px;
    background: var(--ignite-gradient-soft);
}

.dual-range input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 28px;
    margin: 0;
    background: none;
    pointer-events: none;
}

.dual-range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid var(--ignite-orange);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.dual-range input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid var(--ignite-orange);
    cursor: pointer;
}

.profile-card {
    flex: 1;
    min-height: 340px;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    background: var(--night-surface);
}

.profile-card .photo {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-card .photo-initials {
    color: #fff;
    font-size: 48px;
    font-weight: 900;
}

.profile-card .photo-avatar-icon { width: 96px; height: 96px; opacity: 0.9; }

.profile-card .scrim {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.9));
    padding: 48px 20px 20px;
}

.card-name { color: #fff; font-size: 26px; font-weight: 900; }
.card-location { color: rgba(255, 255, 255, 0.85); font-size: 14px; margin-top: 2px; }
.card-bio { color: rgba(255, 255, 255, 0.92); font-size: 15px; margin-top: 10px; }

.card-interests { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.card-interests .chip {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
    background: var(--night-surface-variant);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
}

/* ===== Rating bar (the signature IGNITE control) =====
   Four reactions rising in heat: COLD → SPARK. IGNITE isn't here — it's the
   match itself. Size, glow and emoji all climb with the temperature, so HOT
   visibly outweighs COLD and SPARK dominates the row. */
.rating-hint {
    text-align: center;
    color: var(--on-night-muted);
    font-size: 13px;
    margin-top: 4px;
}

.rating-hint strong { color: var(--ignite-orange); font-weight: 800; }

.rating-bar {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    justify-content: space-around;
    padding: 20px 4px 26px;
    position: relative;
}

.rating-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.rating-btn {
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    border: 2px solid var(--rating-color);
    background:
        radial-gradient(circle at 35% 28%,
            color-mix(in srgb, var(--rating-color) 60%, transparent),
            color-mix(in srgb, var(--rating-color) 12%, transparent));
    box-shadow:
        0 0 var(--glow) color-mix(in srgb, var(--rating-color) 70%, transparent),
        inset 0 1px 1px rgba(255, 255, 255, 0.25);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.rating-emoji {
    font-size: var(--emoji);
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.rating-btn:hover {
    transform: translateY(-6px) scale(1.06);
    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.45),
        0 0 calc(var(--glow) + 16px) color-mix(in srgb, var(--rating-color) 90%, transparent),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.rating-btn:active { transform: translateY(-2px) scale(0.94); }

.rating-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--rating-color);
    text-shadow: 0 0 12px color-mix(in srgb, var(--rating-color) 45%, transparent);
}

/* SPARK is the one that can ignite a match — keep it breathing. */
.is-spark .rating-btn { animation: spark-pulse 2s ease-in-out infinite; }
.is-spark .rating-btn:hover { animation: none; }

@keyframes spark-pulse {
    0%, 100% {
        box-shadow:
            0 0 var(--glow) color-mix(in srgb, var(--rating-color) 70%, transparent),
            inset 0 1px 1px rgba(255, 255, 255, 0.25);
    }
    50% {
        box-shadow:
            0 0 calc(var(--glow) + 18px) color-mix(in srgb, var(--rating-color) 98%, transparent),
            inset 0 1px 1px rgba(255, 255, 255, 0.3);
    }
}

@media (prefers-reduced-motion: reduce) {
    .is-spark .rating-btn { animation: none; }
}

.rating-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--rating-color);
    background: color-mix(in srgb, var(--rating-color) 20%, transparent);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

/* ===== Matches ===== */
.match-list { display: flex; flex-direction: column; gap: 12px; }

.card {
    background: var(--night-surface);
    border-radius: 16px;
    padding: 12px;
}

.match-row { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.match-info { flex: 1; min-width: 0; }
.match-name { font-size: 17px; font-weight: 700; }

/* ===== Avatars ===== */
.avatar {
    border-radius: 50%;
    color: #fff;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.avatar-md { width: 56px; height: 56px; font-size: 16px; }
.avatar-lg { width: 72px; height: 72px; font-size: 20px; }
.avatar-xl { width: 120px; height: 120px; font-size: 32px; }

.avatar-icon { width: 58%; height: 58%; opacity: 0.92; flex-shrink: 0; }

/* ===== Profile (rebrand) ===== */
.profile-screen { padding-bottom: 24px; }

.profile-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 26px 0 6px;
}

.profile-edit-btn {
    position: absolute;
    top: 8px;
    right: 4px;
    z-index: 2;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--night-surface-variant);
    color: var(--on-night);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-edit-btn svg { width: 18px; height: 18px; }
.profile-edit-btn:hover { background: var(--ignite-gradient-soft); }

.hero-glow {
    position: absolute;
    top: 4px;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(243, 112, 27, 0.32), transparent 65%);
    filter: blur(12px);
    pointer-events: none;
    z-index: 0;
}

.avatar-ring {
    position: relative;
    z-index: 1;
    padding: 4px;
    border-radius: 50%;
    background: var(--ignite-gradient);
    box-shadow: 0 0 30px rgba(245, 34, 60, 0.4);
    animation: ring-breathe 4s ease-in-out infinite;
}

.avatar-ring .avatar { border: 3px solid var(--night-bg); }

@keyframes ring-breathe {
    0%, 100% { box-shadow: 0 0 26px rgba(245, 34, 60, 0.35); }
    50%      { box-shadow: 0 0 40px rgba(224, 52, 139, 0.5); }
}

.profile-name { font-size: 27px; font-weight: 800; margin-top: 16px; letter-spacing: 0.3px; z-index: 1; }
.profile-name .age { color: var(--on-night-muted); font-weight: 600; }

.profile-loc {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--on-night-muted);
    font-size: 14px;
    margin-top: 5px;
    z-index: 1;
}

.loc-ico { width: 15px; height: 15px; }

.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: var(--night-surface);
    border: 1px solid var(--hairline);
    border-radius: 18px;
    padding: 16px 8px;
    margin: 22px 0 4px;
}

.stat { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; }

.stat-num {
    font-size: 22px;
    font-weight: 800;
    background: var(--ignite-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat-label { font-size: 12px; color: var(--on-night-muted); letter-spacing: 0.4px; }
.stat-div { width: 1px; height: 30px; background: var(--hairline); }

.panel {
    background: var(--night-surface);
    border: 1px solid var(--hairline);
    border-radius: 18px;
    padding: 18px;
    margin-top: 14px;
}

.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.panel-head .panel-title { margin-bottom: 0; }

.panel-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--on-night-muted);
    margin-bottom: 12px;
}

.panel-hint { font-size: 12px; color: var(--on-night-muted); }
.profile-bio { font-size: 16px; line-height: 1.55; }

.chip-glow {
    background: color-mix(in srgb, var(--ignite-orange) 14%, var(--night-surface-2));
    border: 1px solid color-mix(in srgb, var(--ignite-orange) 35%, transparent);
    color: var(--on-night);
    font-weight: 600;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.photo-cell { aspect-ratio: 1; display: block; }

.photo-btn {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    padding: 0;
    background: var(--night-surface-variant);
    transition: transform 0.15s ease;
}

.photo-btn:hover { transform: scale(1.03); }
.photo-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }

.photo-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.photo-btn:hover .photo-remove { opacity: 1; }
@media (hover: none) { .photo-remove { opacity: 1; } }

.photo-add {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    background: var(--night-surface-2);
    border: 1.5px dashed color-mix(in srgb, var(--ignite-orange) 45%, transparent);
    color: var(--ignite-orange);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.photo-add:hover { background: color-mix(in srgb, var(--ignite-orange) 12%, var(--night-surface-2)); }
.photo-add-plus { font-size: 26px; line-height: 1; }
.photo-add-txt { font-size: 11px; font-weight: 600; }

.logout-form { margin-top: 22px; align-items: flex-start; }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--hairline);
    color: var(--on-night-muted);
    border-radius: 999px;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.btn-ghost:hover { color: var(--ignite-red); border-color: color-mix(in srgb, var(--ignite-red) 50%, transparent); }
.ghost-ico { width: 18px; height: 18px; }

/* ===== Match celebration overlay ===== */
.match-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    /* Gradient colour is set from JS with the match rating colour. */
    background: linear-gradient(to bottom, var(--match-color, var(--ignite-red)), rgba(18, 10, 16, 0.98));
}

.match-overlay:not(.hidden) { animation: overlay-in 0.35s ease; }
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.match-emoji {
    font-size: 76px;
    animation: match-pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4));
}

.match-title {
    color: #fff;
    font-size: 46px;
    font-weight: 900;
    letter-spacing: 5px;
    animation: match-pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) 0.06s both;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.match-subtitle {
    color: #fff;
    font-size: 18px;
    margin: 8px 0 24px;
    animation: match-pop 0.5s ease 0.12s both;
}

.match-overlay .avatar { animation: match-pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) 0.18s both; }
.match-overlay .btn-inline { margin-top: 32px; animation: match-pop 0.5s ease 0.24s both; }

@keyframes match-pop {
    from { opacity: 0; transform: scale(0.7); }
    to   { opacity: 1; transform: scale(1); }
}

/* ===== Onboarding (profile builder) ===== */
.heat-meter { display: flex; flex-direction: column; gap: 6px; }

.heat-track {
    height: 8px;
    border-radius: 999px;
    background: var(--night-surface-variant);
    overflow: hidden;
}

.heat-fill {
    height: 100%;
    width: 0%;
    background: var(--ignite-gradient);
    border-radius: 999px;
    transition: width 0.35s ease;
}

.heat-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--on-night-muted);
}

#heat-word { color: var(--ignite-orange); }

.ob-section {
    background: var(--night-surface);
    border: 1px solid var(--hairline);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ob-section-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--on-night-muted);
}

.ob-hint { font-size: 12px; color: var(--on-night-muted); margin-top: -8px; }

.chip-pick-row { display: flex; flex-wrap: wrap; gap: 8px; }

.chip-pick { position: relative; cursor: pointer; }

.chip-pick input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.chip-pick span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    background: var(--night-surface-variant);
    color: var(--on-night-muted);
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
}

.chip-pick input:checked + span {
    background: var(--ignite-gradient-soft);
    color: #fff;
    box-shadow: 0 4px 14px rgba(243, 112, 27, 0.35);
    transform: translateY(-1px);
}

.chip-pick input:focus-visible + span { outline: 2px solid var(--ignite-orange); outline-offset: 2px; }
.chip-pick input:disabled + span { opacity: 0.35; cursor: not-allowed; }

.interest-cat { display: flex; flex-direction: column; gap: 8px; }
.interest-cat-title { font-size: 13px; font-weight: 700; color: var(--on-night); }

.counter-pill { font-size: 12px; font-weight: 800; color: var(--ignite-orange); white-space: nowrap; }

.bio-wrap { position: relative; }

.bio-counter {
    position: absolute;
    right: 10px;
    bottom: 10px;
    font-size: 11px;
    color: var(--on-night-muted);
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 6px;
    border-radius: 8px;
    pointer-events: none;
}

/* ===== Chat ===== */
.chat-screen { padding: 0; flex: 1; display: flex; flex-direction: column; height: 100dvh; }

.chat-bar, .subpage-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 64px;
    padding: 0 16px;
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(14, 12, 18, 0.92), rgba(14, 12, 18, 0.5));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--hairline);
}

.chat-back {
    color: var(--on-night);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.chat-back svg { width: 24px; height: 24px; }

.chat-bar-info { min-width: 0; }
.chat-bar-name { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-bar-loc { font-size: 12px; color: var(--on-night-muted); }

.msg-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.msg-row { display: flex; }
.msg-row.mine { justify-content: flex-end; }
.msg-row.theirs { justify-content: flex-start; }

.msg-bubble {
    max-width: 78%;
    border-radius: 18px;
    padding: 10px 14px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.msg-row.theirs .msg-bubble {
    background: var(--night-surface-variant);
    border-bottom-left-radius: 4px;
}

.msg-row.mine .msg-bubble {
    background: var(--ignite-gradient-soft);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.msg-text { font-size: 15px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }

.msg-image {
    max-width: 100%;
    max-height: 260px;
    border-radius: 12px;
    object-fit: cover;
}

.msg-time {
    font-size: 10px;
    opacity: 0.7;
    align-self: flex-end;
}

.emoji-panel {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    padding: 10px;
    max-height: 160px;
    overflow-y: auto;
    background: var(--night-surface);
    border-top: 1px solid var(--hairline);
    flex-shrink: 0;
}

.emoji-opt {
    background: none;
    border: none;
    font-size: 22px;
    padding: 6px;
    cursor: pointer;
    border-radius: 8px;
    line-height: 1;
}

.emoji-opt:hover { background: var(--night-surface-variant); }

.chat-composer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    flex-shrink: 0;
    background: var(--night-surface);
    border-top: 1px solid var(--hairline);
}

.composer-btn {
    background: none;
    border: none;
    font-size: 20px;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
}

.composer-btn:hover { background: var(--night-surface-variant); }

.chat-composer input[type="text"] {
    flex: 1;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 15px;
}

.composer-send {
    background: var(--ignite-gradient-soft);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.composer-send svg { width: 20px; height: 20px; }

/* ===== Thermometer (public profile temperature) ===== */
.thermo { display: flex; flex-direction: column; gap: 6px; }

.thermo-scale {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #4F9DDE 0%, #F0B429 50%, #F5223C 100%);
}

.thermo-needle {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--night-bg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -50%);
    transition: left 0.4s ease;
}

.thermo-label { font-size: 12px; font-weight: 700; color: var(--on-night-muted); }
.thermo-label[data-zone="frio"] { color: #4F9DDE; }
.thermo-label[data-zone="morno"] { color: var(--ignite-amber); }
.thermo-label[data-zone="quente"] { color: var(--ignite-red); }

/* Compact variant used on the discovery card scrim */
.card-thermo { margin-top: 10px; }
.card-thermo .thermo-scale { height: 6px; }
.card-thermo .thermo-label { color: rgba(255, 255, 255, 0.9); }
.card-thermo .thermo-needle { width: 12px; height: 12px; }

/* ===== Discovery: spark cooldown + toast ===== */
.rating-item.on-cooldown .rating-btn { filter: grayscale(0.8) brightness(0.6); cursor: not-allowed; }
.rating-item.on-cooldown .rating-btn:hover { transform: none; }
.spark-cooldown-note {
    font-size: 10px;
    font-weight: 700;
    color: var(--on-night-muted);
    margin-top: 2px;
    min-height: 12px;
    text-align: center;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 92px;
    transform: translateX(-50%) translateY(20px);
    max-width: 88%;
    background: var(--night-surface-2);
    border: 1px solid var(--hairline);
    color: var(--on-night);
    padding: 12px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 70;
    text-align: center;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.toast-spark { border-color: color-mix(in srgb, var(--spark-pink) 60%, transparent); }

/* ===== Chat: reaction badge + spark cap notice ===== */
.chat-reactions { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }

.react-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--rb-color, var(--hairline));
    color: var(--rb-color, var(--on-night-muted));
    background: color-mix(in srgb, var(--rb-color, #888) 15%, transparent);
    white-space: nowrap;
}

.chat-notice {
    margin: 0 12px 8px;
    padding: 8px 12px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--spark-pink) 14%, var(--night-surface-2));
    border: 1px solid color-mix(in srgb, var(--spark-pink) 35%, transparent);
    color: var(--on-night);
    font-size: 12px;
    text-align: center;
    flex-shrink: 0;
}
