/* ==========================================================================
   TOKYO 2101 SPRAWL // SHADOWRUN REALISTIC RAINY WINDOW VIDEO GRID
   High-Rise Ballistic Window Pane Simulation with Live Video Streams
   ========================================================================== */

:root {
    --tokyo-bg: #04060a;
    --tokyo-cyan: #00f3ff;
    --tokyo-magenta: #ff0055;
    --tokyo-amber: #ffb700;
    --tokyo-acid-green: #39ff14;
    --tokyo-frame-metal: #121824;
    --tokyo-mullion-border: rgba(0, 243, 255, 0.25);
    --pane-blur: 6px;
}

/* Page Container */
.tokyo-sprawl-wrapper {
    background-color: var(--tokyo-bg);
    color: #e2e8f0;
    font-family: 'JetBrains Mono', 'Segoe UI', -apple-system, monospace;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Ambient Neon City Glow Backdrop */
.tokyo-city-backdrop {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.tokyo-neon-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.28;
    animation: neon-pulse 10s ease-in-out infinite alternate;
}

.glow-shibuya-red {
    width: 600px;
    height: 400px;
    top: 5%;
    left: -100px;
    background: radial-gradient(circle, #ff0055 0%, transparent 70%);
}

.glow-shinjuku-cyan {
    width: 700px;
    height: 500px;
    top: 30%;
    right: -150px;
    background: radial-gradient(circle, #00f3ff 0%, transparent 70%);
    animation-delay: -5s;
}

.glow-chubu-amber {
    width: 500px;
    height: 350px;
    bottom: -50px;
    left: 30%;
    background: radial-gradient(circle, #ffb700 0%, transparent 70%);
    animation-delay: -2s;
}

@keyframes neon-pulse {
    0% { transform: scale(1) translateY(0); opacity: 0.22; }
    50% { transform: scale(1.15) translateY(-20px); opacity: 0.35; }
    100% { transform: scale(0.95) translateY(10px); opacity: 0.25; }
}

/* Top Cyberdeck Telemetry Bar */
.tokyo-telemetry-header {
    background: rgba(10, 15, 26, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 243, 255, 0.25);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 243, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.tokyo-jp-title {
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: #ffffff;
    text-shadow: 0 0 12px rgba(0, 243, 255, 0.7);
}

.tokyo-jp-title span {
    color: var(--tokyo-magenta);
    text-shadow: 0 0 12px rgba(255, 0, 85, 0.8);
}

.sensor-pill {
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 0.25rem 0.65rem;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Architectural Ballistic Window Frame */
.architectural-window-frame {
    background: linear-gradient(135deg, #1e2638 0%, #0d121c 50%, #151c2a 100%);
    border: 8px solid #0b0f17;
    border-radius: 16px;
    box-shadow: 
        inset 0 2px 6px rgba(255, 255, 255, 0.2),
        inset 0 -3px 8px rgba(0, 0, 0, 0.9),
        0 25px 70px rgba(0, 0, 0, 0.95),
        0 0 40px rgba(0, 243, 255, 0.12);
    position: relative;
    padding: 10px;
    overflow: hidden;
}

/* Metal Window Mullions (Pane Separator Grids) */
.window-mullion-grid {
    display: grid;
    gap: 12px;
    background: #090d15;
    padding: 12px;
    border-radius: 10px;
    border: 2px solid rgba(0, 243, 255, 0.18);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}

.grid-quad {
    grid-template-columns: repeat(2, 1fr);
}

.grid-matrix {
    grid-template-columns: repeat(3, 1fr);
}

.grid-single {
    grid-template-columns: 1fr;
}

@media (max-width: 992px) {
    .grid-matrix {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .grid-quad, .grid-matrix {
        grid-template-columns: 1fr;
    }
}

/* Individual Rainy Glass Window Pane */
.window-pane-cell {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #000000;
    border: 2px solid #1f293d;
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.8),
        0 6px 18px rgba(0, 0, 0, 0.7);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 280px;
}

.window-pane-cell.active-focus {
    border-color: var(--tokyo-cyan);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.4), inset 0 0 15px rgba(0, 243, 255, 0.2);
}

/* Aspect Ratio Wrapper for Video */
.pane-video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    background-color: #03060a;
}

.pane-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    transform: scale(1.02); /* slight overscale to conceal edge artifacts */
}

/* ==========================================================================
   WET GLASS SHADER LAYERS (PHYSICAL RAIN & CONDENSATION OVERLAY)
   ========================================================================== */

/* 1. Base Condensation & Blur Layer */
.pane-wet-glass {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    backdrop-filter: blur(var(--pane-blur));
    -webkit-backdrop-filter: blur(var(--pane-blur));
    background: radial-gradient(circle at 45% 45%, rgba(10, 15, 26, 0.15) 0%, rgba(4, 6, 10, 0.65) 100%);
    box-shadow: 
        inset 0 0 60px rgba(0, 243, 255, 0.2),
        inset 0 0 90px rgba(255, 0, 85, 0.15);
    transition: backdrop-filter 0.4s ease, opacity 0.4s ease;
}

/* 2. Streaming Vertical Rain Streaks */
.pane-rain-streaks {
    position: absolute;
    inset: 0;
    z-index: 11;
    pointer-events: none;
    background-image: 
        repeating-linear-gradient(172deg, rgba(255, 255, 255, 0.12) 0px, rgba(255, 255, 255, 0.12) 1.5px, transparent 1.5px, transparent 32px),
        repeating-linear-gradient(166deg, rgba(0, 243, 255, 0.18) 0px, rgba(0, 243, 255, 0.18) 2px, transparent 2px, transparent 48px),
        repeating-linear-gradient(175deg, rgba(255, 0, 85, 0.14) 0px, rgba(255, 0, 85, 0.14) 1px, transparent 1px, transparent 24px);
    background-size: 100% 220px, 100% 300px, 100% 180px;
    animation: rain-fall-sprawl 0.65s linear infinite;
    opacity: 0.9;
    transition: opacity 0.4s ease;
}

@keyframes rain-fall-sprawl {
    0% { background-position: 0 0, 0 0, 0 0; }
    100% { background-position: -25px 220px, -45px 300px, -15px 180px; }
}

/* 3. Physical Water Droplets & Condensation Specular Highlights */
.pane-water-droplets {
    position: absolute;
    inset: 0;
    z-index: 12;
    pointer-events: none;
    background-image: 
        radial-gradient(circle at 18% 28%, rgba(255, 255, 255, 0.45) 2.5px, rgba(255, 255, 255, 0.15) 4px, transparent 5px),
        radial-gradient(circle at 48% 62%, rgba(255, 255, 255, 0.5) 3.5px, rgba(255, 255, 255, 0.2) 6px, transparent 7px),
        radial-gradient(circle at 78% 32%, rgba(0, 243, 255, 0.6) 3px, rgba(0, 243, 255, 0.25) 5px, transparent 6px),
        radial-gradient(circle at 86% 82%, rgba(255, 0, 85, 0.5) 3.5px, rgba(255, 0, 85, 0.2) 6px, transparent 7px),
        radial-gradient(circle at 32% 88%, rgba(255, 255, 255, 0.35) 2px, transparent 4px),
        radial-gradient(circle at 62% 16%, rgba(255, 255, 255, 0.4) 3px, transparent 5px),
        radial-gradient(circle at 12% 75%, rgba(0, 243, 255, 0.4) 2.5px, transparent 4px),
        radial-gradient(circle at 92% 15%, rgba(255, 183, 0, 0.4) 2px, transparent 4px);
    background-size: 190px 190px, 230px 230px, 270px 270px, 310px 310px, 150px 150px, 210px 210px, 250px 250px, 180px 180px;
    opacity: 0.95;
    transition: opacity 0.4s ease;
}

/* 4. Cyberdeck CRT Scanlines & Distortion */
.pane-cyber-scanlines {
    position: absolute;
    inset: 0;
    z-index: 13;
    pointer-events: none;
    background: 
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.4) 50%),
        linear-gradient(90deg, rgba(255, 0, 85, 0.04), rgba(0, 243, 255, 0.02), rgba(0, 243, 255, 0.04));
    background-size: 100% 3px, 6px 100%;
    opacity: 0.65;
}

/* ==========================================================================
   INTERACTIVE WIPED WINDOW STATE (MOUSEOVER WIPE EFFECT)
   ========================================================================== */
.window-pane-cell:hover .pane-wet-glass,
.window-pane-cell.pane-wiped .pane-wet-glass {
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    background: rgba(4, 6, 10, 0.1);
    box-shadow: inset 0 0 20px rgba(0, 243, 255, 0.1);
    opacity: 0.4;
}

.window-pane-cell:hover .pane-rain-streaks,
.window-pane-cell.pane-wiped .pane-rain-streaks {
    opacity: 0.15;
}

.window-pane-cell:hover .pane-water-droplets,
.window-pane-cell.pane-wiped .pane-water-droplets {
    opacity: 0.2;
}

/* Pane HUD Overlay (Top & Bottom Metadata inside Pane) */
.pane-hud-header {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.pane-hud-header * {
    pointer-events: auto;
}

.pane-cam-badge {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--tokyo-cyan);
    color: var(--tokyo-cyan);
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
    letter-spacing: 0.05em;
}

.pane-live-badge {
    background: var(--tokyo-magenta);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(255, 0, 85, 0.6);
    display: flex;
    align-items: center;
    gap: 4px;
}

.pane-live-dot {
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
    animation: live-blink 1.2s infinite ease-in-out;
}

.pane-hud-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    padding: 0.6rem 0.8rem;
    background: linear-gradient(180deg, transparent 0%, rgba(4, 6, 10, 0.95) 100%);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
}

.pane-hud-footer * {
    pointer-events: auto;
}

.pane-title-text {
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    line-height: 1.2;
    max-width: 75%;
}

.pane-channel-text {
    font-size: 0.68rem;
    color: #94a3b8;
}

/* Wipe Glass Interactive Button */
.btn-wipe-glass {
    background: rgba(0, 243, 255, 0.15);
    border: 1px solid var(--tokyo-cyan);
    color: var(--tokyo-cyan);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-wipe-glass:hover {
    background: var(--tokyo-cyan);
    color: #04060a;
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.6);
}

/* ZeroMQ High-Frequency Ticker Footer at Window Base */
.tokyo-hft-ticker {
    background: rgba(7, 10, 18, 0.96);
    border-top: 1px solid rgba(0, 243, 255, 0.25);
    padding: 0.5rem 1.2rem;
    font-size: 0.78rem;
    font-family: 'JetBrains Mono', monospace;
}

.ticker-rate-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    margin-right: 0.5rem;
}
