/* =========================================================================
   OnoTube / nogi-style.com  —  unified design system
   -------------------------------------------------------------------------
   * 1 file only. No @import to keep requests minimal.
   * Mobile-first. Dark/light via prefers-color-scheme.
   * Hardware-accelerated animations, reduced-motion friendly.
   * System-font fallback first, custom font (Hachi Maru Pop) swapped in.
   ========================================================================= */

/* ---------- 1. Design tokens ---------- */
:root {
  color-scheme: light dark;

  --c-bg:          #fcfcf9;
  --c-bg-soft:     #f3f0ea;
  --c-surface:     #ffffff;
  --c-surface-2:   #faf7f1;
  --c-text:        #13343b;
  --c-text-soft:   #4a5560;
  --c-muted:       #6b7480;
  --c-border:      rgba(19, 52, 59, 0.10);
  --c-border-soft: rgba(19, 52, 59, 0.06);
  --c-primary:     #20808d;
  --c-primary-ink: #ffffff;
  --c-accent:      #e67e22;
  --c-pink:        #ec9cbb;
  --c-red:         #d9534f;
  --c-blue:        #4a90e2;
  --c-gray:        #8a94a0;
  --c-green:       #4bb373;
  --c-orange:      #ef8354;
  --c-brown:       #8b6f47;

  --g-hero:        linear-gradient(135deg, #20808d 0%, #4a90e2 55%, #ec9cbb 100%);
  --g-card:        linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.75) 100%);

  --shadow-xs: 0 1px 2px rgba(19,52,59,0.05);
  --shadow-sm: 0 2px 6px rgba(19,52,59,0.07);
  --shadow-md: 0 8px 24px rgba(19,52,59,0.09);
  --shadow-lg: 0 18px 48px rgba(19,52,59,0.12);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 9999px;

  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 20px;  --s-6: 24px;  --s-8: 32px;  --s-10: 40px;
  --s-12: 48px; --s-16: 64px; --s-20: 80px;

  --fs-xs: 12px;  --fs-sm: 14px;  --fs-base: 16px;
  --fs-md: 17px;  --fs-lg: 20px;  --fs-xl: 24px;
  --fs-2xl: 30px; --fs-3xl: 38px; --fs-4xl: 48px;

  --ff-base: "Hachi Maru Pop", "Hiragino Maru Gothic ProN", "Yu Gothic",
             "Segoe UI", system-ui, -apple-system, sans-serif;
  --ff-head: "Hachi Maru Pop", "Hiragino Maru Gothic ProN",
             "Segoe UI", system-ui, -apple-system, sans-serif;
  --ff-mono: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur:  220ms;

  --container: 1180px;
  --container-sm: 880px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-bg:          #0f1416;
    --c-bg-soft:     #161c1f;
    --c-surface:     #1a2125;
    --c-surface-2:   #20282c;
    --c-text:        #edf0f2;
    --c-text-soft:   #c4ccd2;
    --c-muted:       #8e979f;
    --c-border:      rgba(237, 240, 242, 0.08);
    --c-border-soft: rgba(237, 240, 242, 0.04);
    --c-primary:     #39b0bd;
    --c-primary-ink: #0f1416;
    --g-card:        linear-gradient(180deg, rgba(36,44,48,0.9) 0%, rgba(26,33,37,0.8) 100%);
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-sm: 0 2px 6px rgba(0,0,0,0.4);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.45);
    --shadow-lg: 0 18px 48px rgba(0,0,0,0.55);
  }
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}
body {
  min-height: 100dvh;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--ff-base);
  font-size: var(--fs-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, picture, video, canvas, iframe {
  max-width: 100%;
  height: auto;
  display: block;
}
a { color: var(--c-primary); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--c-accent); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, h5 {
  font-family: var(--ff-head);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--c-text);
}
h1 { font-size: clamp(28px, 5vw, var(--fs-4xl)); }
h2 { font-size: clamp(22px, 3.4vw, var(--fs-2xl)); }
h3 { font-size: var(--fs-xl); }
p  { color: var(--c-text-soft); }
ul, ol { list-style: none; }

::selection { background: var(--c-primary); color: var(--c-primary-ink); }

:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link for a11y */
.skip-link {
  position: absolute; top: -48px; left: 12px;
  background: var(--c-primary); color: var(--c-primary-ink);
  padding: 8px 16px; border-radius: var(--r-sm);
  z-index: 1000; transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- 3. Layout primitives ---------- */
.container   { width: min(100% - 32px, var(--container));    margin-inline: auto; }
.container-sm{ width: min(100% - 32px, var(--container-sm)); margin-inline: auto; }

.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-6); }

/* ---------- 4. Site chrome: header / nav / footer ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--c-bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--c-border-soft);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4); padding: var(--s-3) 0;
}
.brand {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-weight: 700; font-size: var(--fs-lg);
  color: var(--c-text);
}
.brand__logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--g-hero); color: #fff;
  display: inline-grid; place-items: center;
  font-size: 18px; box-shadow: var(--shadow-sm);
}
.nav-toggle {
  display: none; background: transparent; border: 0;
  width: 40px; height: 40px; border-radius: 10px;
  align-items: center; justify-content: center; cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 22px; height: 2px;
  background: var(--c-text); border-radius: 2px;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.nav-toggle span { position: relative; }
.nav-toggle span::before { position: absolute; top: -7px; }
.nav-toggle span::after  { position: absolute; top:  7px; }
.nav-toggle[aria-expanded="true"] span { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::before { opacity: 0; }
.nav-toggle[aria-expanded="true"] span::after  { transform: translateY(-7px) rotate(-90deg); }

.nav-links {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
}
.nav-links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--r-full);
  font-size: var(--fs-sm); font-weight: 600;
  color: var(--c-text-soft);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-links a:hover { background: var(--c-surface-2); color: var(--c-text); }
.nav-links a[aria-current="page"] {
  background: var(--c-primary); color: var(--c-primary-ink);
}

@media (max-width: 780px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; inset: 100% 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--c-surface); box-shadow: var(--shadow-md);
    max-height: 0; overflow: hidden;
    transition: max-height 300ms var(--ease);
  }
  .nav-links[data-open="true"] { max-height: 80vh; }
  .nav-links a { padding: 14px 20px; border-radius: 0; border-top: 1px solid var(--c-border-soft); }
}

/* ---------- 5. Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: var(--s-16) 0 var(--s-12);
  background:
    radial-gradient(80% 60% at 20% 0%, rgba(74,144,226,0.18), transparent 60%),
    radial-gradient(60% 50% at 90% 20%, rgba(236,156,187,0.22), transparent 60%),
    radial-gradient(50% 40% at 50% 90%, rgba(32,128,141,0.14), transparent 65%);
}
.hero__eyebrow {
  display: inline-block;
  font-size: var(--fs-xs); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--c-primary); font-weight: 700;
  padding: 6px 12px; border: 1px solid color-mix(in srgb, var(--c-primary) 35%, transparent);
  border-radius: var(--r-full); margin-bottom: var(--s-4);
}
.hero__title {
  font-size: clamp(32px, 6.2vw, 58px);
  font-weight: 800; letter-spacing: -0.02em;
  background: var(--g-hero);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero__lead {
  max-width: 640px; margin-top: var(--s-5);
  font-size: var(--fs-md);
}

/* ---------- 6. Cards / grids ---------- */
.section { padding: var(--s-12) 0; }
.section__title { margin-bottom: var(--s-6); }
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s-5);
}
.card {
  position: relative;
  padding: var(--s-6);
  background: var(--g-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  will-change: transform;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card__icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center; font-size: 26px;
  background: var(--c-surface-2); margin-bottom: var(--s-4);
}
.card h2 { font-size: var(--fs-xl); margin-bottom: var(--s-2); }
.card p  { margin-bottom: var(--s-4); color: var(--c-text-soft); }

/* Colored accent strip on card top */
.card--red    { border-top: 3px solid var(--c-red); }
.card--blue   { border-top: 3px solid var(--c-blue); }
.card--gray   { border-top: 3px solid var(--c-gray); }
.card--green  { border-top: 3px solid var(--c-green); }
.card--orange { border-top: 3px solid var(--c-orange); }
.card--brown  { border-top: 3px solid var(--c-brown); }
.card--pink   { border-top: 3px solid var(--c-pink); }

/* ---------- 7. Button ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 20px;
  border-radius: var(--r-full); border: 1px solid transparent;
  font-weight: 700; font-size: var(--fs-sm);
  cursor: pointer; user-select: none;
  text-decoration: none;
  transition: transform var(--dur) var(--ease),
              background var(--dur) var(--ease),
              color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
  background: var(--c-primary); color: var(--c-primary-ink);
  box-shadow: var(--shadow-xs);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); color: var(--c-primary-ink); }
.btn:active{ transform: translateY(0); }
.btn--ghost {
  background: transparent; color: var(--c-text);
  border-color: var(--c-border);
}
.btn--ghost:hover { background: var(--c-surface-2); color: var(--c-text); }
.btn--red    { background: var(--c-red); }
.btn--blue   { background: var(--c-blue); }
.btn--gray   { background: var(--c-gray); }
.btn--green  { background: var(--c-green); }
.btn--orange { background: var(--c-orange); }
.btn--brown  { background: var(--c-brown); }
.btn--pink   { background: var(--c-pink); color: #fff; }

/* ---------- 8. Media player / list (video & music pages) ---------- */
.media-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: var(--s-6);
  padding: var(--s-6) 0;
}
@media (max-width: 900px) { .media-layout { grid-template-columns: 1fr; } }

.media-player-section {
  position: sticky; top: 88px;
  background: #000;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 16 / 9;
}
.media-player-section video,
.media-player-section audio { width: 100%; height: 100%; display: block; background: #000; }

.playlist-section h2 { margin-bottom: var(--s-4); font-size: var(--fs-lg); }
.playlist {
  display: grid; gap: var(--s-3);
  max-height: calc(100dvh - 180px);
  overflow-y: auto;
  padding-right: var(--s-2);
}
.playlist::-webkit-scrollbar { width: 8px; }
.playlist::-webkit-scrollbar-track { background: transparent; }
.playlist::-webkit-scrollbar-thumb {
  background: var(--c-border); border-radius: 8px;
}

.playlist-item {
  display: grid; grid-template-columns: 96px 1fr; gap: var(--s-3);
  align-items: center; padding: var(--s-2);
  background: var(--c-surface);
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.playlist-item:hover  { background: var(--c-surface-2); border-color: var(--c-border); transform: translateX(2px); }
.playlist-item.is-active,
.playlist-item[aria-current="true"] {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-primary) 25%, transparent);
}
.playlist-item img {
  width: 96px; height: 54px; object-fit: cover; border-radius: 8px; background: #222;
}
.playlist-item .video-title,
.playlist-item .music-title {
  font-size: var(--fs-sm); font-weight: 600; line-height: 1.35;
  color: var(--c-text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 9. Gallery grid ---------- */
.gallery-container { padding: var(--s-6) 0 var(--s-10); }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-3);
}
.gallery-card {
  position: relative; aspect-ratio: 1 / 1;
  border-radius: var(--r-md); overflow: hidden;
  background: var(--c-surface-2);
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.gallery-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.gallery-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 400ms var(--ease);
}
.gallery-card:hover img { transform: scale(1.04); }

/* ---------- 10. Blog article ---------- */
.blog-container {
  display: grid; gap: var(--s-6);
  max-width: 820px; margin-inline: auto;
  padding-block: var(--s-6);
}
.blog-post {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s-8);
  box-shadow: var(--shadow-xs);
}
.blog-post h2 { font-size: var(--fs-2xl); margin-bottom: var(--s-3); }
.post-meta {
  display: flex; gap: var(--s-3); flex-wrap: wrap;
  font-size: var(--fs-xs); color: var(--c-muted);
  margin-bottom: var(--s-4);
}
.post-meta .category {
  padding: 2px 10px; border-radius: var(--r-full);
  background: var(--c-surface-2); color: var(--c-text-soft);
}
.post-rating {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--r-full);
  background: var(--c-surface-2); color: var(--c-text);
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer; border: 0;
}
.post-rating:hover { background: var(--c-surface); box-shadow: var(--shadow-xs); }

/* ---------- 11. Footer ---------- */
.site-footer {
  margin-top: var(--s-16);
  padding: var(--s-10) 0 var(--s-8);
  background: var(--c-bg-soft);
  border-top: 1px solid var(--c-border-soft);
  color: var(--c-text-soft);
  font-size: var(--fs-sm);
}
.site-footer a { color: var(--c-text-soft); }
.site-footer a:hover { color: var(--c-primary); }
.footer-grid {
  display: grid; gap: var(--s-6);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  padding-bottom: var(--s-6);
  border-bottom: 1px solid var(--c-border-soft);
  margin-bottom: var(--s-5);
}
.footer-grid h3 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: var(--s-3); }
.footer-grid ul { display: grid; gap: 6px; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: var(--s-2);
}

/* ---------- 12. Utility: scroll-top button ---------- */
.scroll-top-btn {
  position: fixed; right: 20px; bottom: 20px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--c-primary); color: var(--c-primary-ink);
  border: 0; cursor: pointer; font-size: 18px;
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--dur) var(--ease),
              transform var(--dur) var(--ease),
              visibility var(--dur);
  z-index: 40;
}
.scroll-top-btn.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---------- 13. Game page ---------- */
.game-container {
  display: grid; gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  padding-block: var(--s-5);
}
.game-card {
  padding: var(--s-6);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.game-card h2 { font-size: var(--fs-xl); margin-bottom: var(--s-2); }
.game-card .game-area { display: grid; gap: var(--s-3); margin-top: var(--s-3); }
.game-card input[type="text"] {
  padding: 10px 14px; border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: var(--c-surface-2); color: var(--c-text);
}
.game-card .result-box {
  background: var(--c-bg-soft);
  border: 1px dashed var(--c-border);
  border-radius: var(--r-md);
  padding: var(--s-3);
  min-height: 60px;
  font-size: var(--fs-sm);
  white-space: pre-wrap;
}
.game-btn {
  padding: 10px 16px; border-radius: var(--r-full);
  background: var(--c-primary); color: var(--c-primary-ink);
  border: 0; cursor: pointer; font-weight: 700;
}
.number-buttons, .color-buttons {
  display: grid; gap: var(--s-2);
  grid-template-columns: repeat(5, 1fr);
}
.number-btn {
  padding: 10px 0; background: var(--c-surface-2); border: 1px solid var(--c-border);
  border-radius: var(--r-sm); cursor: pointer;
}
.color-btn { height: 44px; border: 2px solid var(--c-border); border-radius: var(--r-sm); cursor: pointer; }
.target-color { height: 60px; border-radius: var(--r-md); border: 1px solid var(--c-border); }
.score-display, .game-status { font-weight: 700; color: var(--c-text); }

/* ---------- 14. Misc ---------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.muted { color: var(--c-muted); }
hr.divider {
  border: 0; height: 1px;
  background: var(--c-border-soft);
  margin: var(--s-8) 0;
}

/* ---------- 15. SNS share buttons ---------- */
.share-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  align-items: center;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--c-border-soft);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.share-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.share-btn svg { flex-shrink: 0; }
.share-btn--native {
  background: var(--c-primary);
  color: #fff;
  border-color: transparent;
}
.share-btn--x { background: #000; color: #fff; border-color: #000; }
.share-btn--facebook { background: #1877f2; color: #fff; border-color: #1877f2; }
.share-btn--line { background: #06c755; color: #fff; border-color: #06c755; }
.share-btn--copy { background: var(--c-bg); }
.share-btn.is-copied { background: #22c55e; color: #fff; border-color: #22c55e; }

/* ---------- 16. Add-to-Home-Screen (PWA) ---------- */
.a2hs-btn {
  position: fixed;
  right: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 0;
  background: var(--c-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(32,128,141,.35);
  animation: a2hsPop .4s ease;
}
.a2hs-btn:hover { filter: brightness(1.05); }
@keyframes a2hsPop {
  from { transform: translateY(12px) scale(.9); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.a2hs-guide {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
}
.a2hs-guide__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
}
.a2hs-guide__panel {
  position: relative;
  max-width: 420px; width: calc(100% - 32px);
  background: var(--c-surface);
  color: var(--c-text);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 30px 60px rgba(0,0,0,.35);
}
.a2hs-guide__panel h2 { margin: 0 0 12px; font-size: 18px; }
.a2hs-guide__panel ol { padding-left: 20px; line-height: 1.7; }
.a2hs-guide__close {
  display: block; width: 100%;
  margin-top: 16px;
  padding: 12px;
  border: 0; border-radius: 12px;
  background: var(--c-primary); color: #fff;
  font-weight: 700; cursor: pointer;
}

/* ---------- 17. Lite YouTube Embed ---------- */
lite-yt {
  position: relative;
  display: block;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: #000 center/cover no-repeat;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  contain: content;
  box-shadow: 0 20px 40px rgba(0,0,0,.15);
}
lite-yt picture,
lite-yt img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
}
lite-yt iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
lite-yt__play,
lite-yt .lite-yt__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 68px; height: 48px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .2s ease, filter .2s ease;
  z-index: 2;
}
lite-yt:hover .lite-yt__play { transform: scale(1.1); filter: drop-shadow(0 4px 12px rgba(0,0,0,.4)); }
lite-yt::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.2) 0%, transparent 40%, rgba(0,0,0,.3) 100%);
  pointer-events: none;
}

/* ---------- 18. Media player + playlist (YT版) ---------- */
.media-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin: 32px auto;
}
@media (min-width: 1024px) {
  .media-layout {
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  }
}
#media-player {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.media-current-title {
  font-size: clamp(16px, 2vw, 20px);
  margin: 8px 0 0;
  line-height: 1.5;
}
.media-placeholder {
  text-align: center;
  padding: 64px 24px;
  color: var(--c-muted, #888);
  background: var(--c-surface);
  border-radius: 16px;
  border: 2px dashed var(--c-border-soft);
}

#media-playlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 560px;
  overflow-y: auto;
  padding: 4px;
  scrollbar-width: thin;
}
#media-playlist .playlist-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px;
  background: var(--c-surface);
  border: 1px solid var(--c-border-soft);
  border-radius: 12px;
  cursor: pointer;
  color: var(--c-text);
  text-align: left;
  font: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
#media-playlist .playlist-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  border-color: var(--c-primary);
}
#media-playlist .playlist-item.is-active {
  border-color: var(--c-primary);
  background: color-mix(in srgb, var(--c-primary) 8%, var(--c-surface));
}
#media-playlist .playlist-item img {
  width: 120px; height: 68px;
  object-fit: cover;
  border-radius: 8px;
}
.playlist-item__title {
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.playlist-item__badge {
  grid-column: 2;
  justify-self: start;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  font-weight: 700;
  margin-top: 4px;
}

/* ---------- 19. Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
