/* Bimatch design system. Loaded after page styles; responsive.css remains last. */
:root {
  color-scheme: dark;
  --color-bg: #090a0f;
  --color-surface: #11131b;
  --color-surface-raised: #181b25;
  --color-border: rgb(255 255 255 / 8%);
  --color-text: #f5f6f8;
  --color-text-secondary: #a1a5b3;
  --color-text-muted: #6b7080;
  --color-muted: var(--color-text-secondary);
  --color-brand: #f24683;
  --color-brand-hover: #dc356f;
  --color-brand-soft: rgb(242 70 131 / 12%);
  --color-brand-border: rgb(242 70 131 / 40%);
  --color-brand-text: #ffdce8;
  --color-purple: #958bac;
  --color-purple-soft: rgb(149 139 172 / 9%);
  --color-success: #65d19a;
  --color-warning: #e7bd70;
  --color-error: #f07886;
  --font-ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.8125rem;
  --font-size-md: 0.9375rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.5rem;
  --font-size-display: clamp(1.75rem, 3vw, 2rem);
  --line-tight: 1.2;
  --line-normal: 1.5;
  --line-readable: 1.65;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --radius-sm: 0.375rem;
  --radius-control: 0.5rem;
  --radius-card: 0.75rem;
  --radius-panel: 1rem;
  --radius-pill: 999px;
  --radius: var(--radius-card);
  --control-height-sm: 2.25rem;
  --control-height: 2.75rem;
  --control-height-lg: 3rem;
  --card-padding: var(--space-4);
  --panel-padding: clamp(1rem, 3vw, 1.5rem);
  --content-max: 70rem;
  --icon-sm: 1rem;
  --icon-md: 1.25rem;
  --icon-lg: 1.5rem;
  --shadow-panel: 0 12px 32px rgb(0 0 0 / 26%);
  --shadow-focus: 0 0 0 3px rgb(242 70 131 / 22%);
  --motion-fast: 120ms;
  --motion-base: 180ms;
  --motion-page: 220ms;
  --ease-standard: cubic-bezier(0.2, 0.7, 0.25, 1);
  --header: 76px;
  --nav: 0px;
  --z-header: 30;
  --z-nav: 40;
  --z-overlay: 80;
  --z-toast: 1000;
  --bg: var(--color-bg);
  --surface: var(--color-surface);
  --surface2: var(--color-surface-raised);
  --line: var(--color-border);
  --text: var(--color-text);
  --muted: var(--color-text-secondary);
  --pink: var(--color-brand);
  --purple: var(--color-purple);
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-ui);
  font-synthesis: none;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: var(--font-size-md);
  line-height: var(--line-normal);
  letter-spacing: 0.005em;
}

.bimatch-icon {
  display: block;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-create-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.header-create-link .bimatch-icon,
.header-search .bimatch-icon {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
}

.invite-button-icon {
  display: inline-flex;
  vertical-align: middle;
  margin-right: var(--space-1);
}

.invite-button-icon .bimatch-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}

.hot-spark .bimatch-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}

.hot-suggestion-spark .bimatch-icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

.profile-back,
.header-create-link,
.feed-match-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.feed-match-arrow,
.inline-arrow-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

.comment-send-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}

h1,
.panel-heading h1 {
  font-size: var(--font-size-display);
  font-weight: var(--weight-bold);
  line-height: var(--line-tight);
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.125rem, 1.7vw, 1.25rem);
  font-weight: var(--weight-bold);
  line-height: 1.35;
  letter-spacing: -0.015em;
}

h3 {
  font-size: var(--font-size-md);
  font-weight: var(--weight-semibold);
  line-height: var(--line-normal);
}

small {
  color: var(--color-muted);
  font-size: var(--font-size-xs);
}

button,
input,
textarea,
select {
  font-family: var(--font-ui);
}

button {
  border-color: var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface-raised);
  transition: color var(--motion-fast) var(--ease-standard),
    background-color var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

button:hover {
  border-color: rgb(255 255 255 / 16%);
  background: var(--color-surface-raised);
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 3px;
}

.app-glow {
  display: none;
}

.app-header {
  height: var(--header);
  z-index: var(--z-header);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  border-bottom-color: rgb(255 255 255 / 8%);
  background: rgb(9 10 15 / 94%);
  backdrop-filter: blur(14px);
}

.brand {
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand b {
  color: var(--color-muted);
}

.header-nav {
  gap: 0.25rem;
}

.header-link {
  min-height: var(--control-height);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-control);
  color: var(--color-muted);
  font-size: var(--font-size-sm);
  transition: color var(--motion-fast) var(--ease-standard),
    background-color var(--motion-fast) var(--ease-standard);
}

.header-link.active {
  background: var(--color-surface-raised);
  color: var(--color-text);
}

.header-create-link {
  border: 1px solid var(--color-brand-border);
  background: var(--color-brand);
  color: white;
}

.header-create-link:hover {
  border-color: var(--color-brand);
  background: var(--color-brand-hover);
}

.header-search {
  min-height: var(--control-height);
  border-color: transparent;
  border-radius: 999px;
  background: var(--color-surface-raised);
  font-size: 1.25rem;
}

.header-search span {
  color: var(--color-muted);
}

.panel-screen {
  max-width: var(--content-max);
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 3.2vw, 2.5rem) calc(3rem + var(--nav));
  animation: screen-enter var(--motion-page) var(--ease-standard);
}

.panel-heading {
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.panel-heading h1,
.panel-screen > h1 {
  font-size: var(--font-size-display);
  font-weight: 760;
  line-height: var(--line-tight);
  letter-spacing: -0.025em;
}

.panel-subtitle {
  max-width: 62ch;
  color: var(--color-muted);
  font-size: var(--font-size-sm);
  line-height: var(--line-readable);
}

.eyebrow,
.rank-type {
  color: var(--color-muted);
  font-size: var(--font-size-xs);
  letter-spacing: 0.035em;
}

.empty-state,
.loading-state,
.review-empty,
.error-state {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  color: var(--color-muted);
}

.error-state {
  border-color: rgb(240 120 134 / 28%);
  color: #ffc3cb;
}

.toast {
  z-index: var(--z-toast);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: var(--radius-control);
  box-shadow: var(--shadow-panel);
  transition: opacity var(--motion-base) var(--ease-standard),
    transform var(--motion-base) var(--ease-standard);
}

.toast.error {
  border-color: rgb(240 120 134 / 32%);
  background: #52252d;
  color: #ffe1e4;
}

/* Representative page: keep the real clip dominant and all controls quiet. */
.feed-screen {
  background: #08090b;
}

.feed-scroll {
  max-width: 660px;
  background: #08090b;
}

.video-slide {
  background: #08090b;
}

.video-scene,
.battle-video-placeholder,
.battle-video-empty,
.match-feed-slide,
.challenge-source-placeholder,
.topic-video-scene,
.search-video-scene {
  background: #17191d;
}

.feed-toolbar {
  top: 0.75rem;
}

.feed-entries {
  gap: 1.5rem;
  padding: 0.125rem 1rem;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 999px;
  background: rgb(16 17 20 / 76%);
  backdrop-filter: blur(10px);
}

.feed-entry {
  min-height: 40px;
  padding: 0.5rem 0 0.4rem;
  color: rgb(245 245 246 / 72%);
  font-size: var(--font-size-sm);
  font-weight: 650;
  text-shadow: 0 1px 5px rgb(0 0 0 / 55%);
}

.feed-entry.active {
  border-bottom: 2px solid var(--color-brand);
  color: white;
}

.video-shade {
  background: linear-gradient(180deg, rgb(0 0 0 / 8%) 22%, transparent 40%, rgb(0 0 0 / 18%) 58%, rgb(0 0 0 / 76%) 100%);
}

.video-content {
  right: 98px;
  bottom: 56px;
  max-width: min(620px, calc(100% - 140px));
}

.video-kicker {
  color: rgb(245 245 246 / 80%);
  font-size: var(--font-size-xs);
}

.video-content h1 {
  max-width: 28ch;
  margin: 0.35rem 0;
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  font-weight: 720;
  line-height: 1.35;
  letter-spacing: -0.015em;
  text-wrap: pretty;
}

.video-meta {
  color: rgb(245 245 246 / 78%);
  font-size: var(--font-size-xs);
}

.video-tags {
  gap: var(--space-2);
  color: rgb(223 210 255 / 90%);
  font-size: var(--font-size-xs);
}

.feed-match-row {
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.feed-match-cta {
  min-height: 40px;
  border-color: var(--color-brand-border);
  border-radius: var(--radius-control);
  background: var(--color-brand-soft);
  color: var(--color-brand-text);
  font-size: var(--font-size-xs);
}

.feed-match-cta:hover {
  border-color: var(--color-brand);
  background: var(--color-brand-hover);
}

.video-action-rail--vertical {
  gap: 0.5rem;
}

.video-action-rail .action-button {
  min-width: 48px;
  min-height: 48px;
  text-shadow: 0 1px 4px rgb(0 0 0 / 75%);
}

.video-action-rail .action-icon {
  width: 42px;
  height: 42px;
  border-color: rgb(255 255 255 / 25%);
  background: rgb(8 9 11 / 62%);
  box-shadow: 0 3px 12px rgb(0 0 0 / 22%);
}

.video-action-rail .action-button.active .action-icon {
  border-color: var(--color-brand);
  background: var(--color-brand-soft);
  box-shadow: none;
}

.video-action-rail .action-count {
  font-size: var(--font-size-xs);
  font-variant-numeric: tabular-nums;
}

.feed-progress {
  height: 2px;
  background: rgb(255 255 255 / 32%);
}

.feed-progress span {
  background: var(--color-brand);
}

.mobile-nav {
  z-index: var(--z-nav);
  border-top-color: rgb(255 255 255 / 8%);
  background: rgb(17 19 27 / 96%);
  backdrop-filter: blur(16px);
}

.mobile-link {
  color: #8f939c;
  transition: color var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
}

.mobile-link.active {
  color: var(--color-brand);
}

.mobile-link .nav-icon svg {
  width: var(--icon-md);
  height: var(--icon-md);
}

.mobile-create .nav-icon {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 11px;
  background: var(--color-brand);
  color: white;
}

.mobile-create.active .nav-icon {
  background: var(--color-brand-hover);
  color: white;
}

/* Shared page language: content is grouped by spacing first, elevation second. */
.primary-button,
.upload-button {
  min-height: var(--control-height);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--color-brand);
  box-shadow: none;
  color: #fff;
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.secondary-button {
  min-height: var(--control-height);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface-raised);
  color: var(--color-text);
  transition: color var(--motion-fast) var(--ease-standard),
    background-color var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard);
}

.secondary-button:hover {
  border-color: rgb(255 255 255 / 16%);
  background: #20232d;
}

.primary-button:hover,
.upload-button:hover {
  border-color: transparent;
  background: var(--color-brand-hover);
}

.input:not([type=checkbox]),
input:not([type=checkbox]),
textarea,
select {
  min-height: var(--control-height);
  border-color: var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--color-brand);
  box-shadow: var(--shadow-focus);
}

label,
.tag-field legend {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-normal);
}

.field-hint,
.panel-subtitle,
.profile-card p,
.profile-card span,
.friend-challenge-main p {
  color: var(--color-muted);
}

.upload-card,
.auth-card,
.review-card,
.battle-card,
.match-card,
.friends-login-card,
.friends-invite-card,
.friends-empty-card,
.ranking-topic-card,
.topic-video-card,
.search-video-card,
.category-detail-head,
.discussion-card {
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: none;
}

.battle-card {
  padding: clamp(1rem, 2vw, 1.5rem);
}

.watch-info,
.privacy-copy {
  line-height: var(--line-readable);
}

.battle-list {
  gap: var(--space-4);
}

.battle-card-head {
  margin-bottom: var(--space-4);
}

.battle-card-head h2 {
  font-size: var(--font-size-lg);
}

.battle-video-card {
  border-color: rgb(255 255 255 / 10%);
  border-radius: var(--radius-control);
  background: #101114;
}

.battle-video-card.is-a {
  border-color: var(--color-brand-border);
}

.battle-video-card.is-b {
  border-color: rgb(149 139 172 / 34%);
}

.battle-video-label b {
  background: var(--color-brand);
}

.battle-video-card.is-b .battle-video-label b {
  background: #7661c6;
}

.battle-reasons span,
.topic-hash {
  color: var(--color-purple);
}

.battle-choice,
.battle-choice-b {
  min-height: var(--control-height-lg);
  border-radius: var(--radius-control);
  background: var(--color-brand-soft);
  border-color: var(--color-brand-border);
}

.battle-choice-b {
  background: var(--color-purple-soft);
  border-color: rgb(149 139 172 / 34%);
}

.battle-vs span {
  color: var(--color-brand);
  text-shadow: none;
}

.battle-result-bar span,
.match-bar span {
  background: var(--color-brand);
}

.battle-result-bar,
.match-bar {
  background: var(--color-purple);
}

.match-card-top,
.match-result,
.battle-count,
.review-card-top {
  color: var(--color-muted);
  font-size: var(--font-size-xs);
}

.match-card h3,
.battle-card-head h2 {
  letter-spacing: -0.01em;
}

.live-pill,
.challenge-status,
.review-status {
  color: var(--color-success);
}

.category-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.category-card {
  min-height: 174px;
  aspect-ratio: auto;
  gap: var(--space-2);
  padding: var(--card-padding);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  transition: border-color var(--motion-base) var(--ease-standard),
    background-color var(--motion-base) var(--ease-standard),
    transform var(--motion-base) var(--ease-standard);
}

.category-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-brand-border);
  background: var(--color-surface-raised);
}

.category-card strong {
  font-size: 1.25rem;
  letter-spacing: 0;
}

.category-card small,
.category-card em {
  color: var(--color-muted);
  font-size: var(--font-size-xs);
}

.category-card .category-icon,
.category-badge {
  display: grid;
  place-items: center;
  color: var(--color-text-secondary);
}

.category-card .category-icon {
  width: 28px;
  height: 28px;
  margin-bottom: var(--space-1);
}

.category-card .category-card-icon,
.category-badge .category-detail-icon {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
}

.category-card:hover .category-icon {
  color: var(--color-brand);
}

.category-card .card-arrow {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
  transition: color var(--motion-fast) var(--ease-standard), background-color var(--motion-fast) var(--ease-standard);
}

.category-card:hover .card-arrow {
  color: var(--color-brand);
  background: var(--color-brand-soft);
}

.category-arrow-icon,
.ranking-topic-arrow .bimatch-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.back-button-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}

.topic-card-icon,
.ranking-topic-title-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: var(--space-2);
  vertical-align: -0.18em;
  color: var(--color-text-muted);
  flex-basis: 16px;
}

.rank-trend-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
  vertical-align: middle;
}

.champion-crown .bimatch-icon {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
}

.ranking-topic-title-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}

.ranking-topic-arrow {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  color: var(--color-text-muted);
}

.ranking-topic-card:hover .ranking-topic-arrow {
  color: var(--color-brand);
}

.category-clutch,
.category-awp,
.category-multi-kill,
.category-fun,
.category-teaching,
.category-aim {
  background: var(--color-surface);
}

.category-detail-head {
  gap: var(--space-4);
  padding: var(--card-padding);
}

.category-badge {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-control);
  background: var(--color-brand-soft);
}

.match-status-label,
.review-status,
.challenge-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.match-status-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

.match-status-waiting,
.match-status-pending_review,
.match-status-opponent_review {
  color: var(--color-warning);
}

.match-status-active {
  color: var(--color-brand-text);
}

.match-status-finished {
  color: var(--color-text-muted);
}

.review-status-icon,
.challenge-status-icon,
.inline-status-icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

.friend-challenge-mark .bimatch-icon {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
}

.profile-match-mark .bimatch-icon {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
}

.submission-category-chip,
.submission-topic-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.submission-category-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  color: var(--color-text-secondary);
}

.submission-topic-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
  color: var(--color-text-muted);
}

.submission-remove-icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
  color: var(--color-text-muted);
}

.friend-challenge-mark {
  background: var(--color-surface-raised);
  color: var(--color-text-secondary);
}

.topic-entry {
  gap: var(--space-4);
  padding: var(--space-5);
  border-color: rgb(255 255 255 / 8%);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.topic-entry:hover {
  transform: translateY(-2px);
  border-color: var(--color-brand-border);
  background: var(--color-surface-raised);
}

.entry-icon {
  filter: none;
  color: var(--color-brand);
}

.topic-entry strong {
  font-size: var(--font-size-md);
  letter-spacing: 0.015em;
}

.topic-overview-grid {
  gap: var(--space-2);
}

.discussion-card,
.ranking-topic-card {
  min-height: 64px;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  color: var(--color-text);
}

.ranking-topic-card:hover,
.discussion-card:hover {
  border-color: var(--color-brand-border);
  background: var(--color-surface-raised);
}

.ranking-topic-card .topic-rank {
  color: var(--color-brand);
  font-variant-numeric: tabular-nums;
}

.ranking-topic-card small {
  color: var(--color-muted);
}

.ranking-breadcrumb button,
.review-source,
.privacy-check button {
  color: var(--color-purple);
}

.ranking-layer-tabs,
.range-row,
.ranking-category-picker,
.topic-video-ranges {
  gap: var(--space-2);
}

.segment,
.range,
.category-chip,
.topic-video-range,
.search-category-picker .category-chip {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--color-surface-raised);
  color: var(--color-muted);
  font-size: var(--font-size-xs);
  transition: color var(--motion-fast) var(--ease-standard),
    background-color var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard);
}

.segment.active,
.range.active,
.category-chip.active,
.topic-video-range.active {
  border-color: var(--color-brand-border);
  background: var(--color-brand-soft);
  color: var(--color-brand-text);
}

.range-row {
  flex-wrap: wrap;
}

.ranking-rules {
  border-color: rgb(255 255 255 / 8%);
  border-radius: var(--radius-control);
  background: var(--color-surface);
}

.ranking-list {
  gap: var(--space-2);
}

.champion-card {
  gap: var(--space-2);
  border-color: rgb(231 189 112 / 42%);
  border-radius: var(--radius-panel);
  background: #1c1b19;
}

.champion-rank,
.champion-crown,
.champion-card > b {
  color: var(--color-warning);
}

.rank-row,
.topic-video-rank-row {
  border-color: rgb(255 255 255 / 8%);
  border-radius: var(--radius-control);
  background: var(--color-surface);
}

.rank-index,
.topic-video-rank-index {
  color: var(--color-warning);
  font-variant-numeric: tabular-nums;
}

.rank-value > b,
.topic-video-rank-score b {
  font-variant-numeric: tabular-nums;
}

.topic-video-rank-score button {
  border-color: var(--color-brand-border);
  border-radius: var(--radius-control);
  background: var(--color-brand-soft);
}

.upload-card {
  gap: var(--space-4);
  border-style: dashed;
  border-color: var(--color-border);
  padding: clamp(var(--space-4), 3vw, var(--space-8));
  text-align: left;
}

.upload-card-copy {
  grid-template-columns: 48px minmax(0, 1fr);
  justify-items: start;
  align-items: center;
  gap: var(--space-3);
}

.upload-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-color: var(--color-brand-border);
  border-radius: var(--radius-control);
  background: var(--color-brand-soft);
  color: var(--color-brand);
}

.upload-icon .bimatch-icon { width: 22px; height: 22px; flex-basis: 22px; }

.upload-card h2 {
  margin: 0 0 0.25rem;
  font-size: var(--font-size-md);
}

.upload-card p {
  color: var(--color-muted);
  font-size: var(--font-size-xs);
}

.upload-button {
  justify-self: start;
  padding-inline: var(--space-4);
}

.upload-preview {
  border-radius: var(--radius-control);
}

.submission-form,
.submission-form form {
  gap: var(--space-5);
}

.submission-extra {
  border-color: var(--color-border);
}

.submission-category-chip,
.submission-topic-chip {
  border-color: var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface-raised);
}

.submission-category-chip.active,
.submission-topic-chip.active {
  border-color: var(--color-brand-border);
  background: var(--color-brand-soft);
  color: var(--color-brand-text);
  box-shadow: inset 0 -2px 0 var(--color-brand);
}

.profile-avatar {
  border-radius: var(--radius-card);
  background: #28232f;
  color: var(--color-purple);
}

.profile-stats b {
  font-variant-numeric: tabular-nums;
}

.profile-stats,
.creator-profile-stats {
  border: 1px solid var(--color-border);
  border-color: var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-border);
}

.creator-profile-stats > div {
  background: var(--color-surface);
}

.profile-stats span {
  color: var(--color-muted);
}

.my-submissions h2,
.friends-section h2,
.topic-detail h2,
.search-results h2 {
  font-size: var(--font-size-lg);
}

.friends-tabs,
.review-tabs,
.auth-tabs {
  gap: var(--space-2);
  border-color: var(--color-border);
}

.friends-tab,
.review-tab,
.auth-tab {
  min-height: var(--control-height);
  border-radius: var(--radius-control);
  color: var(--color-muted);
}

.friends-tab.active,
.review-tab.active,
.auth-tab.active {
  border-color: var(--color-brand-border);
  background: var(--color-brand-soft);
  color: var(--color-brand-text);
}

.challenge-source-preview,
.challenge-landing-pair section {
  border-color: var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
}

.challenge-target-tab,
.challenge-user-result,
.challenge-share-actions button,
.challenge-actions button {
  min-height: 42px;
  border-radius: var(--radius-control);
  font-size: var(--font-size-xs);
}

.challenge-target-tab.active,
.challenge-user-result.active {
  border-color: var(--color-brand-border);
  background: var(--color-brand-soft);
  color: var(--color-brand-text);
}

.challenge-success {
  border-color: rgb(101 209 154 / 28%);
  border-radius: var(--radius-card);
  background: rgb(101 209 154 / 8%);
}

.challenge-status {
  border-radius: var(--radius-control);
  background: rgb(255 255 255 / 5%);
}

.challenge-status.match_created {
  background: rgb(101 209 154 / 12%);
  color: var(--color-success);
}

.challenge-status.response_rejected,
.challenge-status.declined,
.challenge-status.expired,
.challenge-status.revoked {
  background: rgb(240 120 134 / 12%);
  color: #ffb9c0;
}

.challenge-list-item {
  padding-block: var(--space-3);
  border-color: var(--color-border);
}

.submit-challenge-hint {
  border-color: rgb(149 139 172 / 24%);
  border-radius: var(--radius-control);
  background: var(--color-purple-soft);
  color: #d5cedf;
}

.submit-user-note {
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: var(--radius-control);
  background: var(--color-surface);
}

.search-suggestions button {
  border-color: var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  box-shadow: none;
  color: #d4d6da;
}

.search-suggestions button:hover {
  border-color: var(--color-brand-border);
  background: var(--color-surface-raised);
}

.hot-spark,
.hot-suggestion-spark {
  color: var(--color-brand);
}

.review-card {
  padding: var(--space-4);
}

.review-list {
  gap: var(--space-3);
}

#contentManager details {
  border-color: rgb(255 255 255 / 8%);
  border-radius: var(--radius-card);
}

.comment-list article,
.submission-status {
  border-color: var(--color-border);
}

.comment-list b {
  color: var(--color-purple);
}

.form-message {
  color: var(--color-purple);
}

.review-status.approved {
  color: var(--color-success);
}

.review-status.rejected,
.danger-button {
  color: var(--color-error);
}

.approve {
  border-color: rgb(101 209 154 / 28%);
  background: rgb(101 209 154 / 12%);
  color: #baf0d2;
}

.reject {
  border-color: rgb(240 120 134 / 28%);
  background: rgb(240 120 134 / 12%);
  color: #ffd0d5;
}

dialog {
  border-color: rgb(255 255 255 / 12%);
  border-radius: var(--radius-panel);
  background: var(--color-surface);
  box-shadow: var(--shadow-panel);
}

dialog::backdrop {
  background: rgb(0 0 0 / 70%);
  backdrop-filter: blur(5px);
}

.dialog-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-control);
  background: rgb(32 34 39 / 92%);
}

.dialog-close .bimatch-icon { width: 20px; height: 20px; flex-basis: 20px; }

.topic-video-scene::after,
.search-video-scene::after { content: none; }

.media-preview-play {
  position: absolute;
  left: 18px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: rgb(9 10 15 / 78%);
  color: var(--color-text);
  pointer-events: none;
}

.media-preview-play .bimatch-icon { width: 18px; height: 18px; flex-basis: 18px; }

.watch-player,
.watch-video,
.watch-stage {
  background: #08090b;
}

.playback-prompt,
.player-clock,
.player-seek-time {
  border-color: rgb(255 255 255 / 20%);
  border-radius: var(--radius-control);
  font-variant-numeric: tabular-nums;
}

.player-seek-fill {
  background: var(--color-brand);
}

.player-seek-thumb {
  background: var(--color-brand);
}

.skeleton-block,
.skeleton-line {
  border-radius: var(--radius-control);
  background: rgb(255 255 255 / 6%);
}

.skeleton-block::after,
.skeleton-line::after {
  animation-duration: 1.6s;
}

@media (max-width: 960px) {
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .feed-toolbar {
    top: 0.5rem;
  }

  .feed-entries {
    gap: 1.35rem;
    padding-inline: 0.85rem;
  }

  .video-content {
    right: 82px;
    bottom: 48px;
    max-width: calc(100% - 116px);
  }

  .video-content h1 {
    font-size: clamp(1.05rem, 4.8vw, 1.3rem);
  }

  .video-action-rail--feed {
    right: max(10px, env(safe-area-inset-right, 0px));
    bottom: max(14px, env(safe-area-inset-bottom, 0px));
  }

  .panel-screen {
    padding: 1.25rem 1rem calc(1.5rem + var(--nav));
  }

  .panel-heading {
    margin-bottom: 1.25rem;
  }

  .category-grid {
    gap: var(--space-2);
  }

  .category-card {
    min-height: 148px;
    padding: var(--space-3);
  }

  .category-card strong {
    font-size: var(--font-size-md);
  }

  .category-card em {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .upload-card {
    padding: var(--space-4);
  }

  .battle-card {
    padding: var(--space-3);
  }

  .friends-login-card,
  .friends-invite-card,
  .friends-empty-card {
    padding: var(--space-4);
  }

  .ranking-topic-card {
    padding: var(--space-3);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .panel-screen {
    animation: none;
  }
}

/* Module 03: category filters are a compact part of Rankings, not a primary destination. */
.ranking-category-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 132px), 1fr));
  gap: var(--space-2);
  overflow: visible;
  padding: var(--space-2) 0 var(--space-3);
}

.ranking-category-option {
  display: grid;
  grid-template-rows: 24px auto;
  place-items: center;
  align-content: center;
  gap: var(--space-2);
  min-width: 0;
  min-height: 76px;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  text-align: center;
  white-space: normal;
}

.ranking-category-option .ranking-category-icon {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
  color: var(--color-text-muted);
}

.ranking-category-option > span {
  min-width: 0;
  font-size: var(--font-size-xs);
  font-weight: var(--weight-medium);
  line-height: var(--line-tight);
  overflow-wrap: anywhere;
}

.ranking-category-option:hover {
  border-color: rgb(255 255 255 / 16%);
  color: var(--color-text);
}

.ranking-category-option.active {
  border-color: var(--color-brand-border);
  background: var(--color-brand-soft);
  color: var(--color-brand-text);
}

.ranking-category-option.active .ranking-category-icon {
  color: var(--color-brand);
}

.category-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 148px), 1fr));
  gap: var(--space-3);
  width: 100%;
  max-width: 960px;
  margin-inline: auto;
}

.category-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: 24px auto auto auto;
  align-content: start;
  min-width: 0;
  min-height: 112px;
  padding: var(--space-3);
  gap: var(--space-1) var(--space-2);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  text-align: left;
}

.category-card .category-icon {
  grid-column: 1;
  grid-row: 1;
  width: 24px;
  height: 24px;
  margin: 0;
}

.category-card strong {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
  font-size: var(--font-size-md);
  line-height: var(--line-tight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-card small {
  grid-column: 1 / -1;
  grid-row: 3;
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  line-height: var(--line-tight);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-card em {
  grid-column: 1 / -1;
  grid-row: 4;
  display: -webkit-box;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 11px;
  line-height: var(--line-tight);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.category-card .card-arrow {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  justify-self: end;
  width: 24px;
  height: 24px;
  color: var(--color-text-muted);
}

.category-card:hover .card-arrow {
  color: var(--color-text-secondary);
  background: transparent;
}

.category-card:hover .category-icon {
  color: var(--color-brand);
}

@media (prefers-reduced-motion: reduce) {
  .ranking-category-option,
  .category-card {
    transition: none;
  }
}

.friends-empty-icon .bimatch-icon {
  width: 34px;
  height: 34px;
  color: inherit;
}
