/* =====================================================================
   YouTube (finto) — layout 2008, header glossy rosso/bianco, sidebar,
   grid di card, watch page con player + commenti
   ===================================================================== */
.youtube-win .win-body { overflow: hidden; }
.app.youtube { background: linear-gradient(180deg, #eef6ff, #dceefc); font-size: 0.92rem; }

/* ---------- header ---------- */
.app.youtube .yt-header {
  flex: none; display: flex; align-items: center; gap: 14px; padding: 10px 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f3f8ff 55%, #dfeeff 100%);
  border-bottom: 1px solid rgba(0,60,150,0.2);
  box-shadow: 0 2px 6px rgba(0,40,120,0.12);
}
.app.youtube .yt-brand { display: flex; align-items: center; gap: 8px; flex: none; }
.app.youtube .yt-brand img { width: 26px; height: 26px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0,20,80,0.3)); }
.app.youtube .yt-wordmark {
  font: 800 1.35rem var(--font-display); letter-spacing: -0.02em;
  color: #c2321c; text-shadow: 0 1px 0 rgba(255,255,255,0.8);
}
.app.youtube .yt-search { flex: 1; max-width: 420px; display: flex; align-items: stretch; border-radius: 999px; overflow: hidden; padding: 0; }
.app.youtube .yt-search-input {
  flex: 1; border: 0; outline: none; background: transparent; padding: 0 14px;
  font: 500 0.88rem var(--font); color: #0b3a80; min-width: 0;
}
.app.youtube .yt-search-btn {
  flex: none; width: 40px; border: 0; cursor: pointer; font-size: 0.95rem;
  background: linear-gradient(180deg, #ffd0c6 0%, #ff7a5c 45%, #e0432a 52%, #c2321c 100%);
  color: #fff;
}
.app.youtube .yt-search-btn:hover { filter: brightness(1.08); }
.app.youtube .yt-header-spacer { flex: 1; }

/* ---------- body: sidebar + main ---------- */
.app.youtube .yt-body { flex: 1; min-height: 0; display: flex; overflow: hidden; }
.app.youtube .yt-sidebar {
  flex: none; width: 168px; padding: 10px 8px; display: flex; flex-direction: column; gap: 3px;
  background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(210,232,255,0.4));
  border-right: 1px solid rgba(0,60,150,0.15); overflow-y: auto;
}
.app.youtube .yt-side-item {
  display: flex; align-items: center; gap: 10px; text-align: left;
  border: 0; background: transparent; cursor: pointer; border-radius: 10px;
  padding: 9px 10px; font: 600 0.85rem var(--font); color: #0b3a80;
}
.app.youtube .yt-side-ico { font-size: 1rem; width: 18px; text-align: center; }
.app.youtube .yt-side-item:hover { background: rgba(120,200,255,0.3); }
.app.youtube .yt-side-item.active {
  background: linear-gradient(180deg, #a9ecff, #3aa8ff 48%, #0f7de8 52%, #0b5fd6);
  color: #fff; text-shadow: 0 -1px 0 rgba(0,40,120,0.6);
  box-shadow: 0 3px 8px rgba(0,40,120,0.3), 0 1px 0 rgba(255,255,255,0.6) inset;
}

.app.youtube .yt-main { flex: 1; min-width: 0; overflow-y: auto; padding: 16px; }
.app.youtube .yt-section-title { font: 700 1.05rem var(--font-display); color: #0b3a80; margin-bottom: 12px; }
.app.youtube .yt-section-title.small { font-size: 0.9rem; margin-bottom: 8px; }
.app.youtube .yt-empty { opacity: 0.6; padding: 30px; text-align: center; }

/* ---------- grid + card ---------- */
.app.youtube .yt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.app.youtube .yt-card { cursor: pointer; }
.app.youtube .yt-thumb-wrap { position: relative; aspect-ratio: 16/9; overflow: hidden; }
.app.youtube .yt-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.app.youtube .yt-dur {
  position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: 4px;
  background: rgba(0,10,30,0.82); color: #fff; font: 700 0.72rem var(--font); letter-spacing: 0.02em;
}
.app.youtube .yt-card-info { padding: 10px 12px 12px; position: relative; z-index: 1; }
.app.youtube .yt-card-title { font: 700 0.9rem/1.3 var(--font); color: #0b3a80; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app.youtube .yt-card-channel { font: 600 0.8rem var(--font); color: #3a7bd5; margin-top: 4px; }
.app.youtube .yt-card-meta { font-size: 0.76rem; opacity: 0.65; margin-top: 2px; }

/* ---------- watch page ---------- */
.app.youtube .yt-back { margin-bottom: 12px; }
.app.youtube .yt-watch { display: flex; gap: 18px; align-items: flex-start; }
.app.youtube .yt-player-col { flex: 1; min-width: 0; }
.app.youtube .yt-player {
  position: relative; width: 100%; aspect-ratio: 16/9; border-radius: 14px; overflow: hidden;
  background: #000; padding: 0;
}
.app.youtube .yt-player::before { display: none; }
.app.youtube .yt-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.app.youtube .yt-title { font: 700 1.15rem/1.3 var(--font-display); color: #0b3a80; margin: 12px 0 8px; }

.app.youtube .yt-channel-row { display: flex; align-items: center; gap: 12px; padding: 8px 0 14px; flex-wrap: wrap; }
.app.youtube .yt-channel-id { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.app.youtube .yt-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font: 700 1.1rem var(--font-display); color: #fff;
  background: linear-gradient(180deg, #a9ecff, #3aa8ff 48%, #0f7de8 52%, #0b5fd6);
  border: 2px solid #fff; box-shadow: 0 3px 8px rgba(0,40,120,0.3);
}
.app.youtube .yt-avatar.small { width: 28px; height: 28px; font-size: 0.85rem; }
.app.youtube .yt-channel-name { font: 700 0.92rem var(--font); color: #0b3a80; }
.app.youtube .yt-channel-subs { font-size: 0.76rem; opacity: 0.65; }
.app.youtube .yt-sub-btn {
  flex: none; border: 1px solid #8f2312; cursor: pointer; padding: 9px 20px; border-radius: 999px;
  background: linear-gradient(180deg, #ffd0c6 0%, #ff7a5c 45%, #e0432a 52%, #c2321c 100%);
  color: #fff; font: 700 0.85rem var(--font); text-shadow: 0 -1px 0 rgba(120,20,0,0.6);
  box-shadow: 0 3px 7px rgba(0,40,120,0.25), 0 1px 0 rgba(255,255,255,0.5) inset;
}
.app.youtube .yt-sub-btn:hover { filter: brightness(1.08); }
.app.youtube .yt-sub-btn:active { transform: translateY(1px); }

.app.youtube .yt-reactions { display: flex; gap: 8px; flex: none; }
.app.youtube .yt-react {
  display: flex; align-items: center; gap: 6px; cursor: pointer; border: 1px solid #7fa9d8; border-radius: 999px;
  padding: 8px 14px; font: 700 0.82rem var(--font); color: #0b3a80;
  background: linear-gradient(180deg, #ffffff 0%, #eaf6ff 45%, #cfe6fb 52%, #e3f2ff 100%);
  box-shadow: 0 2px 6px rgba(0,40,120,0.2), 0 1px 0 rgba(255,255,255,0.9) inset;
}
.app.youtube .yt-react:hover { filter: brightness(1.06); }
.app.youtube .yt-react.active { background: linear-gradient(180deg, #a9ecff, #3aa8ff 48%, #0f7de8 52%, #0b5fd6); color: #fff; text-shadow: 0 -1px 0 rgba(0,40,120,0.6); }

.app.youtube .yt-desc { margin-bottom: 14px; }
.app.youtube .yt-desc-meta { font: 700 0.82rem var(--font); opacity: 0.7; margin-bottom: 6px; }
.app.youtube .yt-desc p { margin: 0; line-height: 1.5; }

.app.youtube .yt-comments-title { font: 700 0.95rem var(--font-display); margin-bottom: 10px; }
.app.youtube .yt-comment { display: flex; gap: 10px; padding: 8px 0; align-items: flex-start; }
.app.youtube .yt-comment-body { line-height: 1.4; }
.app.youtube .yt-comment-who { font-weight: 700; color: #3a7bd5; margin-right: 4px; }

/* ---------- related sidebar ---------- */
.app.youtube .yt-related { flex: none; width: 260px; display: flex; flex-direction: column; gap: 10px; }
.app.youtube .yt-rel-card { display: flex; gap: 8px; cursor: pointer; border-radius: 10px; padding: 4px; }
.app.youtube .yt-rel-card:hover { background: rgba(120,200,255,0.25); }
.app.youtube .yt-thumb-wrap.small { flex: none; width: 120px; border-radius: 8px; }
.app.youtube .yt-rel-info { min-width: 0; }
.app.youtube .yt-rel-title { font: 700 0.8rem/1.3 var(--font); color: #0b3a80; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app.youtube .yt-rel-channel { font-size: 0.72rem; color: #3a7bd5; margin-top: 3px; }
.app.youtube .yt-rel-meta { font-size: 0.7rem; opacity: 0.6; }

/* =====================================================================
   Mobile: single column, watch page full width
   ===================================================================== */
html.mobile .app.youtube .yt-header { padding: 8px 10px; gap: 8px; }
html.mobile .app.youtube .yt-wordmark { font-size: 1.1rem; }
html.mobile .app.youtube .yt-search-input { font-size: 16px; }
html.mobile .app.youtube .yt-sidebar {
  width: auto; flex-direction: row; padding: 6px 8px; overflow-x: auto; border-right: 0;
  border-bottom: 1px solid rgba(0,60,150,0.15);
}
html.mobile .app.youtube .yt-side-item { flex: none; padding: 8px 12px; white-space: nowrap; }
html.mobile .app.youtube .yt-body { flex-direction: column; }
html.mobile .app.youtube .yt-main { padding: 10px; }
html.mobile .app.youtube .yt-grid { grid-template-columns: 1fr; gap: 14px; }
html.mobile .app.youtube .yt-watch { flex-direction: column; }
html.mobile .app.youtube .yt-related { width: 100%; }
html.mobile .app.youtube .yt-channel-row { gap: 10px; }
html.mobile .app.youtube .yt-sub-btn { padding: 10px 16px; }
html.mobile .app.youtube .yt-react { padding: 10px 14px; }
