@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --surface-3: #ebebec;
  --border: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.1);
  --text: #0a0a0a;
  --text-2: #52525b;
  --text-3: #a1a1aa;
  --accent: #ff4500;
  --accent-hover: #e63e00;
  --accent-soft: rgba(255, 69, 0, 0.08);
  --accent-glow: rgba(255, 69, 0, 0.22);
  --win: #16a34a;
  --win-soft: rgba(22, 163, 74, 0.1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }

html, body {
  min-height: 100%;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 680px 480px at 24% 36%, rgba(255, 69, 0, 0.11), transparent 68%),
    radial-gradient(ellipse 560px 440px at 70% 64%, rgba(255, 122, 61, 0.08), transparent 70%),
    radial-gradient(ellipse 420px 300px at 48% 92%, rgba(24, 24, 27, 0.04), transparent 72%);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background:
    radial-gradient(circle at 30% 46%, transparent 168px, rgba(255, 69, 0, 0.16) 169px, transparent 171px),
    radial-gradient(circle at 58% 50%, transparent 210px, rgba(24, 24, 27, 0.08) 211px, transparent 213px),
    radial-gradient(circle at 44% 48%, transparent 280px, rgba(255, 69, 0, 0.05) 281px, transparent 283px);
}

body::after {
  background-image: radial-gradient(rgba(10, 10, 10, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 78% 68% at 40% 46%, #000 10%, transparent 74%);
}

button, input, textarea, select { font: inherit; color: inherit; }

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr min(360px, 32vw);
  grid-template-rows: auto 1fr;
  grid-template-areas: "top top" "stage rail";
}

/* ─── header ─── */
.top {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 28px;
  height: 64px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.nav-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  margin-right: auto;
}

.nav-link:hover {
  color: var(--accent);
  background: #fff1eb;
}

.strip {
  display: flex;
  gap: 22px;
  margin: 0 auto;
}
.strip div { display: flex; align-items: center; gap: 6px; }
.strip dt {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.strip dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-blue { background: #3b82f6; }
.dot-green { background: #22c55e; }
.dot-purple { background: #a855f7; }

.top-actions { display: flex; gap: 8px; margin-left: auto; }

.score-menu {
  position: relative;
}

.score-button {
  height: 36px;
  border: 1px solid rgba(255, 69, 0, 0.18);
  border-radius: 999px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fff7f3;
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.score-button:hover,
.score-button[aria-expanded="true"] {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.score-button strong {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.score-spark {
  margin-right: 2px;
}

.score-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 330px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-xl);
  z-index: 50;
  animation: modalIn 0.2s ease both;
}

.score-popover[hidden] {
  display: none;
}

.score-popover-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.score-popover-head p {
  color: var(--text-3);
  font-size: 11px;
  margin-bottom: 2px;
}

.score-popover-head strong {
  font-size: 20px;
  letter-spacing: -0.02em;
}

.rank-pill {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 14px 0;
}

.score-grid div {
  padding: 10px 8px;
  border-radius: 10px;
  background: var(--surface-2);
  text-align: center;
}

.score-grid strong,
.score-grid span {
  display: block;
}

.score-grid strong {
  font-size: 16px;
}

.score-grid span {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 10px;
}

.unlock-box {
  padding: 12px;
  border: 1px solid rgba(255, 69, 0, 0.12);
  border-radius: 12px;
  background: var(--accent-soft);
}

.unlock-copy {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
}

.unlock-copy span {
  color: var(--text-2);
  text-align: right;
}

.unlock-track {
  height: 5px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 69, 0, 0.12);
}

.unlock-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.35s ease;
}

.score-board-head {
  margin-top: 16px;
  padding: 0 4px 7px;
  display: flex;
  justify-content: space-between;
  color: var(--text-3);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.score-board {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.score-player {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 4px;
  border-radius: 8px;
  font-size: 12px;
}

.score-player.is-you {
  background: var(--accent-soft);
}

.score-player-rank {
  color: var(--text-3);
  text-align: center;
  font-weight: 700;
}

.score-player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.score-player-points {
  color: var(--accent);
  font-weight: 800;
}

.score-loading {
  padding: 12px;
  color: var(--text-3);
  text-align: center;
  font-size: 12px;
}

.score-save {
  width: 100%;
  justify-content: center;
  margin-top: 14px;
}

.score-bump {
  animation: scoreBump 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.score-fly-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  overflow: hidden;
}

.score-fly-coin {
  position: fixed;
  top: 0;
  left: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f6de8a 0%, #e4b04a 48%, #c78a22 100%);
  box-shadow:
    0 1px 3px rgba(40, 24, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  .score-fly-layer {
    display: none;
  }
}

/* ─── buttons ─── */
.ghost, .primary {
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ghost {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.ghost:hover {
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}

.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 20px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-plus {
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
}

/* ─── stage ─── */
.stage {
  grid-area: stage;
  padding: 28px 32px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  overflow: auto;
  background: transparent;
}

.stage-push {
  flex: 1 0 0px;
  width: 100%;
  transition: flex-grow 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.stage.is-result > .stage-push:first-child {
  flex-grow: 0;
}

.stage.is-result {
  padding-bottom: 24px;
}

.stage.is-result > .stage-push:last-child {
  flex: 0 0 16px;
  min-height: 16px;
}

.stage.is-result .arena-mark {
  display: none;
}

.stage.is-result .arena-kicker {
  font-size: clamp(24px, 3.5vw, 32px);
}

.stage.is-result .arena-sub {
  display: none;
}

.stage.is-result .duel {
  width: min(900px, 100%);
  gap: 18px;
  margin-top: 4px;
}

.stage.is-result .card {
  min-height: 280px;
  padding: 32px 28px 24px;
  gap: 10px;
  border-radius: 20px;
}

.stage.is-result .logo,
.stage.is-result .logo-init {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}

.stage.is-result .card .name {
  font-size: 26px;
  margin-top: 6px;
  max-width: calc(100% - 120px);
}

.stage.is-result .card .tag {
  font-size: 15px;
  max-width: calc(100% - 120px);
}

.stage.is-result .card .vote-label {
  margin-top: 14px;
  padding: 13px 16px;
  font-size: 14px;
  border-radius: 12px;
}

.stage.is-result .result-panel {
  padding: 24px 24px 20px;
  min-height: 300px;
}

.stage.is-result .result-pct {
  font-size: clamp(36px, 5vw, 48px);
}

.stage.is-result .card:hover:not(:disabled) {
  transform: none;
}

.stage.is-result .card .blurb,
.stage.is-result .card .meta,
.stage.is-result .feat-chip {
  display: none;
}

.stage.is-result .card-side {
  top: 14px;
  right: 14px;
  gap: 4px;
}

.stage.is-result .card .view-product,
.stage.is-result .kind-chip {
  font-size: 11px;
  padding: 3px 8px;
}

.stage.is-result .vs {
  width: 36px;
  height: 36px;
  font-size: 11px;
}

.stage.is-result .stage-body {
  gap: 12px;
}

.stage-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.stage-head {
  text-align: center;
  width: min(720px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.arena-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
  margin-bottom: 14px;
}

.arena-kicker {
  font-family: var(--font);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.05;
  color: var(--text);
}

.arena-sub {
  margin-top: 8px;
  font-size: 15px;
  color: var(--text-2);
  font-weight: 400;
}

/* ─── duel ─── */
.duel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  width: min(960px, 100%);
  align-items: stretch;
  margin-top: 8px;
  overflow: hidden;
  perspective: 1200px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  padding: 36px 32px 28px;
  min-height: 380px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  cursor: default;
  overflow: hidden;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.2s ease,
    box-shadow 0.3s ease,
    opacity 0.3s ease,
    filter 0.3s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle 140px at var(--rx, 50%) var(--ry, 30%),
    var(--accent-glow), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 1;
}

.card:hover:not(:disabled)::before,
.card.is-pressing::before { opacity: 1; }

.card:hover:not(:disabled) {
  transform: translateY(-6px);
  border-color: rgba(255, 69, 0, 0.25);
  box-shadow: var(--shadow-xl);
}

.card.is-pressing:not(:disabled) {
  transform: translateY(2px) scale(0.985);
}

.card.is-winner {
  z-index: 3;
  animation: winnerPop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  border-color: rgba(22, 163, 74, 0.4);
  box-shadow: 0 0 0 3px var(--win-soft), var(--shadow-xl);
}

.card.is-loser {
  z-index: 1;
  animation: loserFade 0.6s ease forwards;
  pointer-events: none;
}

.card.is-enter-left {
  animation: slideInLeft 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.card.is-enter-right {
  animation: slideInRight 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.card:disabled { cursor: default; }

.logo, .logo-init {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: block;
  object-fit: cover;
  background: #e4e4e7;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.logo-init {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.card.is-winner .logo { transform: scale(1.1) rotate(-3deg); }

.card .name {
  display: inline-block;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 8px 0 0 -6px;
  padding: 1px 6px;
  border-radius: 8px;
  position: relative;
  z-index: 2;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.card .name:hover {
  background: #fff1eb;
  color: var(--accent);
}

.card .tag {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  position: relative;
  z-index: 2;
}

.card .meta {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  position: relative;
  z-index: 2;
}

.card .blurb {
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.45;
  position: relative;
  z-index: 2;
}

.card .vote-label {
  margin-top: auto;
  width: 100%;
  padding: 16px 18px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: #fff;
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  z-index: 2;
  cursor: pointer;
  box-shadow: none;
  transition: all 0.2s ease;
}

.card .name,
.card .tag,
.card .meta,
.card .blurb {
  max-width: calc(100% - 128px);
}

.card-side {
  position: absolute;
  top: 28px;
  right: 22px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  max-width: 46%;
}

.card-side .feat-chip {
  position: static;
}

.card .view-product {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  position: relative;
  z-index: 2;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.card .view-product:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.card .view-host {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card .view-product[hidden] { display: none; }

.kind-chip {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
  text-align: right;
  line-height: 1.35;
  max-width: 100%;
}

.kind-chip[hidden] { display: none; }

.card:hover:not(:disabled) .vote-label {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.card.is-winner .vote-label {
  color: #fff;
  background: var(--win);
  border-color: var(--win);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
}

.card.is-loser .vote-label {
  color: #fff;
  background: #3f3f46;
  border-color: #3f3f46;
  box-shadow: none;
}

.btn-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.feat-chip {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(255, 69, 0, 0.15);
}

.vs {
  align-self: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: #18181b;
  color: #fff;
  box-shadow: var(--shadow-md);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}

.duel.is-resolving .vs {
  transform: scale(0.5) rotate(360deg);
  opacity: 0.2;
}

.arena-foot {
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
}

.result-panel {
  position: relative;
  width: min(520px, 100%);
  min-height: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 28px 28px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.result-panel.is-on {
  animation: cardIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.result-panel[hidden] { display: none; }

.result-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  flex: 1 1 auto;
  min-height: 120px;
}

.result-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: auto;
}

.result-pct {
  font-size: clamp(40px, 6vw, 56px);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
  min-height: 1.05em;
}

.result-headline {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.3;
  max-width: 360px;
  min-height: 1.3em;
}

.result-why {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-2);
  max-width: 340px;
  min-height: 1.45em;
}

.result-why.is-match {
  animation: matchPulse 0.9s ease;
}

.result-points {
  font-weight: 700;
  min-height: 1.3em;
  margin-top: 2px;
}

.result-label {
  font-variant: small-caps;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-2);
}

.clap {
  position: absolute;
  left: 0;
  right: 0;
  top: 18px;
  height: 72px;
  pointer-events: none;
}

.clap[hidden] { display: none; }

.clap span {
  position: absolute;
  left: 50%;
  top: 18px;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  opacity: 0;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff4500' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 13v-1a2 2 0 0 1 4 0M12 12V9a2 2 0 0 1 4 0v3M16 11a2 2 0 0 1 4 0v4a6 6 0 0 1-6 6h-2a6 6 0 0 1-5-2.5L4 14a2 2 0 0 1 3-2.6'/%3E%3C/svg%3E");
}

.clap.is-on span {
  animation: clapRise 0.9s ease forwards;
}

.clap span:nth-child(1) { margin-left: -28px; animation-delay: 0s; }
.clap span:nth-child(2) { animation-delay: 0.08s; }
.clap span:nth-child(3) { margin-left: 10px; animation-delay: 0.16s; }

@keyframes clapRise {
  0% { opacity: 0; transform: translateY(6px) scale(0.9); }
  30% { opacity: 0.55; }
  100% { opacity: 0; transform: translateY(-16px) scale(1); }
}

@keyframes matchPulse {
  0%, 100% { color: var(--text-2); }
  40% { color: var(--accent); }
}

.result-facts {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  flex: 0 1 auto;
  min-height: 0;
}

.fact-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 14px;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(10px);
  animation: factIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transition: background 0.15s ease, color 0.15s ease;
}

.fact-row:hover .fact-name {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.fact-row:nth-child(2) { animation-delay: 0.14s; }

.fact-row strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.fact-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--win);
  color: #fff;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.fact-check svg {
  width: 10px;
  height: 10px;
  display: block;
}

.fact-row span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.result-facts[hidden] { display: none; }

@keyframes factIn {
  to { opacity: 1; transform: none; }
}

.result-panel .primary,
.result-panel .next-match {
  margin-top: 0;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.next-match {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 16px 18px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 12px;
  box-shadow: none;
}

.next-clock {
  position: relative;
  width: 48px;
  height: 48px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  flex-shrink: 0;
}

.next-clock:hover {
  transform: scale(1.05);
}

.next-clock.is-paused .next-clock-progress {
  stroke: var(--text-3);
}

.next-clock-ring {
  width: 52px;
  height: 52px;
  transform: rotate(-90deg);
}

.next-clock-track {
  fill: none;
  stroke: var(--surface-3);
  stroke-width: 3.5;
}

.next-clock-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 125.6;
  stroke-dashoffset: 0;
  transition: stroke 0.2s ease;
}

.next-clock-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  pointer-events: none;
}

.next-hint {
  font-size: 11px;
  color: var(--text-3);
  min-height: 1.2em;
}

.arena-note {
  color: var(--text-3);
  font-size: 12px;
  min-height: 1em;
}

.share-row {
  width: 100%;
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 13px;
}

.share-row[hidden] { display: none; }

#copyShare {
  padding: 6px 12px;
  font-size: 13px;
}

/* ─── sidebar ─── */
.rail {
  grid-area: rail;
  padding: 20px 20px 20px 0;
  background: transparent;
  overflow: hidden;
}

.rail-card {
  height: calc(100vh - 64px - 40px);
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  background: var(--surface-2);
  padding: 3px;
  border-radius: 10px;
  flex-shrink: 0;
}

.tab {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 8px 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  transition: all 0.15s ease;
}
.tab:hover { color: var(--text-2); }
.tab.is-on {
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.rail-head {
  margin-bottom: 12px;
  flex-shrink: 0;
}
.rail-head h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.rail-head p {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.panel[hidden] {
  display: none;
}

.row {
  display: grid;
  grid-template-columns: 22px 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 8px;
  border-radius: 12px;
  min-width: 0;
  transition: background 0.12s ease;
}
.row:hover { background: var(--surface-2); }

.row .rank {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  text-align: center;
}
.row:nth-child(1) .rank { color: #d4a017; }
.row:nth-child(2) .rank { color: #8a8a8a; }
.row:nth-child(3) .rank { color: #b87333; }

.row .logo, .row .logo-init, .row .ph {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 12px;
  box-shadow: none;
}

.row .meta {
  min-width: 0;
}
.row .meta strong,
.row .meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row .meta strong { display: block; font-size: 13px; font-weight: 700; }
.row .meta span { display: block; font-size: 11px; color: var(--text-3); margin-top: 1px; }

.row-slide {
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.row-end {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 28px;
  max-width: 100%;
  overflow: hidden;
  transition: min-width 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.row-actions {
  position: absolute;
  right: 0;
  top: 50%;
  display: flex;
  gap: 6px;
  /* Clipped by .row-end; keep offset small so it never widens the panel. */
  transform: translate(8px, -50%);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease;
}

.row-act {
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 26px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.row-act.is-visit {
  color: var(--accent);
  border-color: rgba(255, 69, 0, 0.4);
}

.row-act.is-detail:hover { background: var(--surface-2); }
.row-act.is-visit:hover { background: var(--accent); color: #fff; }

.row .score {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  background: var(--accent-soft);
  padding: 4px 8px;
  border-radius: 999px;
  transition: opacity 0.2s ease, transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) and (pointer: fine) {
  .row:hover .row-slide,
  .row:focus-within .row-slide {
    transform: translateX(-6px);
  }
  .row:hover .row-end,
  .row:focus-within .row-end {
    min-width: 132px;
  }
  .row:hover .score,
  .row:focus-within .score {
    opacity: 0;
    transform: translateX(-8px);
  }
  .row:hover .row-actions,
  .row:focus-within .row-actions {
    transform: translate(0, -50%);
    opacity: 1;
    pointer-events: auto;
  }
}

@media (hover: none) {
  .row-end { min-width: 132px; }
  .score { display: none; }
  .row-actions {
    position: static;
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }
}

.rail-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 11px;
  text-align: center;
  flex-shrink: 0;
}

.empty {
  padding: 28px 14px;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

/* ─── modals ─── */
.modal-root {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 40;
}
.modal-root[hidden] {
  display: none !important;
}
.modal-root.is-forced {
  background: rgba(24, 24, 27, 0.55);
  pointer-events: auto;
}

.modal-root.is-forced .modal {
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}

.modal {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.16s ease both;
}

.modal h2 {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.modal p, .modal label {
  color: var(--text-2);
  font-size: 13px;
}
.modal label { font-weight: 600; color: var(--text); }

.modal input, .modal textarea, .modal select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.modal input:focus, .modal textarea:focus, .modal select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.modal.is-auth {
  width: min(760px, 100%);
  padding: 0;
  flex-direction: row;
  gap: 0;
  overflow: hidden;
}

.auth-art {
  position: relative;
  width: 280px;
  flex: 0 0 280px;
  padding: 28px 24px;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 69, 0, 0.18), transparent 42%),
    radial-gradient(circle at 80% 80%, rgba(255, 180, 120, 0.35), transparent 46%),
    #fff7f3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  text-align: center;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.auth-brand strong {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.auth-mark {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.auth-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

.auth-art h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--text-2);
  max-width: none;
}

.auth-form {
  flex: 1;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.auth-form .modal-actions a { text-decoration: none; }

.auth-google {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.auth-google:hover { background: var(--surface-2); }

.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-or::before,
.auth-or::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}

.auth-send {
  width: 100%;
  justify-content: center;
  min-height: 44px;
}

.auth-dismiss {
  align-self: center;
  border: 0;
  background: none;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 720px) {
  .modal.is-auth { flex-direction: column; }
  .auth-art { width: auto; flex-basis: auto; min-height: 140px; padding: 22px; }
  .auth-art h3 { font-size: 22px; }
}

.tier {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.tier:hover { border-color: var(--border-strong); }

.tier-boost {
  margin-top: 2px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.tier-share {
  margin-top: 2px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
}

.modal.is-feature {
  width: min(640px, 100%);
}

.modal.is-feature-pricing {
  width: min(720px, 100%);
}

.modal.is-feature-success {
  width: min(480px, 100%);
  text-align: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.feature-pitch {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feature-pitch h2 {
  margin: 0;
}

.feature-pitch-lead {
  margin: 0;
  color: var(--text-2);
  line-height: 1.45;
}

.feature-pitch-list {
  margin: 0;
  padding: 0 0 0 1.15em;
  color: var(--text);
  line-height: 1.5;
}

.feature-pitch-list li {
  margin: 0 0 6px;
}

.feature-pitch-list li:last-child {
  margin-bottom: 0;
}

.feature-pitch-compare {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 69, 0, 0.12);
}

.feature-pitch-compare p {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
}

.feature-pitch-compare strong {
  color: var(--accent);
  font-weight: 700;
}

.feature-slim-note {
  margin: 0;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.4;
}

.feature-existing {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.feature-pricing-lead {
  margin: 0;
  color: var(--text-2);
  line-height: 1.45;
}

.feature-pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.feature-tier-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background:
    linear-gradient(165deg, rgba(255, 69, 0, 0.04), transparent 42%),
    var(--surface-2);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.feature-tier-card:hover {
  border-color: rgba(255, 69, 0, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
}

.feature-tier-card.is-mid {
  border-color: rgba(255, 69, 0, 0.28);
  background:
    linear-gradient(165deg, rgba(255, 69, 0, 0.1), transparent 48%),
    var(--surface);
  box-shadow: 0 8px 24px rgba(255, 69, 0, 0.08);
}

.feature-tier-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}

.feature-tier-price {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}

.feature-tier-share {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.feature-tier-detail {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.4;
  flex: 1;
}

.feature-tier-meta {
  font-size: 11px;
  color: var(--text-3);
}

.feature-tier-card .tier-buy {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

.feature-success-mark {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 28px;
  color: #fff;
  background: linear-gradient(145deg, #ff6a33, var(--accent));
  box-shadow: 0 12px 28px var(--accent-glow);
  animation: featureSuccessPop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.feature-success-lead {
  margin: 0;
  max-width: 34ch;
  color: var(--text-2);
  line-height: 1.45;
}

.feature-success-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-3);
}

.modal.is-feature-success .modal-actions {
  width: 100%;
  justify-content: center;
}

@keyframes featureSuccessPop {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 640px) {
  .feature-pricing-grid {
    grid-template-columns: 1fr;
  }
}

.err { color: #dc2626; font-size: 12px; font-weight: 500; }

.save-points-hero {
  padding: 18px;
  border-radius: 14px;
  background: var(--accent-soft);
  text-align: center;
}

.save-points-hero strong {
  display: block;
  color: var(--accent);
  font-size: 34px;
  letter-spacing: -0.04em;
}

.save-points-hero span {
  color: var(--text-2);
  font-size: 12px;
}

.save-warning {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff7ed;
  color: #9a3412 !important;
}

/* ─── animations ─── */
@keyframes winnerPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.04) translateY(-8px); }
  100% { transform: scale(1.02) translateY(-4px); }
}

@keyframes loserFade {
  0% { transform: scale(1); opacity: 1; filter: grayscale(0); }
  100% { transform: scale(0.94) translateY(12px); opacity: 0.2; filter: grayscale(1); }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-120%) scale(0.96);
  }
  70% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(120%) scale(0.96);
  }
  70% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes spark {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0); }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scoreBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

.burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
  z-index: 5;
}
.burst span {
  position: absolute;
  left: 50%;
  top: 45%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation: spark 0.65s ease-out forwards;
}

@media (max-width: 960px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-areas: "top" "stage" "rail";
  }
  .strip { display: none; }
  .rail { padding: 0 16px 24px; }
  .rail-card { height: auto; max-height: none; }
  .duel { grid-template-columns: 1fr; }
  .vs { justify-self: center; }
  .stage { padding: 20px 16px 28px; }
  .top { padding: 0 16px; }
  .brand-name { font-size: 15px; }
  #listBtn,
  #featureBtn { padding: 8px 12px; font-size: 12px; }
  .score-popover {
    position: fixed;
    top: 58px;
    right: 12px;
    left: 12px;
    width: auto;
  }
  .score-button {
    padding: 0 10px;
  }
}

.product-view {
  grid-column: 1 / -1;
  grid-row: 2;
  width: min(1120px, calc(100% - 48px));
  margin: 16px auto 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 12px 20px;
  align-items: start;
  align-content: start;
}

.product-view[hidden] { display: none; }

.product-back {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  margin-bottom: 0;
}

.product-main { grid-column: 1; grid-row: 2; }
.product-side { grid-column: 2; grid-row: 2; }

body.is-product .stage,
body.is-product .rail { display: none; }

body.is-directory .stage,
body.is-directory .rail { display: none; }

.directory-view {
  grid-column: 1 / -1;
  grid-row: 2;
  width: min(960px, calc(100% - 48px));
  margin: 16px auto 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.directory-view[hidden] { display: none; }

.directory-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.directory-bar h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
}

.directory-bar p {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 14px;
}

.directory-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.directory-loading {
  color: var(--text-2);
  font-size: 14px;
  padding: 20px 0;
}

.directory-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.directory-card:hover {
  border-color: rgba(255, 69, 0, 0.28);
  box-shadow: var(--shadow-sm);
}

.directory-card img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  background: #e4e4e7;
}

.directory-card strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.directory-card span {
  display: block;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
}

.directory-card em {
  display: block;
  font-style: normal;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}

.directory-ships {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  white-space: nowrap;
}

a.clash-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.product-head,
.product-section,
.product-side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}

.product-head {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 22px;
}

.product-head img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  background: #e4e4e7;
  flex: 0 0 auto;
}

.product-copy { min-width: 0; }
.product-head h1 { font-size: 32px; letter-spacing: -0.04em; line-height: 1.1; }
.product-head .tag { color: var(--accent); font-weight: 650; display: block; margin-top: 6px; }
.product-head .kind-chip {
  display: inline-block;
  margin-top: 10px;
  text-align: left;
  color: var(--text-2);
}
.product-desc { color: var(--text); margin-top: 10px; line-height: 1.45; }
.product-facts { color: var(--text-2); margin-top: 6px; font-size: 13px; font-weight: 600; }

.product-visit {
  display: inline-flex;
  margin-top: 14px;
  height: 34px;
  padding: 0 14px;
  align-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}
.product-visit:hover { background: var(--accent-hover); }

.product-record {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.product-record div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.product-record strong {
  display: block;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.product-record span {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
}

.product-section {
  margin-top: 16px;
  padding: 18px;
}

.product-section h2 {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.product-section > p {
  color: var(--text-3);
  font-size: 12px;
  margin-top: 2px;
}

.product-clashes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.clash-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  min-width: 0;
}

.clash-card img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
  margin-bottom: 8px;
}

.clash-card strong {
  font-size: 13px;
  letter-spacing: -0.01em;
}

.clash-card span {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.clash-card:hover {
  border-color: rgba(255, 69, 0, 0.35);
  background: #fff;
}

.product-empty { color: var(--text-3); margin-top: 12px; font-size: 13px; }

.clash-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.clash-pager[hidden] { display: none; }

.clash-pager button {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.clash-pager button:disabled {
  opacity: 0.4;
  cursor: default;
}

.clash-pager span {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
}

.product-side {
  padding: 24px 20px 20px;
  position: sticky;
  top: 80px;
}

.product-side h2 { margin: 0 0 12px; font-size: 16px; }

.comment { padding: 10px 0; border-top: 1px solid var(--border); }
.comment strong { display: block; font-size: 13px; }
.comment p { color: var(--text-2); font-size: 13px; margin-top: 2px; line-height: 1.4; }

#productCommentForm {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

#productCommentForm textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 10px;
  resize: vertical;
  background: #fff;
}

#productCommentForm .primary {
  width: 100%;
  justify-content: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

@media (max-width: 960px) {
  .product-view {
    width: auto;
    margin: 16px;
    grid-template-columns: 1fr;
  }
  .product-side { position: static; grid-column: 1; grid-row: auto; }
  .product-head { padding: 16px; }
  .product-head h1 { font-size: 26px; }
  .product-clashes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .product-record,
  .product-clashes { grid-template-columns: 1fr; }
  .product-head { flex-direction: column; }
}

.fact-row {
  border: 0;
  cursor: pointer;
  width: auto;
  background: transparent;
}

/* ─── legal pages ─── */
.legal-body {
  min-height: 100vh;
}

.legal-top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  height: 64px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.legal-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.legal-nav a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.legal-nav a:hover,
.legal-nav a[aria-current="page"] {
  color: var(--text);
}

.legal-main {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 40px));
  margin: 40px auto 80px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.legal-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.legal-main h1 {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.legal-updated {
  color: var(--text-3);
  font-size: 13px;
  margin-bottom: 8px;
}

.legal-main h2 {
  margin-top: 18px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.legal-main p,
.legal-main li {
  color: var(--text-2);
  line-height: 1.65;
  font-size: 15px;
}

.legal-main ul {
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal-main a {
  color: var(--accent);
  font-weight: 600;
}

.legal-also {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.site-foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 18px 20px 28px;
}

.site-foot a {
  color: var(--text-3);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.site-foot a:hover { color: var(--text-2); }

@media (max-width: 720px) {
  .legal-top { padding: 0 16px; }
  .legal-main { margin-top: 28px; }
}

