body {
  --ink: #f4fbf6;
  --ink-muted: #d6e8dc;
  --field-deep: #071e18;
  --field-mid: #0b4933;
  --field-light: #16784a;
  background: #071e18;
  color: var(--ink);
  font-family: "Aptos", "Trebuchet MS", sans-serif;
  letter-spacing: 0.01em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% -12%, rgba(255,255,255,0.2), transparent 42%),
    linear-gradient(180deg, rgba(2, 15, 11, 0.72), rgba(3, 20, 14, 0.84)),
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.045) 0,
      rgba(255,255,255,0.045) 2px,
      rgba(0,0,0,0.025) 2px,
      rgba(0,0,0,0.025) 8px
    ),
    repeating-linear-gradient(
      105deg,
      rgba(255,255,255,0.035) 0,
      rgba(255,255,255,0.035) 12%,
      rgba(0,0,0,0.04) 12%,
      rgba(0,0,0,0.04) 24%
    ),
    linear-gradient(135deg, var(--field-light) 0%, var(--field-mid) 48%, var(--field-deep) 100%);
  background-size: cover;
  animation: field-scroll 34s linear infinite;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,0.48) 100%),
    linear-gradient(to right,
      transparent 0,
      transparent 11%,
      rgba(255,255,255,0.14) 11%,
      rgba(255,255,255,0.14) 11.4%,
      transparent 11.5%,
      transparent 88.5%,
      rgba(255,255,255,0.14) 88.5%,
      rgba(255,255,255,0.14) 88.9%,
      transparent 89%,
      transparent 100%),
    linear-gradient(to bottom,
      transparent 0,
      transparent 48%,
      rgba(255,255,255,0.18) 49.5%,
      rgba(255,255,255,0.18) 50.5%,
      transparent 52%,
      transparent 100%);
}

main,
#quarto-header,
#quarto-document-content,
#quarto-margin-sidebar {
  position: relative;
  z-index: 1;
}

#quarto-document-content {
  background: linear-gradient(180deg, rgba(3, 24, 17, 0.5), rgba(3, 18, 13, 0.28));
  border-radius: 18px;
  padding: 1.2rem 1.1rem 0.5rem;
  box-shadow: 0 18px 60px rgba(0,0,0,0.18);
  backdrop-filter: blur(4px);
}

h1, h2, h3, p, li {
  color: var(--ink);
  -webkit-text-stroke: 0.25px rgba(0,0,0,0.8);
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.quarto-title {
  margin-bottom: 0.5rem;
}

.quarto-title .title {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  color: #f2fff8;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.quarto-title-author {
  color: var(--ink-muted);
  -webkit-text-stroke: 0.2px rgba(0,0,0,0.75);
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}

.figure {
  background: rgba(12, 49, 33, 0.46);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 0.5rem;
}

.background-hero {
  margin: 0.8rem 0 1.8rem;
  padding: 0.3rem 0 0.5rem;
}

.background-cover {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: 450px;
  margin: 0.6rem 0 1.6rem;
  overflow: hidden;
  background: #071e18;
}

.background-cover img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 52%;
}

.background-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(3, 17, 12, 0.88) 0%, rgba(3, 17, 12, 0.58) 48%, rgba(3, 17, 12, 0.08) 100%), linear-gradient(0deg, rgba(3, 17, 12, 0.58), transparent 55%);
}

.background-cover-copy {
  max-width: 760px;
  padding: 3rem;
}

.background-cover-kicker {
  margin: 0 0 1rem;
  color: #b6e4c9;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.background-cover h3 {
  max-width: 700px;
  margin: 0 0 1rem;
  color: #fff;
  font-size: 3rem;
  line-height: 1.05;
  text-shadow: 0 2px 18px rgba(0,0,0,0.6);
}

.background-cover-copy > p:not(.background-cover-kicker) {
  max-width: 610px;
  margin: 0 0 1.4rem;
  color: #edf7f1;
  font-size: 1.05rem;
  line-height: 1.6;
  text-shadow: 0 1px 8px rgba(0,0,0,0.7);
}

.background-cover-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #fff;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: #b6e4c9;
  text-underline-offset: 0.3rem;
}

.background-cover-credit {
  position: absolute;
  right: 0.8rem;
  bottom: 0.5rem;
  margin: 0;
  color: #fff;
  font-size: 0.75rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.background-cover-credit a {
  color: inherit;
}

@media (max-width: 680px) {
  .background-cover {
    min-height: 500px;
  }

  .background-cover img {
    object-position: 58% center;
  }

  .background-cover-copy {
    padding: 1.4rem 1.2rem 2.2rem;
  }

  .background-cover h3 {
    font-size: 2.25rem;
  }
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 1rem;
  min-height: 520px;
  padding: 0.7rem 0.3rem 0.2rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(2, 16, 32, 0.94), rgba(5, 26, 58, 0.9));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06), 0 18px 40px rgba(0,0,0,0.28);
  overflow: hidden;
}

.hero-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.12), rgba(0,0,0,0.2)),
    radial-gradient(circle at 50% 15%, rgba(55, 182, 255, 0.55), transparent 20%),
    linear-gradient(180deg, rgba(9, 33, 108, 0.88), rgba(2, 10, 30, 0.96));
  z-index: 0;
}

.hero-card {
  position: relative;
  z-index: 1;
  min-height: 210px;
  padding: 1.1rem 1rem 0.9rem;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(6, 38, 72, 0.8), rgba(2, 16, 32, 0.82));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), transparent 38%, rgba(0,0,0,0.16));
}

.hero-card::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 14%;
  transform: translateX(-50%);
  width: 56%;
  height: 72%;
  border-radius: 34% 34% 16% 16% / 28% 28% 18% 18%;
  background: linear-gradient(180deg, rgba(240,242,247,0.88), rgba(179,186,198,0.8));
  box-shadow: inset 0 -18px 22px rgba(122, 132, 139, 0.25);
  opacity: 0.75;
}

.hero-card.left-top::after,
.hero-card.left-bottom::after {
  background: linear-gradient(180deg, rgba(246,246,248,0.9), rgba(194,205,216,0.82));
}

.hero-card.right-top::after,
.hero-card.right-bottom::after {
  background: linear-gradient(180deg, rgba(233,234,240,0.9), rgba(192,197,209,0.84));
}

.player-name {
  position: relative;
  z-index: 2;
  margin-top: 164px;
  font-size: clamp(1.2rem, 2vw, 2.1rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: #edf8ff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6), 0 0 8px rgba(53,181,255,0.35);
}

.right-align {
  text-align: right;
}

.player-meta {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 0.8rem;
  margin-top: 0.8rem;
  color: #edf8ff;
}

.right-meta {
  text-align: right;
}

.meta-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  font-weight: 800;
  opacity: 0.85;
}

.meta-value {
  display: block;
  margin-top: 0.22rem;
  font-size: clamp(0.9rem, 1.6vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.meta-value.positive {
  color: #7fe3ff;
}

.club-badge {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  z-index: 3;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 900;
  color: #f8fdff;
  background: rgba(255,255,255,0.08);
  border: 3px solid rgba(255,255,255,0.8);
  box-shadow: 0 0 0 4px rgba(14,31,53,0.4);
}

.club-badge.bayern {
  background: radial-gradient(circle at 30% 30%, #f3f9ff, #d4dbe5 38%, #0d1e34 40%, #d71f2a 41%, #0d1e34 78%);
}

.club-badge.frankfurt {
  background: radial-gradient(circle at 30% 30%, #fff4eb, #d0d5e0 38%, #0d1e34 40%, #ea1d2d 41%, #0d1e34 78%);
}

.transfermarkt-brand-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.transfermarkt-brand {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 1.15rem 2.8rem;
  border-radius: 1.3rem;
  background: rgba(246, 248, 250, 0.97);
  box-shadow: 0 8px 24px rgba(0,0,0,0.26);
  transform: rotate(-6deg);
  border: 6px solid rgba(16,30,42,0.9);
}

.transfermarkt-brand::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 110%;
  height: 70%;
  transform: translate(-50%, -50%);
  border-radius: 1rem;
  border: 2px solid rgba(255,255,255,0.7);
  opacity: 0.7;
}

.brand-title {
  position: relative;
  z-index: 1;
  font-size: clamp(2.4rem, 5vw, 6rem);
  line-height: 0.9;
  font-weight: 900;
  letter-spacing: -0.06em;
  color: #0d1b2a;
  text-transform: lowercase;
  text-shadow: 0 2px 0 rgba(255,255,255,0.7);
}

.story-chart-container {
  margin: 1.4rem 0 2rem;
  padding: 0.9rem;
  background: linear-gradient(145deg, rgba(7, 40, 28, 0.8), rgba(4, 23, 17, 0.72));
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.06);
}

.story-chart-container svg {
  display: block;
  width: 100%;
  height: auto;
}

.story-chart-container svg text {
  fill: #edf7f1;
  font-family: "Aptos", "Trebuchet MS", sans-serif;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}

.story-chart-title {
  font-size: 17px;
  font-weight: 700;
}

.story-chart-axis-label,
.story-chart-tick {
  font-size: 10px;
}

.story-chart-grid {
  stroke: rgba(255,255,255,0.12);
  stroke-width: 1;
}

.story-chart-value-line,
.story-chart-cpi-line {
  fill: none;
  stroke-width: 3;
}

.story-chart-value-line {
  stroke: #62c5ff;
}

.story-chart-cpi-line {
  stroke: #f7c948;
}

.story-chart-value-point {
  fill: #62c5ff;
  stroke: #071e18;
  stroke-width: 2;
}

.story-chart-legend-value,
.story-chart-legend-cpi {
  font-size: 11px;
  font-weight: 700;
}

.story-chart-legend-value {
  fill: #62c5ff !important;
}

.story-chart-legend-cpi {
  fill: #f7c948 !important;
}

img {
  border-radius: 8px;
}

.year-selector-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
}

#yearSelect {
  display: inline-block;
  padding: 0.45rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(10, 30, 22, 0.7);
  color: var(--ink);
  font-size: 1rem;
  font-family: inherit;
  -webkit-text-stroke: 0.2px rgba(0,0,0,0.7);
}

.year-selector-row label,
.chart-panel-header,
.chart-panel-header .chart-title,
.chart-panel-header .chart-range,
.top25-table th,
.top25-table td,
#cpiChartContainer text {
  -webkit-text-stroke: 0.25px rgba(0,0,0,0.8);
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}

.year-selector-row label {
  color: var(--ink);
  font-weight: 700;
}

.comparison-controls {
  display: flex;
  justify-content: flex-start;
  margin: 0.5rem 0 1rem;
}

.comparison-play-button {
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(25, 96, 68, 0.9), rgba(11, 35, 26, 0.9));
  color: var(--ink);
  padding: 0.55rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,0.2);
}

.comparison-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.comparison-chart-card {
  min-width: 0;
}

.transfermarkt-vs-cpi-chart-container {
  padding: 0.9rem;
  background: linear-gradient(145deg, rgba(7, 40, 28, 0.8), rgba(4, 23, 17, 0.72));
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.06);
}

.transfermarkt-vs-cpi-chart-container svg {
  display: block;
  width: 100%;
  height: auto;
}

.transfermarkt-intro {
  margin: 0.5rem 0 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(15, 66, 46, 0.56), rgba(10, 31, 22, 0.36));
  color: #f4fbf6;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.6;
  text-shadow: -0.8px -0.8px 0 #000,
    0.8px -0.8px 0 #000,
    -0.8px 0.8px 0 #000,
    0.8px 0.8px 0 #000,
    0 1px 8px rgba(0,0,0,0.7);
  box-shadow: 0 10px 22px rgba(0,0,0,0.15);
}

.top25-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 1.25rem;
  align-items: start;
  margin-top: 0.25rem;
}

#top25TableContainer,
#cpiChartContainer {
  min-width: 0;
}

#top25TableContainer {
  overflow-x: auto;
}

#cpiChartContainer {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 260px;
  padding: 0.8rem 0.9rem 0.9rem;
  background: linear-gradient(145deg, rgba(7, 40, 28, 0.8), rgba(4, 23, 17, 0.72));
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.06);
}

.chart-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  color: #edf7f1;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.chart-panel-header .chart-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.9;
}

.chart-panel-header .chart-range {
  font-size: 0.82rem;
  color: #f7c948;
  font-weight: 700;
}

.top25-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(4, 27, 19, 0.78);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}

.top25-table th,
.top25-table td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: left;
  color: #f1faf5;
}

.top25-table th {
  background: linear-gradient(180deg, rgba(23, 91, 58, 0.9), rgba(12, 60, 39, 0.9));
  font-weight: 700;
}

.top25-table tbody tr:hover {
  background: rgba(255,255,255,0.04);
}

@media (max-width: 900px) {
  .top25-layout {
    grid-template-columns: 1fr;
  }
}

@keyframes field-scroll {
  0% { background-position: 0 0, 0 0, 0 0; }
  100% { background-position: 0 0, 0 160px, 0 100%; }
}

body {
  --ink: #e8eef7;
  --ink-muted: #9eafc3;
  background: #0b1220;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before {
  background:
    radial-gradient(circle at 80% 0%, rgba(46, 157, 185, 0.18), transparent 34%),
    radial-gradient(circle at 8% 18%, rgba(64, 91, 160, 0.16), transparent 30%),
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(145deg, #0e1a2b 0%, #101a2b 54%, #0a111e 100%);
  background-size: auto, auto, 44px 44px, 44px 44px, auto;
  animation: none;
}

body::after {
  background: radial-gradient(ellipse at center, transparent 38%, rgba(3, 7, 14, 0.46) 100%);
}

#quarto-document-content {
  background: rgba(13, 23, 38, 0.76);
  border: 1px solid rgba(159, 183, 211, 0.14);
  border-radius: 12px;
  padding: 1.5rem 1.6rem 0.8rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.22);
  backdrop-filter: blur(10px);
}

h1, h2, h3, p, li {
  color: var(--ink);
  -webkit-text-stroke: 0;
  text-shadow: none;
}

h1, h2, h3 {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-weight: 700;
}

h2 {
  margin-top: 1.8rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(159, 183, 211, 0.16);
}

p, li {
  line-height: 1.7;
}

.quarto-title .title {
  color: #f3f7fc;
  font-size: clamp(2rem, 4vw, 3.1rem);
  letter-spacing: -0.025em;
  text-shadow: none;
}

.quarto-title-author {
  color: var(--ink-muted);
  -webkit-text-stroke: 0;
  text-shadow: none;
}

.panel-tabset .nav-tabs {
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(159, 183, 211, 0.18);
}

.panel-tabset .nav-link {
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: 7px 7px 0 0;
  color: #9eafc3;
  font-weight: 700;
}

.panel-tabset .nav-link:hover {
  color: #e8eef7;
  border-color: rgba(159, 183, 211, 0.14);
  background: rgba(159, 183, 211, 0.06);
}

.panel-tabset .nav-link.active {
  color: #f3f7fc;
  border-color: rgba(99, 194, 222, 0.42) rgba(99, 194, 222, 0.42) #0d1726;
  background: #0d1726;
  box-shadow: inset 0 -2px 0 #63c2de;
}

.figure,
.story-chart-container,
#cpiChartContainer {
  background: rgba(16, 30, 49, 0.82);
  border: 1px solid rgba(159, 183, 211, 0.16);
  border-radius: 9px;
  box-shadow: 0 12px 26px rgba(0,0,0,0.16);
}

.story-chart-container {
  margin-top: 1.2rem;
}

.story-chart-container svg text,
#cpiChartContainer text {
  text-shadow: none;
}

.year-selector-row {
  margin: 1rem 0 1.15rem;
}

#yearSelect {
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(159, 183, 211, 0.26);
  border-radius: 6px;
  background: #111f32;
  color: var(--ink);
  -webkit-text-stroke: 0;
}

.year-selector-row label,
.chart-panel-header,
.chart-panel-header .chart-title,
.chart-panel-header .chart-range,
.top25-table th,
.top25-table td,
#cpiChartContainer text {
  -webkit-text-stroke: 0;
  text-shadow: none;
}

.top25-table {
  background: rgba(11, 21, 35, 0.86);
  border: 1px solid rgba(159, 183, 211, 0.16);
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(0,0,0,0.14);
}

.top25-table th,
.top25-table td {
  padding: 0.65rem 0.75rem;
  border-bottom-color: rgba(159, 183, 211, 0.1);
  color: #dce6f2;
}

.top25-table th {
  background: #172b43;
  color: #f3f7fc;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.top25-table tbody tr:hover {
  background: rgba(99, 194, 222, 0.08);
}

@media (max-width: 600px) {
  #quarto-document-content {
    padding: 1rem 0.85rem 0.5rem;
  }

  .panel-tabset .nav-link {
    padding: 0.55rem 0.75rem;
  }
}
