/* =========================================================
   RATEMATCH // HEATCHECK — OBSIDIAN & CRIMSON EMBER DESIGN
   Estilo Hot, Maduro, Seductor & Premium (High-End Chemistry)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@600;700;800&display=swap');

:root {
    /* Obsidian & Velvet Dark Base */
    --bg-void: #07060a;
    --bg-panel: rgba(18, 14, 24, 0.82);
    --bg-surface: rgba(28, 22, 38, 0.72);
    --bg-card: rgba(24, 18, 33, 0.85);

    /* Subtle Luxury Borders */
    --border-metal: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 42, 84, 0.18);
    --border-focus: rgba(255, 42, 84, 0.65);

    /* Typography Colors */
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    /* Passion & Heat Palette */
    --thermal-cold: #38bdf8;
    --thermal-ambient: #c084fc;
    --thermal-warm: #fb923c;
    --thermal-hot: #ff2a5f;
    --thermal-thermo: #ff0055;
    --thermal-phosphor: #fbbf24;
    
    --glow-crimson: 0 0 35px rgba(255, 42, 95, 0.35);
    --glow-gold: 0 0 25px rgba(251, 191, 36, 0.4);

    --font-display: 'Space Grotesk', sans-serif;
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Space Grotesk', sans-serif;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 9999px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-void);
    background-image: 
        radial-gradient(circle at 85% 12%, rgba(255, 42, 95, 0.16) 0%, transparent 40%),
        radial-gradient(circle at 15% 88%, rgba(168, 85, 247, 0.12) 0%, transparent 42%),
        radial-gradient(circle at 50% 50%, rgba(255, 94, 58, 0.04) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    user-select: none;
    position: relative;
    letter-spacing: -0.01em;
}

/* Seductive atmospheric noise texture */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, transparent 20%, rgba(7, 6, 10, 0.7) 100%);
    pointer-events: none;
    z-index: 1;
}

/* =========================================
   TOP HUD & NAVIGATION BAR
   ========================================= */
.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-metal);
    background: rgba(11, 8, 16, 0.88);
    backdrop-filter: blur(20px) saturate(160%);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #FFF;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #FFFFFF 30%, #ff8b7b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-title span.flame {
    -webkit-text-fill-color: initial;
    filter: drop-shadow(0 0 10px rgba(255, 42, 95, 0.7));
    animation: flamePulse 2s ease-in-out infinite alternate;
}

@keyframes flamePulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(255, 42, 95, 0.5)); }
    100% { transform: scale(1.15) rotate(4deg); filter: drop-shadow(0 0 16px rgba(255, 75, 43, 0.9)); }
}

.hud-network-actions {
    margin-left: auto;
    margin-right: 18px;
    display: flex;
    gap: 8px;
}

.btn-tactical-network {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    letter-spacing: 0.02em;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-tactical-network:hover {
    border-color: var(--thermal-hot);
    background: rgba(255, 42, 95, 0.12);
    color: #FFF;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 42, 95, 0.2);
}

.btn-tactical-network .net-tag {
    font-size: 9px;
    background: rgba(255, 42, 95, 0.2);
    color: var(--thermal-hot);
    padding: 2px 6px;
    border-radius: var(--radius-pill);
    font-weight: 800;
}

.hud-status-line {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sensor-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--thermal-hot);
    box-shadow: 0 0 12px var(--thermal-hot);
    animation: hotPulse 1.6s infinite;
}

@keyframes hotPulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 12px var(--thermal-hot); }
    50% { opacity: 0.5; transform: scale(0.85); box-shadow: 0 0 4px var(--thermal-hot); }
}

/* =========================================
   MAIN APP CONTAINER
   ========================================= */
.app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 10;
}

.view-screen {
    width: 100%;
    display: none;
    flex-direction: column;
    animation: screenReveal 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view-screen.active {
    display: flex;
}

@keyframes screenReveal {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* =========================================
   SEXY GLASS CARD (TACTICAL BOX REDESIGNED)
   ========================================= */
.tactical-box {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    position: relative;
    padding: 26px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    backdrop-filter: blur(24px) saturate(180%);
    box-shadow: 0 24px 60px -15px rgba(0, 0, 0, 0.85), 0 0 40px -10px rgba(255, 42, 95, 0.12);
    overflow: hidden;
}

/* Ambient glow accent at the top of the card */
.tactical-box::before {
    content: "";
    position: absolute;
    top: 0; left: 10%; right: 10%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 42, 95, 0.6), transparent);
}

.box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-metal);
    padding-bottom: 14px;
}

.box-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #FFF;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.box-telemetry {
    font-size: 11px;
    font-weight: 700;
    color: var(--thermal-hot);
    background: rgba(255, 42, 95, 0.1);
    border: 1px solid rgba(255, 42, 95, 0.25);
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    letter-spacing: 0.05em;
}

/* =========================================
   STAGE 1: CAMERA & VIEWFINDER
   ========================================= */
.viewfinder-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    background: #000;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 42, 95, 0.25);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.viewfinder-frame video,
.viewfinder-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.viewfinder-frame img.partner-photo {
    transform: none;
}

/* Elegant HUD overlay */
.crosshair-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
    background: linear-gradient(180deg, rgba(7, 6, 10, 0.4) 0%, transparent 35%, transparent 65%, rgba(7, 6, 10, 0.6) 100%);
}

.hud-watermark {
    font-size: 11px;
    color: #FFF;
    text-shadow: 0 2px 6px rgba(0,0,0,0.8);
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.center-cross {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 40px; height: 40px;
    pointer-events: none;
}
.center-cross::before {
    content: "";
    position: absolute;
    top: 0; left: 50%; width: 1px; height: 100%;
    background: rgba(255, 42, 95, 0.4);
}
.center-cross::after {
    content: "";
    position: absolute;
    top: 50%; left: 0; height: 1px; width: 100%;
    background: rgba(255, 42, 95, 0.4);
}

/* Inputs & Form Elements */
.input-tactical {
    background: rgba(14, 11, 20, 0.7);
    border: 1px solid var(--border-metal);
    border-radius: var(--radius-sm);
    color: #FFF;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    padding: 14px 16px;
    width: 100%;
    outline: none;
    transition: all 0.2s ease;
}

.input-tactical:focus {
    border-color: var(--thermal-hot);
    box-shadow: 0 0 16px rgba(255, 42, 95, 0.25);
    background: rgba(20, 15, 28, 0.9);
}

/* Buttons: Seductive Crimson & Glass */
.btn-tactical {
    background: linear-gradient(135deg, #ff2a5f 0%, #ff5e36 100%);
    color: #FFF;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 15px 22px;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
    box-shadow: 0 6px 20px rgba(255, 42, 95, 0.35);
}

.btn-tactical:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(255, 42, 95, 0.55);
    filter: brightness(1.08);
}

.btn-tactical:active {
    transform: translateY(0) scale(0.98);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-metal);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #FFF;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* =========================================
   STAGE 2: RADAR QUEUE (PASSION RINGS)
   ========================================= */
.radar-scanner {
    width: 100%;
    aspect-ratio: 1;
    max-height: 280px;
    margin: 12px auto;
    position: relative;
    border-radius: 50%;
    border: 1px solid rgba(255, 42, 95, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(circle, rgba(255, 42, 95, 0.06) 0%, transparent 70%);
}

.radar-sweep {
    position: absolute;
    width: 100%;
    height: 100%;
    background: conic-gradient(from 0deg, transparent 65%, rgba(255, 42, 95, 0.4) 100%);
    animation: rotateSweep 2.4s linear infinite;
}

@keyframes rotateSweep {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.radar-circles {
    position: absolute;
    border: 1px solid rgba(255, 42, 95, 0.12);
    border-radius: 50%;
}
.radar-c1 { width: 33%; height: 33%; }
.radar-c2 { width: 66%; height: 66%; }
.radar-c3 { width: 95%; height: 95%; }

/* =========================================
   STAGE 3: THE HEATCHECK ENCOUNTER (1-10)
   ========================================= */
.encounter-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(14, 11, 20, 0.6);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-metal);
}

.partner-tag {
    font-weight: 700;
    color: #FFF;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timer-countdown {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 800;
    color: var(--thermal-hot);
    background: rgba(255, 42, 95, 0.12);
    border: 1px solid rgba(255, 42, 95, 0.3);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

/* Mechanical Heat Gauge / Slider */
.heat-gauge-container {
    background: rgba(14, 11, 20, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gauge-readout {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.gauge-level {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 900;
    color: var(--thermal-hot);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    filter: drop-shadow(0 0 10px rgba(255, 42, 95, 0.4));
}

.gauge-state {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Sleek Glowing Slider Track */
.slider-rail {
    position: relative;
    width: 100%;
    height: 48px;
    background: rgba(7, 6, 10, 0.85);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    padding: 0 12px;
    touch-action: none;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.heat-slider-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 100%;
    background: transparent;
    outline: none;
    cursor: grab;
    z-index: 5;
}

.heat-slider-input:active {
    cursor: grabbing;
}

.heat-slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    background: radial-gradient(circle, #FFF 25%, #ff2a5f 70%, #ff5e36 100%);
    border: 2px solid #FFF;
    border-radius: 50%;
    box-shadow: 0 0 18px rgba(255, 42, 95, 0.8);
    cursor: ew-resize;
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.heat-slider-input::-webkit-slider-thumb:active {
    transform: scale(1.2);
    box-shadow: 0 0 26px rgba(255, 42, 95, 1);
}

.slider-notches {
    position: absolute;
    top: 0; left: 16px; right: 16px; height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 2;
}

.notch {
    width: 2px;
    height: 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 1px;
}
.notch.major {
    height: 22px;
    background: var(--thermal-hot);
    box-shadow: 0 0 6px rgba(255, 42, 95, 0.5);
}

.notch-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    margin-top: 4px;
}

.encounter-actions {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 12px;
    margin-top: 8px;
}

/* =========================================
   STAGE 4: EXPLOSION / SHOCKWAVE OVERLAY
   ========================================= */
#shockwaveOverlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #FFF;
    opacity: 0;
    pointer-events: none;
    z-index: 99999;
}
#shockwaveOverlay.ignite {
    animation: hotDetonation 1.4s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

@keyframes hotDetonation {
    0% { opacity: 1; background: #FFF; }
    20% { opacity: 0.9; background: #ff2a5f; }
    50% { opacity: 0.4; background: #07060a; }
    100% { opacity: 0; }
}

/* =========================================
   STAGE 5: 5-MINUTE BURNER CHAT
   ========================================= */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 75vh;
    max-height: 640px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: 0 24px 60px -15px rgba(0, 0, 0, 0.9);
}

.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-metal);
    background: rgba(14, 11, 20, 0.9);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detonator-clock {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    color: var(--thermal-hot);
    letter-spacing: 0.05em;
    text-shadow: 0 0 12px rgba(255, 42, 95, 0.5);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 42, 95, 0.1);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 42, 95, 0.3);
}

.detonator-clock.warning {
    color: #ff0033;
    animation: flashAlarm 0.8s infinite;
}

@keyframes flashAlarm {
    0%, 100% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 10px #ff0033); }
    50% { opacity: 0.4; transform: scale(0.96); filter: none; }
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-msg {
    max-width: 82%;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}

.chat-msg.mine {
    align-self: flex-end;
    background: linear-gradient(135deg, #ff2a5f 0%, #ff5e36 100%);
    color: #FFF;
    border-bottom-right-radius: 4px;
}

.chat-msg.theirs {
    align-self: flex-start;
    background: rgba(28, 22, 38, 0.85);
    border: 1px solid var(--border-metal);
    color: #f1f5f9;
    border-bottom-left-radius: 4px;
}

.msg-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.chat-input-bar {
    padding: 14px;
    border-top: 1px solid var(--border-metal);
    background: rgba(11, 8, 16, 0.95);
    display: flex;
    gap: 10px;
}

/* =========================================
   SISTER APPS BANNER (RED PULSIDEV)
   ========================================= */
.network-tactical-banner {
    margin-top: 36px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
}

.banner-telemetry {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.btn-banner-link {
    background: rgba(255, 42, 95, 0.1);
    border: 1px solid rgba(255, 42, 95, 0.3);
    color: #FFF;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    letter-spacing: 0.03em;
    transition: all 0.2s ease;
}

.btn-banner-link:hover {
    background: var(--thermal-hot);
    color: #FFF;
    box-shadow: 0 4px 15px rgba(255, 42, 95, 0.4);
    transform: translateY(-1px);
}

/* Dev helper button */
.dev-helper {
    position: fixed;
    bottom: 12px;
    right: 12px;
    z-index: 999;
}

.btn-dev {
    background: rgba(18, 14, 24, 0.85);
    color: var(--thermal-hot);
    border: 1px solid rgba(255, 42, 95, 0.3);
    border-radius: var(--radius-pill);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    padding: 6px 14px;
    cursor: pointer;
    backdrop-filter: blur(10px);
}
.btn-dev:hover {
    background: var(--thermal-hot);
    color: #FFF;
}

/* Toast alert */
.thermal-toast {
    position: fixed;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(18, 14, 24, 0.95);
    border: 1px solid var(--thermal-hot);
    border-radius: var(--radius-pill);
    color: #FFF;
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 600;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8), 0 0 20px rgba(255, 42, 95, 0.3);
    display: none;
}
