* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(56, 189, 248, 0.14), transparent 60%),
    radial-gradient(800px 500px at 95% 110%, rgba(34, 197, 94, 0.07), transparent 60%),
    #07090d;
  color: #e8eef4;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 20px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
#app { max-width: 1400px; margin: 0 auto; padding: 0 28px 120px; }
button { font-family: inherit; }
.hidden { display: none !important; }

/* Top bar */
#topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 0 10px;
}
.brand {
  font-size: 30px; font-weight: 800; letter-spacing: 6px; cursor: pointer;
  color: #7dd3fc; text-shadow: 0 0 24px rgba(56, 189, 248, 0.35);
}
.top-right { display: flex; gap: 16px; align-items: center; }
#clock { font-size: 26px; font-weight: 600; color: #cbd5e1; font-variant-numeric: tabular-nums; }
#parkBadge {
  background: rgba(20, 83, 45, 0.85); color: #86efac; font-weight: 700; font-size: 16px;
  padding: 6px 14px; border-radius: 999px; letter-spacing: 2px;
  border: 1px solid rgba(134, 239, 172, 0.25);
}

/* Views */
.view { display: none; }
.view.active { display: block; animation: fadein 0.25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.view-head h2 { font-size: 44px; margin: 18px 0 6px; letter-spacing: -0.5px; }
.note { color: #94a3b8; font-size: 19px; margin-bottom: 18px; }
.demo-badge {
  display: inline-block; background: #422006; color: #fbbf24;
  padding: 8px 14px; border-radius: 10px; font-weight: 700;
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.hint { color: #7c8aa0; font-size: 17px; margin-top: 20px; text-align: center; }

/* Home */
.hero { text-align: center; margin: 34px 0 30px; }
.hero h1 {
  font-size: 84px; letter-spacing: 12px; color: #7dd3fc;
  text-shadow: 0 0 40px rgba(56, 189, 248, 0.35);
}
.hero .sub { color: #94a3b8; font-size: 24px; margin-top: 6px; }
.tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.tile {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 22px;
  padding: 34px 26px; text-align: left; cursor: pointer; color: #e8eef4;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 190px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.tile:hover, .tile:focus {
  border-color: rgba(56, 189, 248, 0.6); background: linear-gradient(160deg, rgba(56, 189, 248, 0.1), rgba(255, 255, 255, 0.02));
  transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); outline: none;
}
.tile-icon {
  font-size: 46px; width: 72px; height: 72px; border-radius: 50%;
  background: rgba(56, 189, 248, 0.12); display: flex; align-items: center; justify-content: center;
}
.tile-title { font-size: 32px; font-weight: 700; letter-spacing: -0.5px; }
.tile-desc { font-size: 18px; color: #94a3b8; }

/* Sections and feeds */
.feed { margin-top: 44px; }
.section-head {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 14px; margin-bottom: 18px;
}
.section-head h2 { font-size: 30px; letter-spacing: -0.5px; }
#homeMore { display: block; margin: 24px auto 0; }

/* Chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip-row.cats { margin-bottom: 20px; }
.chip {
  background: rgba(255, 255, 255, 0.06); color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px; padding: 12px 20px; font-size: 18px; cursor: pointer;
  min-height: 48px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.chip:hover { border-color: rgba(56, 189, 248, 0.6); }
.chip.active { background: #0284c7; border-color: #0284c7; color: #fff; font-weight: 700; }

/* Buttons and inputs */
.btn {
  background: #0284c7; color: #fff; border: none; border-radius: 14px;
  padding: 14px 26px; font-size: 20px; font-weight: 700; cursor: pointer;
  text-decoration: none; display: inline-block; min-height: 52px;
  transition: background 0.15s ease;
}
.btn:hover { background: #0369a1; }
.btn.small { padding: 10px 18px; font-size: 17px; min-height: 44px; }
.btn.big { padding: 18px 34px; font-size: 22px; min-height: 60px; }
.btn.ghost {
  background: transparent; color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn.ghost:hover { border-color: rgba(56, 189, 248, 0.6); background: rgba(56, 189, 248, 0.08); }
.search-row { display: flex; gap: 12px; margin-bottom: 16px; align-items: flex-start; }
.search-box { position: relative; flex: 1; }
.search-box input {
  width: 100%; background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 14px;
  color: #e8eef4; font-size: 21px; padding: 14px 18px; font-family: inherit;
  min-height: 56px;
}
.search-box input:focus { border-color: #38bdf8; outline: none; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2); }

/* Suggestions dropdown */
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 40;
  background: #111827; border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px; overflow: hidden; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}
.suggest-row {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; background: none; border: none; color: #e8eef4; cursor: pointer;
  padding: 14px 18px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.suggest-row:last-child { border-bottom: none; }
.suggest-row:hover { background: rgba(56, 189, 248, 0.1); }
.suggest-label { font-size: 19px; font-weight: 600; }
.suggest-sub { font-size: 16px; color: #94a3b8; }

/* Recent searches */
.recent-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.recent-label { color: #7c8aa0; font-size: 17px; font-weight: 600; }

/* Video cards and grids */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.video-card {
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px; padding: 0 0 16px; overflow: hidden; cursor: pointer;
  color: #e8eef4; text-align: left; display: flex; flex-direction: column; gap: 8px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.video-card:hover, .video-card:focus {
  border-color: rgba(56, 189, 248, 0.55); transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); outline: none;
}
.video-thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s ease; }
.video-card:hover .video-thumb img { transform: scale(1.04); }
.video-tag {
  position: absolute; left: 10px; top: 10px; background: rgba(0, 0, 0, 0.65);
  color: #fff; font-size: 14px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  letter-spacing: 0.5px;
}
.video-title {
  font-size: 19px; font-weight: 600; line-height: 1.35; padding: 6px 16px 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.video-channel { font-size: 16px; color: #94a3b8; padding: 0 16px; }
.results-head { font-size: 22px; margin-bottom: 16px; color: #cbd5e1; }
.wide-search { margin-top: 22px; text-align: center; }

/* Watch */
.now-playing { margin-bottom: 14px; }
.now-title { display: block; font-size: 24px; font-weight: 700; letter-spacing: -0.3px; }
.now-channel { display: block; font-size: 18px; color: #94a3b8; margin-top: 2px; }
.player-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 16px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.1); }
.player-wrap iframe { width: 100%; height: 100%; border: 0; display: none; }
.player-wrap iframe.on { display: block; }
.placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #64748b; font-size: 22px; text-align: center; padding: 20px;
}
.player-controls { display: flex; gap: 12px; margin-top: 16px; }

/* Stream directory */
.stream-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.stream-card {
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 20px;
  padding: 26px; display: flex; flex-direction: column; gap: 10px;
}
.stream-card.blocked { border-color: rgba(127, 29, 29, 0.8); }
.stream-card.works { border-color: rgba(20, 83, 45, 0.9); }
.stream-name { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; }
.stream-status { font-size: 18px; font-weight: 700; padding: 6px 12px; border-radius: 999px; display: inline-block; align-self: flex-start; }
.stream-status.works { background: #14532d; color: #86efac; }
.stream-status.blocked { background: #7f1d1d; color: #fca5a5; }
.stream-why { font-size: 18px; color: #94a3b8; line-height: 1.5; }
.stream-card .btn { margin-top: 8px; align-self: flex-start; }

/* Dash */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.dash-card {
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 20px;
  padding: 28px; display: flex; flex-direction: column; gap: 10px;
}
.dash-card.big { grid-column: span 2; }
.dash-label { color: #94a3b8; font-size: 19px; letter-spacing: 2px; text-transform: uppercase; }
.dash-value { font-size: 56px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.dash-value .unit { font-size: 22px; color: #94a3b8; font-weight: 600; }
.dash-value.ap { font-size: 44px; color: #7dd3fc; }
.bar { background: rgba(255, 255, 255, 0.1); border-radius: 999px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; width: 0%; background: #38bdf8; border-radius: 999px; transition: width 0.4s ease; }
.bar-fill.green { background: #22c55e; }

/* Border */
.border-card {
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 24px; padding: 44px 36px; text-align: center;
  max-width: 760px; margin: 24px auto 0;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.border-icon { font-size: 64px; }
.border-card h3 { font-size: 30px; letter-spacing: -0.5px; }
.border-card p { font-size: 19px; color: #94a3b8; line-height: 1.6; max-width: 560px; }

/* Home button */
.home-btn {
  position: fixed; right: 24px; bottom: 24px; z-index: 50;
  background: #0284c7; color: #fff; border: none; border-radius: 999px;
  padding: 16px 28px; font-size: 22px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5); min-height: 60px;
}
.home-btn:hover { background: #0369a1; }

/* Immersive fullscreen mode (one-finger long-press) */
body.immersive { overflow: hidden; }
body.immersive #topbar,
body.immersive #homeBtn,
body.immersive .hint,
body.immersive .view-head,
body.immersive .section-head,
body.immersive .search-row,
body.immersive .chip-row,
body.immersive .recent-row,
body.immersive .results-head,
body.immersive .player-controls,
body.immersive .now-playing,
body.immersive .wide-search,
body.immersive #homeMore { display: none !important; }
body.immersive #app { padding: 0; max-width: none; }
body.immersive .player-wrap {
  position: fixed; inset: 0; z-index: 100; border: none; border-radius: 0;
  aspect-ratio: auto; width: 100vw; height: 100vh;
}

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%);
  background: #1e293b; color: #e2e8f0; border: 1px solid #38bdf8;
  border-radius: 999px; padding: 12px 24px; font-size: 18px; z-index: 60;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5); white-space: nowrap;
}

/* Smaller screens */
@media (max-width: 900px) {
  body { font-size: 17px; }
  .hero h1 { font-size: 56px; }
  .tile { min-height: 150px; padding: 24px 20px; }
  .tile-title { font-size: 26px; }
  .dash-card.big { grid-column: span 1; }
  .dash-value { font-size: 44px; }
  .view-head h2 { font-size: 34px; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .search-row { flex-direction: column; }
  .search-row .btn { width: 100%; }
}
