:root {
  --forest-900: #102a18;
  --forest-800: #193c22;
  --forest-700: #23522f;
  --forest-500: #4f7b3a;
  --leaf-300: #b8d294;
  --leaf-200: #dce9cc;
  --mist: #f3f7ef;
  --paper: #fffdf4;
  --sun: #f4ca54;
  --clay: #9f5c34;
  --water: #5c91a5;
  --ink: #162018;
  --muted: #65725f;
  --shadow: 0 18px 50px rgba(13, 38, 20, 0.22);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  align-items: center;
  background:
    radial-gradient(circle at 15% 18%, rgba(244, 202, 84, 0.18), transparent 28%),
    linear-gradient(145deg, #eef5e8 0%, #d7e7d0 45%, #9faf9d 100%);
  color: var(--ink);
  display: flex;
  justify-content: center;
  min-height: 100svh;
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
  border: 0;
  cursor: pointer;
}

.app-shell {
  aspect-ratio: 9 / 16;
  background:
    linear-gradient(180deg, rgba(247, 252, 241, 0.88), rgba(232, 241, 224, 0.96)),
    var(--mist);
  box-shadow: var(--shadow);
  height: min(100svh, 900px);
  max-height: 100svh;
  max-width: 100vw;
  overflow: hidden;
  position: relative;
  width: min(100vw, 506px);
}

@media (max-width: 520px) {
  body {
    display: block;
  }

  .app-shell {
    box-shadow: none;
    height: 100svh;
    width: 100vw;
  }
}

.view {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  min-height: 0;
}

.cover-screen {
  background: #eef5e8;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.cover-screen::after {
  background: linear-gradient(180deg, rgba(255, 253, 244, 0), rgba(255, 253, 244, 0.84));
  content: "";
  inset: auto 0 0;
  height: 18%;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transition: opacity 520ms ease;
}

.cover-button {
  background: transparent;
  display: block;
  height: 100%;
  margin: 0;
  overflow: hidden;
  padding: 0;
  width: 100%;
}

.cover-button img {
  display: block;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 620ms cubic-bezier(0.22, 1, 0.36, 1), opacity 520ms ease, filter 520ms ease;
  width: 100%;
}

.cover-screen.is-leaving::after {
  opacity: 1;
}

.cover-screen.is-leaving .cover-button img {
  filter: saturate(1.08) brightness(1.06);
  opacity: 0;
  transform: scale(1.045);
}

.topbar {
  background: rgba(247, 252, 241, 0.92);
  border-bottom: 1px solid rgba(16, 42, 24, 0.1);
  display: block;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
  position: relative;
  z-index: 3;
}

.brand {
  line-height: 0.88;
  text-align: center;
}

.brand-button {
  background: transparent;
  color: inherit;
  display: block;
  margin: 0 auto;
  padding: 0;
}

.brand small {
  color: var(--forest-700);
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.brand strong {
  color: var(--forest-900);
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(23px, 7vw, 36px);
  letter-spacing: 0;
}

.header-panel {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  margin-top: 12px;
}

.header-action {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(25, 60, 34, 0.13);
  border-radius: 14px;
  color: var(--forest-800);
  font-size: 12px;
  font-weight: 950;
  min-height: 42px;
  padding: 0 10px;
}

.header-action.danger {
  color: var(--clay);
}

.header-action:disabled {
  opacity: 0.42;
}

.icon-button {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(25, 60, 34, 0.14);
  border-radius: 50%;
  color: var(--forest-800);
  display: inline-grid;
  font-size: 24px;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.icon-button:disabled {
  opacity: 0.35;
}

.setup {
  animation: setup-in 460ms ease both;
  min-height: 0;
  overflow-anchor: none;
  overflow-y: auto;
  padding: 14px 18px calc(env(safe-area-inset-bottom) + 18px);
}

@keyframes setup-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-hole {
  background-position: center top;
  background-size: cover;
  border-radius: 0 0 26px 26px;
  box-shadow: inset 0 -70px 90px rgba(16, 42, 24, 0.2);
  height: 31svh;
  margin: -14px -18px 14px;
  min-height: 218px;
  position: relative;
}

.hero-hole::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 25%, rgba(16, 42, 24, 0.55));
  border-radius: inherit;
  content: "";
  inset: 0;
  position: absolute;
}

.hero-title {
  bottom: 18px;
  color: white;
  left: 18px;
  position: absolute;
  right: 18px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
  z-index: 1;
}

.kicker {
  color: var(--sun);
  display: block;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 10vw, 52px);
  line-height: 0.95;
}

.setup-copy {
  color: var(--forest-900);
  font-size: 17px;
  line-height: 1.38;
  margin: 0 2px 14px;
}

.field-group {
  margin-top: 14px;
}

.field-help {
  color: var(--forest-700);
  font-size: 13px;
  line-height: 1.35;
  margin: 8px 2px 0;
}

.field-label {
  color: var(--forest-800);
  display: block;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.9px;
  margin-bottom: 9px;
  text-transform: uppercase;
}

.segmented {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(25, 60, 34, 0.13);
  border-radius: 16px;
  display: grid;
  gap: 6px;
  padding: 6px;
}

.segmented.three {
  grid-template-columns: repeat(3, 1fr);
}

.segmented.two {
  grid-template-columns: repeat(2, 1fr);
}

.segmented.player-count {
  grid-template-columns: repeat(4, 1fr);
  margin-top: 8px;
}

.segmented button {
  background: transparent;
  border-radius: 12px;
  color: var(--forest-800);
  font-size: 13px;
  font-weight: 850;
  min-height: 44px;
  padding: 8px 6px;
}

.segmented button.is-active {
  background: var(--forest-800);
  color: var(--paper);
  box-shadow: 0 7px 18px rgba(25, 60, 34, 0.24);
}

.player-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 46px;
  margin-bottom: 8px;
}

.player-row input {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(25, 60, 34, 0.16);
  border-radius: 14px;
  color: var(--forest-900);
  min-height: 46px;
  min-width: 0;
  padding: 0 13px;
}

.registry-card {
  background: rgba(255, 253, 244, 0.78);
  border: 1px solid rgba(25, 60, 34, 0.13);
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(16, 42, 24, 0.08);
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 13px;
}

.registry-card p {
  color: var(--forest-900);
  font-size: 14px;
  line-height: 1.34;
}

.registry-grid {
  display: grid;
  gap: 9px;
  grid-template-columns: 1fr 1fr;
}

.registry-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.registry-grid span {
  color: var(--forest-700);
  font-size: 11px;
  font-weight: 900;
}

.registry-grid input {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(25, 60, 34, 0.16);
  border-radius: 13px;
  color: var(--forest-900);
  min-height: 43px;
  min-width: 0;
  padding: 0 11px;
  width: 100%;
}

.registry-wide {
  grid-column: 1 / -1;
}

.registry-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.registry-error {
  background: rgba(159, 92, 52, 0.12);
  border-radius: 12px;
  color: var(--clay);
  display: block;
  font-size: 12px;
  line-height: 1.3;
  padding: 9px 10px;
}

.primary-action,
.secondary-action {
  align-items: center;
  border-radius: 18px;
  display: inline-flex;
  font-weight: 900;
  gap: 9px;
  justify-content: center;
  min-height: 54px;
  padding: 0 18px;
  width: 100%;
}

.primary-action {
  background: var(--forest-800);
  color: white;
  box-shadow: 0 14px 30px rgba(16, 42, 24, 0.28);
}

.secondary-action {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(25, 60, 34, 0.13);
  color: var(--forest-800);
}

.setup-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.hole-stage {
  display: block;
  min-height: 0;
  overflow-anchor: none;
  overflow-y: auto;
  padding-bottom: 86px;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.course-image {
  align-items: start;
  background: #f7faf2;
  border: 0;
  border-bottom: 1px solid rgba(16, 42, 24, 0.1);
  color: inherit;
  cursor: pointer;
  display: flex;
  justify-content: center;
  margin: 0;
  overflow: hidden;
  padding: 0;
  position: relative;
  text-align: left;
  width: 100%;
}

.course-image img {
  display: block;
  height: auto;
  object-fit: contain;
  width: 100%;
}

.image-shade {
  background: linear-gradient(180deg, rgba(16, 42, 24, 0), rgba(16, 42, 24, 0.16));
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.hole-badge {
  background: rgba(255, 253, 244, 0.9);
  border: 1px solid rgba(25, 60, 34, 0.12);
  border-radius: 16px;
  box-shadow: 0 8px 26px rgba(16, 42, 24, 0.16);
  left: 14px;
  padding: 10px 12px;
  position: absolute;
  top: 14px;
  width: 86px;
}

.hole-badge strong {
  color: var(--forest-800);
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 44px;
  line-height: 0.8;
}

.hole-badge span {
  color: var(--forest-500);
  display: block;
  font-size: 12px;
  font-weight: 900;
  margin-top: 7px;
  text-transform: uppercase;
}

.breath-pill {
  align-items: center;
  background: rgba(16, 42, 24, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  bottom: 10px;
  color: white;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  gap: 8px;
  left: 14px;
  max-width: calc(100% - 28px);
  padding: 9px 12px;
  position: absolute;
}

.course-image::before {
  background:
    linear-gradient(315deg, rgba(255, 255, 255, 0) 48%, rgba(255, 253, 244, 0.96) 50%),
    linear-gradient(315deg, rgba(16, 42, 24, 0.18), rgba(255, 255, 255, 0));
  border-top-left-radius: 12px;
  box-shadow: -8px -7px 16px rgba(16, 42, 24, 0.16);
  content: "";
  height: 48px;
  opacity: 0.92;
  position: absolute;
  bottom: 0;
  right: 0;
  transform-origin: 100% 100%;
  transition: transform 280ms ease, opacity 280ms ease;
  width: 48px;
  z-index: 1;
}

.course-image.is-open::before {
  opacity: 0.64;
  transform: rotate(16deg) translate(-4px, -4px);
}

.breath-dot {
  background: var(--sun);
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(244, 202, 84, 0.85);
  display: block;
  height: 10px;
  flex: 0 0 auto;
  width: 10px;
}

.content-panel {
  display: block;
  max-height: 0;
  min-height: auto;
  opacity: 0;
  overflow: hidden;
  padding: 0 14px;
  pointer-events: none;
  position: relative;
  transform: perspective(800px) rotateX(-70deg) translateY(-8px);
  transform-origin: top center;
  transition:
    max-height 360ms ease,
    opacity 220ms ease,
    padding 260ms ease,
    transform 360ms cubic-bezier(0.2, 0.82, 0.2, 1);
}

.content-panel.is-open {
  max-height: 1400px;
  opacity: 1;
  padding: 8px 14px 14px;
  pointer-events: auto;
  transform: perspective(800px) rotateX(0deg) translateY(0);
}

.content-panel.is-open::before {
  background:
    linear-gradient(135deg, rgba(255, 253, 244, 0.94), rgba(255, 253, 244, 0) 62%),
    linear-gradient(135deg, rgba(16, 42, 24, 0.12), rgba(16, 42, 24, 0));
  border-bottom-left-radius: 16px;
  box-shadow: -8px 10px 20px rgba(16, 42, 24, 0.12);
  content: "";
  height: 46px;
  pointer-events: none;
  position: absolute;
  right: 14px;
  top: 0;
  width: 46px;
}

.hole-heading {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
}

.hole-heading h2 {
  color: var(--forest-900);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 5vw, 24px);
  line-height: 1.02;
}

.hole-heading p {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin-top: 3px;
}

.stars {
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  color: var(--clay);
  display: inline-flex;
  font-size: 12px;
  font-weight: 950;
  gap: 6px;
  padding: 6px 9px;
}

.progress-dots {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(12, 1fr);
  margin: 7px 0;
}

.progress-dots span {
  background: rgba(25, 60, 34, 0.18);
  border-radius: 999px;
  height: 5px;
}

.progress-dots span.done {
  background: var(--forest-700);
}

.progress-dots span.current {
  background: var(--sun);
}

.tabs {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 7px;
}

.tabs button {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(25, 60, 34, 0.1);
  border-radius: 13px;
  color: var(--forest-700);
  font-size: 11px;
  font-weight: 900;
  min-height: 32px;
  padding: 0 5px;
}

.tabs button.is-active {
  background: var(--leaf-300);
  color: var(--forest-900);
}

.story-scroll {
  min-height: auto;
  overflow: visible;
  padding-right: 3px;
}

.story-text {
  color: var(--forest-900);
  font-size: 15px;
  line-height: 1.32;
}

.story-text strong {
  color: var(--forest-800);
}

.challenge-list {
  display: grid;
  gap: 8px;
}

.challenge-item {
  background: rgba(255, 255, 255, 0.68);
  border-left: 5px solid var(--forest-500);
  border-radius: 14px;
  padding: 10px 11px;
}

.challenge-item.story-card {
  background: rgba(255, 253, 244, 0.82);
  border-left-color: var(--sun);
}

.challenge-item.is-priority {
  background: rgba(184, 210, 148, 0.42);
  border-left-color: var(--forest-800);
}

.challenge-item small {
  color: var(--forest-700);
  display: block;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.7px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.challenge-item p {
  color: var(--forest-900);
  font-size: 14px;
  line-height: 1.3;
}

.play-panel {
  align-items: center;
  backdrop-filter: blur(14px);
  background: rgba(239, 247, 232, 0.92);
  border-top: 1px solid rgba(16, 42, 24, 0.1);
  bottom: 0;
  box-shadow: 0 -14px 34px rgba(16, 42, 24, 0.12);
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr auto;
  left: 50%;
  margin-top: 0;
  max-width: 506px;
  padding: 10px 14px calc(env(safe-area-inset-bottom) + 10px);
  position: fixed;
  transform: translateX(-50%);
  width: 100vw;
  z-index: 5;
}

.play-panel:has(.multi-score-panel) {
  align-items: stretch;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.score-stepper {
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(25, 60, 34, 0.13);
  border-radius: 16px;
  display: grid;
  gap: 5px;
  grid-template-columns: 38px minmax(48px, 1fr) 38px;
  min-width: 158px;
  padding: 5px;
}

.multi-score-panel {
  display: grid;
  gap: 6px;
  max-height: 132px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.player-score-control {
  align-items: center;
  display: grid;
  gap: 7px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.player-score-control > span {
  color: var(--forest-900);
  font-size: 12px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-score-control.is-ranked > span {
  color: var(--earth);
}

.player-score-control .score-stepper {
  grid-template-columns: 30px 44px 30px;
  min-width: 112px;
  padding: 4px;
}

.player-score-control .score-stepper button {
  border-radius: 10px;
  font-size: 18px;
  height: 30px;
}

.player-score-control .score-value span {
  font-size: 19px;
}

.player-score-control .score-value small {
  display: none;
}

.score-stepper button {
  background: var(--forest-800);
  border-radius: 12px;
  color: white;
  font-size: 22px;
  font-weight: 900;
  height: 36px;
}

.score-value {
  color: var(--forest-900);
  font-weight: 950;
  line-height: 1;
  text-align: center;
}

.score-value span {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.score-value small {
  color: var(--muted);
  display: block;
  font-size: 10px;
  font-weight: 900;
  margin-top: 2px;
  text-transform: uppercase;
}

.complete-button {
  background: var(--sun);
  border-radius: 16px;
  color: var(--forest-900);
  font-weight: 950;
  min-height: 46px;
  padding: 0 14px;
}

.status-button {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(25, 60, 34, 0.13);
  border-radius: 16px;
  color: var(--forest-800);
  font-size: 12px;
  font-weight: 950;
  min-height: 46px;
  padding: 0 10px;
}

.reward,
.finale {
  background:
    radial-gradient(circle at 50% 20%, rgba(244, 202, 84, 0.38), transparent 35%),
    linear-gradient(180deg, var(--forest-800), var(--forest-900));
  color: white;
  display: grid;
  grid-template-rows: 1fr auto;
  height: 100%;
  min-height: 0;
  padding: calc(env(safe-area-inset-top) + 24px) 18px calc(env(safe-area-inset-bottom) + 18px);
}

.reward-body,
.finale-body {
  align-content: center;
  display: grid;
  gap: 17px;
  justify-items: center;
  text-align: center;
}

.oh-orb {
  align-items: center;
  background: radial-gradient(circle, #fff9cf 0%, #f4ca54 52%, #d89136 100%);
  border-radius: 50%;
  box-shadow:
    0 0 42px rgba(244, 202, 84, 0.78),
    inset 0 0 28px rgba(255, 255, 255, 0.6);
  color: var(--forest-900);
  display: grid;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 18vw, 78px);
  font-weight: 950;
  height: 154px;
  justify-items: center;
  line-height: 1;
  width: 154px;
}

.reward h2,
.finale h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 10vw, 52px);
  line-height: 0.94;
}

.reward p,
.finale p {
  color: rgba(255, 255, 255, 0.86);
  font-size: 17px;
  line-height: 1.38;
  max-width: 32ch;
}

.reward .primary-action,
.finale .primary-action {
  background: white;
  color: var(--forest-900);
}

.finale {
  background:
    linear-gradient(180deg, rgba(16, 42, 24, 0.35), rgba(16, 42, 24, 0.86)),
  url("public/assets/hole-12.jpg?v=36") center top / cover;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.finale .finale-body {
  align-content: start;
  padding-bottom: 14px;
}

.diploma {
  background: rgba(255, 253, 244, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 20px;
  color: var(--forest-900);
  padding: 17px;
  width: min(100%, 390px);
}

.diploma small {
  color: var(--forest-700);
  display: block;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.diploma h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  line-height: 1;
}

.diploma-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 15px;
}

.diploma-grid div {
  background: rgba(184, 210, 148, 0.42);
  border-radius: 12px;
  padding: 9px 4px;
}

.diploma-grid strong {
  display: block;
  font-size: 20px;
}

.diploma-grid span {
  color: var(--muted);
  display: block;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.final-scorecard {
  background: rgba(255, 253, 244, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 16px;
  color: var(--forest-900);
  display: grid;
  gap: 8px;
  padding: 10px;
  text-align: left;
  width: min(100%, 430px);
}

.scorecard-title {
  align-items: end;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.scorecard-title small {
  color: var(--forest-700);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.scorecard-title strong {
  color: var(--forest-900);
  font-size: 14px;
  text-transform: uppercase;
}

.scorecard-table-wrap {
  overflow: hidden;
}

.scorecard-table {
  border-collapse: collapse;
  font-size: clamp(8px, 2.25vw, 11px);
  table-layout: fixed;
  width: 100%;
}

.scorecard-table th,
.scorecard-table td {
  border: 1px solid rgba(25, 60, 34, 0.35);
  height: 25px;
  padding: 0;
  text-align: center;
}

.scorecard-table th {
  background: #168a3b;
  color: white;
  font-weight: 950;
}

.scorecard-table th:first-child {
  width: 19%;
}

.scorecard-table td:last-child,
.scorecard-table th:last-child {
  width: 9%;
}

.scorecard-table tbody th {
  padding: 2px 3px;
  text-align: left;
}

.scorecard-table tbody th span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scorecard-table tbody th em {
  color: rgba(255, 255, 255, 0.82);
  display: none;
  font-size: 8px;
  font-style: normal;
  margin-top: 1px;
  text-transform: uppercase;
}

.scorecard-table td {
  background: rgba(255, 255, 255, 0.82);
  color: var(--forest-900);
  font-weight: 850;
}

.scorecard-table td:not(:last-child),
.scorecard-table th:not(:first-child):not(:last-child) {
  width: 6%;
}

.scorecard-table .scorecard-par-row td {
  background: rgba(239, 247, 232, 0.96);
}

.final-scorecard p {
  color: var(--forest-700);
  font-size: 10px;
  line-height: 1.3;
  max-width: none;
}

.viral-card {
  background: rgba(255, 253, 244, 0.88);
  border: 1px solid rgba(25, 60, 34, 0.11);
  border-radius: 18px;
  color: var(--forest-900);
  display: grid;
  gap: 9px;
  margin-top: 14px;
  padding: 14px;
}

.final-viral-card {
  background: rgba(255, 253, 244, 0.95);
  margin-top: 0;
  text-align: left;
  width: min(100%, 430px);
}

.viral-card h2,
.viral-card h3 {
  color: var(--forest-900);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  line-height: 1;
}

.viral-card p {
  color: var(--forest-700);
  font-size: 13px;
  line-height: 1.35;
  max-width: none;
}

.viral-card small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.viral-actions {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(2, 1fr);
}

.viral-actions button {
  background: var(--forest-800);
  border-radius: 13px;
  color: white;
  font-size: 12px;
  font-weight: 950;
  min-height: 42px;
  padding: 0 8px;
}

.viral-actions button:nth-child(2) {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(25, 60, 34, 0.12);
  color: var(--forest-800);
}

.final-viral-card .viral-actions {
  grid-template-columns: 1fr 1fr;
}

.final-viral-card .viral-actions button:nth-child(1) {
  background: var(--sun);
  color: var(--forest-900);
}

.final-viral-card .viral-actions button:nth-child(2) {
  background: var(--forest-800);
  color: white;
}

.final-viral-card .viral-actions button:nth-child(3),
.final-viral-card .viral-actions button:nth-child(4) {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(25, 60, 34, 0.12);
  color: var(--forest-800);
}

.selfie-booth {
  align-items: center;
  background: rgba(16, 42, 24, 0.78);
  display: grid;
  inset: 0;
  padding: 16px;
  position: absolute;
  z-index: 20;
}

.selfie-panel {
  background: var(--paper);
  border-radius: 20px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.35);
  color: var(--forest-900);
  display: grid;
  gap: 12px;
  max-height: calc(100svh - 32px);
  min-height: 0;
  overflow: hidden;
  padding: 13px;
}

.selfie-header {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
}

.selfie-header h3 {
  color: var(--forest-900);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  line-height: 1;
}

.selfie-stage {
  aspect-ratio: 4 / 5;
  background: var(--forest-900);
  border-radius: 18px;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.selfie-video,
.selfie-preview {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.selfie-video[hidden],
.selfie-preview[hidden] {
  display: none;
}

.selfie-video {
  transform: scaleX(-1);
}

.selfie-badge {
  background: linear-gradient(180deg, rgba(16, 42, 24, 0), rgba(16, 42, 24, 0.92));
  bottom: 0;
  color: white;
  left: 0;
  padding: 74px 16px 16px;
  position: absolute;
  right: 0;
}

.selfie-badge strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selfie-badge span {
  color: var(--sun);
  display: block;
  font-size: 12px;
  font-weight: 950;
  margin-top: 7px;
  text-transform: uppercase;
}

.selfie-error {
  color: white;
  font-size: 15px;
  font-weight: 850;
  left: 18px;
  line-height: 1.35;
  position: absolute;
  right: 18px;
  text-align: center;
  top: 44%;
}

.selfie-actions {
  display: grid;
  gap: 9px;
  grid-template-columns: 1fr 1fr;
}

.selfie-actions .primary-action {
  grid-column: 1 / -1;
}

.selfie-actions button[hidden] {
  display: none;
}

.selfie-actions button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.closing-card {
  background:
    linear-gradient(180deg, rgba(255, 253, 244, 0.96), rgba(239, 247, 232, 0.96));
  border: 1px solid rgba(25, 60, 34, 0.12);
  border-radius: 20px;
  box-shadow: 0 18px 36px rgba(16, 42, 24, 0.1);
  color: var(--forest-900);
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 18px 16px;
  text-align: center;
}

.closing-card h2 {
  color: var(--forest-900);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1;
}

.closing-card p {
  color: var(--forest-700);
  font-size: 14px;
  line-height: 1.4;
}

.closing-card .primary-action {
  margin-top: 4px;
}

.wake-word {
  color: var(--sun);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 950;
}

.leaderboard-shell {
  background:
    linear-gradient(180deg, rgba(247, 252, 241, 0.94), rgba(227, 239, 219, 0.96)),
    var(--mist);
}

.leaderboard-page {
  height: 100%;
  overflow-y: auto;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 18px);
  -webkit-overflow-scrolling: touch;
}

.leaderboard-hero {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.leaderboard-hero h1 {
  color: var(--forest-900);
  font-size: clamp(34px, 11vw, 52px);
}

.leaderboard-hero p {
  color: var(--forest-700);
  font-size: 15px;
  line-height: 1.34;
  margin-top: 8px;
}

.leaderboard-tabs {
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(25, 60, 34, 0.12);
  border-radius: 16px;
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 18px;
  padding: 5px;
}

.leaderboard-tabs button {
  background: transparent;
  border-radius: 12px;
  color: var(--forest-800);
  font-size: 12px;
  font-weight: 950;
  min-height: 40px;
}

.leaderboard-tabs button.is-active {
  background: var(--forest-800);
  color: white;
}

.leaderboard-summary {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 14px;
}

.leaderboard-summary article {
  background: rgba(255, 253, 244, 0.84);
  border: 1px solid rgba(25, 60, 34, 0.1);
  border-radius: 14px;
  padding: 11px 8px;
  text-align: center;
}

.leaderboard-summary span,
.leaderboard-player span {
  color: var(--muted);
  display: block;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.leaderboard-summary strong {
  color: var(--forest-900);
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  margin-top: 3px;
}

.leaderboard-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.leaderboard-sync-note {
  background: rgba(244, 202, 84, 0.22);
  border-radius: 13px;
  color: var(--forest-800);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
  margin-top: 12px;
  padding: 10px 12px;
}

.leaderboard-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(25, 60, 34, 0.1);
  border-radius: 15px;
  display: grid;
  gap: 10px;
  grid-template-columns: 38px 1fr auto;
  padding: 10px;
}

.leaderboard-row.is-current {
  background: rgba(244, 202, 84, 0.28);
  border-color: rgba(159, 92, 52, 0.28);
}

.rank {
  align-items: center;
  background: var(--forest-800);
  border-radius: 50%;
  color: white;
  display: grid;
  font-weight: 950;
  height: 34px;
  justify-items: center;
  width: 34px;
}

.leaderboard-player {
  min-width: 0;
}

.leaderboard-player strong {
  color: var(--forest-900);
  display: block;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-score {
  color: var(--forest-900);
  text-align: right;
}

.leaderboard-score strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
}

.empty-leaderboard {
  background: rgba(255, 253, 244, 0.82);
  border: 1px dashed rgba(25, 60, 34, 0.24);
  border-radius: 18px;
  padding: 20px;
  text-align: center;
}

.empty-leaderboard strong {
  color: var(--forest-900);
}

.empty-leaderboard p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  margin-top: 8px;
}

.tv-body {
  background:
    linear-gradient(105deg, rgba(16, 42, 24, 0.96), rgba(25, 60, 34, 0.88)),
    url("public/assets/cover-app.jpg?v=42") center / cover;
  display: block;
  min-height: 100vh;
  overflow: hidden;
}

.tv-leaderboard-shell {
  color: white;
  height: 100vh;
  width: 100vw;
}

.tv-board {
  background:
    linear-gradient(90deg, rgba(16, 42, 24, 0.95), rgba(16, 42, 24, 0.76) 58%, rgba(255, 253, 244, 0.96) 58%),
    rgba(16, 42, 24, 0.88);
  display: grid;
  gap: 0;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 28vw);
  height: 100%;
  overflow: hidden;
}

.tv-board-main {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-width: 0;
  padding: 5.2vh 4.6vw 4.2vh;
}

.tv-header {
  align-items: start;
  display: flex;
  justify-content: space-between;
  gap: 32px;
}

.tv-kicker {
  color: var(--sun);
  display: block;
  font-size: clamp(17px, 1.35vw, 26px);
  font-weight: 950;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.tv-header h1 {
  color: white;
  font-size: clamp(78px, 7.8vw, 154px);
  line-height: 0.88;
  margin-top: 0.8vh;
}

.tv-period {
  background: rgba(255, 253, 244, 0.12);
  border: 1px solid rgba(255, 253, 244, 0.2);
  border-radius: 999px;
  color: var(--paper);
  flex: 0 0 auto;
  font-size: clamp(22px, 1.8vw, 36px);
  font-weight: 950;
  padding: 18px 28px;
}

.tv-highlight {
  align-items: center;
  background: rgba(255, 253, 244, 0.1);
  border: 1px solid rgba(255, 253, 244, 0.16);
  border-radius: 8px;
  display: grid;
  gap: 24px;
  grid-template-columns: auto auto 1fr;
  margin-top: 3.2vh;
  padding: 20px 26px;
}

.tv-highlight span {
  color: var(--leaf-200);
  font-size: clamp(17px, 1.25vw, 24px);
  font-weight: 900;
  text-transform: uppercase;
}

.tv-highlight strong {
  color: var(--sun);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(56px, 4.5vw, 92px);
  line-height: 0.9;
}

.tv-highlight em {
  color: white;
  font-size: clamp(26px, 2.1vw, 42px);
  font-style: normal;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-list {
  align-content: start;
  display: grid;
  gap: 1.25vh;
  margin-top: 3.2vh;
  min-height: 0;
}

.tv-row {
  align-items: center;
  background: rgba(255, 253, 244, 0.94);
  border: 1px solid rgba(255, 253, 244, 0.22);
  border-radius: 8px;
  color: var(--forest-900);
  display: grid;
  gap: 24px;
  grid-template-columns: 82px minmax(0, 1fr) 124px;
  min-height: clamp(72px, 7.4vh, 104px);
  padding: 14px 22px;
}

.tv-row.is-leader {
  background: linear-gradient(90deg, #f9dc78, #fff6cc);
}

.tv-row.is-loading {
  opacity: 0.7;
}

.tv-rank {
  align-items: center;
  background: var(--forest-800);
  border-radius: 50%;
  color: white;
  display: grid;
  font-size: clamp(24px, 2vw, 38px);
  font-weight: 950;
  height: clamp(54px, 5.1vw, 74px);
  justify-items: center;
  width: clamp(54px, 5.1vw, 74px);
}

.tv-player {
  min-width: 0;
}

.tv-player strong {
  color: var(--forest-900);
  display: block;
  font-size: clamp(28px, 2.45vw, 48px);
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-player span {
  color: var(--forest-700);
  display: block;
  font-size: clamp(15px, 1.2vw, 22px);
  font-weight: 900;
  margin-top: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.tv-score {
  color: var(--forest-900);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 4.3vw, 82px);
  font-weight: 950;
  line-height: 0.9;
  text-align: right;
}

.tv-empty {
  background: rgba(255, 253, 244, 0.94);
  border-radius: 8px;
  color: var(--forest-900);
  display: grid;
  gap: 12px;
  padding: 4vh 3vw;
  text-align: center;
}

.tv-empty strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 4vw, 78px);
}

.tv-empty span {
  color: var(--forest-700);
  font-size: clamp(22px, 2vw, 36px);
  font-weight: 850;
}

.tv-footer {
  align-items: center;
  color: rgba(255, 253, 244, 0.74);
  display: flex;
  font-size: clamp(15px, 1.15vw, 22px);
  font-weight: 850;
  justify-content: space-between;
  gap: 24px;
  margin-top: 2.2vh;
}

.tv-join-panel {
  align-content: center;
  color: var(--forest-900);
  display: grid;
  gap: 3vh;
  justify-items: center;
  padding: 5vh 3vw;
  text-align: center;
}

.tv-qr-wrap {
  background: white;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(16, 42, 24, 0.22);
  padding: clamp(16px, 1.6vw, 28px);
  width: min(72%, 420px);
}

.tv-qr-wrap img {
  display: block;
  height: auto;
  width: 100%;
}

.tv-join-panel h2 {
  color: var(--forest-900);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 4vw, 82px);
  line-height: 0.94;
  margin-top: 10px;
}

.tv-join-panel p {
  color: var(--forest-700);
  font-size: clamp(21px, 1.75vw, 34px);
  font-weight: 850;
  line-height: 1.18;
  margin-top: 18px;
}

.tv-join-panel small {
  color: var(--muted);
  display: block;
  font-size: clamp(12px, 0.82vw, 16px);
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

@media (max-aspect-ratio: 4 / 3) {
  .tv-board {
    grid-template-columns: 1fr;
  }

  .tv-join-panel {
    display: none;
  }
}

.sr-only {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

@media (max-height: 720px) {
  .hole-stage {
    display: block;
  }

  .story-text {
    font-size: 15px;
  }

  .challenge-item p {
    font-size: 14px;
  }

  .play-panel {
    grid-template-columns: 1fr 1fr;
  }

  .status-button {
    display: none;
  }
}

.public-setup .hero-hole {
  min-height: 196px;
}

.public-setup .segmented button:disabled,
.public-setup .secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.team-name-row {
  grid-template-columns: 1fr;
}

.public-hole-stage {
  display: grid;
  grid-template-rows: minmax(320px, 1fr) auto auto;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: calc(env(safe-area-inset-bottom) + 14px);
}

.public-hole-stage.is-multi-player {
  grid-template-rows: minmax(170px, 28svh) auto auto;
}

.public-hole-stage.is-multi-player .public-hole-panel {
  gap: 7px;
  padding: 8px 14px 2px;
}

.public-hole-stage.is-multi-player .hole-heading h2 {
  font-size: clamp(28px, 8vw, 34px);
}

.public-hole-stage.is-multi-player .hole-heading p {
  font-size: 14px;
}

.public-hole-stage.is-multi-player .public-multi-score {
  gap: 5px;
}

.public-hole-stage.is-multi-player .public-multi-score .player-score-control {
  border-radius: 12px;
  padding: 4px 7px;
}

.public-hole-stage.is-multi-player .player-score-control > span {
  font-size: 13px;
}

.public-hole-stage.is-multi-player .player-score-control .score-stepper {
  gap: 3px;
  min-width: 106px;
  padding: 3px;
}

.public-hole-stage.is-multi-player .player-score-control .score-stepper button {
  height: 28px;
}

.public-hole-stage.is-multi-player .player-score-control .score-value span {
  font-size: 18px;
}

.public-course-image {
  align-items: center;
  cursor: default;
  height: 100%;
  max-height: none;
  min-height: 0;
}

.public-course-image::before {
  display: none;
}

.public-course-image img {
  height: 100%;
  max-height: none;
  object-fit: contain;
  width: 100%;
}

.public-hole-panel {
  display: grid;
  gap: 11px;
  padding: 12px 16px 4px;
}

.hole-par {
  background: var(--sun);
  border-radius: 999px;
  color: var(--forest-900);
  font-size: 13px;
  padding: 8px 11px;
  white-space: nowrap;
}

.public-score-block {
  background: rgba(255, 253, 244, 0.84);
  border: 1px solid rgba(25, 60, 34, 0.12);
  border-radius: 18px;
  display: grid;
  gap: 10px;
  padding: 13px;
}

.public-score-block > span {
  color: var(--forest-900);
  font-size: 15px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-score-block .score-stepper {
  min-width: 0;
  width: 100%;
}

.public-multi-score {
  max-height: none;
  overflow: visible;
}

.public-multi-score .player-score-control {
  background: rgba(255, 253, 244, 0.84);
  border: 1px solid rgba(25, 60, 34, 0.12);
  border-radius: 16px;
  padding: 8px;
}

.public-hole-actions {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 0.8fr 1.2fr;
  margin-top: auto;
  padding: 8px 16px 0;
}

.public-hole-actions .secondary-action,
.public-hole-actions .complete-button {
  min-height: 54px;
  width: 100%;
}

.public-hole-stage.is-multi-player .public-hole-actions {
  gap: 8px;
  padding: 6px 14px 0;
}

.public-hole-stage.is-multi-player .public-hole-actions .secondary-action,
.public-hole-stage.is-multi-player .public-hole-actions .complete-button {
  min-height: 48px;
}

.public-hole-actions .secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.public-finale {
  background:
    linear-gradient(180deg, rgba(16, 42, 24, 0.32), rgba(16, 42, 24, 0.9)),
    url("public/assets/hole-12.jpg?v=36") center top / cover;
}

.round-ranking {
  background: rgba(255, 253, 244, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 18px;
  color: var(--forest-900);
  display: grid;
  gap: 8px;
  padding: 13px;
  text-align: left;
  width: min(100%, 430px);
}

.round-rank-row {
  align-items: center;
  background: rgba(239, 247, 232, 0.82);
  border-radius: 13px;
  display: grid;
  gap: 9px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  min-height: 42px;
  padding: 6px 9px;
}

.round-rank-row.is-winner {
  background: rgba(244, 202, 84, 0.42);
}

.round-rank-row strong {
  align-items: center;
  background: var(--forest-800);
  border-radius: 50%;
  color: white;
  display: grid;
  height: 28px;
  justify-items: center;
  width: 28px;
}

.round-rank-row span {
  font-size: 14px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-rank-row em {
  color: var(--forest-700);
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
}

.scorecard-date {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.public-finale .setup-actions {
  background: rgba(16, 42, 24, 0.72);
  border-radius: 18px;
  padding: 10px;
}

.public-finale .secondary-action {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: white;
}

@media (max-width: 380px) {
  .public-hole-actions {
    grid-template-columns: 1fr;
  }

  .viral-actions {
    grid-template-columns: 1fr;
  }
}

/* Information e-mail et refus en un lien : discret, sans case a cocher */
.registry-card .consent-row {
  margin: 2px 0 0;
  font-size: 11.5px;
  line-height: 1.4;
  opacity: 0.74;
}
.consent-link {
  appearance: none;
  background: none;
  border: 0;
  padding: 4px 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
