:root {
  --red: #e10600;
  --red-bright: #ff2b2b;
  --red-deep: #8a0a12;
  --red-glow: rgba(225, 6, 0, 0.55);
  --black: #050505;
  --ink: #0c0c0c;
  --white: #f6f6f6;
  --muted: rgba(246, 246, 246, 0.62);
  --line: rgba(255, 255, 255, 0.12);
  --glass: rgba(8, 8, 8, 0.78);
  --glass-strong: rgba(6, 6, 6, 0.88);
  --radius: 18px;
  --nav-h: 64px;
  --max: 760px;
  --max-wide: 1080px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: "Outfit", system-ui, sans-serif;
  --display: "Bebas Neue", "Oswald", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--white);
  background: var(--black);
  line-height: 1.5;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font-family: inherit;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 100;
  background: var(--red);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- YouTube background ---------- */
.video-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #050505;
}

.video-background__frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 56.25vw;
  min-height: 100vh;
  min-width: 177.77vh;
  transform: translate(-50%, -50%) scale(1.28);
  filter: grayscale(0.1) contrast(1.08) saturate(0.88) brightness(0.78);
  opacity: 0;
  transition: opacity 1.6s ease;
}

html.yt-ready .video-background__frame {
  opacity: 1;
}

.video-background__frame iframe,
.video-background__frame #yt-bg-player {
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}

.video-background__grade,
.video-background__tint,
.video-background__vignette,
.video-background__grain,
.video-background__cover {
  position: absolute;
  inset: 0;
}

.video-background__grade {
  background:
    linear-gradient(180deg,
      rgba(10, 0, 0, 0.4) 0%,
      rgba(176, 8, 24, 0.16) 42%,
      rgba(0, 0, 0, 0.58) 100%);
}

.video-background__tint {
  background: #8f0810;
  mix-blend-mode: multiply;
  opacity: 0.38;
}

.video-background__vignette {
  background:
    radial-gradient(ellipse at center, transparent 46%, rgba(0, 0, 0, 0.55) 100%);
}

.video-background__cover {
  z-index: 3;
  background: #050505;
  transition: opacity 1.6s ease;
}

html.yt-ready .video-background__cover {
  opacity: 0;
}

html.yt-concealed .video-background__cover {
  opacity: 1;
  transition: none;
}

html.yt-concealed .video-background__frame {
  opacity: 0;
  transition: none;
}

.video-background__grain {
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255, 0, 0, 0.04) 0 1px, transparent 1px 4px);
}

html.no-video-bg .video-background__frame {
  display: none;
}

html.no-video-bg .video-background__cover {
  opacity: 1;
}

.page {
  position: relative;
  z-index: 1;
  isolation: isolate;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(16px) saturate(1.2);
  background: rgba(5, 5, 5, 0.72);
  border-bottom: 1px solid var(--line);
}

.nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
}

.nav__inner {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nav__logo {
  height: 44px;
  width: auto;
  transform: rotate(-6deg);
}

.nav__title {
  font-family: var(--display);
  letter-spacing: 0.08em;
  font-size: 1.15rem;
  white-space: nowrap;
}

.nav__toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav__links a,
.nav__links button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--white);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.nav__links a:hover,
.nav__links button:hover,
.nav__links a:focus-visible,
.nav__links button:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line);
}

.nav__links .is-accent {
  border-color: rgba(225, 6, 0, 0.45);
  background: rgba(225, 6, 0, 0.18);
}

.nav-drop {
  position: relative;
}

.nav-drop__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  min-width: 220px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  display: grid;
  gap: 4px;
}

.nav-drop__menu[hidden] {
  display: none;
}

.nav-drop__menu button {
  width: 100%;
  justify-content: flex-start;
  border-radius: 8px;
  padding: 10px 12px;
}

/* ---------- Layout ---------- */
.wrap {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.wrap--wide {
  width: min(var(--max-wide), calc(100% - 32px));
}

.hero {
  text-align: center;
  padding: 12px 0 28px;
}

.hero__logo-wrap {
  width: min(340px, 78vw);
  margin: 0 auto 8px;
  view-transition-name: goat-logo;
}

.hero__logo {
  width: 100%;
  margin: 0;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.55));
}

.hero__badges {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge--red {
  background: var(--red);
  color: #fff;
  box-shadow: 0 0 18px var(--red-glow);
}

.badge--ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
}

.hero__lede {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.02rem;
}

/* ---------- Cards / form ---------- */
.notice,
.panel {
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.15);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.notice {
  padding: 16px 18px;
  margin-bottom: 18px;
  border-left: 3px solid var(--red);
  text-align: left;
  font-size: 0.95rem;
}

.notice strong {
  color: #fff;
}

.notice .tip {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.panel {
  padding: 22px 22px 10px;
  margin-bottom: 18px;
}

.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.panel__kicker {
  font-family: var(--display);
  letter-spacing: 0.18em;
  color: var(--red-bright);
  font-size: 0.95rem;
}

.panel__title {
  font-size: 1.35rem;
  font-weight: 700;
}

.panel__desc {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 18px;
}

.stat-row {
  padding: 12px 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-row:last-child {
  border-bottom: 0;
}

.stat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.stat-label span {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
}

.rating-group,
.boost-group {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}

.boost-group {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  margin-bottom: 8px;
}

.rating-option,
.boost-option {
  position: relative;
}

.rating-option input,
.boost-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.rating-option label,
.boost-option label {
  display: grid;
  place-items: center;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.rating-option input:hover + label,
.boost-option input:hover + label {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.rating-option input:checked + label,
.boost-option input:checked + label {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 0 16px var(--red-glow);
  transform: translateY(-1px);
}

.boost-option.is-hot input:checked + label {
  background: linear-gradient(180deg, var(--red-bright), var(--red-deep));
}

.rating-option input:focus-visible + label,
.boost-option input:focus-visible + label {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.stat-row.is-error {
  outline: 2px solid var(--red);
  outline-offset: 6px;
  border-radius: 12px;
}

.submit-bar {
  display: flex;
  justify-content: center;
  margin: 24px 0 8px;
}

.submit-button.is-loading {
  pointer-events: none;
  opacity: 0.85;
}

.calc-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(5, 5, 5, 0.72);
  backdrop-filter: blur(10px);
}

.calc-overlay[hidden] {
  display: none;
}

.calc-overlay__card {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 28px 32px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  font-weight: 600;
  text-align: center;
}

.calc-overlay__logo {
  width: min(220px, 62vw);
  height: auto;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.5));
}

.calc-overlay__spin {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--red-bright);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.restore-panel__toggle {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: inherit;
  cursor: pointer;
  font: inherit;
}

.restore-panel__toggle .panel__head {
  margin-bottom: 0;
}

.restore-panel.is-open .restore-panel__toggle .panel__head {
  margin-bottom: 8px;
}

.restore-panel__chevron {
  display: inline-block;
  margin-left: 8px;
  transition: transform 0.2s ease;
}

.restore-panel.is-open .restore-panel__chevron {
  transform: rotate(180deg);
}

.restore-panel:not(.is-open) {
  padding-bottom: 12px;
}

.restore-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: end;
  padding-bottom: 8px;
}

.restore-field {
  display: grid;
  gap: 6px;
  text-align: left;
}

.restore-field span {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.restore-panel .btn {
  min-height: 44px;
}

.restore-field input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.results-meta {
  margin-top: 12px;
}

.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.code-chip span {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.code-chip strong {
  font-family: ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.12em;
}

.linkish {
  background: none;
  border: 0;
  color: var(--red-bright);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.results-stamp {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .restore-grid {
    grid-template-columns: 1fr;
  }
}

.error-panel .btn {
  margin: 8px 0 18px;
}

.submit-button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  cursor: pointer;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.submit-button {
  background: linear-gradient(180deg, var(--red-bright), var(--red));
  padding: 16px 42px;
  font-size: 1.05rem;
  box-shadow: 0 10px 30px var(--red-glow);
  min-width: min(420px, 100%);
}

.submit-button:hover,
.btn:hover {
  transform: translateY(-2px);
}

.submit-button:active,
.btn:active {
  transform: translateY(1px);
}

.btn {
  padding: 12px 22px;
  font-size: 0.92rem;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.btn--red {
  background: var(--red);
  box-shadow: 0 8px 22px var(--red-glow);
}

.progress {
  position: sticky;
  top: var(--nav-h);
  z-index: 30;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red-deep), var(--red-bright));
  box-shadow: 0 0 12px var(--red-glow);
  transition: width 0.25s ease;
}

/* ---------- Results ---------- */
.results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 24px;
}

.results-head h1 {
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  letter-spacing: 0.06em;
  line-height: 0.95;
}

.results-head p {
  color: var(--muted);
  margin-top: 6px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.csv-split {
  position: relative;
}

.csv-split__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 180px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  display: grid;
  gap: 4px;
}

.csv-split__menu[hidden] {
  display: none;
}

.csv-split__menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
}

.csv-split__menu a:hover,
.csv-split__menu a:focus-visible {
  background: rgba(225, 6, 0, 0.22);
}

.score-dialog {
  width: min(640px, calc(100% - 32px));
  max-height: min(88vh, 760px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--glass-strong);
  color: #fff;
  box-shadow: var(--shadow);
}

.score-dialog[open] {
  display: flex;
  flex-direction: column;
}

.score-dialog::backdrop {
  background: rgba(5, 5, 5, 0.72);
  backdrop-filter: blur(10px);
}

.score-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.score-dialog__kicker {
  font-family: var(--display);
  letter-spacing: 0.18em;
  color: var(--red-bright);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.score-dialog__head h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.score-dialog__close {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
}

.score-dialog__close:hover,
.score-dialog__close:focus-visible {
  background: rgba(225, 6, 0, 0.22);
  border-color: rgba(225, 6, 0, 0.45);
}

.score-dialog__body {
  padding: 8px 22px 22px;
  overflow: auto;
  max-height: min(68vh, 620px);
}

.score-dialog__lede {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
  margin: 12px 0 8px;
}

.score-explain {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.score-explain:last-child {
  border-bottom: 0;
  padding-bottom: 4px;
}

.score-explain h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.18rem;
  margin-bottom: 8px;
}

.score-explain__letter {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-family: "Changa One", var(--display);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
}

.score-explain p {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
  margin: 0 0 8px;
}

.score-explain p:last-child {
  margin-bottom: 0;
}

.score-explain--goat h3 {
  color: var(--red-bright);
}

.score-dialog__context {
  padding: 16px 0 4px;
  border-top: 1px solid var(--line);
}

.score-dialog__context p {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
  margin: 0 0 10px;
}

.score-dialog__closer {
  color: #fff !important;
}

.score-dialog__closer em {
  font-style: italic;
  color: var(--red-bright);
}

.score-dialog__more {
  width: 100%;
  margin-top: 8px;
}

.player-card {
  display: grid;
  grid-template-columns: 72px 92px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 12px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.player-card:hover {
  transform: translateY(-3px);
  border-color: rgba(225, 6, 0, 0.45);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.player-card.is-top {
  border-color: rgba(225, 6, 0, 0.55);
  box-shadow: 0 0 0 1px rgba(225, 6, 0, 0.2), 0 16px 40px rgba(225, 6, 0, 0.18);
}

.player-rank {
  font-family: var(--display);
  font-size: 2.4rem;
  letter-spacing: 0.04em;
  color: #fff;
  text-align: center;
}

.player-card.is-top .player-rank {
  color: var(--red-bright);
  text-shadow: 0 0 18px var(--red-glow);
}

.player-image {
  width: 92px;
  height: 128px;
  object-fit: cover;
  object-position: top center;
  border-radius: 12px;
  border: 2px solid rgba(225, 6, 0, 0.7);
  background: #111;
}

.player-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.score-container {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
}

.score-item {
  min-width: 64px;
}

.score-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.score-value {
  font-size: 1.05rem;
  font-weight: 700;
}

.g-score { color: #ff6b6b; }
.o-score { color: #ffffff; }
.a-score { color: #ffb3b3; }
.t-score { color: #d1d1d1; }

.goat-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: linear-gradient(180deg, var(--red-bright), var(--red-deep));
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  min-width: 110px;
}

.goat-score .score-label {
  color: rgba(255, 255, 255, 0.85);
}

.goat-score .score-value {
  font-family: var(--display);
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0.04em;
}

/* ---------- Footer / toast ---------- */
.site-footer {
  margin-top: auto;
  padding: 28px 16px 36px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer p {
  margin: 0 auto 8px;
  max-width: 42rem;
}

.site-footer a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--red-bright);
}

.site-footer__legal {
  font-size: 0.75rem;
  line-height: 1.5;
  opacity: 0.88;
}

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: rgba(8, 8, 8, 0.92);
  border: 1px solid var(--line);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  animation: toast-in 0.25s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .player-card {
    grid-template-columns: 56px 84px 1fr;
    grid-template-areas:
      "rank photo info"
      "goat goat goat";
  }

  .player-rank { grid-area: rank; }
  .player-image { grid-area: photo; }
  .player-info { grid-area: info; }

  .goat-score {
    grid-area: goat;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
}

@media (max-width: 768px) {
  :root { --nav-h: 58px; }

  .nav__toggle { display: grid; place-items: center; }

  .nav__title { display: none; }

  .nav__links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    background: var(--glass-strong);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
  }

  .nav.is-open .nav__links { display: flex; }

  .nav__links a,
  .nav__links button {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 14px;
  }

  .nav-drop__menu {
    position: static;
    min-width: 0;
    margin-top: 6px;
    box-shadow: none;
  }

  .rating-group {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .panel { padding: 18px 16px 8px; }

  .submit-button { width: 100%; }
}

@media (max-width: 560px) {
  .wrap { width: min(100% - 20px, var(--max)); padding-top: 16px; }

  .player-card {
    grid-template-columns: 44px 1fr;
    grid-template-areas:
      "rank photo"
      "info info"
      "goat goat";
    gap: 10px;
    padding: 12px;
  }

  .player-image {
    width: 72px;
    height: 100px;
    grid-area: photo;
    justify-self: end;
  }

  .hero__logo-wrap { width: min(240px, 72vw); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Page transitions (Motion + View Transitions) ---------- */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: goat-vt-out 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

::view-transition-new(root) {
  animation: goat-vt-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

html:active-view-transition-type(to-results)::view-transition-old(root) {
  animation: goat-vt-out 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

html:active-view-transition-type(to-results)::view-transition-new(root) {
  animation: goat-vt-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

html:active-view-transition-type(to-home)::view-transition-old(root) {
  animation: goat-vt-down-out 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

html:active-view-transition-type(to-home)::view-transition-new(root) {
  animation: goat-vt-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

::view-transition-group(goat-logo) {
  z-index: 10;
  animation-duration: 0.55s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

::view-transition-old(goat-logo),
::view-transition-new(goat-logo) {
  height: 100%;
  object-fit: contain;
  overflow: clip;
  animation-duration: 0.45s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes goat-vt-out {
  to {
    opacity: 0;
    transform: translateY(-16px) scale(0.985);
    filter: blur(6px);
  }
}

@keyframes goat-vt-in {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.99);
    filter: blur(8px);
  }
}

@keyframes goat-vt-up {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
    filter: blur(8px);
  }
}

@keyframes goat-vt-down-out {
  to {
    opacity: 0;
    transform: translateY(28px) scale(0.985);
    filter: blur(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }

  .hero__logo-wrap {
    view-transition-name: none;
  }
}
