/* Grumpy's Movies — in-browser watch UI (matches index.html theme) */
:root {
  --bg: #0b0d12;
  --bg-2: #11141b;
  --panel: #161a24;
  --panel-2: #1c2230;
  --text: #e7e9ee;
  --muted: #97a0b3;
  --accent: #e11d48;
  --accent-2: #f59e0b;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 14px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(225, 29, 72, 0.18), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(245, 158, 11, 0.10), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 24px;
  background: rgba(11, 13, 18, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  margin-right: auto;
}

.brand .logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #9f1239);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
}

.nav-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-tabs button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.nav-tabs button:hover { color: var(--text); }

.nav-tabs button.active {
  color: var(--text);
  background: var(--panel);
  border-color: var(--border);
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn:hover { background: var(--panel-2); }
.btn:active { transform: scale(0.98); }

.btn.primary {
  background: linear-gradient(135deg, var(--accent), #be123c);
  border-color: transparent;
  color: #fff;
}

.btn.primary:hover { filter: brightness(1.08); }

.btn.ghost { background: transparent; }

.search-box {
  display: none;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.search-box.visible { display: flex; }

.search-box input {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text);
  font: inherit;
}

.search-box input:focus {
  outline: 2px solid rgba(225, 29, 72, 0.45);
  outline-offset: 1px;
}

main {
  flex: 1;
  padding: 24px 28px 48px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.apps-ad-free-banner {
  margin: 0 0 16px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.1);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.apps-ad-free-banner strong { color: #86efac; }

.apps-ad-free-banner a {
  color: #86efac;
  font-weight: 700;
}

.apps-ad-free-banner a:hover { text-decoration: underline; }

.brave-sticky {
  position: sticky;
  top: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 14px 48px 14px 20px;
  background: linear-gradient(90deg, #c2410c, #fb542b 45%, #e11d48);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 4px 24px rgba(251, 84, 43, 0.45);
}

[data-brave-notice][hidden],
[data-brave-notice].brave-notice-hidden {
  display: none !important;
}

.brave-sticky-text {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.brave-sticky-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 18px;
}

.brave-sticky .btn-brave {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 10px;
  background: #fff;
  color: #9a3412;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.brave-sticky .btn-brave:hover { color: #7c2d12; filter: brightness(1.05); }

.brave-sticky-dismiss {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(0, 0, 0, 0.25);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  pointer-events: auto;
}

.brave-sticky-dismiss:hover {
  background: rgba(0, 0, 0, 0.4);
}

.brave-top-cta {
  background: linear-gradient(135deg, #fb542b, #e11d48) !important;
  border-color: transparent !important;
  color: #fff !important;
  font-weight: 700;
}

.brave-callout {
  margin: 0 0 24px;
  padding: 22px 24px;
  border-radius: 16px;
  border: 2px solid rgba(251, 84, 43, 0.55);
  background: linear-gradient(135deg, rgba(251, 84, 43, 0.2), rgba(225, 29, 72, 0.12));
  box-shadow: 0 12px 40px rgba(251, 84, 43, 0.2);
}

.brave-callout-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.brave-callout-icon {
  font-size: 2.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.brave-callout h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  color: #fb923c;
}

.brave-callout p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.brave-callout p strong { color: var(--text); }

.brave-steps {
  margin: 16px 0 18px;
  padding-left: 22px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.75;
}

.brave-steps li { margin-bottom: 4px; }
.brave-steps strong { color: #fdba74; }

.btn-brave-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fb542b, #e11d48);
  color: #fff !important;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 10px 28px rgba(251, 84, 43, 0.45);
}

.btn-brave-lg:hover { filter: brightness(1.08); }

.brave-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
}

.brave-modal-overlay[hidden],
.brave-modal-overlay.brave-notice-hidden {
  display: none !important;
}

.brave-modal {
  width: min(480px, 100%);
  padding: 28px 28px 24px;
  border-radius: 20px;
  border: 2px solid rgba(251, 84, 43, 0.6);
  background: linear-gradient(180deg, #1a1410, var(--panel));
  box-shadow: 0 24px 80px rgba(251, 84, 43, 0.35);
  text-align: center;
}

.brave-modal-eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fb923c;
}

.brave-modal h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  color: #fff;
}

.brave-modal-lede {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.brave-modal-lede strong { color: #fca5a5; }

.brave-modal .brave-steps {
  text-align: left;
  margin: 16px 0 20px;
}

.brave-modal .btn-brave-lg {
  width: 100%;
  margin-bottom: 12px;
}

.brave-modal-skip {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 8px;
}

.brave-modal-skip:hover { color: var(--text); }

@media (max-width: 720px) {
  .brave-sticky { font-size: 14px; padding-top: 16px; padding-bottom: 16px; }
  .brave-sticky .btn-brave { width: 100%; justify-content: center; }
  .brave-callout-head { flex-direction: column; }
}

.view { display: none; }
.view.active { display: block; }

.status {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}

.status.error { color: #fca5a5; }

.rail {
  margin-bottom: 32px;
}

.rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rail-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.poster-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.poster-row::-webkit-scrollbar { height: 6px; }
.poster-row::-webkit-scrollbar-thumb {
  background: var(--panel-2);
  border-radius: 99px;
}

.poster-card {
  flex: 0 0 130px;
  scroll-snap-align: start;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  text-align: left;
  color: inherit;
  transition: transform 0.15s;
}

.poster-card:hover { transform: translateY(-4px); }

.poster-card img {
  width: 130px;
  height: 195px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--panel);
  display: block;
  box-shadow: var(--shadow);
}

.poster-card .no-img {
  width: 130px;
  height: 195px;
  border-radius: 10px;
  background: var(--panel);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 8px;
}

.poster-card .title {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.poster-card .meta {
  font-size: 12px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
}

.browse-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
}

.browse-toolbar select {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  font: inherit;
}

.detail-back {
  margin-bottom: 16px;
}

.detail-hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 280px;
  background: var(--panel);
  margin-bottom: 20px;
}

.detail-hero .backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
}

.detail-hero .scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 10%, transparent 70%);
}

.detail-hero .content {
  position: relative;
  padding: 24px;
  display: flex;
  gap: 20px;
  align-items: flex-end;
  flex-wrap: wrap;
  min-height: 280px;
}

.detail-hero .poster {
  width: 120px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.detail-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.detail-hero .meta {
  color: var(--muted);
  margin-bottom: 12px;
}

.detail-hero .overview {
  max-width: 720px;
  opacity: 0.92;
}

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.episode-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.episode-list button {
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.episode-list button:hover { background: var(--panel-2); }

.season-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.season-tabs button {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.season-tabs button.active {
  color: var(--text);
  border-color: var(--accent);
}

.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  display: none;
  flex-direction: column;
}

.player-overlay.open { display: flex; }

.player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.player-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.player-top h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.player-hint {
  margin: 0;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--muted);
  background: rgba(225, 29, 72, 0.12);
  border-bottom: 1px solid var(--border);
}

.player-hint strong { color: var(--text); }

.player-frame {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: none;
  background: #000;
}

.player-overlay:fullscreen,
.player-overlay:-webkit-full-screen {
  background: #000;
}

.player-overlay:fullscreen .player-top,
.player-overlay:-webkit-full-screen .player-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s ease;
  border-bottom: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent);
}

.player-overlay:fullscreen:hover .player-top,
.player-overlay:fullscreen:focus-within .player-top,
.player-overlay:-webkit-full-screen:hover .player-top,
.player-overlay:-webkit-full-screen:focus-within .player-top {
  opacity: 1;
}

.player-overlay:fullscreen .player-hint,
.player-overlay:-webkit-full-screen .player-hint {
  display: none !important;
}

.player-overlay:fullscreen .player-frame,
.player-overlay:-webkit-full-screen .player-frame {
  height: 100%;
}

@media (max-width: 720px) {
  .topbar { padding: 12px 16px; }
  main { padding: 16px; }
  .nav-tabs { order: 3; width: 100%; }
}
