:root {
  --bg: #050505;
  --card: rgba(255,255,255,0.05);
  --border: rgba(255,255,255,0.1);
  --text: rgba(255,255,255,0.9);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  /* Extra padding to ensure bottom nav doesn't cover content */
  padding-bottom: 70px; 
}

/* APP CONTAINER */
#app {
  width: 100%;
  max-width: 1200px;
  margin: auto;
  padding: 20px;
}

/* TYPOGRAPHY & LAYOUT */
h1 { font-size: clamp(24px, 4vw, 48px); font-weight: 800; margin-bottom: 15px; }
h2 { font-size: clamp(18px, 2vw, 26px); margin: 30px 0 15px; }
p { color: #aaa; }
.label { font-size: 12px; color: #888; text-transform: uppercase; margin-bottom: 4px; }

/* COMMUNITY GATE */
#gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 15px;
  padding: 20px;
  text-align: center;
}

/* NETWORK BAR */
.network-bar {
  position: sticky;
  top: 10px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  padding: 15px 20px;
  border-radius: 12px;
  margin-bottom: 30px;
  border: 1px solid var(--border);
}

.network-right { text-align: right; }

/* TOP NAV */
.top-nav {
  display: flex;
  gap: 15px;
  margin: 20px 0 30px;
  overflow-x: auto;
  padding-bottom: 10px;
}
.top-nav a { color: var(--text); text-decoration: none; font-weight: 600; white-space: nowrap; }
.top-nav::-webkit-scrollbar { display: none; }

/* INPUTS & BUTTONS */
.input-group { display: flex; gap: 10px; flex-wrap: wrap; }
input {
  padding: 12px 15px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: white;
  flex: 1;
  min-width: 200px;
}
input:focus { outline: none; border-color: rgba(255,255,255,0.4); }

button {
  border: 1px solid var(--border);
  background: var(--card);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}
button:hover { background: white; color: black; }
.broadcast-btn { width: 100%; margin: 20px 0; background: rgba(255,255,255,0.1); }

/* HERO / PLAYER CARD */
.player-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 40px;
}

.player-card video {
  width: 100%;
  height: 50vh;
  object-fit: cover;
  background: #000;
  display: block;
}

.player-info { padding: 25px; }

.pulse-grid {
  display: flex;
  justify-content: space-between;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.pulse-grid label { font-size: 11px; opacity: 0.6; text-transform: uppercase; display: block; margin-bottom: 5px;}
.pulse-grid span { font-size: 20px; font-weight: bold; }

.extra-info { margin-top: 25px; }
.extra-info h2 { margin-top: 0; }

/* =========================
   HYBRID SYSTEM (MOBILE FIRST)
========================= */

/* MOBILE = NETFLIX SCROLL */
.scroll {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding-bottom: 20px;
  scroll-snap-type: x mandatory; /* App-like snapping */
  scroll-padding-left: 0;
}

.scroll::-webkit-scrollbar { display: none; }

/* VIDEO & UPLOAD CARDS */
.video-card, .upload-card {
  flex: 0 0 75vw; /* Fluid width for mobile */
  max-width: 320px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  scroll-snap-align: start;
}

.video-card video,
.upload-card video,
.upload-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  background: #000;
}

/* CARD TEXT */
.video-card p,
.upload-card p { padding: 12px 15px; font-size: 14px; margin: 0; }
.upload-card .card-content { padding: 15px; display: flex; flex-direction: column; gap: 10px; }
.upload-card .comments { font-size: 13px; margin: 10px 0; max-height: 100px; overflow-y: auto; }

/* UPLOAD FORM */
.card.upload-form {
  background: var(--card);
  padding: 20px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  border: 1px solid var(--border);
}

/* BOTTOM NAV */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  left: 0;
  display: flex;
  justify-content: space-around;
  background: rgba(5,5,5,0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 15px 0 calc(15px + env(safe-area-inset-bottom)); /* iOS safe area */
  border-top: 1px solid var(--border);
  z-index: 1000;
}

.bottom-nav a { color: white; text-decoration: none; font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 5px; opacity: 0.7;}
.bottom-nav a:hover { opacity: 1; }

/* =========================
   TABLET
========================= */
@media (min-width: 700px) {
  .player-card video { height: 400px; }
  .video-card, .upload-card { flex: 0 0 300px; }
}

/* =========================
   DESKTOP = GRID OVERRIDE
========================= */
@media (min-width: 1024px) {
  /* Convert horizontal scroll to grid */
  .scroll {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    overflow: visible;
    gap: 20px;
  }

  .video-card, .upload-card {
    flex: unset;
    width: 100%;
    max-width: none;
  }

  /* Split Hero Player */
  .player-card {
    display: grid;
    grid-template-columns: 2fr 1fr;
    align-items: stretch;
  }

  .player-card video { height: 100%; min-height: 450px; }
  
  .bottom-nav { 
    max-width: 1200px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 20px 20px 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
  }
}

/* =========================
   ULTRA WIDE (TV)
========================= */
@media (min-width: 1600px) {
  #app { max-width: 1500px; }
  .bottom-nav { max-width: 1500px; }
}