/* ChallengeTube "arena" theme (2026-11-25 revamp).
   Loaded AFTER ch.css: it re-points the palette to a dark stage with hard red,
   adds the sidebar shell and the home-page pieces from the mockup. Every page
   keeps its existing markup; only the look changes. */

:root {
  --bg: #0b0b0e;
  --bg2: #15151a;
  --panel: #131318;
  --line: #2a2a31;
  --ink: #f4f4f6;
  --muted: #a9a9b3;
  --dim: #7d7d87;
  --red: #ff1f2d;
  --red-hi: #ff4652;
  --red-soft: rgba(255, 31, 45, .16);
  --ok-soft: rgba(43, 182, 115, .16);
  --ok: #4ade80;
  --warn-soft: rgba(242, 183, 5, .16);
  --warn: #fbbf24;
  --bad-soft: rgba(255, 70, 82, .16);
  --bad: #ff7a82;
  --info-soft: rgba(47, 123, 255, .18);
  --info: #7aa7ff;
  --gold-ink: #fcd34d;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --side-w: 232px;
  color-scheme: dark;
}

body { background: radial-gradient(1200px 500px at 70% -10%, rgba(255, 31, 45, .10), transparent 60%), var(--bg); }
a { color: var(--red-hi); }

/* -------------------------------------------------------------- top bar */
.topbar { background: rgba(11, 11, 14, .92); border-bottom: 1px solid var(--line); }
.topbar__in { max-width: none; padding: 10px 20px; gap: 16px; }
.burger { display: inline-flex !important; flex-direction: column; gap: 5px; background: none; border: 0; padding: 8px; cursor: pointer; }
.burger span { display: block; width: 24px; height: 3px; border-radius: 2px; background: var(--ink); }
.logo--arena { gap: 0; margin-right: 6px; }
.logo__art { height: 44px; width: auto; }
.logo__art + .logo__text { display: none; }
.logo__text {
  position: relative; display: inline-flex; align-items: center;
  font: italic 900 30px/1 var(--display); letter-spacing: -.01em; color: #fff;
  background: linear-gradient(180deg, #ffffff 0%, #d7d9de 45%, #8f939c 55%, #f2f3f5 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .6));
}
.logo__text b { color: var(--red); -webkit-text-fill-color: var(--red); font-weight: 900; margin-left: 2px; transform: skewX(-6deg); display: inline-block; }
.logo__text sup { font-size: 10px; -webkit-text-fill-color: #fff; margin-left: 2px; align-self: flex-start; }
.logo__crown { position: absolute; left: 34%; top: -13px; width: 30px; height: 18px; }

.search { display: flex !important; align-items: center; gap: 10px; flex: 1; max-width: 700px; margin: 0 auto; padding: 0 14px; border: 1.5px solid #3a3a43; border-radius: 999px; background: #121217; }
.search svg { width: 22px; height: 22px; fill: none; stroke: #d4d4da; stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 11px 0 !important; color: var(--ink); }
.search__mic { background: none; border: 0; padding: 4px; cursor: pointer; display: grid; }
.search__mic.is-on svg { stroke: var(--red); }
.tb-icon { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--ink); }
.tb-icon:hover { background: #1d1d23; text-decoration: none; }
.tb-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tb-bell i { position: absolute; right: 9px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.tb-upload { padding: 10px 18px; font-size: 17px; border-radius: 10px; box-shadow: 0 6px 18px rgba(255, 31, 45, .35); }
.tb-upload svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; }
.acct { margin-left: 0; }
.acct .avatar { width: 40px; height: 40px; border: 2px solid var(--red); box-shadow: 0 0 0 2px #000; }
.menu { background: #16161b; }
.drawer { background: #111115; }

/* ------------------------------------------------------------- shell + side */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); flex: 1; width: 100%; }
body.side-collapsed .shell { grid-template-columns: 0 minmax(0, 1fr); }
body.side-collapsed .side { visibility: hidden; }
main { max-width: 1440px; padding: 16px 22px 60px; }
.side {
  position: sticky; top: 65px; align-self: start; height: calc(100vh - 65px); overflow-y: auto;
  padding: 16px 12px 24px 14px; border-right: 1px solid #1f1f25;
  background: linear-gradient(180deg, #0e0e12, #0b0b0e);
  box-shadow: inset -1px 0 0 rgba(255, 31, 45, .25);
  scrollbar-width: thin;
}
.side__nav { display: grid; gap: 2px; }
.side__nav a { display: flex; align-items: center; gap: 14px; padding: 9px 14px; border-radius: 10px; color: #e7e7ea; font-weight: 600; font-size: 16px; text-decoration: none; }
.side__nav a:hover { background: #1a1a20; text-decoration: none; }
.side__nav a.on { background: linear-gradient(90deg, #ff1f2d, #c40f1b); color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15) inset, 0 6px 20px rgba(255, 31, 45, .35); }
.side__nav svg { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.side__rule { height: 1px; background: #2a2a31; margin: 12px 6px; }
.side__card {
  margin: 14px 4px 0; padding: 16px 14px; border-radius: 14px; text-align: center;
  border: 1.5px solid var(--red); background: radial-gradient(160px 120px at 50% 0, rgba(255, 31, 45, .25), transparent), #0f0f13;
  box-shadow: 0 0 24px rgba(255, 31, 45, .25);
}
.side__card h4 { margin: 6px 0 8px; font: italic 900 26px/.9 var(--display); text-transform: uppercase; color: #fff; }
.side__card ul { list-style: none; margin: 0 0 12px; padding: 0; text-align: left; font-size: 13px; color: #d4d4da; display: grid; gap: 5px; }
.side__card li::before { content: "✓"; color: #f2c94c; font-weight: 900; margin-right: 8px; }
.side__card .btn { width: 100%; border-radius: 999px; font: italic 900 18px/1 var(--display); letter-spacing: .03em; padding: 11px; }

/* ----------------------------------------------------------- base overrides */
.btn { background: #1a1a20; border-color: #33333b; color: var(--ink); }
.btn:hover { border-color: #55555f; }
.btn--ink { background: #f4f4f6; border-color: #f4f4f6; color: #0b0b0e; }
.btn--ghost { background: transparent; }
.btn--red { background: var(--red); border-color: var(--red); color: #fff; }
.btn--red:hover { background: #e0101d; border-color: #e0101d; }
.input, select.input, textarea.input { background: #101014; border-color: #33333b; color: var(--ink); }
.tab { background: #16161b; border-color: #33333b; color: var(--ink); }
.tab[aria-selected="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.chip--ink { background: #f4f4f6; color: #0b0b0e; }
.card { background: #131318; border-color: #24242b; }
.card:hover { box-shadow: 0 10px 30px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 31, 45, .35); }
.panel { background: #131318; border-color: #24242b; }
.panel--soft { background: #101014; }
.modal__box { background: #141419; border: 1px solid #2a2a31; }
.toast { background: #f4f4f6; color: #0b0b0e; }
.foot { background: #08080a; border-top-color: #1f1f25; }
.empty { border-color: #33333b; }
h1, h2 { font-family: var(--display); font-style: italic; font-weight: 900; text-transform: uppercase; letter-spacing: 0; }
h1 { font-size: clamp(36px, 5vw, 60px); }
h2 { font-size: clamp(26px, 3vw, 34px); }
/* The shared item-RPG and apparel embeds were drawn for a light page; give them one. */
.rpg, .rpg-panel, .ap-shop, [class^="ap-"] { color-scheme: light; }

/* ------------------------------------------------------------------- hero */
.arena-hero {
  position: relative; min-height: 330px; border-radius: 6px; overflow: hidden;
  background: #120a0c url("/assets/hero.webp") center / cover no-repeat;
  box-shadow: 0 0 0 1px #2a1013, 0 18px 40px rgba(0, 0, 0, .55);
  display: grid; place-items: center; text-align: center;
}
.arena-hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(520px 260px at 50% 45%, rgba(0, 0, 0, .55), transparent 70%),
    linear-gradient(115deg, rgba(255, 31, 45, .55) 0 18%, transparent 18% 82%, rgba(255, 31, 45, .45) 82%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 9px);
}
.arena-hero.has-art::before { background: radial-gradient(520px 260px at 50% 45%, rgba(0, 0, 0, .35), transparent 70%); }
.arena-hero__in { position: relative; padding: 36px 20px; }
.arena-hero__crown { width: 90px; height: 54px; margin: 0 auto -6px; display: block; filter: drop-shadow(0 4px 10px rgba(255, 31, 45, .6)); }
.arena-hero__title { margin: 0; line-height: .82; font: italic 900 clamp(64px, 10vw, 150px)/.82 var(--display); text-transform: uppercase; }
.arena-hero__title span { display: block;
  background: linear-gradient(180deg, #fff 0%, #e3e5ea 42%, #7f848e 52%, #fafafa 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 0 #000) drop-shadow(0 0 18px rgba(255, 255, 255, .15)); }
.arena-hero__title span + span { margin-top: -6px; background: linear-gradient(180deg, #ff5a63, #ff1f2d 55%, #a1000b);
  -webkit-background-clip: text; background-clip: text; transform: skewX(-8deg); }
.arena-hero__tag { margin-top: 14px; font: italic 800 20px/1 var(--display); letter-spacing: .3em; color: #fff; text-shadow: 0 2px 6px #000; }
.arena-hero__tag i { color: var(--red); font-style: normal; margin: 0 .6em; }
.arena-hero__cta { margin-top: 18px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.arena-hero__stats { position: absolute; right: 16px; bottom: 12px; display: flex; gap: 18px; font-size: 12px; color: #d4d4da; text-transform: uppercase; letter-spacing: .08em; }
.arena-hero__stats b { display: block; font: italic 900 24px/1 var(--display); color: #fff; letter-spacing: 0; }

/* ------------------------------------------------------------- category row */
.catrow { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(130px, 170px); justify-content: start; gap: 10px; margin: 14px 0 6px; overflow-x: auto; scrollbar-width: none; }
.catrow::-webkit-scrollbar { display: none; }
.cat {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; min-height: 62px; border-radius: 10px;
  background: linear-gradient(180deg, #19191f, #111115); border: 1px solid #34343c; color: #fff;
  font-weight: 700; font-size: 14px; line-height: 1.15; text-decoration: none !important; cursor: pointer;
}
.cat:hover { border-color: #6b6b75; }
.cat.on { border: 2px solid var(--red); box-shadow: 0 0 18px rgba(255, 31, 45, .4) inset; justify-content: center; flex-direction: column; gap: 4px; }
.cat svg { width: 30px; height: 30px; flex: none; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cat small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; }

/* --------------------------------------------------------------- sections */
.arena-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.arena-head h2 { margin: 0; display: flex; align-items: center; gap: 12px; font-size: clamp(26px, 2.6vw, 34px); }
.arena-head h2::before { content: ""; width: 14px; height: 30px; background: var(--red); transform: skewX(-18deg); }
.arena-head a { color: #fff; font-weight: 700; font-size: 16px; display: inline-flex; gap: 8px; align-items: center; }
.arena-head a:hover { color: var(--red-hi); text-decoration: none; }

/* video cards */
.vgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.vcard { position: relative; display: flex; flex-direction: column; background: #121216; border: 1px solid #26262d; border-radius: 10px; overflow: hidden; color: var(--ink); text-decoration: none !important; }
.vcard:hover { border-color: #4a4a54; }
.vcard__thumb { position: relative; aspect-ratio: 16 / 9; background: #1c1c22; overflow: hidden; }
.vcard__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.vcard:hover .vcard__thumb img { transform: scale(1.05); }
.vcard__dur { position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 4px; background: rgba(0, 0, 0, .85); color: #fff; font-weight: 800; font-size: 14px; }
.vcard__ch { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 4px; background: var(--red); color: #fff; font: italic 800 13px/1.2 var(--display); text-transform: uppercase; max-width: 80%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard__body { padding: 10px 12px 12px; display: grid; gap: 6px; }
.vcard__title { font-weight: 800; font-size: 16px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard__by { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.vcard__by .avatar { width: 26px; height: 26px; font-size: 11px; }
.vcard__by b { color: #fff; }
.vcard__save { position: absolute; right: 8px; top: 8px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .7); border: 0; color: #fff; cursor: pointer; opacity: 0; transition: opacity .2s; }
.vcard:hover .vcard__save, .vcard__save.on { opacity: 1; }
.vcard__save.on { background: var(--red); }
.vcard__save svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; }

/* ongoing challenge posters */
.posters { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.poster {
  position: relative; min-height: 120px; aspect-ratio: 2.25; border-radius: 8px; overflow: hidden; display: flex; align-items: flex-end;
  padding: 12px 14px; color: #fff; text-decoration: none !important; border: 1px solid #2c2c33;
  background: linear-gradient(120deg, #1a0d10 0%, #3a0a10 55%, #ff1f2d 140%);
}
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .8), rgba(0, 0, 0, .1)); }
.poster > * { position: relative; z-index: 1; }
.poster__t { font: italic 900 30px/.86 var(--display); text-transform: uppercase; max-width: 85%; transform: rotate(-3deg); transform-origin: left bottom; text-shadow: 0 3px 0 #000; }
.poster__t em { display: block; color: var(--red); font-style: italic; }
.poster__meta { position: absolute; right: 10px; top: 10px; display: flex; gap: 6px; }
.poster:hover { border-color: var(--red); }

/* watch page */
.watchp { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; }
.player video { width: 100%; height: 100%; background: #000; }
.player__msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: #fff; font-weight: 700; background: rgba(0, 0, 0, .6); }
.watchp h1 { font-size: clamp(28px, 3vw, 40px); margin: 14px 0 8px; }
.watchp__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.watchp__row .grow { flex: 1; }
.watchp__desc { margin-top: 14px; padding: 14px; border-radius: 10px; background: #131318; white-space: pre-wrap; color: #d4d4da; }
.btn.on { background: var(--red); border-color: var(--red); color: #fff; }
.upnext .vcard { flex-direction: row; margin-bottom: 10px; }
.upnext .vcard__thumb { width: 160px; flex: none; }
.upnext .vcard__by .avatar { display: none; }

/* shorts */
.shorts { height: calc(100vh - 110px); overflow-y: auto; scroll-snap-type: y mandatory; display: grid; justify-items: center; gap: 20px; scrollbar-width: none; }
.shorts__item { scroll-snap-align: center; position: relative; height: calc(100vh - 130px); aspect-ratio: 9 / 16; max-width: 100%; border-radius: 14px; overflow: hidden; background: #000; }
.shorts__item video { width: 100%; height: 100%; object-fit: cover; }
.shorts__cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 14px 14px; background: linear-gradient(0deg, rgba(0, 0, 0, .85), transparent); }
.shorts__cap h3 { margin: 4px 0 0; }

/* upload */
.up { max-width: 820px; }
.up__steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; }
.up__steps li { flex: 1; padding: 10px 14px; background: #16161b; font: italic 800 18px/1 var(--display); text-transform: uppercase; color: var(--muted); clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%); }
.up__steps li.on { background: var(--red); color: #fff; }
.up__steps li.done { background: #2a2a31; color: #fff; }
.drop { display: grid; justify-items: center; gap: 10px; padding: 46px 18px; border: 2px dashed #3a3a43; border-radius: 14px; text-align: center; cursor: pointer; }
.drop.over { border-color: var(--red); background: var(--red-soft); }
.drop h2 { margin: 0; }
.bar { height: 10px; border-radius: 5px; background: #24242b; overflow: hidden; margin: 8px 0; }
.bar i { display: block; height: 100%; width: 0; background: var(--red); transition: width .3s; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border-radius: 10px; background: #101014; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--red); flex: none; margin: 1px 0 0; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1300px) { .vgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .watchp { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 65px; z-index: 70; width: var(--side-w); transform: translateX(-105%); transition: transform .25s; box-shadow: 8px 0 30px rgba(0, 0, 0, .6); }
  body.side-open .side { transform: none; }
  body.side-collapsed .side { visibility: visible; }
  .vgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .watchp { grid-template-columns: 1fr; }
  .tb-icon:not(.tb-bell) { display: none; }
}
@media (max-width: 640px) {
  .search { display: none !important; }
  .topbar__in { justify-content: space-between; padding: 8px 10px; }
  .logo__text { font-size: 22px; }
  .tb-upload span { display: none; }
  .vgrid { grid-template-columns: 1fr; }
  main { padding: 12px 12px 50px; }
  .arena-hero__stats { position: static; justify-content: center; margin-top: 10px; }
}
.drawer { display: none !important; }

/* ------------------------------------------------------------------ phones
   (2026-11-25 pass) The sidebar column becomes a slide-in drawer, so the
   page grid must be minmax(0, 1fr) — a bare 1fr grows to the widest child and
   pushed the page to 410px on a 375px phone. */
@media (max-width: 1000px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  main { min-width: 0; }
}
@media (max-width: 640px) {
  html, body { overflow-x: hidden; }
  .topbar__in { gap: 6px; padding: 8px; }
  .burger { padding: 6px; }
  .logo--arena { margin-right: auto; flex: none; }
  .logo__text { font-size: 20px; }
  .logo__crown { width: 22px; height: 13px; top: -9px; }
  .logo__art { height: 30px; }
  .tb-upload { width: 40px; height: 40px; padding: 0; border-radius: 50%; flex: none; }
  .tb-upload svg { width: 22px; height: 22px; }
  .tb-icon { width: 38px; height: 38px; flex: none; }
  .tb-icon svg { width: 24px; height: 24px; }
  .acct { flex: none; }
  .acct .btn--sm { padding: 7px 10px; font-size: 13px; }
  .acct .avatar { width: 34px; height: 34px; }
  .menu { left: 8px; right: 8px; min-width: 0; }
  .side { width: min(82vw, 290px); top: 57px; height: calc(100vh - 57px); }

  main { padding: 10px 10px 40px; }
  .arena-hero { min-height: 0; border-radius: 10px; }
  .arena-hero__in { padding: 26px 12px 18px; }
  .arena-hero__crown { width: 58px; height: 35px; }
  .arena-hero__title { font-size: clamp(46px, 15vw, 64px); }
  .arena-hero__tag { font-size: 14px; letter-spacing: .18em; margin-top: 10px; }
  .arena-hero__cta { gap: 8px; }
  .arena-hero__cta .btn--lg { padding: 11px 16px; font-size: 15px; }
  .arena-hero__stats { position: static; justify-content: center; gap: 14px; padding: 0 0 14px; font-size: 10px; }
  .arena-hero__stats b { font-size: 20px; }

  .catrow { grid-auto-columns: minmax(118px, 140px); gap: 8px; margin: 10px -10px 4px; padding: 0 10px; }
  .cat { min-height: 54px; padding: 10px; font-size: 13px; }
  .cat svg { width: 24px; height: 24px; }
  .arena-head { margin: 20px 0 10px; }
  .arena-head h2 { font-size: 24px; gap: 8px; }
  .arena-head h2::before { width: 10px; height: 22px; }
  .arena-head a { font-size: 14px; flex: none; }
  .posters { grid-auto-columns: 78%; margin: 0 -10px; padding: 0 10px 6px; scroll-snap-type: x mandatory; }
  .poster { scroll-snap-align: start; }
  .poster__t { font-size: 26px; }
  .vgrid { gap: 14px; }
  .vcard__save { opacity: 1; }

  .watchp { gap: 14px; }
  .watchp .player { border-radius: 0; margin: -10px -10px 0; }
  .watchp h1 { font-size: 26px; }
  .watchp__row .btn { flex: 1 1 auto; padding: 9px 10px; font-size: 13px; }
  .watchp__row .row.grow { flex: 1 1 100%; }
  .upnext .vcard__thumb { width: 130px; }
  .upnext .vcard__title { font-size: 14px; }

  .shorts { height: calc(100svh - 70px); gap: 10px; }
  .shorts__item { height: calc(100svh - 80px); width: 100%; aspect-ratio: auto; border-radius: 10px; }

  .up__steps { flex-direction: column; gap: 4px; }
  .up__steps li { font-size: 16px; padding: 8px 12px; }
  .drop { padding: 28px 12px; }
  .modal { padding: 0; align-items: end; }
  .modal__box { width: 100%; max-height: 92svh; border-radius: 18px 18px 0 0; }
  .toasts { left: 10px; right: 10px; }
}
