/* Page-specific sections. Depends on tokens.css, base.css and components.css. */

/* --- Hero (index) --- */

.hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(40px, 7vw, 80px);
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(
      ellipse at 50% 0%,
      color-mix(in srgb, var(--vvm-action-secondary) 24%, transparent) 0%,
      transparent 62%
    ),
    var(--vvm-bg-layer);
}

.hero__art {
  width: 100%;
  border: var(--vvm-border-thin) solid var(--vvm-border);
  border-radius: var(--vvm-radius-xl);
  box-shadow: var(--vvm-elev-overlay);
}

.hero__copy {
  max-width: 62ch;
  margin-block: var(--vvm-space-xl) 0;
}

.hero__copy h1 {
  margin-bottom: var(--vvm-space-md);
}

.hero__tagline {
  font-size: clamp(1.0625rem, 2.2vw, 1.375rem);
  color: var(--vvm-text-secondary);
  margin-bottom: var(--vvm-space-lg);
}

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: var(--vvm-space-md);
  margin-top: var(--vvm-space-xl);
}

.hero__actions .btn {
  align-self: flex-start;
}

.scroll-hint {
  display: inline-flex;
  align-items: center;
  gap: var(--vvm-space-sm);
  margin-top: var(--vvm-space-xl);
  color: var(--vvm-text-muted);
  font-size: var(--vvm-text-meta);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}

.scroll-hint svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  animation: nudge 2.4s var(--vvm-ease) infinite;
}

@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint svg {
    animation: none;
  }
}

/* --- Screenshot strip --- */

.shots {
  display: flex;
  gap: var(--vvm-space-lg);
  padding-bottom: var(--vvm-space-md);
  scroll-snap-type: x mandatory;
}

.shots figure {
  flex: 0 0 auto;
  width: min(260px, 68vw);
  margin: 0;
  scroll-snap-align: start;
}

.shots img {
  width: 100%;
  border: var(--vvm-border-thin) solid var(--vvm-border);
  border-radius: var(--vvm-radius-lg);
  background: var(--vvm-bg-base);
}

.shots figcaption {
  margin-top: var(--vvm-space-sm);
  font-size: var(--vvm-text-meta);
  color: var(--vvm-text-muted);
}

/* --- Faction split --- */

.factions {
  display: grid;
  gap: var(--vvm-space-lg);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.faction {
  display: flex;
  flex-direction: column;
  gap: var(--vvm-space-md);
  padding: var(--vvm-space-xl);
  border: var(--vvm-border-thin) solid var(--vvm-border-muted);
  border-radius: var(--vvm-radius-lg);
  background: var(--vvm-surface);
}

.faction--villager {
  border-top: 4px solid var(--vvm-action);
}

.faction--monster {
  border-top: 4px solid var(--vvm-danger);
}

.faction__portraits {
  display: flex;
  gap: var(--vvm-space-sm);
}

.faction ul {
  margin-bottom: 0;
  color: var(--vvm-text-secondary);
}

/* --- District cards --- */

.district {
  display: flex;
  flex-direction: column;
  gap: var(--vvm-space-md);
  padding: var(--vvm-space-lg);
  border: var(--vvm-border-thin) solid var(--vvm-border-muted);
  border-top: 4px solid var(--district-accent, var(--vvm-border));
  border-radius: var(--vvm-radius-lg);
  background: var(--vvm-surface);
}

.district__crest {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.district__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vvm-space-xs);
}

.district dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--vvm-space-xs) var(--vvm-space-md);
  margin: 0;
  font-size: var(--vvm-text-label);
}

.district dt {
  color: var(--vvm-text-muted);
}

.district dd {
  margin: 0;
  color: var(--vvm-text-secondary);
}

/* --- Steps (how to play) --- */

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--vvm-space-lg);
}

.steps > li {
  counter-increment: step;
  position: relative;
  margin: 0;
  padding: var(--vvm-space-lg) var(--vvm-space-lg) var(--vvm-space-lg) 72px;
  border: var(--vvm-border-thin) solid var(--vvm-border-muted);
  border-radius: var(--vvm-radius-lg);
  background: var(--vvm-surface);
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: var(--vvm-space-lg);
  top: var(--vvm-space-lg);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--vvm-action);
  color: var(--vvm-action-content);
  font-family: var(--vvm-font-display);
  font-weight: 700;
}

.steps h3 {
  margin-bottom: var(--vvm-space-xs);
}

.steps p:last-child {
  margin-bottom: 0;
  color: var(--vvm-text-secondary);
}

/* --- Leaderboards --- */

.stats-bar {
  display: grid;
  gap: var(--vvm-space-md);
  /* 48% keeps these two-up on a narrow phone rather than stacking into four
     full-width blocks of mostly empty space. */
  grid-template-columns: repeat(auto-fit, minmax(min(48%, 180px), 1fr));
  margin-bottom: var(--vvm-space-xl);
}

.stats-bar .stat {
  padding: var(--vvm-space-md);
}

.stats-bar .stat__value {
  font-size: clamp(1.5rem, 5vw, 2rem);
}

.stats-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--vvm-space-sm) var(--vvm-space-lg);
  margin-bottom: var(--vvm-space-lg);
  font-size: var(--vvm-text-meta);
  color: var(--vvm-text-muted);
}

.board__empty {
  padding: var(--vvm-space-xxl) var(--vvm-space-lg);
  text-align: center;
  color: var(--vvm-text-muted);
}

.equip-strip {
  display: flex;
  gap: var(--vvm-space-xs);
}

.equip-strip .tile {
  width: 32px;
  padding: 2px;
  border-radius: var(--vvm-radius-sm);
}

.district-pips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vvm-space-xs);
}

.district-pip {
  display: inline-flex;
  align-items: center;
  gap: var(--vvm-space-xxs);
  padding: 1px var(--vvm-space-xs);
  border-radius: var(--vvm-radius-sm);
  background: var(--vvm-surface-inset);
  font-size: var(--vvm-text-meta);
  color: var(--vvm-text-secondary);
  white-space: nowrap;
}

.district-pip img {
  width: 16px;
  height: 16px;
}

/* --- Player detail --- */

.player-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--vvm-space-xl);
  margin-bottom: var(--vvm-space-xl);
}

.player-head__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vvm-space-sm);
  margin-top: var(--vvm-space-sm);
}

.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--vvm-space-md);
  list-style: none;
  padding: 0;
  margin: 0;
}

.slots > li {
  display: flex;
  align-items: center;
  gap: var(--vvm-space-md);
  margin: 0;
  padding: var(--vvm-space-sm);
  border: var(--vvm-border-thin) solid var(--vvm-border-muted);
  border-radius: var(--vvm-radius-md);
  background: var(--vvm-surface);
}

.slots .tile {
  width: 48px;
  flex: none;
}

.slot__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.slot__name {
  font-size: var(--vvm-text-label);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.slot__label {
  font-size: var(--vvm-text-meta);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--vvm-text-muted);
}

.slots > li.is-empty {
  opacity: 0.55;
}

/* --- Legal pages --- */

.legal h2 {
  margin-top: var(--vvm-space-xxl);
  margin-bottom: var(--vvm-space-md);
  padding-top: var(--vvm-space-lg);
  border-top: var(--vvm-border-thin) solid var(--vvm-border-muted);
  font-size: 1.375rem;
}

.legal h3 {
  margin-top: var(--vvm-space-xl);
  margin-bottom: var(--vvm-space-sm);
}

.legal ul {
  color: var(--vvm-text-secondary);
}

.legal__toc {
  padding: var(--vvm-space-lg);
  border: var(--vvm-border-thin) solid var(--vvm-border-muted);
  border-radius: var(--vvm-radius-lg);
  background: var(--vvm-surface);
}

.legal__toc h2 {
  margin: 0 0 var(--vvm-space-sm);
  padding: 0;
  border: 0;
  font-size: var(--vvm-text-title-md);
}

.legal__toc ol {
  margin-bottom: 0;
  color: var(--vvm-text-secondary);
}

/* --- Error page --- */

.error-page {
  display: grid;
  place-items: center;
  gap: var(--vvm-space-lg);
  min-height: 60vh;
  text-align: center;
}
