/* CruiseTubers Simulate: maritime design system ------------------------------------ */
:root {
  --navy-900: #071a2e; --navy-800: #0b2540; --navy-700: #12365a; --navy-600: #1b4b78;
  --sea-600: #0e7490; --sea-500: #0891b2; --sea-400: #22b8cf; --sea-100: #d9f3f7;
  --sun-500: #f59e0b; --sun-400: #fbbf24; --coral-500: #ef4444; --kelp-500: #16a34a;

  --bg: #f4f7fb; --surface: #ffffff; --surface-2: #eef3f8; --text: #0f1f33; --text-2: #4a5b70; --muted: #6b7c90;
  --line: #dde5ee; --accent: var(--sea-600); --accent-ink: #ffffff; --link: #0b6b86;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(7, 26, 46, .06), 0 4px 16px rgba(7, 26, 46, .06);
  --shadow-lg: 0 10px 30px rgba(7, 26, 46, .14);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1240px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #07131f; --surface: #0e1f31; --surface-2: #132a41; --text: #e7eef6; --text-2: #b3c2d3; --muted: #8699ae;
    --line: #1e3651; --link: #5fd0e4; --accent: var(--sea-500); --sea-100: #0f3342;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Footer sits at the bottom of the window on short pages. */
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
body > main { width: 100%; box-sizing: border-box; max-width: calc(var(--maxw) + 40px); } /* same content width as before (padding now inside) */
body > main.wide { max-width: 1440px; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
img { max-width: 100%; }
svg { width: 1em; height: 1em; flex: none; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; margin: 0; }
h1 { font-size: clamp(1.6rem, 2.4vw, 2.2rem); font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 750; }
h3 { font-size: 1rem; font-weight: 650; }
.muted { color: var(--muted); } .small { font-size: .82rem; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); margin: .4em 0; }
.flag { font-size: 1.05em; }
.nolink { color: inherit; }

main { max-width: var(--maxw); margin: 0 auto; padding: 24px 20px 40px; }
main.wide { max-width: 1400px; }
.page-title { margin: 8px 0 20px; }

/* Header ------------------------------------------------------------------------------ */
.site-header { position: sticky; top: 0; z-index: 40; background: linear-gradient(90deg, var(--navy-900), var(--navy-800)); color: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.18); }
.bar { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 10px 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.12rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
/* The logo PNG has opaque white corners outside its rounded square (~24% radius): round to match. */
.logo-img { width: 34px; height: 34px; border-radius: 26%; object-fit: cover; }
.logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--sea-400), var(--sea-600)); font-size: 22px; color: #fff; }
.primary { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.primary > a, .dropdown > summary { color: #d6e4f2; padding: 7px 11px; border-radius: 8px; font-weight: 550; font-size: .93rem; cursor: pointer; list-style: none; }
.primary > a:hover, .dropdown > summary:hover, .dropdown[open] > summary { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.primary > a.on { color: #fff; background: rgba(255,255,255,.14); }
.dropdown { position: relative; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown > summary::after { content: "▾"; margin-left: 6px; font-size: .75em; opacity: .8; }
.dropdown-panel { position: absolute; top: calc(100% + 8px); left: 0; width: min(720px, 90vw); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 12px; z-index: 50; }
.dropdown-all { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; margin: 2px 6px 10px; }
.dropdown-list { columns: 3 180px; column-gap: 8px; max-height: 60vh; overflow: auto; }
.dropdown-list a, .dropdown-list span { display: block; padding: 4px 8px; border-radius: 6px; color: var(--text-2); break-inside: avoid; font-size: .9rem; }
.dropdown-list a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

form.search { position: relative; margin-left: auto; display: flex; align-items: center; }
form.search > svg { position: absolute; left: 12px; color: #9fb4ca; font-size: 16px; pointer-events: none; }
form.search input { width: 320px; padding: 9px 14px 9px 36px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.08); color: #fff; font: inherit; font-size: .93rem; outline: none; transition: background .15s, width .2s; }
form.search input::placeholder { color: #9fb4ca; }
form.search input:focus { background: rgba(255,255,255,.16); border-color: var(--sea-400); width: 380px; }
.suggest { position: absolute; top: calc(100% + 8px); left: 0; right: 0; min-width: 320px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; }
.suggest a, .suggest span.row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--text); }
.suggest a:hover, .suggest a.active { background: var(--surface-2); text-decoration: none; }
.suggest img, .suggest .ph { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; }
.suggest small { margin-left: auto; color: var(--muted); font-size: .75rem; }
.region { display: flex; align-items: center; gap: 6px; color: #9fb4ca; }
.region select { appearance: none; background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .9rem; cursor: pointer; }
.region select option { color: #0f1f33; }

/* Hero, bands ------------------------------------------------------------------------ */
.hero { position: relative; background: radial-gradient(1200px 400px at 80% -10%, rgba(34,184,207,.35), transparent 60%), linear-gradient(160deg, var(--navy-800), var(--navy-600) 55%, var(--sea-600)); color: #fff; padding: 56px 20px 88px; overflow: hidden; }
.hero-inner { max-width: var(--maxw); margin: 0 auto; }
.hero h1 { font-size: clamp(1.9rem, 3.6vw, 3rem); max-width: 26ch; }
.hero .lead { color: #cfe3f3; font-size: 1.1rem; max-width: 60ch; margin: 14px 0 28px; }
.hero .stats { margin: 0; }
.hero .stat { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(6px); color: #fff; box-shadow: none; }
.hero .stat span { color: #bfd7ea; }
.hero-wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 60px; fill: var(--bg); }
.band { background: linear-gradient(160deg, var(--navy-800), var(--navy-600) 60%, var(--sea-600)); color: #fff; padding: 28px 20px 34px; }
.band-inner { max-width: var(--maxw); margin: 0 auto; }
.band h1 { margin: 6px 0 8px; }
.band .lead { color: #cfe3f3; margin: 0; max-width: 70ch; }
.crumbs { font-size: .85rem; color: #a9c3da; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.crumbs a { color: #d6e7f5; } .crumbs .sep { opacity: .6; }
/* Breadcrumbs on a normal page background (classifier All videos), not the dark band. */
.page-head .crumbs { color: var(--muted); margin-bottom: 6px; } .page-head .crumbs a { color: var(--link); }
.type-pill { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.14); color: #e3f4fa; }

/* Blocks ------------------------------------------------------------------------------ */
.block { margin: 36px 0; }
.block-head { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.block-head h2 { margin-right: auto; }
.block-head h2 small { font-weight: 500; color: var(--muted); font-size: .85rem; margin-left: 8px; }
.more { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: .9rem; white-space: nowrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card h2 { margin-bottom: 10px; font-size: 1.1rem; }
.card h3 { margin: 16px 0 8px; font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.card.narrow { max-width: 640px; margin: 20px auto; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin: 24px 0; align-items: start; }
.empty { color: var(--muted); padding: 24px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.page-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 8px 0 22px; }
.page-head h1 a { color: inherit; }
.page-head p { margin: 4px 0 0; }
.page-head .filters { margin-left: auto; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: .75rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
select, input, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
select:focus, input:focus, textarea:focus { outline: 2px solid var(--sea-400); outline-offset: 1px; }
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-ink); border: 0; padding: 10px 18px; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 650; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--link); border: 1px solid var(--line); }
.btn.yt { background: #e62117; color: #fff; }
.pager { text-align: center; margin: 28px 0; }

/* Stats ------------------------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 20px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .82rem; }
.callout { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--sea-100); color: var(--text); border-radius: var(--radius-sm); padding: 12px 16px; margin: 0 0 8px; font-size: .92rem; }
.callout > svg { color: var(--sea-600); font-size: 18px; }
.pill-link { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; background: var(--surface); padding: 6px 12px; border-radius: 999px; font-weight: 650; font-size: .85rem; border: 1px solid var(--line); }

/* Grids and cards ----------------------------------------------------------------------- */
.grid { display: grid; gap: 18px; }
.grid.videos { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid.channels { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.grid.places { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.grid.channels.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid.channels.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid.channels.three { grid-template-columns: 1fr; } }

.vcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.vcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.vcard-media { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--surface-2); }
.vcard-media .thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.dur { position: absolute; right: 8px; bottom: 8px; background: rgba(7,26,46,.85); color: #fff; font-size: .75rem; font-weight: 650; padding: 2px 7px; border-radius: 6px; }
.live-pill { display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; color: #fff; background: var(--coral-500); vertical-align: middle; }
.live-pill.upcoming { background: var(--navy-600); }
.vcard-media .live-pill { position: absolute; left: 8px; top: 8px; }
.vcard-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.vcard-title { font-size: .95rem; font-weight: 650; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard-title a { color: var(--text); }
.byline-link { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-size: .85rem; font-weight: 550; }
.mini { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.meta { color: var(--muted); font-size: .82rem; }
.vcard .chips { margin-top: auto; padding-top: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { display: inline-flex; align-items: baseline; gap: 5px; background: var(--surface-2); color: var(--text-2); border-radius: 999px; padding: 3px 10px; font-size: .78rem; font-weight: 550; border: 1px solid transparent; }
a.chip:hover { border-color: var(--sea-400); color: var(--text); text-decoration: none; }
.chip small { color: var(--muted); font-weight: 500; }
.chip.more { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.chips-more { display: contents; }
.chips-more > summary { list-style: none; cursor: pointer; }
.chips-more > summary::-webkit-details-marker { display: none; }
.chips-more[open] > summary { display: none; }
.chips-more > .chips { display: contents; }

.ccard { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.ccard-img { flex: none; }
.ccard-body { min-width: 0; }
.ccard-title { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ccard-title a { color: var(--text); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.badge.rank { background: linear-gradient(135deg, var(--sun-400), var(--sun-500)); color: #3b2500; }
.badge.warn { background: #fde68a; color: #6b4b00; }

.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--surface-2); display: block; }
.avatar.sm { width: 34px; height: 34px; } .avatar.md { width: 56px; height: 56px; }
.avatar.lg { width: 84px; height: 84px; } .avatar.xl { width: 120px; height: 120px; border: 5px solid var(--bg); box-shadow: var(--shadow-lg); }
.noimg { display: inline-block; background: linear-gradient(135deg, var(--surface-2), var(--line)); }

.place { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: var(--shadow); color: var(--text); transition: border-color .15s, transform .15s; }
.place:hover { border-color: var(--sea-400); transform: translateY(-1px); text-decoration: none; }
.place-type { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--sea-600); }
.place-name { font-weight: 700; }
.place-counts { color: var(--muted); font-size: .82rem; }
mark { background: rgba(251,191,36,.35); color: inherit; border-radius: 3px; padding: 0 2px; }

/* Leaderboard --------------------------------------------------------------------------- */
.podiums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.podium { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 16px 18px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.podium h3 { font-size: 1rem; } .podium h3 a { color: var(--text); }
.podium .avatar { margin: 4px auto 4px; }
.podium.p1 { background: linear-gradient(180deg, rgba(251,191,36,.18), var(--surface) 60%); border-color: rgba(245,158,11,.5); }
.medal { position: absolute; top: 12px; left: 12px; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; font-weight: 800; background: var(--navy-800); color: #fff; }
.p1 .medal { background: linear-gradient(135deg, var(--sun-400), var(--sun-500)); color: #3b2500; }
.p2 .medal { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #1f2937; }
.p3 .medal { background: linear-gradient(135deg, #f0b27a, #b45309); color: #fff; }
.leaders { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 8px; }
.leaders.tight { grid-template-columns: 1fr; }
/* Even columns (owner decision): hide the tiles left alone on a short last row. Column count follows
   the grid above (minmax 360px + 8px gap): 3 columns from 1096px wide, 2 from 728px. */
.leaders:not(.tight) { container-type: inline-size; }
@container (min-width: 1096px) {
  .lrow:nth-child(3n+1):last-child, .lrow:nth-child(3n+1):nth-last-child(2), .lrow:nth-child(3n+1):nth-last-child(2) + .lrow { display: none; }
}
@container (min-width: 728px) and (max-width: 1095.98px) {
  .lrow:nth-child(2n+1):last-child { display: none; }
}
.lrow { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; min-width: 0; }
.lrow.self { border-color: var(--sea-400); background: var(--sea-100); }
.pos { min-width: 2.4em; text-align: center; font-weight: 800; color: var(--text-2); font-variant-numeric: tabular-nums; }
.who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.who a { color: var(--text); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { color: var(--muted); font-size: .78rem; }
.mv { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
.mv i { font-style: normal; font-size: .72rem; }
.mv-up { color: var(--kelp-500); } .mv-down { color: var(--coral-500); } .mv-new { color: var(--sea-600); }

.block-head .segmented { margin: 0; }
.segmented.small .seg { padding: 5px 12px; font-size: .85rem; }
.block-head > div, .block-head .more { margin-left: 12px; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 999px; margin: 0 0 20px; }
.seg { padding: 7px 16px; border-radius: 999px; font-weight: 650; font-size: .9rem; color: var(--text-2); }
.seg:hover { text-decoration: none; color: var(--text); }
.seg.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Channel page -------------------------------------------------------------------------- */
.channel-hero picture { display: block; }
.channel-hero .banner { display: block; width: 100%; height: clamp(120px, 18vw, 240px); object-fit: cover; background: linear-gradient(135deg, var(--navy-700), var(--sea-600)); }
.channel-head { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.channel-head .avatar-wrap { position: relative; margin-top: -64px; flex: none; }
.rank-medal { position: absolute; right: -4px; bottom: 4px; min-width: 44px; height: 44px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center;
  font-weight: 850; font-size: 1rem; letter-spacing: -.02em; background: var(--navy-800); color: #fff; border: 3px solid var(--bg); box-shadow: var(--shadow-lg); }
.rank-medal.m1 { background: linear-gradient(135deg, var(--sun-400), var(--sun-500)); color: #3b2500; }
.rank-medal.m2 { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #1f2937; }
.rank-medal.m3 { background: linear-gradient(135deg, #f0b27a, #b45309); color: #fff; }
.channel-info { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: stretch; }
.channel-info .chips { margin-top: 16px; }
/* About fills the card height set by its neighbour; JS clamps to whole lines and shows the toggle only when clipped. */
.card.about { display: flex; flex-direction: column; }
.desc-fit { position: relative; flex: 1; min-height: calc(1.55em * 8); margin: .4em 0; }
.desc-fit .desc-text { position: absolute; inset: 0; margin: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; }
.card.about.expanded .desc-fit { min-height: 0; }
.card.about.expanded .desc-text { position: static; display: block; overflow: visible; }
.desc-toggle { align-self: flex-start; background: none; border: 0; padding: 0; margin-top: 6px; color: var(--link); font: inherit; font-weight: 650; font-size: .88rem; cursor: pointer; }
@media (max-width: 820px) { .channel-info { grid-template-columns: 1fr; } }
.channel-id { flex: 1; min-width: 240px; padding-bottom: 6px; }
.channel-id h1 { margin-bottom: 4px; }
.channel-head .btn { margin-bottom: 10px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn svg { width: 18px; height: 18px; flex: none; }
.rankcard .rank-numbers { display: flex; gap: 20px; flex-wrap: wrap; }
.rank-numbers b { display: block; font-size: 2rem; font-weight: 850; letter-spacing: -.02em; }
.rank-numbers span { color: var(--muted); font-size: .82rem; }
.moves { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; }
.moves > div { display: flex; flex-direction: column; gap: 2px; font-size: .8rem; }

/* Readmore ---------------------------------------------------------------------------------- */
.readmore summary { list-style: none; cursor: pointer; }
.readmore summary::-webkit-details-marker { display: none; }
.readmore .toggle { display: inline-block; font-weight: 650; color: var(--link); font-size: .88rem; }
.readmore[open] .preview { display: none; }
.readmore .show-less { display: none; } .readmore[open] .show-less { display: inline; } .readmore[open] .show-more { display: none; }
.readmore[open] { display: flex; flex-direction: column; }
.readmore[open] summary { order: 2; }

/* Format bar ---------------------------------------------------------------------------------- */
.fmtbar { margin-top: 12px; }
.fmtbar-track { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.fmtbar-legend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; gap: 16px; flex-wrap: wrap; font-size: .85rem; color: var(--text-2); }
.fmtbar-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.s0 { background: var(--sea-600); } .s1 { background: var(--sea-400); } .s2 { background: var(--sun-500); } .s3 { background: var(--navy-600); } .s4 { background: var(--coral-500); }
.block .fmtbar { max-width: 760px; }

/* Unavailable video (thumbnail gone: probably removed from YouTube) */
.unavailable { background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 10px, var(--line) 10px, var(--line) 20px); }
.unavailable img { visibility: hidden; }
.unavailable::after { content: ""; position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; transform: translate(-50%, -50%); border-radius: 50%;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='%236b7c90'/%3E%3Cpath d='M4 4l16 16' stroke='%236b7c90' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 22px no-repeat; box-shadow: var(--shadow); }
.vrow-media.unavailable::after { width: 30px; height: 30px; background-size: 16px; }

/* Watch page ------------------------------------------------------------------------------- */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.player { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow-lg); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player.still img { width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.player.still .btn { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 1.05rem; padding: 14px 24px; }
.watch-title { font-size: clamp(1.25rem, 2vw, 1.6rem); margin: 16px 0 6px; }
.watch-channel { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0 4px; }
.watch-channel .ccard { flex: 1; min-width: 260px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; color: var(--link); font-size: .85rem; }
.watch-side h2 { font-size: 1rem; margin-bottom: 12px; }
.vrow { display: grid; grid-template-columns: 160px 1fr; gap: 10px; margin-bottom: 12px; }
.vrow-media { position: relative; display: block; aspect-ratio: 16/9; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.vrow-media .thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.vrow h3 { font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vrow h3 a { color: var(--text); }

/* Classifier page --------------------------------------------------------------------------- */
.spotlight { display: flex; flex-direction: column; gap: 8px; margin: 20px 0; max-width: 460px; }
.eyebrow { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.countries { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.countries li { display: flex; gap: 6px; align-items: center; background: var(--surface-2); border-radius: 8px; padding: 6px 10px; font-size: .88rem; }
.countries b { margin-left: auto; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; font-weight: 550; }

/* Explore tree -------------------------------------------------------------------------------- */
.explore .tree { max-height: 70vh; overflow: auto; }
ul.tree { list-style: none; padding-left: 16px; margin: 4px 0; border-left: 1px solid var(--line); }
.explore > ul.tree { border-left: 0; padding-left: 0; }
ul.tree li { margin: 2px 0; }
ul.tree summary { cursor: pointer; padding: 4px 6px; border-radius: 6px; }
ul.tree summary:hover { background: var(--surface-2); }
ul.tree .leaf { padding: 3px 6px 3px 22px; }
ul.tree a { color: var(--text); font-weight: 550; }
.count { margin-left: 8px; font-size: .72rem; font-weight: 700; color: var(--muted); background: var(--surface-2); padding: 1px 7px; border-radius: 999px; }

/* Forms, notices --------------------------------------------------------------------------------- */
form.stack { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
form.stack label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
form.stack .btn { align-self: flex-start; }
.alert { padding: 10px 14px; border-radius: 10px; }
.alert.ok { background: #dcfce7; color: #14532d; } .alert.error { background: #fee2e2; color: #7f1d1d; }
.notice { text-align: center; max-width: 560px; margin: 60px auto; }
.notice-code { font-size: 4rem; font-weight: 900; margin: 0; background: linear-gradient(135deg, var(--sea-400), var(--navy-600)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.notice h1 { margin: 8px 0 12px; }

/* Static pages ------------------------------------------------------------------------------ */
.prose-page { max-width: 760px; margin: 12px auto; padding: 32px 36px; }
.prose-page h1 { margin-bottom: 16px; }
.prose-page h2 { font-size: 1.15rem; margin: 26px 0 8px; }
.prose-page p { color: var(--text-2); margin: 0 0 12px; }
.prose-page .lead { font-size: 1.08rem; color: var(--text); }
@media (max-width: 640px) { .prose-page { padding: 22px 18px; } }

/* Footer -------------------------------------------------------------------------------------- */
.site-footer { background: var(--navy-900); color: #9fb4ca; margin-top: auto; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 32px 20px; display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: center; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer nav a { color: #d6e4f2; font-weight: 550; }
.site-footer p { width: 100%; margin: 0; font-size: .82rem; }

/* Responsive ---------------------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .watch { grid-template-columns: 1fr; }
  form.search input, form.search input:focus { width: 240px; }
}
@media (max-width: 820px) {
  .bar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .brand { order: 1; }
  .region { order: 2; margin-left: auto; }
  form.search { order: 3; width: 100%; margin-left: 0; }
  form.search input, form.search input:focus { width: 100%; }
  .primary { order: 4; width: calc(100% + 28px); margin: 0 -14px; padding: 0 10px 2px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .primary > a, .dropdown > summary { white-space: nowrap; }
  .suggest { min-width: 0; }
  .podiums { grid-template-columns: 1fr; }
  .leaders { grid-template-columns: 1fr; }
  .hero { padding: 36px 16px 70px; }
  main { padding: 18px 16px 32px; }
  .avatar.xl { width: 96px; height: 96px; } .channel-head .avatar-wrap { margin-top: -52px; } .rank-medal { min-width: 38px; height: 38px; font-size: .9rem; }
  .dropdown-panel { position: fixed; left: 12px; right: 12px; top: 110px; width: auto; }
}

/* ---- analytics opt-out (footer link + dialog) ---- */
.linklike { background: none; border: 0; padding: 0; font: inherit; font-weight: 550; color: #d6e4f2; cursor: pointer; }
.linklike:hover { text-decoration: underline; }
.analytics-dialog { max-width: min(460px, calc(100vw - 32px)); background: var(--surface); color: var(--text); border: 0; border-radius: 14px; padding: 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.analytics-dialog::backdrop { background: rgba(8, 20, 36, .55); }
.analytics-dialog h2 { margin: 0 0 10px; font-size: 1.2rem; }
.analytics-dialog p { margin: 0 0 14px; line-height: 1.5; }
.analytics-toggle { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 8px; cursor: pointer; }
.analytics-toggle input { width: 18px; height: 18px; }
.analytics-actions { display: flex; gap: 10px; flex-wrap: wrap; }
