:root{
      --bg:#0b1220;
      --panel:#0f172a;
      --muted:#9ca3af;
      --text:#e5e7eb;
      --accent:#3b82f6;
      --border:#d1d5db;
      --chip:#0f172a;
      --chipActive:#2563eb;
      --chipColor:#cbd5e1;

      /* tabs */
      --tab-bg: #ffffff;
      --tab-text: #000000;
      --active-color: #2563eb;

      --header-h: 56px;
      --gap-1px: 1px;
    }

    *{box-sizing:border-box}
    body{margin:0;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,Arial}
    a{color:inherit;text-decoration:none}

    header{position:relative; z-index:30}

    .wrap{max-width:1200px;margin:0 auto;padding:8px 12px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}

    .hide-now{ display:none !important; }

    /* ---------- TOP CHIPS SECTION (sticky row 1) ---------- */
    .top-chips {
      background: transparent;
      position:sticky;
      top:0;
      z-index:1030;
      padding:6px 0;
      border-bottom: var(--gap-1px) solid rgba(255,255,255,0.04);
      backdrop-filter: blur(4px);
    }
    .category-grid{
      display:grid;
      gap:6px;
      width:100%;
      grid-template-rows: repeat(2, 32px);
      grid-auto-flow: column;
      grid-auto-columns: minmax(0, 1fr);
      align-items:center;
    }
    .chip{
      display:inline-flex;align-items:center;justify-content:center;gap:6px;
      background:var(--chip);border:1px solid rgba(255,255,255,0.03);color:var(--chipColor);
      padding:6px 10px;border-radius:999px;cursor:pointer;font-size:13px;line-height:1;user-select:none;width:100%;
    }
    .chip.active{background:var(--chipActive);border-color:rgba(0,0,0,0.2);color:#fff;box-shadow:0 6px 14px rgba(37,99,235,.18)}

    /* stickers inside chips */
    .sticker { font-weight:700;font-size:9px;padding:1px 6px;border-radius:999px;margin-left:6px }
    .sticker-live{background:#dc2626;color:#fff}
    .sticker-new{background:#16a34a;color:#fff}

    @media (max-width:700px){
      .category-grid{
        grid-template-columns: repeat(4, 1fr);
        grid-auto-flow: row;
        grid-template-rows: repeat(auto-fill, 40px);
        max-height: calc(2.5 * 40px);
        overflow-y: auto;
        padding-right:8px;
      }
      .chip{font-size:14px;padding:8px 10px}
    }

    /* ---------- GOOGLE ROW (sticky row 2) ---------- */
    .google-row {
      background: var(--panel);
      position:sticky;
      top:0;
      z-index:1025;
      padding:8px 0;
      border-bottom: var(--gap-1px) solid rgba(87, 87, 47, 0.04);
      display:flex;
      align-items:center;
      justify-content:center;
      width:100%;
      box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    }
    .google-inner { max-width:1200px; width:100%; padding:0 12px; display:flex; gap:12px; align-items:center; justify-content:space-between; flex-wrap:wrap; }

    .gsi-btn-wrap{display:flex;align-items:center;gap:8px}
    .user-pill{background:rgba(255,255,255,0.04);padding:6px 10px;border-radius:999px;font-size:13px;border:1px solid rgba(255,255,255,0.03);display:flex;gap:8px;align-items:center}

    .yt-search-inline { display:flex; gap:8px; align-items:center; }
    @media (max-width:700px){
      .google-inner { align-items:center; }
      .yt-search-inline { flex:1; min-width:0; }
      #yt-q { flex:1; min-width:0; }
    }

    /* ---------- SEARCH PANEL (sticky row 3) ---------- */
    .search-panel {
      background: var(--panel);
      position:sticky;
      top:0;
      z-index:1020;
      padding:8px 0;
      border-bottom: var(--gap-1px) solid rgba(255,255,255,0.04);
    }
    .search-inner { max-width:1200px; margin:0 auto; padding:0 12px; }

    .panel {
      background:transparent;
      border-radius:8px;
      padding:6px;
      margin:0;
    }
    .controls{
      display:grid;gap:8px;grid-template-columns: 1fr auto auto;align-items:center
    }
    input,select,button{font-family:inherit}
    input{
      background:#071426;color:var(--text);border:1px solid rgba(255,255,255,0.04);border-radius:8px;padding:8px 10px
    }
    button{background:#1f2937;border:1px solid var(--border);color:var(--text);padding:8px 12px;border-radius:8px;cursor:pointer;white-space:nowrap}
    .primary{background:var(--accent);border-color:var(--accent);color:#fff}
    .secondary{background:#374151;border-color:var(--border);color:#fff}

    /* ---------- Tabs (white bg + black text) ---------- */
    .tabs-wrap{ position:relative; margin:12px 0 8px; display:flex; align-items:flex-end; gap:12px; }
    .tabs{display:flex; gap:8px; flex-wrap:wrap; align-items:flex-end;}
    .tab{
      appearance:none;
      border:1px solid rgba(0,0,0,0.06);
      color:var(--tab-text);
      background: var(--tab-bg);
      border-radius:14px 14px 0 0;
      padding:6px 12px;
      cursor:pointer;
      font-weight:700;
      position:relative; top:8px;
      transition:transform .12s ease, background .12s ease, color .12s ease;
      box-shadow: 0 2px 6px rgba(0,0,0,0.08);
      display:inline-flex; align-items:center; gap:8px;
    }
    .tab:hover { transform: translateY(-2px); }
    .tab.active{
      color:#fff;
      background: var(--active-color);
      box-shadow: 0 8px 18px rgba(0,0,0,0.18);
      transform: translateY(-3px);
    }

    /* Grid / cards */
    .count{color:var(--muted);font-size:12px;margin:6px 0 8px}
    .grid{display:grid;gap:10px;grid-template-columns:repeat(4,1fr);padding:12px}
    @media(max-width:1000px){ .grid{grid-template-columns:repeat(3,1fr)} }
    @media(max-width:700px){ .grid{grid-template-columns:repeat(2,1fr)} }
    @media(max-width:480px){ .grid{grid-template-columns:1fr} }

    .card{background:#0c1426;border:1px solid var(--border);border-radius:10px;overflow:hidden;display:flex;flex-direction:column}
    .thumb{position:relative;background:#000;height:0;padding-bottom:56.25%;overflow: hidden;}
    .thumb img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;cursor:pointer;z-index: 1;}
    .badge{position:absolute;left:8px;top:8px;background:#16a34a;color:#fff;font-size:11px;padding:3px 7px;border-radius:999px}
    .duration{position:absolute; right:8px; bottom:8px; background:rgba(0,0,0,.7); color:#fff; font-size:12px; padding:2px 6px; border-radius:6px; border:1px solid rgba(255,255,255,.35); }

    .content{padding:8px;display:flex;flex-direction:column;gap:6px}
    .title{font-weight:600;line-height:1.2;font-size:14px}
    .meta{font-size:12px;color:var(--muted)}
    .tags{display:flex;gap:6px;flex-wrap:wrap}
    .tag{font-size:11px;border:1px solid var(--border);border-radius:999px;padding:2px 8px;color:#a5b4fc}

    .actions{display:flex;gap:8px;margin-top:6px;align-items:center}
    .watch{background:var(--accent);border-color:var(--accent);color:#fff;padding:6px 10px;border-radius:8px;border:0;cursor:pointer}
    .open-source{background:#374151;color:#fff;border-radius:8px;padding:6px 10px;border:0;cursor:pointer}
    .btn-subscribe{ background:#ff0033; border-color:var(--border); color:#fff; }

    /* favorite star */
    .fav-btn{border:0;background:transparent;font-size:18px;cursor:pointer;padding:6px;border-radius:6px;color:#ccc}
    .fav-btn.fav { color:#ffcc00; }

    .loader{display:flex;align-items:center;justify-content:center;gap:10px;color:var(--muted);padding:12px 0}
    .spinner{width:16px;height:16px;border:3px solid var(--border);border-top-color:#8ab4ff;border-radius:50%;animation:spin 1s linear infinite}
    @keyframes spin{to{transform:rotate(360deg)}}

    .overlay{position:fixed;inset:0;background:rgba(0,0,0,.85);display:none;align-items:center;justify-content:center;padding:18px;z-index:10050}
    .overlay .frame{position:relative;width:min(96vw,1100px);aspect-ratio:16/9;background:#000;border:1px solid var(--border);border-radius:10px;overflow:hidden}
    .overlay iframe{width:100%;height:100%;border:0}
    .overlay .close{position:absolute;top:-8px;right:-8px;background:#111827;border:1px solid var(--border);color:#fff;border-radius:999px;width:34px;height:34px;display:flex;align-items:center;justify-content:center;cursor:pointer}

    main { position:relative; z-index:1; }

    .wrap > * { margin-bottom: 0; }
  
/* Favorites tab smaller + tighter badge spacing */
.tab[data-provider="Favorites"] { padding:4px 8px; font-weight:700; }
.tab[data-provider="Favorites"] .fav-star { font-size:13px; margin-right:4px; color: #d4af37; } /* gold-ish */
.tab[data-provider="Favorites"] .sticker-count { margin-left:2px; font-size:11px; padding:2px 5px; }
#btn-favorites-open .fav-star { color: #d4af37; } /* gold */
#btn-favorites-open { display:inline-flex; align-items:center; gap:0; padding:6px 10px; }

/* place YouTube search more to the left and align vertically with search controls */
.google-inner { align-items: center; }
.google-inner .yt-search-inline { flex: 1 1 420px; justify-content: flex-start; max-width:520px; }
.google-inner .gsi-btn-wrap { margin-right: 12px; }
@media (max-width:700px){
  .google-inner .yt-search-inline { order: 3; width: 100%; }
}

#playlist-section .card {
  background: var(--panel);
  border-radius: 8px;
  overflow: hidden;
  color: var(--text);
}
#playlist-section .thumb img {
  width: 100%;
  display: block;
  border-radius: 8px 8px 0 0;
}
#playlist-section .content {
  padding: 8px;
}
#playlist-section button.primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
#playlist-section button.primary:hover {
  opacity: 0.9;
}

/* --- Responsive Preferences Modal --- */
@media (max-width: 768px) {
  #prefModal {
    align-items: stretch !important;
    padding-top: 0;
  }
  #prefFrame {
    width: 100% !important;
    height: 100vh !important;
    max-height: none !important;
    border-radius: 0 !important;
    padding: 20px !important;
  }
}

/* ================= THEME STYLES ================= */
body.dark-theme {
  background-color: #020a18;
  color: #e5e7eb;
}

body.light-theme {
  background-color: #f9fafb;
  color: #111827;
}

/* Adjust key UI elements for light mode */
body.light-theme .card {
  background-color: #ffffff;
  color: #111;
  border: 1px solid #ddd;
}

body.light-theme .btn {
  background: #e5e7eb;
  color: #111;
}

body.light-theme .primary {
  background: #2563eb;
  color: #fff;
}

body.light-theme .secondary {
  background: #e2e8f0;
  color: #111;
}

.tab {
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.tab[style*="display: none"] {
  opacity: 0;
  visibility: hidden;
}
.card .thumb {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.card .duration {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 4px;
  font-weight: 500;
  z-index: 2;
}


#btn-prefs-refresh::after {
  content: attr(title);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

#btn-prefs-refresh:hover::after {
  opacity: 1;
  transform: translate(-50%, -4px);
}

/* ✅ Make cards consistent with main grid */
#playlist-videos .card {
  width: 100% !important;
  max-width: 360px !important;
  background: var(--panel);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  display: flex !important;
  flex-direction: column !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#playlist-videos .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* ✅ Thumbnail consistency */
#playlist-videos .thumb img {
  width: 100% !important;
  height: 200px !important;
  object-fit: cover !important;
  display: block !important;
}

/* ✅ Title and text consistency */
#playlist-videos .content {
  padding: 10px 12px !important;
  flex-grow: 1;
}

#playlist-videos .title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* ✅ Make playlist videos behave exactly like other grids */
#playlist-videos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  padding: 12px;
  align-items: start;
}


/* Arrange stacked layout on mobile */
@media (max-width: 700px) {
  .gsi-btn-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .gsi-btn-wrap .top-line,
  .gsi-btn-wrap .bottom-line {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .gsi-btn-wrap .bottom-line {
    margin-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 6px;
  }
}

/* Optional — improve touch spacing */
@media (max-width: 700px) {
  .gsi-btn-wrap button {
    flex: 1;
    min-width: 120px;
  }
}

/* Each line grouping */
.gsi-btn-wrap .top-line,
.gsi-btn-wrap .bottom-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Desktop: everything in one line */
@media (min-width: 701px) {
  .gsi-btn-wrap {
    flex-direction: row;
    align-items: center;
  }
  .gsi-btn-wrap .top-line,
  .gsi-btn-wrap .bottom-line {
    flex-direction: row;
    margin: 0;
    padding: 0;
    border: none;
  }
}

/* Mobile: stack into two lines to avoid horizontal scroll */
@media (max-width: 700px) {
  .gsi-btn-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .gsi-btn-wrap .top-line,
  .gsi-btn-wrap .bottom-line {
    justify-content: center;
    flex-wrap: wrap;
  }

  .gsi-btn-wrap .bottom-line {
    margin-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 6px;
  }

  /* Make touch-friendly */
  .gsi-btn-wrap button {
    flex: 1;
    min-width: 120px;
  }
}
/* ---------- Toolbar layout adjustments ---------- */
.gsi-btn-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Grouped lines */
.gsi-btn-wrap .top-line,
.gsi-btn-wrap .bottom-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Desktop: all inline */
@media (min-width: 701px) {
  .gsi-btn-wrap {
    flex-direction: row;
  }
  .gsi-btn-wrap .top-line,
  .gsi-btn-wrap .bottom-line {
    flex-direction: row;
    border: none;
    margin: 0;
    padding: 0;
  }
}

/* Mobile view */
@media (max-width: 700px) {
  .gsi-btn-wrap {
    flex-direction: column;
    align-items: center;
  }

  /* Top line: Sign Out + Preferences + Refresh fit in one row */
  .gsi-btn-wrap .top-line {
    justify-content: center;
    flex-wrap: nowrap;
    gap: 4px;
  }

  /* Make buttons smaller to fit one row */
  .gsi-btn-wrap .top-line button {
    font-size: 12px;
    padding: 4px 6px;
    min-width: auto;
  }

  /* Bottom line: Favorites + Playlists on next line */
  .gsi-btn-wrap .bottom-line {
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 6px;
  }

  .gsi-btn-wrap .bottom-line button {
    font-size: 13px;
    padding: 6px 8px;
  }
}
/* ✅ Prevent horizontal scrolling on mobile */
html, body {
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}

/* ✅ Ensure all layout containers respect screen width */
.wrap, .google-inner, .gsi-btn-wrap {
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* ✅ Adjust flex containers to never overflow horizontally */
@media (max-width: 700px) {
  .gsi-btn-wrap .top-line,
  .gsi-btn-wrap .bottom-line {
    flex-wrap: nowrap;
    justify-content: center;
    max-width: 100%;
  }

  /* Reduce button padding slightly to ensure fit */
  .gsi-btn-wrap .top-line button,
  .gsi-btn-wrap .bottom-line button {
    font-size: 12px;
    padding: 4px 6px;
  }
}

/* ✅ Overlay fix: always centered and within viewport */
/* ✅ Overlay fix: always centered + larger default size + viewport safe */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 18px;
  z-index: 10050;
  overflow: hidden;
  touch-action: none;
  -ms-touch-action: none;
  user-select: none;
  box-sizing: border-box;
}

/* === Video Overlay (with minimum size rules) === */
.overlay .frame {
  position: relative;
  width: min(96vw, 1200px);
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-sizing: border-box;

  /* Default desktop/tablet minimum = 4 inches */
  min-width: 384px;
  min-height: calc(384px * 9 / 16);
}

/* Mobile: minimum 1.5 inches */
@media (max-width: 700px) {
  .overlay .frame {
    min-width: 144px;
    min-height: calc(144px * 9 / 16);
  }
}

#gsi-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px 0;
}

button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
button.secondary:hover {
  background: rgba(255,255,255,0.06);
}
.top-chips {
  display: none !important;
}


/* ===== Responsive Tweaks ===== */
@media (max-width: 900px) {
  .signin-marquee {
    font-size: 13px;
    padding: 5px 0;
  }
  .signin-marquee .marquee-content {
    animation-duration: 22s;
  }
}

@media (max-width: 600px) {
  .signin-marquee {
    font-size: 12px;
    background: linear-gradient(90deg, #ff6a00, #ffbb00);
    text-shadow: none;
  }
  .signin-marquee .marquee-content {
    animation-duration: 26s;
  }
}

/* ✅ Fix left/right clipping and top overlap in mobile view */
@media (max-width: 600px) {
  .google-row {
    width: 100vw !important;
    margin: 0 !important;
    padding: 10px 10px !important; /* add top/bottom space */
    box-sizing: border-box;
    overflow-x: visible !important;
    background: var(--panel);
    position: relative;
    top: 8px; /* offset from top */
  }

  .google-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    width: 100%;
    max-width: 100%;
  }

  .user-pill {
    margin-left: 2px !important;
    padding-left: 2px !important;
  }

  #btn-prefs-refresh {
    margin-right: 6px !important;
    transform: scale(0.9);
  }

  body, html {
    overflow-x: hidden;
  }

  /* Optional: give a little space below the google row */
  .search-panel {
    margin-top: 8px !important;
  }
}
/* ✅ Fine-tune left and right spacing for Google row content */
@media (max-width: 600px) {
  .google-inner {
    padding: 0 12px !important; /* ensures full visibility of icons */
    width: 100%;
    box-sizing: border-box;
  }

  /* prevent clipping of first and last child elements */
  .google-inner > *:first-child {
    margin-left: 0 !important;
  }
  .google-inner > *:last-child {
    margin-right: 0 !important;
  }
}

#prefCategories,
label[for="prefCategories"],
.pref-section:has(#prefCategories) {
  display: none !important;
}
/* ✅ Completely hide the Categories section including label */
label[for="prefCategories"],
#prefCategories,
.pref-section:has(#prefCategories) {
  display: none !important;
}

/* ✅ (Optional fallback) In case the label doesn’t use 'for' attribute */
.pref-section label:has(+ #prefCategories) {
  display: none !important;
}
/* ✅ Hide only the Categories preference and its label */
.pref-section:has(#prefCategories),
#prefCategories,
label[for="prefCategories"] {
  display: none !important;
}
label:has(#prefCategories) {
  display: none !important;
}

.red-link {
color: rgb(255, 255, 255);
text-decoration: underline;
padding: 5px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 20px;
}

.video-item {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}

.video-item:hover {
  transform: scale(1.03);
}

.video-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.video-title {
  font-size: 14px;
  font-weight: 600;
  margin: 8px;
}

.video-meta {
  font-size: 12px;
  color: #666;
  margin: 0 8px 8px;
}
/* =====================
   HEADER TOP (Logo + Marquee)
   ===================== */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 18px;
  background-color: var(--panel);
  flex-wrap: wrap; /* ✅ Keeps responsive on mobile */
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
}

.app-logo {
  height: 38px;
  width: auto;
  border-radius: 6px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.app-logo:hover {
  transform: scale(1.05);
}

.app-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.4px;
}

/* Marquee Styling */
.signin-marquee {
  flex: 1;
  overflow: hidden;
  background: linear-gradient(90deg, #ff007f, #ff9900);
  color: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  white-space: nowrap;
}

.marquee-content {
  display: inline-block;
  animation: marquee 18s linear infinite;
  font-weight: 500;
}

@keyframes marquee {
  from { transform: translateX(100%); }
  to { transform: translateX(-100%); }
}

/* ✅ Responsive (Mobile View) */
@media (max-width: 768px) {
  .header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .app-logo {
    height: 32px;
  }

  .app-name {
    font-size: 1.1rem;
  }

  .signin-marquee {
    width: 100%;
    font-size: 0.9rem;
    padding: 5px 10px;
  }
}

/* ===== DARK THEME FIX for Choices.js dropdowns ===== */
.choices {
  background-color: #071426 !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 8px !important;
}

.choices__inner {
  background-color: #071426 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  min-height: 44px;
}

.choices__list--dropdown {
  background-color: #0b192d !important; /* darker dropdown menu */
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.choices__list--dropdown .choices__item {
  color: #000000 !important;
  padding: 8px 10px;
  font-size: 14px;
}

.choices__list--dropdown .choices__item--selectable:hover,
.choices__list--dropdown .choices__item--selectable.is-highlighted {
  background-color: #2563eb !important; /* blue highlight */
  color: #fff !important;
}

.choices__list--multiple .choices__item {
  background-color: #16a34a !important; /* green chips */
  color: #fff !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 4px 8px;
  font-size: 13px;
}

.choices__button {
  background: transparent !important;
  color: #fff !important;
  opacity: 0.7;
}
.choices__button:hover {
  opacity: 1;
}
.actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.actions .share-btn:hover {
  color: #3b82f6; /* brighter blue */
  transform: scale(1.1);
}

.actions .fav-btn:hover {
  transform: scale(1.1);
}
.fav-btn {
  background-color: #374151; /* default: dark gray */
  color: #d1d5db; /* light gray star */
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.25s ease;
}
.fav-btn:hover {
  background-color: #4b5563; /* slightly lighter on hover */
}
.fav-btn.fav {
  background-color: #fbbf24 !important; /* gold background */
  color: #fff !important; /* white star */
  transform: scale(1.05);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

#miniPlayer {
  transition: transform 0.3s ease, opacity 0.3s ease;
}
#miniPlayer:hover {
  transform: scale(1.04);
}

.like-btn.liked {
background-color: var(--accent, #3b82f6);
color: #fff;
}
.like-btn:hover {
transform: translateY(-1px);
background-color: #2563eb;
color: #fff;
}
.like-btn.liked {
  color: #3b82f6 !important; /* blue highlight when liked */
}
.like-btn:hover {
  transform: scale(1.05);
  background-color: #273244;
}

.pl-share-btn {
  background: #1f2937;
  color: #d1d5db;
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
.pl-share-btn:hover { filter: brightness(1.1); }

/* --- Enhanced Overlay Styling (Full Drag + Resize) — FINAL VERSION --- */

/* Main overlay (full screen, centered) */
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 18px;
  z-index: 9999;
  overflow: hidden;
  touch-action: none;          /* required for tablet drag/resize */
  -ms-touch-action: none;
  user-select: none;
  box-sizing: border-box;
}

/* Main player frame (draggable + resizable video box) */
#overlay .frame {
  position: relative;
  width: min(96vw, 1200px);     /* bigger default */
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-sizing: border-box;
}

/* Even larger on very wide screens */
@media (min-width: 1400px) {
  #overlay .frame {
    width: min(92vw, 1400px);
  }
}

/* Disable iframe stealing touches when dragging/resizing */
#overlay.dragging iframe,
#overlay.resizing iframe {
  pointer-events: none;
}

/* iframe fills the frame */
#ovFrame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ===== Visible 8 Resize Handles (4 corners + 4 sides) ===== */

.overlay-handle {
  position: absolute;
  background: #3b82f6; /* bright blue */
  border-radius: 50%;
  z-index: 2;
}

/* Mid-side handles (pill shape) */
.overlay-handle.n,
.overlay-handle.s {
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

.overlay-handle.e,
.overlay-handle.w {
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 36px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

/* Corner handles (diamond shape) */
.overlay-handle.nw,
.overlay-handle.ne,
.overlay-handle.sw,
.overlay-handle.se {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  transform-origin: center;
  transform: rotate(45deg);
}

/* Positions */
.overlay-handle.n  { top: -6px; }
.overlay-handle.s  { bottom: -6px; }
.overlay-handle.e  { right: -6px; }
.overlay-handle.w  { left: -6px; }

.overlay-handle.nw { top: -8px; left: -8px; }
.overlay-handle.ne { top: -8px; right: -8px; }
.overlay-handle.sw { bottom: -8px; left: -8px; }
.overlay-handle.se { bottom: -8px; right: -8px; }

/* Hover feedback */
.overlay-handle:hover {
  transform: scale(1.2) rotate(45deg);
  background: #8ab4ff;
}

/* 🔹 My Hub Slider Styles */
.myhub-slider {
  position: fixed;
  top: 0;
  right: -400px;
  width: min(90vw, 360px);
  height: 100%;
  background: var(--panel);
  color: var(--text);
  box-shadow: -4px 0 18px rgba(0,0,0,0.5);
  z-index: 11000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px;
}
.myhub-slider.open { right: 0; }

.myhub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.myhub-title { font-size: 18px; font-weight: 600; }
.myhub-close {
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
}

.myhub-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.myhub-section button {
  width: 100%;
  text-align: center;
  font-size: 14px;
}

@media (max-width: 700px) {
  .myhub-slider {
    width: 100%;
    right: -100%;
  }
  .myhub-slider.open {
    right: 0;
  }
}
/* My Hub — better YouTube search proportions */
.myhub-yt-search input#yt-q {
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,0.06) !important;
  background: #071426 !important;
  color: var(--text) !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
  font-size: 14px;
}

.myhub-search-btn {
  min-width: 48px;
  max-width: 72px;
  padding-left: 10px !important;
  padding-right: 10px !important;
  background-color: #00C853 !important;
  border: none !important;
  box-shadow: none !important;
}

/* ensure the small left rounded box you saw is not caused by flex-children overflow;
   this keeps the search row full width within the slider */
.myhub-yt-search { width: 100%; box-sizing: border-box; }

/* 🌈 Animated Rainbow Gradient for "My Hub" button */
#btn-myhub {
  background: linear-gradient(
    90deg,
    #ff0057,
    #ff7b00,
    #ffee00,
    #00ff88,
    #00c3ff,
    #7a00ff,
    #ff00c8,
    #ff0057
  );
  background-size: 600% 600%;
  color: #fff !important;
  border: none;
  box-shadow: 0 0 8px rgba(255,255,255,0.3);
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: rainbowMove 6s linear infinite;
}

#btn-myhub:hover {
  transform: scale(1.05);
  box-shadow: 0 0 14px rgba(255,255,255,0.6);
}

#btn-myhub:active {
  transform: scale(0.97);
}

/* keyframes for gradient motion */
@keyframes rainbowMove {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#miniPlayer, .mini-player {
  touch-action: none;     /* enables dragging on touch */
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

#miniPlayer iframe {
  touch-action: none;     /* prevents iframe from stealing touch drags */
}

#miniPlayer, .mini-player {
  position: fixed;
  z-index: 10000;
  background: #000;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

/* =============================
   🎬 Mobile Fullscreen Behavior
============================= */
@media (max-width: 768px) {
  #miniPlayer.expanded-mobile {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0;
    z-index: 99999;
  }

  #miniPlayer.expanded-mobile iframe {
    width: 100%;
    height: 100%;
  }
}

/* ================================
   🎉 Greetings Overlay Styles
================================ */
/* Make overlay fully cover the app & show clean GIF background */
.overlay-greetings {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.90);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 12000;

  /* NEW → layout side-by-side */
  flex-direction: row;
  padding: 0;
}

.greetings-frame {
  background: var(--panel);
  color: var(--text);
  width: min(90vw, 400px);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.greetings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.greetings-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.greetings-body textarea,
.greetings-body input,
.greetings-body select {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: #071426;
  color: var(--text);
}

.greetings-body button {
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
}

.greeting-message {
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  margin: 10px 0;
}

.greeting-video iframe {
  width: 100%;
  height: 220px;
  border-radius: 10px;
  border: none;
}

/* ======================================
   🎉 Greeting Animations (Works NOW)
====================================== */
.greet-anim-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2; /* ABOVE background, BELOW content */
}

/* animation icons */
.greet-item {
  position: absolute;
  font-size: 28px;
  opacity: 0.8;
  animation: greetingFall linear infinite;
}

/* falling animation */
@keyframes greetingFall {
  0% { transform: translateY(-60px) rotate(0deg); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(120vh) rotate(360deg); opacity: 0; }
}

/* bubbles upward */
@keyframes greetingBubble {
  0% { transform: translateY(40px) scale(0.8); opacity: 0; }
  20% { opacity: 0.5; }
  100% { transform: translateY(-120vh) scale(1.3); opacity: 0; }
}

/* sparkle twinkle */
@keyframes greetingSparkle {
  0%,100% { opacity: 0; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* 🔔 Animated greeting icon */
.greet-icon {
  width: 26px;
  height: 26px;
  animation: greetPulse 1.6s ease-in-out infinite;
}

@keyframes greetPulse {
  0%   { transform: scale(1);   filter: drop-shadow(0 0 2px #ff00aa); }
  50%  { transform: scale(1.25); filter: drop-shadow(0 0 8px #ff66dd); }
  100% { transform: scale(1);   filter: drop-shadow(0 0 2px #ff00aa); }
}

/* Optional – remove default button padding to make it look cleaner */
.greetings-icon-btn {
  padding: 6px 8px !important;
  background: transparent;
  border: none;
}

/* 🌟 Subtle glowing effect (no breathing) */
.greet-glow {
  animation: greetGlow 1.4s ease-in-out infinite;
}

@keyframes greetGlow {
  0%   { filter: drop-shadow(0 0 2px #ff66cc); }
  50%  { filter: drop-shadow(0 0 10px #ff99dd); }
  100% { filter: drop-shadow(0 0 2px #ff66cc); }
}
/* =========================================================
   🎉 ADVANCED GREETING ENHANCEMENTS
========================================================= */

/* === Particle Layer === */
.greet-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

/* Single particle */
.greet-p {
  position: absolute;
  font-size: 26px;
  opacity: 0.9;
  animation: particleFall linear infinite;
}

/* Falling particles */
@keyframes particleFall {
  0%   { transform: translateY(-60px) rotate(0deg); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translateY(120vh) rotate(360deg); opacity: 0; }
}

/* === GIF Animation Container === */
.greet-gif-box {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 15px;
}

.greet-gif-box img {
  width: 160px;
  height: auto;
  border-radius: 12px;
}

/* ================================
   🎉 Left GIF + Right Card Layout
================================ */
.greeting-layout {
  display: flex;
  width: 100%;
  height: 100%;
}

.greeting-gif-area {
  width: 66%;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
}

.overlay-greetings .greetings-frame {
  width: 34% !important;
  height: 100%;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  background: var(--panel);
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
}

/* Mobile fallback → use full-screen GIF + center card */
@media(max-width: 900px) {
  .greeting-layout {
    flex-direction: column;
  }
  .greeting-gif-area {
    width: 100%;
    height: 40vh;
  }
  .overlay-greetings .greetings-frame {
    width: 100% !important;
    height: auto;
  }
}

/* =========================================================
      MOBILE SEARCH OVERLAY (Full-screen search)
   ========================================================= */
@media (max-width: 600px) {

  /* Floating button */
  .mobile-search-btn {
      width: 46px;
      height: 46px;
      font-size: 16px;
      box-shadow: 0 4px 10px rgba(0,0,0,0.3);
      border-radius: 50%;
      background: #ffffff;
      color: #083ef1;
  }

  /* Full-screen overlay */
  .mobile-search-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.92);
      display: none;
      justify-content: center;
      align-items: flex-start;
      padding-top: 80px;
      z-index: 10000;
  }

  .mobile-search-overlay.show {
      display: flex;
  }

  .mobile-search-box-full {
      width: 90%;
      background: var(--panel);
      padding: 16px;
      border-radius: 12px;
      box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  }

  .mobile-close-btn {
      background: #742f3d;
      border: none;
      color: #fff;
      font-size: 18px;
      padding: 6px 10px;
      border-radius: 8px;
      float: right;
      margin-bottom: 16px;
  }

  .mobile-search-box-full input {
      width: 100%;
      padding: 10px;
      border-radius: 8px;
      border: 1px solid rgba(255,255,255,0.1);
      background: #071426;
      color: var(--text);
      margin-bottom: 16px;
  }

  .btn-row {
      display: flex;
      justify-content: center;
      gap: 20px;
  }
}

/* =========================================================
      FLOATING MINI SEARCH (Bottom-right floating bar)
   ========================================================= */

/* Hard hide mobile UI by default to prevent flashing */
.mobile-search-btn,
.mobile-search-wrapper,
.mobile-search-box,
.mobile-search-overlay {
    display: none !important;
}

@media (max-width:600px) {

  /* Re-enable mobile UI ONLY on phones */
  .mobile-search-btn {
      display: inline-flex !important;
  }

  .mobile-search-wrapper {
      display: flex !important;
  }

  .mobile-search-box {
      display: flex !important;
  }

  .mobile-search-overlay {
      display: none !important; /* visible only when .show is added */
  }

  /* Hide desktop search panel on mobile */
  .search-panel { display:none !important; }

  /* Wrapper: fixes floating bar near bottom-right */
  .mobile-search-wrapper {
      position: fixed;
      bottom: 86px;
      right: 20px;
      flex-direction: row-reverse;
      align-items: center;
      gap: 10px;
      z-index: 99999;
      pointer-events: auto;
  }

  /* Floating round search button */
  .mobile-search-btn {
      outline: none !important;
      box-shadow: 0 6px 18px rgba(0,0,0,0.35);
      width: 46px;
      height: 46px;
      border-radius: 50%;
      background: #ffffff;
      color: #083ef1;
      font-size: 20px;
      align-items: center;
      justify-content: center;
  }

  .mobile-search-btn:focus,
  .mobile-search-btn:active {
      outline: none !important;
      box-shadow: 0 6px 18px rgba(0,0,0,0.35) !important;
  }

  /* ======================================================
       ⭐ UPDATED MINI SEARCH BOX (your requested changes)
     ====================================================== */

  .mobile-search-box {
      align-items: center;
      gap: 8px;

      background: var(--panel);
      border-radius: 10px;

      /* ⭐ Bigger + more padding */
      padding: 4px 8px;
      height: 40px !important;

      /* ⭐ White border to stand out */
      border: 2px solid #ffffff !important;

      overflow: hidden;

      /* ⭐ Wider collapsed/expanded behavior */
      width: 0;
      opacity: 0;
      pointer-events: none;
      transition: width 0.25s ease, opacity 0.18s ease;
  }

  .mobile-search-box.show {
      width: 280px !important; /* increased from 220px */
      opacity: 1;
      pointer-events: auto;
  }

  /* Input area inside mini-search */
.mobile-search-box input {
    height: 34px !important;
    line-height: 34px !important;
    padding: 0 10px !important;
    margin: 0 !important;
    font-size: 14px;
    border-radius: 6px;
    border: 0;
    outline: none !important;
    background: #071426;
    color: var(--text);
    flex: 1 1 auto;
    min-width: 0;
}


  .mobile-search-box input:focus {
      outline: none !important;
      border: 1px solid rgba(255,255,255,0.25);
  }

  /* Buttons inside search mini-bar */
  .m-btn {
      width: 28px;
      height: 26px;
      padding: 0;
      border: none;
      border-radius: 6px;
      font-size: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
  }

  .m-btn.green { background:#00C853; color:#fff; }
  .m-btn.red   { background:#c04a5c; color:#fff; }
}

/* Tablet rule */
@media (max-width:700px) {
  .search-panel {
      display: none !important;
  }
}

/* === Visible Blue Resize Handles (all 8 sides) === */
#overlay .overlay-handle {
  background: rgba(0, 123, 255, 0.9);   /* bright blue */
  border-radius: 50%;
}

/* 4 corners (bigger bubbles) */
#overlay .overlay-handle.nw,
#overlay .overlay-handle.ne,
#overlay .overlay-handle.sw,
#overlay .overlay-handle.se {
  width: 14px !important;
  height: 14px !important;
}

/* 4 sides (slightly smaller) */
#overlay .overlay-handle.n,
#overlay .overlay-handle.s {
  height: 10px !important;
  width: 24px !important;
  border-radius: 6px;
}
#overlay .overlay-handle.e,
#overlay .overlay-handle.w {
  width: 10px !important;
  height: 24px !important;
  border-radius: 6px;
}

#myhub-signedin #btn-favorites-open {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  padding: 6px 12px !important;
  align-items: center !important;
  justify-content: center !important;
}

body.no-scroll {
  overflow: hidden !important;
  position: fixed !important;
  width: 100%;
}

#viz-text-drawer {
  background: rgba(7, 20, 40, 0.55) !important;
  backdrop-filter: blur(6px);
}

#viz-meme-upload-video {
    display: none !important;
}

#viz-meme-drawer-video {
    display: none !important;
}

/* 🔥 Overlay must allow scroll */
#viz-meme-overlay {
  overflow-y: auto !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* ==========================================
   ⭐ FIXED CANVAS WRAPPER (critical)
========================================== */
#viz-meme-canvas-wrap {
  width: auto !important;
  height: auto !important;
  max-height: none !important;

  /* allow Fabric.js gestures (pinch/pan) */
  overflow: visible !important;
  touch-action: none !important;

  display: inline-block !important;
  position: relative !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ==========================================
   ⭐ TRUE SCROLL CONTAINER
========================================== */
#viz-meme-canvas-scroll {
  position: relative !important;

  height: calc(100vh - 130px) !important;

  overflow-x: scroll !important;
  overflow-y: scroll !important;
  -webkit-overflow-scrolling: touch !important;

  overscroll-behavior: contain !important;
  touch-action: auto !important;
}

/* Scrollbars */
#viz-meme-canvas-scroll::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

#viz-meme-canvas-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 0, 0.1);
  border-radius: 4px;
}

#viz-meme-canvas-scroll::-webkit-scrollbar-thumb {
  background: #FFD400;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 0, 0.25);
}

#viz-meme-canvas-scroll::-webkit-scrollbar-thumb:hover {
  background: #ffea00;
}

/* ======================
   Bottom toolbar
====================== */
#viz-meme-toolbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  z-index: 200010;

  background: transparent !important;
  backdrop-filter: none !important;

  border-radius: 999px;
  padding: 8px 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  box-shadow: none !important;
  border: none !important;
}

/* ======================
   Mobile horizontal scroll for Auth buttons
====================== */
@media (max-width: 600px) {
  .auth-scroll {
    display: block;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding-bottom: 4px;
  }

  .auth-scroll::-webkit-scrollbar {
    height: 4px;
  }
  .auth-scroll::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
  }

  #auth-section {
    flex-wrap: nowrap !important;
  }

  #auth-section button,
  #auth-section #gsi-container {
    white-space: nowrap;
    flex-shrink: 0;
  }
}
/* ==========================================
   ⭐ FIXED CANVAS WRAPPER (critical)
========================================== */
#viz-meme-canvas-wrap {
  width: max-content !important;      /* canvas uses real width */
  height: max-content !important;
  max-height: none !important;

  overflow: visible !important;        /* fabric gestures need this */
  touch-action: none !important;       /* allow pinch & pan */

  display: inline-block !important;    /* prevents clipping */
  position: relative !important;

  margin: 0 !important;
  padding: 0 !important;
}

/* ==========================================
   ⭐ TRUE SCROLL CONTAINER → OUTER LAYER
========================================== */
#viz-meme-canvas-scroll {
  position: relative !important;

  height: calc(100vh - 130px) !important;

  /* REAL SCROLLING IN BOTH DIRECTIONS */
  overflow-x: scroll !important;
  overflow-y: scroll !important;
  -webkit-overflow-scrolling: touch !important;

  overscroll-behavior: contain !important;
  touch-action: auto !important;
}

/* Scrollbars */
#viz-meme-canvas-scroll::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
#viz-meme-canvas-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 0, 0.1);
  border-radius: 4px;
}
#viz-meme-canvas-scroll::-webkit-scrollbar-thumb {
  background: #FFD400;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 0, 0.25);
}
#viz-meme-canvas-scroll::-webkit-scrollbar-thumb:hover {
  background: #ffea00;
}

/* ======================
   Floating toolbar
====================== */
#viz-meme-toolbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  z-index: 200010;

  background: transparent !important;
  backdrop-filter: none !important;

  border-radius: 999px;
  padding: 8px 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  box-shadow: none !important;
  border: none !important;
}

/* ======================
   Mobile auth scroll
====================== */
@media (max-width: 600px) {
  .auth-scroll {
    display: block;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding-bottom: 4px;
  }

  .auth-scroll::-webkit-scrollbar {
    height: 4px;
  }
  .auth-scroll::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
  }

  #auth-section {
    flex-wrap: nowrap !important;
  }

  #auth-section button,
  #auth-section #gsi-container {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* ===============================
   📱 MOBILE: Vertical Meme Toolbar
=============================== */
@media (max-width: 700px) {
  #viz-meme-toolbar {
    position: fixed !important;
    left: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    bottom: auto !important;

    flex-direction: column !important;
    gap: 10px !important;

    background: rgba(0,0,0,0.1) !important;
    backdrop-filter: blur(4px) !important;

    border-radius: 16px !important;
    padding: 10px 6px !important;
    z-index: 200020 !important;
  }

  #viz-meme-toolbar .viz-meme-pill-btn {
    min-width: 42px !important;
    height: 42px !important;
    font-size: 18px !important;
    padding: 6px !important;
  }
}

/* ==========================================
   ⭐ HIDE VERTICAL MEME TOOLBAR WHEN TEXT EDITOR IS OPEN
========================================== */
#viz-meme-toolbar.hide-toolbar {
  display: none !important;
}

/* ===============================
   ⭐ MOBILE SCROLL ADJUSTMENTS
=============================== */
@media (max-width: 700px) {
  #viz-meme-canvas-scroll {
    height: calc(100vh - 40px) !important;
    overflow-y: scroll !important;
    overflow-x: scroll !important;
    padding-left: 0 !important;
  }
}

/* ⭐ Remove bottom black strip + full canvas scroll */
@media (max-width: 700px) {
  #viz-meme-canvas-scroll {
    height: auto !important;
    max-height: none !important;
    min-height: calc(100vh - 20px) !important;

    overflow-y: auto !important;
    overflow-x: scroll !important;

    padding: 0 !important;
  }
}

/* Wrapper stays natural size */
@media (max-width: 700px) {
  #viz-meme-canvas-wrap {
    height: auto !important;
    max-height: none !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }
}

/* ======================================================
   ⭐ Mobile-only Right-side Scroll Arrow for auth-scroll
   ====================================================== */

/* Hide arrow by default on all devices */
.auth-scroll .scroll-hint {
  display: none !important;
}

/* Enable arrow ONLY on mobile devices */
@media (max-width: 600px) {

  .auth-scroll {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
  }

  .auth-scroll .scroll-hint {
    display: block !important;
    position: absolute;
    top: 50%;
    right: 2px; /* ALWAYS far right */
    transform: translateY(-50%);
    pointer-events: none;

    font-size: 20px;
    opacity: 0.75;
    animation: scrollHintMove 1.4s infinite;
    z-index: 50;
  }

  /* Hide arrow when scrolling reaches end */
  .auth-scroll.scrolled-end .scroll-hint {
    display: none !important;
  }
}

/* Wiggle animation (global, safe) */
@keyframes scrollHintMove {
  0%   { transform: translateY(-50%) translateX(0); }
  50%  { transform: translateY(-50%) translateX(6px); }
  100% { transform: translateY(-50%) translateX(0); }
}

#previewGreetingContent,
#viewGreetingContent {
    white-space: pre-wrap !important;
}

#mobileSearchWrapper,
#mobileSearchToggle,
#mobileSearchBox {
    z-index: 1 !important;
}

/* ========== C-Rooms styles ========== */
.croom-item { padding:10px;border:1px solid rgba(255,255,255,0.04);margin-bottom:8px;border-radius:8px;background: #071428; display:flex; align-items:center; justify-content:space-between; gap:8px; }
.croom-meta { font-size:13px;color:var(--muted); }
.croom-actions { display:flex; gap:8px; }
.btn.small { padding:6px 8px; font-size:13px; border-radius:8px; }

/* Highlight active C-Rooms tab */
#croomsOverlay .btn.small.active {
  background: #2563eb !important;   /* Blue */
  color: white !important;
  border-color: #1d4ed8 !important;
}

/* ===============================================
   ⭐ CHAT ROOM OVERLAY — MATCH C-ROOMS OVERLAY
   =============================================== */
#chatWindow {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40000;
}

#chatWindowContent {
  width: 95%;
  max-width: 900px;
  height: 90vh;
  background: var(--card-bg);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(0,0,0,0.3);
}

/* Header (title + close button) */
#chatHeader {
  padding: 14px;
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--accent-light);
  color: var(--accent-dark);
}

/* Messages area */
#croomMessages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}

/* Bottom input bar */
#chatInputBar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
}

#msgInput {
  flex: 1;
  padding: 10px 14px;
  font-size: 15px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
}

#msgSend {
  padding: 10px 14px;
  font-size: 15px;
  border-radius: 8px;
}
