:root {
  --ink: #0f172a;
  --ink-soft: #475569;
  --bg: #f5f2ea;
  --bg-2: #fefcf7;
  --surface-1: #ffffff;
  --surface-2: #f2efe6;
  --accent: #ff6b4a;
  --accent-deep: #d94e36;
  --mint: #26b39a;
  --line: rgba(15, 23, 42, 0.12);
  --shadow: rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none;
}

body.alt-zen {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(1200px 700px at 10% -10%, #fff4d9 0%, #f4efe4 55%, #efe7da 100%);
  font-family: "Plus Jakarta Sans", "Sora", "Helvetica Neue", sans-serif;
  letter-spacing: 0.01em;
}

.paper-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 107, 74, 0.12), transparent 50%),
    radial-gradient(circle at 10% 80%, rgba(38, 179, 154, 0.12), transparent 55%),
    repeating-linear-gradient(135deg, rgba(15, 23, 42, 0.04) 0 1px, rgba(0, 0, 0, 0) 1px 6px);
  opacity: 0.9;
  pointer-events: none;
  z-index: -1;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.mast {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 28px 32px;
  border: 1px solid var(--line);
  background: linear-gradient(130deg, #ffffff 0%, #fff8ef 100%);
  box-shadow: 0 24px 50px var(--shadow);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  animation: float-in 0.7s ease-out both;
}

.mast::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -60px;
  top: -80px;
  background: radial-gradient(circle, rgba(255, 107, 74, 0.22), transparent 70%);
  pointer-events: none;
}

.title-block h1 {
  /* margin: 8px 0 6px; */
  font-family: "Fraunces", "Georgia", serif;
  font-weight: 600;
  font-size: clamp(34px, 4vw, 52px);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  color: var(--accent);
}

.deck {
  margin: 0;
  color: var(--ink-soft);
  max-width: 40ch;
}

.content {
  /* margin-top: 28px; */
  display: grid;
  gap: 28px;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
}

#scores {
  min-width: 0;
  display: grid;
  gap: 28px;
}

.panel {
  position: relative;
  padding: 28px 28px 32px;
  border-radius: 24px;
  background: var(--surface-1);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
  min-width: 0;
  width: 100%;
}

.linescore-panel {
  width: 100%;
  overflow-x: auto;
  min-width: 0;
}

.golf-ball-overlay {
  position: absolute;
  inset: 18px 20px auto auto;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle at 30% 30%, rgba(15, 23, 42, 0.05), transparent 55%);
  border-radius: 50%;
  opacity: 0.6;
  pointer-events: none;
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  /* table-layout: fixed; */
}

.styled-table thead th {
  text-align: left;
  color: var(--ink-soft);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.styled-table tbody td {
  padding: 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

/* .styled-table th,
.styled-table td {
  overflow-wrap: anywhere;
} */

.styled-table tbody tr:nth-child(odd) {
  background: rgba(255, 107, 74, 0.04);
}

.styled-table tbody tr:hover {
  background: rgba(38, 179, 154, 0.08);
}

.styled-table tbody tr:nth-child(1) {
  background: rgba(38, 179, 154, 0.18);
  font-weight: 600;
}

.styled-table tbody tr:nth-child(2) {
  background: rgba(38, 179, 154, 0.12);
  font-weight: 550;
}

.styled-table tbody tr:nth-child(3) {
  background: rgba(255, 107, 74, 0.08);
  color: var(--ink);
}

.styled-table tbody tr:nth-child(4) {
  background: rgba(255, 107, 74, 0.04);
  color: var(--ink-soft);
}

.styled-table tbody tr:nth-child(5) {
  background: rgba(15, 23, 42, 0.06);
  color: var(--ink-soft);
  font-weight: 500;
}

.playerbars {
  margin-top: 28px;
  font-family: "Sora", "Plus Jakarta Sans", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.drop-down-bar-chart {
  margin-top: 16px;
  max-width: 100%;
  overflow-x: hidden;
}

.chart-container {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.player-selection {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.player-button {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: var(--surface-2);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.player-button.selected {
  background: var(--accent);
  color: #ffffff;
  border-color: transparent;
}

.chart.hidden {
  display: none;
}

.chart.visible {
  display: block;
}

.linescore-container {
  display: none;
}

.linescore-container.visible {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.75rem;
  align-items: start;
}

.linescore-table {
  width: max-content;
  flex: 0 0 auto;
  border-collapse: collapse;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.linescore-table th,
.linescore-table td {
  padding: 0.25rem 0.25rem;
  text-align: left;
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
  font-size: 0.55rem;
}

.linescore-table thead th {
  background: #28c7a7;
  color: #ffffff;
}

.linescore-round-button.selected {
  border: 1px solid #ffffff;
  background: #ffffff;
  color: #0f766e;
  /* padding: 4px 8px; */
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.linescore-round-button {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  font-size: 11px;
}

.score-shape-birdie,
.score-shape-eagle,
.score-shape-albatross,
.score-shape-condor,
.score-shape-doublecondor,
.score-shape-bogey,
.score-shape-doublebogey,
.score-shape-triplebogey,
.score-shape-quadruplebogey,
.score-shape-quintuplebogey,
.score-shape-sextuplebogey,
.score-shape-septuplebogey,
.score-shape-octuplebogey,
.score-shape-nonuplebogey,
.score-shape-dodecuplebogey {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
}

.score-shape-birdie,
.score-shape-eagle,
.score-shape-albatross,
.score-shape-condor,
.score-shape-doublecondor {
  background: #d5f1e6;
  border: 1px solid #68bda2;
  border-radius: 50%;
  color: #0f513f;
}

.score-shape-eagle,
.score-shape-albatross,
.score-shape-condor,
.score-shape-doublecondor {
  border-width: 2px;
  box-shadow: inset 0 0 0 1px #ecfbf5;
}

.score-shape-bogey,
.score-shape-doublebogey,
.score-shape-triplebogey,
.score-shape-quadruplebogey,
.score-shape-quintuplebogey,
.score-shape-sextuplebogey,
.score-shape-septuplebogey,
.score-shape-octuplebogey,
.score-shape-nonuplebogey,
.score-shape-dodecuplebogey {
  background: #ffd8cf;
  border: 1px solid #e07864;
  border-radius: 3px;
  color: #7a2618;
}

.score-shape-doublebogey,
.score-shape-triplebogey,
.score-shape-quadruplebogey,
.score-shape-quintuplebogey,
.score-shape-sextuplebogey,
.score-shape-septuplebogey,
.score-shape-octuplebogey,
.score-shape-nonuplebogey,
.score-shape-dodecuplebogey {
  border-width: 2px;
  box-shadow: inset 0 0 0 1px #fff2ee;
}

.score-shape-par {
  display: inline-block;
  min-width: 1.35rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--ink-soft);
  font-weight: 600;
  text-align: center;
}

.golfer-bar-container {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  min-width: 0;
}

.golfer-label {
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-align: right;
  width: 16ch;
  padding-right: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
}

.bar-row {
  flex: 1;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 8px;
  min-width: 0;
  max-width: 100%;
}

.progress-bar {
  position: relative;
  height: 26px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  min-width: 0;
}

.centerline.horizontal-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  height: 100%;
  background: rgba(15, 23, 42, 0.1);
  left: 50%;
  transform: translateX(-50%);
}

.vertical-line {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.06), transparent 40%, transparent 60%, rgba(15, 23, 42, 0.06));
}

.bar {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-right: 6px;
  padding-left: 6px;
  font-size: 0.7rem;
  font-weight: 400;
  color: #0f172a;
}

.bar.negative {
  background: linear-gradient(90deg, #28c7a7, #1f9f85);
  color: #ffffff;
}

.bar.positive {
  background: linear-gradient(90deg, #ff9f6e, #ff6b4a);
  color: #ffffff;
}

.bar.zero {
  background: #cbd5e1;
  color: #0f172a;
  justify-content: center;
  padding-right: 0;
}

.bar-text {
  position: relative;
  z-index: 1;
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .mast {
    padding: 20px 20px;
  }

  /* .panel {
    padding: 22px 18px 24px;
  } */

  .golfer-bar-container {
    grid-template-columns: 1fr;
  }

  .styled-table {
    font-size: 0.65rem;
    letter-spacing: 0.06em;
  }

  /* .styled-table thead th,
  .styled-table tbody td {
    padding: 8px 8px;
  } */

  .playerbars {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
  }

  .player-selection {
    gap: 8px;
  }

  .player-button {
    font-size: 0.7rem;
    padding: 5px 10px;
    letter-spacing: 0.1em;
  }


  .golfer-label {
    /* width: min(12ch, 35vw); */
    font-size: 0.8rem;
  }

  .bar-row {
    padding: 6px;
  }

  .bar {
    font-size: 0.6rem;
  }
}
