/* ============================================================
   KICK COSTREAM — styles.css
   ============================================================ */

:root {
    --primary-color: #53fc18;
    --primary-glow: rgba(83, 252, 24, 0.7);
    --bg-dark: #0a0a0a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-radius: 20px;
    --transition-speed: 0.3s;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

/* ── Body & Root Structure ──────────────────────────────── */
html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
    color: var(--text-primary);
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(83, 252, 24, 0.10) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(147, 51, 234, 0.10) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* ── Header ─────────────────────────────────────────────── */
header[role="banner"] {
    width: 100%;
    text-align: center;
    padding: 12px 0;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 10;
    flex-shrink: 0;
}

header[role="banner"] h1 {
    margin: 0;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    background: linear-gradient(135deg, var(--primary-color) 0%, #9333ea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Main ───────────────────────────────────────────────── */
main {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
}

/* ── Setup Screen ───────────────────────────────────────── */
.setup-container {
    width: min(90%, 600px);
    padding: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 10;
    flex-shrink: 0;
}

.setup-container h2 {
    background: linear-gradient(135deg, var(--primary-color) 0%, #9333ea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    margin-top: 0;
}

.setup-container p {
    color: var(--text-secondary);
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.input-group input {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Roboto', sans-serif;
    transition: all var(--transition-speed) ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(83, 252, 24, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.start-button {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #9333ea 100%);
    color: #000;
    font-weight: 700;
    font-size: 1.3rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(83, 252, 24, 0.4);
    transition: all var(--transition-speed) ease;
    margin-top: 10px;
    font-family: 'Roboto', sans-serif;
}

.start-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(83, 252, 24, 0.6);
}

/* ── Stream Layout Container ────────────────────────────── */
.container {
    width: 100%;
    z-index: 10;
    display: none;
    overflow: hidden;
}

.container.active {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* ── Main Player Grid ────────────────────────────────────── */
.main-player {
    display: grid;
    grid-template-columns: 2.4fr 1fr 2.4fr;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    perspective: 2000px;

    /* Generous breathing room - prevents edge overflow */
    padding: 24px 60px;

    align-items: center;
}

/* ── Channel Cards (Left & Right) ───────────────────────── */
.channel-left,
.channel-right {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    min-width: 0;
    align-self: center;
    transition: transform var(--transition-speed) ease-out,
                box-shadow  var(--transition-speed) ease;
    max-width: 100%;
}

.channel-left  { transform: rotateY(5deg);  transform-origin: right; }
.channel-right { transform: rotateY(-5deg); transform-origin: left;  }

.channel-left:hover,
.channel-right:hover {
    box-shadow:
        0 12px 48px rgba(83, 252, 24, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ── Card Header Band ───────────────────────────────────── */
.header h2 {
    padding: 10px 12px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin: 0;
    font-size: clamp(1rem, 2vw, 1.4rem);
    font-weight: 500;
    color: var(--text-primary);
}

.stream-info {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 5px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.category {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 3px 15px;
    background: rgba(0, 0, 0, 0.2);
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
}

/* ── Video Wrapper ───────────────────────────────────────── */
.video-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: calc(100vh - 260px);
    background: #000;
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

iframe.player-embed {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.channel-button {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-color) 0%, #9333ea 100%);
    color: #000;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 9px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(83, 252, 24, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 100;
    font-family: 'Roboto', sans-serif;
    white-space: nowrap;
}

.channel-left  .channel-button { transform: translateX(-50%) rotateY(5deg);  }
.channel-right .channel-button { transform: translateX(-50%) rotateY(-5deg); }

.channel-button:hover {
    transform: translateX(-50%) rotateY(0) translateY(-3px);
    box-shadow: 0 8px 30px rgba(83, 252, 24, 0.6);
}

/* ── Centre Chat Column ─────────────────────────────────── */
.chats-center {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-self: stretch;
    min-height: 0;
}

.chat-upper,
.chat-lower {
    flex: 1 1 auto;
    min-height: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 14px;
    overflow: hidden;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    position: relative;
}

.chat-upper iframe,
.chat-lower iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ── Chat Notice Overlay ────────────────────────────────── */
.chat-notice {
    position: absolute;
    inset: 10px 10px auto 10px;
    background: rgba(83, 252, 24, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #000;
    padding: 12px 36px 12px 15px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 4px 16px rgba(83, 252, 24, 0.4);
    animation: slideDown 0.5s ease-out;
    line-height: 1.4;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

.chat-notice-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--primary-color);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
    transition: all 0.2s ease;
    padding: 0;
}

.chat-notice-close:hover {
    background: var(--primary-color);
    color: #000;
}

/* ── Live / Offline Badges ──────────────────────────────── */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid rgba(255, 0, 0, 0.5);
}

.live-dot {
    width: 9px;
    height: 9px;
    background: #ff0000;
    border-radius: 50%;
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%,  100% { opacity: 1;   box-shadow: 0 0 5px  #ff0000; }
    50%        { opacity: 0.5; box-shadow: 0 0 15px #ff0000; }
}

.viewers {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
}

.offline-badge {
    background: rgba(128, 128, 128, 0.2);
    border-color: rgba(128, 128, 128, 0.5);
}

.offline-dot {
    background: #808080;
    animation: none;
}

/* ── Reset Button (fixed overlay) ───────────────────────── */
.reset-button {
    position: fixed;
    top: 18px;
    right: 18px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #9333ea 100%);
    color: #000;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(83, 252, 24, 0.4);
    transition: all var(--transition-speed) ease;
    z-index: 100;
    font-family: 'Roboto', sans-serif;
}

.reset-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(83, 252, 24, 0.6);
}

/* ── Particle Canvas ─────────────────────────────────────── */
#particles {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

/* ── Footer ─────────────────────────────────────────────── */
footer[role="contentinfo"] {
    width: 100%;
    text-align: center;
    padding: 10px 0;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    z-index: 10;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.footer-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    padding: 0 16px;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
}

footer a:hover {
    color: #9333ea;
    text-shadow: 0 0 20px rgba(147, 51, 234, 0.5);
}

.hit-counter {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.hit-counter-number {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1rem;
    margin-left: 5px;
    text-shadow: 0 0 10px rgba(83, 252, 24, 0.5);
    display: inline-block;
    min-width: 60px;
    text-align: left;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
    html, body, main { overflow: auto; }

    .container.active { overflow: auto; }

    .main-player {
        grid-template-columns: 1fr;
        perspective: none;
        gap: 20px;
        padding: 20px 30px;
        align-items: start;
        overflow-y: auto;
    }

    .channel-left,
    .channel-right {
        transform: none;
        align-self: auto;
        max-width: 100%;
    }

    .video-wrapper {
        max-height: none;
    }

    .chats-center {
        display: grid;
        grid-template-columns: 1fr 1fr;
        height: 300px;
        align-self: auto;
        flex: none;
        min-height: unset;
    }

    .chat-upper,
    .chat-lower {
        flex: none;
        height: 100%;
    }
}

@media (max-width: 768px) {
    .setup-container { padding: 28px 18px; }

    .main-player {
        padding: 16px 20px;
    }

    .chats-center {
        grid-template-columns: 1fr;
        height: 260px;
    }

    .channel-button {
        font-size: 0.9rem;
        padding: 9px 20px;
    }

    .stream-info {
        flex-direction: column;
        gap: 6px;
    }
}