/* K3N LIVE - Audience Page Styles */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a0a0a;
    font-family: 'Space Mono', 'Courier New', monospace;
}

.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ── Scanlines overlay ── */
.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.15) 2px,
        rgba(0, 0, 0, 0.15) 4px
    );
}

/* ── Offline Screen ── */
.offline-content {
    text-align: center;
    z-index: 10;
}

.offline-logo {
    font-size: 5rem;
    font-weight: 700;
    color: #ff2d6b;
    letter-spacing: 0.3em;
    text-shadow: 0 0 40px rgba(255, 45, 107, 0.5), 0 0 80px rgba(255, 45, 107, 0.2);
    margin-bottom: 10px;
}

.offline-status {
    font-size: 1.2rem;
    color: #555;
    letter-spacing: 0.5em;
    margin-bottom: 30px;
}

.next-set {
    color: #888;
    font-size: 0.9rem;
    line-height: 1.6;
}

.next-set .label {
    color: #ff2d6b;
    font-weight: 700;
}

/* ── Persistent Header ── */
#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: max(16px, env(safe-area-inset-top)) 16px 14px;
    background: linear-gradient(180deg, rgba(10,10,10,0.97) 0%, rgba(10,10,10,0.8) 85%, transparent 100%);
    text-align: center;
    gap: 6px;
}

.header-logo {
    width: 70px;
    height: auto;
    filter: drop-shadow(4px 5px 8px rgba(0, 0, 0, 0.9));
}

.header-title {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: clamp(1.4rem, 5vw, 2rem);
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.1em;
    text-shadow:
        0 0 15px rgba(255, 45, 107, 0.7),
        0 0 40px rgba(255, 45, 107, 0.3);
}

.header-sub {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: clamp(0.7rem, 2.5vw, 0.9rem);
    color: #ff2d6b;
    letter-spacing: 0.12em;
}

/* ── Live Screen ── */
#live-screen {
    background: #0a0a0a;
    justify-content: flex-end;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
}

/* Fly-away zone */
#fly-zone {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    overflow: hidden;
}

.fly-emoji {
    position: absolute;
    font-size: 3rem;
    pointer-events: none;
    z-index: 51;
    animation: flyAway 1.2s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
    filter: drop-shadow(0 0 8px rgba(255, 45, 107, 0.6));
}

@keyframes flyAway {
    0% {
        transform: scale(1) translateY(0) rotate(0deg);
        opacity: 1;
    }
    30% {
        transform: scale(1.3) translateY(-40px) rotate(-5deg);
        opacity: 1;
    }
    100% {
        transform: scale(0.3) translateY(-110vh) rotate(15deg);
        opacity: 0;
    }
}

/* Viewer count */
#viewer-count {
    color: #666;
    font-size: 0.75rem;
    font-family: 'Space Mono', 'Courier New', monospace;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px #00ff88; }
    50% { opacity: 0.4; box-shadow: 0 0 8px #00ff88; }
}

/* ── Button Grid ── */
#button-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0 16px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    z-index: 100;
}

.emoji-btn {
    aspect-ratio: 1;
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.08s ease, border-color 0.15s ease, background 0.15s ease;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.emoji-btn span {
    font-size: 3rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    transition: transform 0.08s ease;
}

.emoji-btn:active {
    transform: scale(0.88);
    background: #252525;
    border-color: #ff2d6b;
}

.emoji-btn:active span {
    transform: scale(0.9);
}

/* Ripple effect on tap */
.emoji-btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 45, 107, 0.3);
    transform: scale(0);
    animation: ripple 0.5s ease-out forwards;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Button glow at high intensity */
.emoji-btn.glow {
    border-color: #ff2d6b;
    box-shadow: 0 0 15px rgba(255, 45, 107, 0.3), inset 0 0 15px rgba(255, 45, 107, 0.1);
}

/* ── Responsive ── */
@media (max-height: 600px) {
    .emoji-btn span { font-size: 2.2rem; }
    #button-grid { gap: 8px; }
}

@media (min-width: 500px) {
    #button-grid { max-width: 420px; }
    .emoji-btn span { font-size: 3.5rem; }
}
