/* --- Clip Battle rebrand, responsive shell, and art direction --- */
:root {
  --bg: #06060a;
  --surface-1: rgba(15, 15, 22, 0.92);
  --surface-2: rgba(20, 20, 30, 0.94);
  --surface-3: rgba(30, 30, 44, 0.92);
  --surface-4: rgba(39, 39, 58, 0.9);
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.14);
  --text-1: #f7f7fb;
  --text-2: #b7b7c9;
  --text-3: #7f7f95;
  --cyan: #69e5ff;
  --violet: #9b6cff;
  --gold: #d7ac61;
  --gold-bright: #f0c97f;
  --shell-height: calc(100dvh - 24px);
  --shadow-soft: 0 28px 60px rgba(0, 0, 0, 0.45);
}
html,
body {
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.page-title,
.hero-title,
.empty-title,
.hero-copy h1,
.auth-card h1,
.stat-value,
.hero-score,
.clip-row-score,
.preview-card-score,
.podium-score,
.mini-rank-score {
  font-family: "Avenir Next", "Segoe UI", Inter, Helvetica, Arial, sans-serif;
}

.app-body {
  background:
    radial-gradient(circle at 12% 0%, rgba(155, 108, 255, 0.22), transparent 26%),
    radial-gradient(circle at 88% 18%, rgba(105, 229, 255, 0.16), transparent 24%),
    radial-gradient(circle at 52% 100%, rgba(240, 201, 127, 0.12), transparent 24%),
    #06060a;
}

.shell-wrap {
  align-items: stretch;
  gap: 20px;
  padding: 12px;
}

.shell-rail {
  display: none;
  width: 320px;
  flex: 0 0 320px;
  border-radius: 30px;
  padding: 24px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(15, 15, 22, 0.92), rgba(10, 10, 16, 0.88));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px);
  transition:
    opacity 0.24s ease,
    transform 0.24s ease,
    width 0.24s ease,
    flex-basis 0.24s ease,
    padding 0.24s ease,
    margin 0.24s ease;
}

.rail-brand,
.toolbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.rail-brand-mark,
.toolbar-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(155, 108, 255, 0.26), rgba(105, 229, 255, 0.26));
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-1);
}

.rail-brand-copy,
.toolbar-brand span {
  display: flex;
  flex-direction: column;
}

.rail-brand strong,
.toolbar-brand strong {
  font-size: 16px;
  letter-spacing: -0.03em;
}

.rail-brand small,
.toolbar-brand small {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rail-copy,
.rail-glass p {
  margin: 0;
  color: var(--text-2);
  line-height: 1.6;
  font-size: 14px;
}

.rail-copy {
  margin-top: 18px;
}

.rail-art {
  width: 100%;
  height: auto;
  margin-top: 22px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.rail-glass {
  margin-top: 18px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.rail-nav {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 22px;
}

.rail-nav .nav-item {
  flex-direction: row;
  justify-content: flex-start;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
  opacity: 1;
}

.rail-nav .nav-item:hover,
.rail-nav .nav-item.active {
  border-color: rgba(105, 229, 255, 0.18);
  background: rgba(105, 229, 255, 0.06);
}

.device-shell {
  width: 100%;
  max-width: 100%;
  height: var(--shell-height);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(10, 10, 16, 0.96), rgba(8, 8, 12, 0.98));
  transition: max-width 0.24s ease;
}

.app-toolbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 24;
  height: 78px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(180deg, rgba(6, 6, 10, 0.88), rgba(6, 6, 10, 0.55), rgba(6, 6, 10, 0));
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.locale-switch {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.locale-chip {
  min-width: 42px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.locale-chip.is-active {
  background: rgba(105, 229, 255, 0.16);
  color: var(--text-1);
}

.screen-scroll {
  inset: 78px 0 86px;
}

.page-section {
  padding: 0 18px 28px;
  max-width: 980px;
  margin: 0 auto;
}

.page-subtitle {
  color: var(--text-2);
  font-size: 12px;
}

.brand-mark {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-1);
}

.showcase-banner,
.spotlight-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.showcase-banner,
.spotlight-art-card,
.winner-showcase {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(14, 14, 22, 0.94), rgba(10, 10, 16, 0.98));
  box-shadow: var(--shadow-soft);
}

.showcase-banner {
  padding: 18px;
  align-items: center;
}

.showcase-banner img,
.spotlight-art,
.winner-showcase-art {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.showcase-copy h2,
.spotlight-grid h1 {
  margin: 10px 0 8px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.showcase-copy p {
  margin: 0;
  color: var(--text-2);
  line-height: 1.6;
}

.onboarding-surface {
  padding: 0 18px 30px;
}

.spotlight-art-card {
  min-height: 320px;
  padding: 18px;
}

.hero-stack-polished {
  height: 100%;
  margin-top: 0;
}

.hero-stack-polished .preview-card {
  backdrop-filter: blur(10px);
  background: rgba(10, 10, 16, 0.6);
}

.auth-credentials {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  color: var(--text-2);
}

.winner-showcase {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.winner-showcase-art {
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.hero-card,
.detail-hero,
.winner-card,
.panel,
.auth-card,
.clip-row,
.mini-rank-card,
.member-card,
.activity-row,
.moderation-card,
.setting-row,
.duel-card,
.podium-card,
.profile-card {
  backdrop-filter: blur(18px);
}

.hero-card,
.detail-hero,
.winner-card {
  border-radius: 28px;
}

.hero-media {
  height: clamp(240px, 34vw, 320px);
}

.tall-media {
  height: clamp(280px, 40vw, 380px);
}

.hero-topline {
  inset: 18px 18px auto 18px;
}

.hero-content {
  left: 18px;
  right: 18px;
  bottom: 18px;
}

.hero-score {
  background: rgba(8, 8, 12, 0.68);
}

.stats-grid.four-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rating-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.bottom-nav {
  left: 14px;
  right: 14px;
  bottom: 14px;
  min-height: 72px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: rgba(12, 12, 20, 0.92);
  backdrop-filter: blur(22px);
}

.home-indicator,
.device-island,
.status-bar {
  display: none;
}

@media (min-width: 860px) {
  .showcase-banner,
  .spotlight-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .showcase-banner {
    padding: 22px 24px;
  }

  .stats-grid.four-up {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .member-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 1120px) {
  .shell-rail {
    display: flex;
    flex-direction: column;
  }

  .device-shell {
    max-width: min(1040px, calc(100vw - 376px));
  }

  .rail-toggle-button {
    display: inline-flex;
  }

  .shell-wrap.rail-collapsed {
    gap: 0;
  }

  .shell-wrap.rail-collapsed .shell-rail {
    width: 0;
    flex-basis: 0;
    padding: 0;
    margin: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    border-color: transparent;
    transform: translateX(-12px);
  }

  .shell-wrap.rail-collapsed .device-shell {
    max-width: min(1320px, calc(100vw - 48px));
  }

  .page-duel .duel-shell {
    padding-top: 18px;
  }

  .page-duel .duel-axis {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    margin: 0;
    transform: translate(-50%, -50%);
    width: 78px;
    height: 78px;
    font-size: 24px;
    pointer-events: none;
  }

  .page-duel .duel-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    align-items: stretch;
  }

  .page-duel .duel-form-card {
    display: flex;
  }

  .page-duel .duel-card {
    height: 100%;
  }

  .page-duel .duel-thumb {
    height: clamp(260px, 28vw, 360px);
  }

  .page-duel .duel-card-body {
    min-height: 92px;
  }

  .page-section {
    padding: 0 26px 36px;
  }

  .screen-scroll {
    inset: 82px 0 92px;
  }
}

@media (max-width: 640px) {
  .shell-wrap {
    padding: 0;
  }

  .device-shell {
    height: 100dvh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .app-toolbar {
    padding: 14px 14px;
  }

  .page-section,
  .onboarding-surface,
  .auth-screen {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero-copy h1,
  .auth-card h1 {
    font-size: 30px;
  }

  .action-row.three-up,
  .form-grid.two-columns,
  .action-row.two-up,
  .stats-grid.three-up {
    grid-template-columns: 1fr;
  }

  .member-grid,
  .rating-grid,
  .podium {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reaction-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (orientation: landscape) and (max-height: 720px) {
  .shell-wrap {
    padding: 0;
  }

  .shell-rail {
    display: none;
  }

  .rail-toggle-button {
    display: none;
  }

  .device-shell {
    height: 100dvh;
    border-radius: 0;
  }

  .app-toolbar {
    height: 66px;
    padding: 12px 14px;
  }

  .screen-scroll {
    inset: 66px 0 76px;
  }

  .page-section {
    padding: 0 16px 22px;
  }

  .showcase-banner,
  .spotlight-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .hero-media,
  .tall-media,
  .duel-thumb {
    height: 220px;
  }
}

.oauth-stack {
  display: grid;
  gap: 10px;
}

.auth-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  padding: 0 12px;
}

.icon-button-stack {
  position: relative;
}

.toolbar-badge,
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: var(--text-1);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.toolbar-badge {
  position: absolute;
  top: -4px;
  right: -4px;
}

.nav-badge {
  margin-left: auto;
}

.nav-badge-large {
  min-width: 24px;
  height: 24px;
  font-size: 11px;
}

.field-textarea,
.field.textarea,
textarea.field {
  min-height: 120px;
  padding: 12px 14px;
  resize: vertical;
}

.field-compact {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
}

.provider-row,
.message-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.provider-row {
  justify-content: space-between;
}

.provider-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.message-card {
  text-align: left;
}

.message-card-body {
  flex: 1 1 auto;
  min-width: 0;
}

.message-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.message-card-snippet {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.message-thread-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.message-thread-list {
  display: grid;
  gap: 12px;
}

.message-bubble {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 18px 18px 18px 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.message-bubble.is-own {
  margin-left: auto;
  border-radius: 18px 18px 6px 18px;
  background: rgba(5, 224, 255, 0.08);
  border-color: rgba(5, 224, 255, 0.22);
}

.message-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-3);
  font-size: 11px;
}

.message-bubble-body {
  margin-top: 6px;
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-report-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.composer-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.composer-search-row .field {
  flex: 1 1 auto;
}

.recipient-picker {
  display: grid;
  gap: 10px;
}

.recipient-option {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.recipient-option:hover {
  transform: translateY(-1px);
  border-color: rgba(105, 229, 255, 0.18);
}

.recipient-option.is-selected {
  border-color: rgba(105, 229, 255, 0.3);
  background: rgba(105, 229, 255, 0.08);
}

.recipient-option:has(.recipient-option-input:checked) {
  border-color: rgba(105, 229, 255, 0.3);
  background: rgba(105, 229, 255, 0.08);
}

.app-body .recipient-option-input {
  grid-column: 3;
  grid-row: 1;
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  accent-color: var(--cyan);
}

.recipient-option .avatar {
  grid-column: 1;
  grid-row: 1;
}

.recipient-option-body {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
}

.recipient-option-body strong,
.recipient-option-body .body-muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipient-option-meta {
  max-width: 100%;
}

.recipient-chooser-empty {
  min-height: 132px;
}

.creator-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.member-card-action {
  width: 100%;
}

@media (max-width: 640px) {
  .provider-grid {
    grid-template-columns: 1fr;
  }

  .composer-search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .message-card-topline,
  .message-thread-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .message-bubble {
    max-width: 100%;
  }

  .message-report-form {
    flex-direction: column;
  }
}
