/* ============================================================
   Los Moriscos · Tarjeta Digital
   Paleta oficial terracota + ocre
   ============================================================ */

:root {
  --terracota:        #A84A15;
  --terracota-dark:   #8B3A0F;
  --terracota-soft:   #C25A22;
  --ocre:             #8D7E56;
  --ocre-light:       #B8AB87;
  --bg:               #F7F7F7;
  --card:             #FFFFFF;
  --ink:              #1a1a1a;
  --ink-soft:         #4a4a4a;
  --ink-mute:         #7a7a7a;
  --border:           #E5E1D8;
  --border-strong:    #D6D0C2;
  --shadow-sm: 0 1px 2px rgba(20,15,8,.04), 0 1px 3px rgba(20,15,8,.06);
  --shadow-md: 0 4px 12px rgba(20,15,8,.06), 0 2px 4px rgba(20,15,8,.04);
  --shadow-lg: 0 10px 28px rgba(20,15,8,.10), 0 4px 10px rgba(20,15,8,.06);
  --radius-sm: 10px;
  --radius:    14px;
  --radius-lg: 18px;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); }
body { min-height: 100vh; line-height: 1.45; -webkit-font-smoothing: antialiased; }

/* App shell, mobile-first centered on desktop */
.app {
  max-width: 480px;
  margin: 0 auto;
  /* dvh en iOS 16+ respeta la barra de gestos; vh como fallback en navegadores antiguos */
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  /* No cortamos: si en iPhones muy pequeños el contenido excede la
     pantalla, dejamos que el navegador haga scroll nativo en vez de
     ocultar bajo la barra de gestos. */
  /* visible: permite que la barra de navegación "sticky" funcione en todos los navegadores */
  overflow: visible;
}

/* ---------- Screens ---------- */
.screen {
  display: none;
  /* Bottom padding = 80px + safe-area-inset-bottom (barra de gestos iPhone) */
  padding: 12px 16px calc(80px + env(safe-area-inset-bottom, 0px));
  animation: fadeUp .35s ease both;
}
/* La pantalla de juego del hoyo lleva un padding aún más compacto
   arriba y abajo para maximizar el espacio visible en móvil */
#screen-hole {
  padding: 8px 14px calc(80px + env(safe-area-inset-bottom, 0px));
}
.screen.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Typography ---------- */
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: 28px; line-height: 1.15; margin: 0 0 6px; }
h2 { font-size: 22px; line-height: 1.2;  margin: 0 0 8px; }
h3 { font-size: 17px; line-height: 1.25; margin: 0 0 6px; }
.muted { color: var(--ink-mute); font-size: 13px; }
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--terracota);
  font-weight: 600;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform .12s ease, background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
  text-decoration: none;
}
.btn:active { transform: scale(.985); }
.btn-primary {
  background: var(--terracota); color: #fff;
  box-shadow: 0 4px 14px rgba(168,74,21,.28);
}
.btn-primary:hover { background: var(--terracota-dark); }
.btn-secondary {
  background: #fff; color: var(--terracota); border-color: var(--terracota);
}
.btn-secondary:hover { background: #FFF4EE; }
.btn-ghost {
  background: transparent; color: var(--ink-soft); border-color: var(--border-strong);
}
.btn-ghost:hover { background: #fff; }
.btn[disabled] { opacity: .35; cursor: not-allowed; }

.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row .btn { flex: 1; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}

/* ============================================================
   SCREEN 1 · Splash / Home
   ============================================================ */
#screen-home { padding-top: 40px; text-align: center; min-height: 100vh; display: none; flex-direction: column; }
#screen-home.active { display: flex; }

.splash-logo {
  /* Limitamos el logo a ≤ resolución nativa/densidad para evitar
     sobre-escalado (que sería la causa del emborronado en Retina). */
  width: 58%;
  max-width: 240px;
  height: auto;
  margin: 36px auto 18px;
  display: block;

  /* Renderizado nítido en pantallas HiDPI */
  image-rendering: -webkit-optimize-contrast;

  /* Evitar difuminado del navegador al escalar */
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;

  /* Realce sutil de contraste (los contornos negros del logo se ven más
     definidos sin alterar los colores terracota/ocre de la marca). */
  filter: contrast(1.05) saturate(1.02);
}
.splash-title {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  color: var(--terracota);
  letter-spacing: .02em;
  margin: 6px 0 4px;
}
.splash-tagline {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 36px;
  padding: 0 24px;
}
.splash-actions {
  margin-top: auto;
  padding: 0 4px 28px;
}
.splash-actions .btn { margin-bottom: 10px; }
.splash-footer {
  font-size: 11.5px;
  color: var(--ink-mute);
  letter-spacing: .04em;
  padding-bottom: 12px;
}

/* ============================================================
   SCREEN 2 · Setup jugadores
   ============================================================ */
.setup-header { margin-bottom: 18px; }
.player-count {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 8px 0 22px;
}
.pc-btn {
  height: 56px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border-strong);
  background: #fff;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all .15s ease;
}
.pc-btn:hover { border-color: var(--terracota); }
.pc-btn.selected {
  background: var(--terracota); color: #fff; border-color: var(--terracota);
  box-shadow: 0 4px 12px rgba(168,74,21,.25);
}
.player-form { display: grid; gap: 12px; }
.player-form .form-row {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 10px;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-mute);
}
.field input {
  font-family: var(--sans); font-size: 15px;
  height: 46px; padding: 0 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff; color: var(--ink);
  transition: border-color .15s ease;
  width: 100%;
}
.field input:focus { outline: none; border-color: var(--terracota); }

.tee-toggle {
  display: inline-flex; gap: 6px; margin-top: 8px;
  background: #F1ECE1; border-radius: 999px; padding: 4px;
}
.tee-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  letter-spacing: .02em; color: var(--ink-soft);
  cursor: pointer; border: 0; background: transparent;
  transition: all .15s ease;
}
.tee-pill .dot {
  width: 10px; height: 10px; border-radius: 999px;
  border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.18);
}
.tee-pill[data-tee="yellow"] .dot { background: #F4C430; }
.tee-pill[data-tee="red"]    .dot { background: #D6362B; }
.tee-pill.active {
  background: #fff; color: var(--ink); box-shadow: var(--shadow-sm);
}

/* ============================================================
   SCREEN 3 · Vista de Hoyo
   ============================================================ */
.hole-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin-bottom: 8px;
  padding: 2px 2px;
}
.hole-topbar::before {
  /* Columna 1: espacio equivalente al badge para mantener el título centrado */
  content: "";
  display: block;
}
.brand-mark {
  display: none;
}
.brand-mark img {
  width: 56px; height: 56px;
  object-fit: cover;
  object-position: center 22%;
  transform: scale(1.6);
  transform-origin: center 30%;
}
.hole-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
  grid-column: 2;
}
.hole-title .of { color: var(--ink-mute); font-weight: 500; }
.tee-badge {
  grid-column: 3;
  justify-self: end;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  background: #F1ECE1; color: var(--ink-soft);
  border: 1.5px solid transparent;
}
.tee-badge .dot {
  width: 9px; height: 9px; border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.2);
}
.tee-badge.yellow { background: #FFF6D6; color: #6B5300; border-color: #F4C430; }
.tee-badge.yellow .dot { background: #F4C430; }
.tee-badge.red    { background: #FFEAE6; color: #8B1F18; border-color: #D6362B; }
.tee-badge.red    .dot { background: #D6362B; }

/* Medalla "Hoyo emblemático" */
.emblematic-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--terracota), var(--terracota-dark));
  color: #fff;
  border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  margin: 0 auto 10px;
  box-shadow: 0 6px 16px rgba(168,74,21,.30);
  width: fit-content;
}
.emblematic-badge::before {
  content: "★"; font-size: 14px; line-height: 1;
}
.emblematic-row { text-align: center; }

/* Imagen del hoyo (sin overlays) — compacta para vista rápida en móvil */
.hole-image-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 8px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 300px;
  overflow: hidden;
}
.hole-image-card img {
  width: auto;
  max-width: 100%;
  height: 100%;
  max-height: 284px;
  display: block;
  border-radius: 10px;
  object-fit: contain;
  /* Renderizado nítido en pantallas HiDPI */
  image-rendering: -webkit-optimize-contrast;
  filter: contrast(1.03) saturate(1.02);
}

/* Stat row */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.stat {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 12px 8px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat .label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-mute);
  margin-bottom: 4px;
}
.stat .value {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--terracota);
  line-height: 1;
}
.stat .unit { font-family: var(--sans); font-size: 12px; color: var(--ink-mute); margin-left: 2px; }

/* Tip colapsable */
.tip {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.tip-toggle {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  background: transparent; border: 0;
  padding: 14px 16px;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  color: var(--ink); cursor: pointer; text-align: left;
}
.tip-toggle .chev {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: #F1ECE1;
  color: var(--terracota);
  font-size: 12px;
  transition: transform .2s ease;
}
.tip.open .tip-toggle .chev { transform: rotate(180deg); }
.tip-body {
  padding: 0 16px;
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease, padding .25s ease;
  font-size: 13.5px; color: var(--ink-soft); line-height: 1.55;
}
.tip.open .tip-body { padding: 0 16px 14px; max-height: 240px; }

/* Player score cards */
.player-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 14px;
  margin-bottom: 12px;
}
.player-card .pc-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.player-name {
  font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--ink);
  margin: 0;
}
.player-meta { font-size: 11.5px; color: var(--ink-mute); }
.player-meta .tee-mini {
  display: inline-block; width: 8px; height: 8px; border-radius: 999px;
  vertical-align: middle; margin-right: 4px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.18);
}
.tee-mini.yellow { background: #F4C430; }
.tee-mini.red    { background: #D6362B; }

.score-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 10px;
  align-items: center;
}
.score-block { text-align: center; }
.score-block .lbl {
  font-size: 10px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-mute); margin-bottom: 6px;
}
.counter {
  display: inline-flex; align-items: center; gap: 6px;
}
.counter button {
  width: 36px; height: 36px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: #fff;
  font-size: 18px; font-weight: 600; line-height: 1;
  color: var(--terracota); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s ease;
}
.counter button:hover { border-color: var(--terracota); background: #FFF4EE; }
.counter .num {
  font-family: var(--serif);
  font-weight: 600;
  min-width: 38px;
  text-align: center;
  color: var(--ink);
}
.counter.big .num { font-size: 32px; }
.counter.sm  .num { font-size: 22px; color: var(--ink-soft); }
.counter.sm button { width: 30px; height: 30px; font-size: 16px; }

.points-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 52px; padding: 6px 12px;
  background: var(--terracota); color: #fff;
  border-radius: 999px;
  font-family: var(--serif); font-weight: 600; font-size: 18px;
  box-shadow: 0 3px 8px rgba(168,74,21,.28);
}
.points-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--border-strong);
  font-size: 12px;
}
.points-row .pl { color: var(--ink-mute); letter-spacing: .04em; text-transform: uppercase; font-size: 10.5px; font-weight: 600; }

/* Ads */
.ad {
  border-radius: var(--radius);
  margin-bottom: 14px;
  padding: 18px 16px;
  position: relative;
  overflow: hidden;
}
.ad-club {
  background: var(--terracota);
  color: #fff;
  box-shadow: 0 8px 22px rgba(168,74,21,.25);
}
.ad-club .ad-title {
  font-family: var(--serif); font-size: 20px; font-weight: 600;
  margin: 0 0 4px; line-height: 1.2;
}
.ad-club .ad-sub {
  font-size: 13px; opacity: .92; margin: 0 0 12px;
}
.ad-club .ad-cta {
  display: inline-block;
  background: #fff;
  color: var(--terracota);
  font-weight: 600; font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 0; cursor: pointer;
  letter-spacing: .02em;
}
.ad-club .ad-iso {
  position: absolute;
  right: -10px; bottom: -10px;
  width: 90px; height: 90px;
  opacity: .14;
  background: #fff;
  border-radius: 999px;
}
.ad-club .ad-mark {
  position: absolute; right: 14px; top: 14px;
  width: 28px; height: 28px; border-radius: 999px;
  background: rgba(255,255,255,.18);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; font-size: 13px;
  color: #fff;
}

.ad-sponsor {
  background: #fff;
  border: 1.5px solid var(--terracota);
  color: var(--ink);
}
.ad-sponsor .tag {
  display: inline-block;
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  font-weight: 700; color: var(--ocre);
  margin-bottom: 6px;
}
.ad-sponsor .ad-title {
  font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--terracota);
  margin: 0 0 4px;
}
.ad-sponsor .ad-sub { font-size: 13px; color: var(--ink-soft); margin: 0; }

/* Bottom nav */
.hole-nav {
  display: flex; gap: 10px;
  margin-top: 18px;
  /* Siempre visible abajo, en cualquier móvil, por encima de la barra de gestos */
  position: -webkit-sticky;
  position: sticky;
  bottom: 0;
  z-index: 40;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to bottom, rgba(247,247,247,0), var(--bg, #F7F7F7) 28%);
}
.hole-nav .btn { flex: 1; min-height: 50px; font-size: 14.5px; }
.hole-nav .btn-prev { flex: 0 0 96px; }

/* ============================================================
   SCREEN 4 · Bisagra (fin de IDA)
   ============================================================ */
.ida-hero {
  text-align: center; padding: 16px 4px 22px;
}
.ida-hero .eyebrow { margin-bottom: 8px; }
.ida-hero h1 { font-size: 30px; margin-bottom: 6px; }
.ida-hero .sub { color: var(--ink-soft); font-size: 14px; margin: 0; }
.ida-table {
  width: 100%; border-collapse: collapse;
}
.ida-table th, .ida-table td {
  padding: 12px 8px;
  text-align: center;
  font-size: 13px;
}
.ida-table th {
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-mute); font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.ida-table td { border-bottom: 1px solid var(--border); }
.ida-table tr:last-child td { border-bottom: 0; }
.ida-table td:first-child { text-align: left; font-weight: 600; font-family: var(--serif); font-size: 15px; }
.ida-table .pts { color: var(--terracota); font-weight: 600; }

.ida-motiv {
  margin-top: 14px;
  padding: 14px 16px;
  background: #FFF4EE;
  border: 1px solid #F1D9C6;
  border-radius: var(--radius);
  color: var(--terracota-dark);
  font-size: 13.5px;
  text-align: center;
}

/* ============================================================
   SCREEN 5 · Resultados finales
   ============================================================ */
.podium {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 10px;
  align-items: end;
  margin: 18px 0 22px;
}
.pod {
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 8px 12px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.pod .ico { font-size: 30px; line-height: 1; margin-bottom: 4px; }
.pod .nm  { font-family: var(--serif); font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 2px;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod .pt  { color: var(--terracota); font-weight: 700; font-size: 18px; font-family: var(--serif); }
.pod .pl  { font-size: 10.5px; color: var(--ink-mute); letter-spacing: .08em; text-transform: uppercase; }
.pod.gold   { background: linear-gradient(180deg,#FFF8E7,#fff); padding-top: 22px; transform: translateY(-6px); border-color: #F1D789; }
.pod.silver { background: linear-gradient(180deg,#F2F2F2,#fff); border-color: #D6D6D6; }
.pod.bronze { background: linear-gradient(180deg,#F6E7D5,#fff); border-color: #E2C7A1; }

.result-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  overflow: hidden;
}
.result-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  background: #fff;
}
.result-head .nm { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.result-head .totals { display: flex; gap: 14px; font-size: 12px; color: var(--ink-mute); }
.result-head .totals b { color: var(--terracota); font-family: var(--serif); font-size: 16px; }
.result-head .chev {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: #F1ECE1; color: var(--terracota);
  font-size: 12px; transition: transform .2s ease;
  margin-left: 10px;
}
.result-card.open .result-head .chev { transform: rotate(180deg); }
.result-body {
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease;
}
.result-card.open .result-body { max-height: 1200px; }
.scorecard-table {
  width: 100%; border-collapse: collapse;
  font-size: 12.5px;
}
.scorecard-table th, .scorecard-table td {
  padding: 6px 4px; text-align: center;
  border-bottom: 1px solid var(--border);
}
.scorecard-table th {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-mute); font-weight: 600;
  background: #FAF7F1;
}
.scorecard-table .h { color: var(--ink-mute); font-weight: 600; }
.scorecard-table .pts { color: var(--terracota); font-weight: 700; }
.scorecard-table .tot-row td { background: #FAF7F1; font-weight: 700; }

.result-footer {
  text-align: center;
  padding: 22px 12px 8px;
  color: var(--ink-mute);
  font-size: 12px;
}
.result-footer img {
  width: 130px; opacity: .85; margin: 14px auto 6px;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  filter: contrast(1.05) saturate(1.02);
}

/* ============================================================
   Selector de idiomas (ES / EN)
   ============================================================ */
.lang-selector {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 4px 0;
  margin-bottom: -10px;
  z-index: 10;
  position: relative;
  min-height: 36px;
  align-items: center;
}
.lang-btn {
  background: #E5E1D8;
  color: var(--ink-soft);
  border: 0;
  padding: 6px 12px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
}
.lang-btn.active {
  background: var(--terracota);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   Botón Compartir (destacado, pantalla resultados)
   ============================================================ */
.btn-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  margin-top: 4px;
  margin-bottom: 12px;
  background: #fff;
  color: var(--terracota-dark);
  border: 1.5px solid var(--terracota);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  transition: all .18s ease;
  box-shadow: 0 3px 10px rgba(168,74,21,.10);
}
.btn-share:hover, .btn-share:active {
  background: var(--terracota);
  color: #fff;
  transform: scale(.99);
}
.btn-share svg { flex-shrink: 0; }

/* ============================================================
   Modal Compartir (bottom sheet)
   ============================================================ */
.share-modal {
  position: fixed; inset: 0;
  background: rgba(20,15,8,.55);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 300;
  padding: 0;
  animation: shareFadeIn .2s ease both;
}
.share-modal.open { display: flex; }
@keyframes shareFadeIn { from { opacity: 0; } to { opacity: 1; } }

.share-sheet {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 20px 18px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(20,15,8,.28);
  animation: shareSlideUp .28s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes shareSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.share-sheet::before {
  content: "";
  display: block;
  width: 44px; height: 4px;
  border-radius: 999px;
  background: var(--border-strong);
  margin: 0 auto 14px;
}
.share-title {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  margin: 2px 0 18px;
  letter-spacing: -.01em;
}
.share-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.share-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 6px;
  background: #FAF7F1;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s ease;
  font-family: var(--sans);
}
.share-opt:active { transform: scale(.97); }
.share-opt:hover { border-color: var(--terracota); }
.share-ico {
  width: 46px; height: 46px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.share-opt-wa   .share-ico { background: #25D366; }
.share-opt-mail .share-ico { background: #4285F4; }
.share-opt-copy .share-ico { background: var(--ocre); }
.share-lbl {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .01em;
}
.share-cancel {
  width: 100%;
  min-height: 48px;
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.share-cancel:active { transform: scale(.99); }
.share-cancel:hover { background: #FAF7F1; }

/* ============================================================
   Image lightbox modal
   ============================================================ */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(20,15,8,.92);
  display: none;
  align-items: center; justify-content: center;
  z-index: 200;
  padding: 20px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
}

/* ============================================================
   Sponsors card (sutil · entre "Nueva partida" y meteo en home)
   ============================================================ */
.sponsors-card {
  display: block;
  width: calc(100% - 24px);
  max-width: 520px;
  margin: 4px auto 8px;
  padding: 8px 12px 10px;
  background: #FAF7F1;
  border: 1px solid rgba(176,108,52,.18);
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .2s ease;
  font: inherit;
  color: inherit;
}
.sponsors-card:hover {
  border-color: rgba(176,108,52,.32);
  box-shadow: 0 4px 14px rgba(0,0,0,.05);
}
.sponsors-card:active { transform: scale(.99); }
.sponsors-card:focus-visible {
  outline: 2px solid var(--terracota, #B06C34);
  outline-offset: 2px;
}
.sponsors-label {
  display: block;
  font-family: var(--sans, system-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #8a7558;
  opacity: .85;
  margin-bottom: 6px;
}
.sponsors-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 132px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}
/* Tablet y pantallas anchas: imagen algo mayor pero sin saturar */
@media (min-width: 600px) {
  .sponsors-card { max-width: 560px; }
  .sponsors-img  { max-height: 158px; }
}
/* Móvil muy pequeño: comprimir padding */
@media (max-width: 359px) {
  .sponsors-card { padding: 6px 8px 8px; }
  .sponsors-img  { max-height: 110px; }
}
.lightbox .close {
  position: absolute; top: 18px; right: 18px;
  width: 40px; height: 40px;
  border-radius: 999px;
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 0; cursor: pointer;
  font-size: 20px;
}

/* ============================================================
   Save toast
   ============================================================ */
.toast {
  position: fixed;
  left: 50%; bottom: 30px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  z-index: 250;
  transition: all .25s ease;
  box-shadow: 0 8px 22px rgba(0,0,0,.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   Cápsula Meteo (Open-Meteo, discreta y estética)
   ============================================================ */
.weather-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #FFF6E4, #FFEAC7);
  border: 1.5px solid rgba(196, 150, 26, 0.28);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: 0 2px 8px rgba(196, 150, 26, 0.10);
  margin: 4px auto 0;
  max-width: max-content;
}
.weather-chip:active { transform: scale(.97); }
.weather-chip:hover { border-color: var(--terracota); }
.weather-chip[hidden] { display: none; }

.weather-chip .wx-ico {
  font-size: 16px;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.08));
}
.weather-chip .wx-temp {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 14px;
  color: var(--terracota-dark);
}
.weather-chip .wx-sep {
  color: rgba(107, 83, 0, .35);
  margin: 0 1px;
}
.weather-chip .wx-wind {
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: .01em;
}
.weather-chip .wx-local {
  background: var(--terracota);
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-left: 2px;
}

/* Versión compacta para dentro de la vista de hoyo (más pequeña) */
.weather-chip-hole {
  margin: 2px auto 10px;
  padding: 6px 12px;
  font-size: 12px;
  background: #fff;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.weather-chip-hole .wx-temp { font-size: 13px; }
.weather-chip-hole .wx-wind { font-size: 11px; }

/* Estado: dato antiguo (>2h) → opacidad reducida */
.weather-chip.is-stale {
  opacity: .58;
  background: linear-gradient(135deg, #F0EBE0, #E7E1D2);
  border-color: var(--border);
}
.weather-chip.is-stale .wx-temp { color: var(--ink-soft); }

/* Estado: modo offline (dato de caché) → punto naranja discreto */
.weather-chip.is-offline::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 999px;
  background: #E89B3B;
  box-shadow: 0 0 0 2px rgba(232,155,59,.15);
  margin-right: 2px;
}

/* ============================================================
   Modal detalle Meteo
   ============================================================ */
.weather-modal {
  position: fixed; inset: 0;
  background: rgba(20,15,8,.62);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 270;
  animation: shareFadeIn .2s ease both;
}
.weather-modal.open { display: flex; }
.weather-sheet {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 18px 20px calc(28px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(20,15,8,.28);
  animation: shareSlideUp .28s cubic-bezier(.22,.61,.36,1) both;
}
.weather-sheet::before {
  content: "";
  display: block;
  width: 44px; height: 4px;
  border-radius: 999px;
  background: var(--border-strong);
  margin: 0 auto 14px;
}
.weather-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.weather-modal-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.01em;
}
.weather-close-btn {
  width: 34px; height: 34px;
  border-radius: 999px;
  background: #F1ECE1;
  color: var(--ink-soft);
  border: 0;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: all .15s ease;
}
.weather-close-btn:hover { background: var(--terracota); color: #fff; }

.weather-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.wx-card {
  background: #FAF7F1;
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
  border: 1px solid var(--border);
}
.wx-card .wx-card-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 6px;
}
.wx-card .wx-card-value {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--terracota-dark);
  line-height: 1.1;
}
.wx-card .wx-card-value .unit {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-mute);
  margin-left: 3px;
}
.wx-card.wx-card-wind .wx-card-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.wx-arrow {
  display: inline-block;
  width: 20px; height: 20px;
  color: var(--terracota);
}

.weather-condition {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 12px;
  background: linear-gradient(135deg, #FFF6E4, #FFEAC7);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.weather-condition .wc-icon { font-size: 32px; line-height: 1; }
.weather-condition .wc-text {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  color: var(--terracota-dark);
}

.weather-meta {
  font-size: 11.5px;
  color: var(--ink-mute);
  text-align: center;
  padding-top: 6px;
  border-top: 1px dashed var(--border-strong);
  margin-top: 4px;
}
.weather-empty {
  text-align: center;
  padding: 20px 12px;
  color: var(--ink-mute);
  font-size: 14px;
}
.weather-empty .we-ico { font-size: 32px; margin-bottom: 8px; opacity: .5; }
.weather-empty .we-hint { font-size: 12px; margin-top: 6px; }

/* ============================================================
   Bloque patrocinador externo (Tropiauto Motril)
   Sutil, sin disturbios, con paleta neutra para diferenciarse
   del autopromo del club (terracota).
   ============================================================ */
.tropiauto-block {
  margin-top: 22px;
  padding: 14px 16px 16px;
  background: #FAF7F1;
  border: 1.5px solid rgba(141, 126, 86, 0.22);
  border-radius: var(--radius);
  text-align: center;
}
.tropiauto-tag {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ocre);
  margin-bottom: 6px;
}
.tropiauto-title {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
  margin: 2px 0 4px;
  letter-spacing: -.01em;
}
.tropiauto-sub {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.35;
  margin: 0 0 12px;
}
.tropiauto-cta {
  display: inline-block;
  padding: 7px 16px;
  background: #fff;
  color: var(--ocre);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  border: 1.5px solid var(--ocre);
  border-radius: 999px;
  cursor: default;        /* decorativo: NO actúa como link/botón */
  pointer-events: none;   /* ningún click handler se ejecuta */
  user-select: none;
}
.tropiauto-block-home {
  margin-top: 18px;
  margin-bottom: 16px;
}
.tropiauto-block-results {
  margin: 12px auto 20px;
  max-width: 360px;
}

/* ============================================================
   Botón "Tarjeta general" en cabecera del hoyo
   ============================================================ */
.btn-scorecard {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 34px;
  padding: 0;
  background: #F1ECE1;
  color: var(--terracota-dark);
  border: 1.5px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
}
.btn-scorecard:hover, .btn-scorecard:active {
  background: var(--terracota);
  color: #fff;
  transform: scale(.96);
}
.btn-scorecard svg { display: block; }

/* ============================================================
   Modal Tarjeta general (todos los jugadores)
   ============================================================ */
.scorecard-modal {
  position: fixed; inset: 0;
  background: rgba(20,15,8,.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 260;
  padding: 20px 12px;
  animation: shareFadeIn .2s ease both;
}
.scorecard-modal.open { display: flex; }
.scorecard-content {
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(20,15,8,.35);
  animation: shareSlideUp .28s cubic-bezier(.22,.61,.36,1) both;
}
.scorecard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
  background: #FAF7F1;
}
.scorecard-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  letter-spacing: -.01em;
}
.scorecard-close-btn {
  width: 36px; height: 36px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  border: 1.5px solid var(--border-strong);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: all .15s ease;
}
.scorecard-close-btn:hover { background: var(--terracota); color: #fff; border-color: var(--terracota); }
.scorecard-scroll {
  overflow: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}
.scorecard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  font-family: var(--sans);
}
.scorecard-table th, .scorecard-table td {
  padding: 6px 3px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  min-width: 28px;
}
.scorecard-table thead th {
  background: #FAF7F1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding-top: 8px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--border-strong);
}
.scorecard-table tbody .col-label,
.scorecard-table thead .col-label {
  text-align: left;
  padding-left: 12px;
  padding-right: 10px;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  position: sticky;
  left: 0;
  border-right: 1.5px solid var(--border);
  min-width: 66px;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}
.scorecard-table thead .col-label {
  background: #FAF7F1;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-family: var(--sans);
  font-weight: 700;
}
.scorecard-table .ref-row td,
.scorecard-table .ref-row th {
  background: #FBF8F1;
}
.scorecard-table .ref-row .col-label {
  background: #FBF8F1;
}
.scorecard-table .col-par {
  color: var(--ocre);
  font-weight: 700;
  font-size: 12px;
}
.scorecard-table .col-hcp {
  color: var(--ink-mute);
  font-size: 10px;
  font-weight: 600;
}
.scorecard-table .player-name-cell {
  padding-top: 10px;
  padding-bottom: 10px;
  color: var(--ink);
  font-size: 13px;
}
.scorecard-table .cell-combo {
  padding: 6px 3px;
  vertical-align: middle;
}
.scorecard-table .cell-combo .cc-strokes {
  display: block;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.05;
}
.scorecard-table .cell-combo .cc-pts {
  display: block;
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--terracota);
  margin-top: 2px;
  letter-spacing: .02em;
}
.scorecard-table .sep-col { border-left: 2px solid var(--border-strong); }
.scorecard-table .total-cell {
  background: #FBF8F1;
}
.scorecard-table .total-cell .cc-strokes { font-size: 15px; font-weight: 700; }
.scorecard-table .total-cell .cc-pts {
  background: var(--terracota);
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  display: inline-block;
  font-size: 10px;
  min-width: 22px;
  margin-top: 3px;
}
.scorecard-table .total-cell.grand { background: #FFF4EE; }
.scorecard-table .diff-eagle    { background: #FFE9BF; }
.scorecard-table .diff-birdie   { background: #E4F1D8; }
.scorecard-table .diff-bogey    { background: #FBECE4; }
.scorecard-table .diff-double   { background: #F5D9CE; }
.scorecard-table .row-current { }
.scorecard-table thead .row-current,
.scorecard-table tbody .row-current { position: relative; }
.scorecard-table .cell-combo.row-current {
  outline: 2px solid var(--terracota);
  outline-offset: -2px;
  z-index: 1;
}

/* Leyenda de colores debajo de la tabla */
.scorecard-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px 4px;
  margin: 0;
  font-size: 11px;
  color: var(--ink-soft);
}
.scorecard-legend .lg-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.scorecard-legend .lg-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ============================================================
   Feedback visual birdie / eagle / albatross
   ============================================================ */
.points-badge {
  transition: background .3s ease, color .3s ease, transform .3s ease, box-shadow .3s ease;
}
.points-badge.is-birdie {
  background: linear-gradient(135deg, #4CAF50, #2E7D32);
  box-shadow: 0 4px 14px rgba(46,125,50,.45);
}
.points-badge.is-eagle {
  background: linear-gradient(135deg, #F4C430, #C7961A);
  color: #4a2f00;
  box-shadow: 0 4px 14px rgba(196,150,26,.55);
}
.points-badge.is-albatross {
  background: linear-gradient(135deg, #7B4DFF, #4A22C4);
  box-shadow: 0 4px 14px rgba(74,34,196,.55);
}

.score-flash {
  position: absolute;
  left: 50%;
  top: -8px;
  transform: translate(-50%, -100%) scale(.8);
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.score-flash.show {
  animation: scoreFlash 1.6s cubic-bezier(.22,.61,.36,1) forwards;
}
@keyframes scoreFlash {
  0%   { opacity: 0; transform: translate(-50%, -80%) scale(.7); }
  15%  { opacity: 1; transform: translate(-50%, -100%) scale(1.08); }
  30%  { transform: translate(-50%, -100%) scale(1); }
  75%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -140%) scale(.95); }
}
.score-flash.type-birdie {
  background: linear-gradient(135deg, #4CAF50, #2E7D32);
  color: #fff;
}
.score-flash.type-eagle {
  background: linear-gradient(135deg, #F4C430, #C7961A);
  color: #4a2f00;
}
.score-flash.type-albatross,
.score-flash.type-ace {
  background: linear-gradient(135deg, #7B4DFF, #4A22C4);
  color: #fff;
}

.score-block { position: relative; }

/* ============================================================
   RESPONSIVE · Pantallas muy pequeñas (<360px)
   Ejemplo: iPhone SE 1G (320px), Galaxy Fold plegado
   ============================================================ */
@media (max-width: 359px) {
  .screen             { padding: 10px 12px 80px; }
  #screen-hole        { padding: 6px 10px 80px; }
  h1                  { font-size: 24px; }
  h2                  { font-size: 20px; }
  h3                  { font-size: 16px; }
  .splash-title       { font-size: 26px; }
  .splash-logo        { max-width: 240px; }
  .hole-title         { font-size: 17px; letter-spacing: .02em; }
  .tee-badge          { padding: 6px 10px; font-size: 11px; }
  .btn                { font-size: 15px; min-height: 48px; }
  .btn-share          { font-size: 15px; }
  .pc-btn             { height: 50px; font-size: 20px; }
  .player-count       { gap: 6px; }
  .player-form .form-row { grid-template-columns: 1fr 74px; gap: 8px; }
  .counter.big .num   { font-size: 26px; }
  .counter.sm  .num   { font-size: 18px; }
  .counter button     { width: 32px; height: 32px; font-size: 16px; }
  .counter.sm button  { width: 28px; height: 28px; font-size: 14px; }
  .points-badge       { min-width: 44px; font-size: 16px; padding: 5px 10px; }
  .score-row          { grid-template-columns: 1.3fr 1fr 1fr; gap: 6px; }
  .hole-image-card    { padding: 6px; max-height: 260px; }
  .hole-image-card img { max-height: 246px; }
  .ida-hero h1        { font-size: 26px; }
  .pod .nm            { font-size: 12px; }
  .pod .pt            { font-size: 16px; }
  .share-opt          { padding: 12px 4px; }
  .share-ico          { width: 40px; height: 40px; }
  .share-lbl          { font-size: 11px; }
  .btn-scorecard      { width: 34px; height: 30px; }
  .scorecard-title    { font-size: 17px; }
  .scorecard-table    { font-size: 11px; }
  .scorecard-table th, .scorecard-table td { padding: 5px 2px; min-width: 24px; }
  .scorecard-table tbody .col-label { min-width: 54px; max-width: 70px; padding-left: 8px; font-size: 12px; }
  .scorecard-table .cell-combo .cc-strokes { font-size: 12px; }
  .scorecard-table .cell-combo .cc-pts { font-size: 8.5px; }
  .scorecard-legend { font-size: 10px; gap: 8px; }
  .scorecard-legend .lg-swatch { width: 11px; height: 11px; }
  .weather-chip     { font-size: 12px; padding: 7px 12px; gap: 6px; }
  .weather-chip .wx-temp { font-size: 13px; }
  .weather-chip-hole { font-size: 11px; padding: 5px 10px; }
  .weather-details  { grid-template-columns: 1fr 1fr; gap: 8px; }
  .wx-card          { padding: 12px 8px; }
  .wx-card .wx-card-value { font-size: 18px; }
}

/* ============================================================
   RESPONSIVE · Tablet vertical (≥600px de ancho)
   Ejemplo: iPad Mini, iPad Air, Samsung Tab, tablets Android
   La app mantiene el layout mobile-first centrado con max-width,
   pero aprovechamos el espacio extra para mostrar la imagen del
   hoyo más grande y aumentar el confort visual.
   ============================================================ */
@media (min-width: 600px) {
  .app                { max-width: 560px; }
  .screen             { padding: 24px 24px 100px; }
  #screen-hole        { padding: 14px 22px 100px; }
  h1                  { font-size: 32px; }
  .splash-logo        { max-width: 300px; margin-top: 60px; }
  .splash-title       { font-size: 34px; }
  .splash-tagline     { font-size: 16px; }
  .hole-title         { font-size: 24px; }
  .tee-badge          { padding: 8px 14px; font-size: 13px; }
  .hole-image-card    { max-height: 380px; padding: 12px; }
  .hole-image-card img { max-height: 356px; }
  .btn                { font-size: 17px; min-height: 56px; }
  .btn-share          { min-height: 58px; font-size: 17px; }
  .player-name        { font-size: 19px; }
  .counter.big .num   { font-size: 36px; }
  .counter.sm  .num   { font-size: 24px; }
  .points-badge       { font-size: 20px; min-width: 56px; }
  .ida-hero h1        { font-size: 34px; }
  .pod .nm            { font-size: 15px; }
  .pod .pt            { font-size: 20px; }
}


/* ============================================================
   Compatibilidad universal de toques (Android / iOS / todos)
   ============================================================ */
html, body { overflow-x: hidden; max-width: 100%; }
button, .btn, a, [role="button"] {
  touch-action: manipulation;          /* sin retardo de 300 ms ni doble-tap zoom */
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
}
.hole-nav .btn { min-height: 54px; font-size: 15px; }
.toast { pointer-events: none; }
input, select, textarea { font-size: 16px; }   /* evita el zoom automático de iOS al escribir */

/* Hándicap de juego calculado (pantalla de jugadores) */
.ph-preview {
  margin-top: 8px; padding: 7px 10px;
  background: #FAF7F1; border: 1px solid rgba(176,108,52,.2); border-radius: 10px;
  font-size: 13px; color: var(--ink-soft, #555); text-align: center;
}
.ph-preview strong { color: var(--terracota, #A84A15); font-size: 15px; }


/* ============================================================
   Botón "Tarjeta" (vista de hoyo) · visible y reconocible
   ============================================================ */
.hole-topbar { position: relative; }
.btn-scorecard {
  width: auto;
  height: 40px;
  min-width: 44px;
  padding: 0 14px 0 11px;
  gap: 7px;
  background: var(--terracota, #A84A15);
  color: #fff;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(168,74,21,.28);
  font-family: var(--sans, system-ui);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .01em;
  position: relative;
  touch-action: manipulation;
}
.btn-scorecard svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn-scorecard-label { white-space: nowrap; line-height: 1; }
.btn-scorecard:hover, .btn-scorecard:active {
  background: var(--terracota-dark, #8A3A0F);
  color: #fff;
  transform: scale(.97);
}
.btn-scorecard:focus-visible { outline: 3px solid rgba(168,74,21,.35); outline-offset: 2px; }

/* Destello: anillo suave que se expande (3 veces) */
.btn-scorecard::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(168,74,21,.55);
  pointer-events: none;
}
.btn-scorecard.attn::after { animation: scPulse 1.6s ease-out 3; }
@keyframes scPulse {
  0%   { box-shadow: 0 0 0 0 rgba(168,74,21,.55); }
  70%  { box-shadow: 0 0 0 12px rgba(168,74,21,0); }
  100% { box-shadow: 0 0 0 0 rgba(168,74,21,0); }
}

/* Aviso de primera vez */
.sc-hint {
  position: absolute;
  left: 0; top: calc(100% + 10px);
  z-index: 45;
  max-width: 230px;
  padding: 10px 13px;
  background: var(--ink, #1F1A14);
  color: #fff;
  border-radius: 12px;
  font-size: 13px; font-weight: 500; line-height: 1.35;
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
  opacity: 0; transform: translateY(-4px);
  transition: opacity .25s ease, transform .25s ease;
  cursor: pointer;
}
.sc-hint::before {
  content: ""; position: absolute; top: -6px; left: 22px;
  width: 12px; height: 12px; background: inherit;
  transform: rotate(45deg); border-radius: 2px;
}
.sc-hint.show { opacity: 1; transform: translateY(0); }
.sc-hint[hidden] { display: none; }

/* Pantallas estrechas (≤ 379px): todo cabe en una línea */
@media (max-width: 379px) {
  .hole-topbar { gap: 6px; }
  .btn-scorecard { height: 38px; padding: 0 11px 0 9px; gap: 5px; font-size: 12.5px; }
  .btn-scorecard svg { width: 16px; height: 16px; }
  .hole-title { font-size: 17px; }
  .tee-badge { padding: 6px 9px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn-scorecard.attn::after { animation: none; box-shadow: 0 0 0 3px rgba(168,74,21,.35); }
}

/* Cabecera del hoyo: posiciones fijas para que nada se salga en móviles estrechos */
.hole-topbar { grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); }
.hole-topbar::before { display: none; }
.hole-topbar .btn-scorecard { grid-column: 1; grid-row: 1; justify-self: start; }
.hole-topbar .hole-title    { grid-column: 2; grid-row: 1; white-space: nowrap; }
.hole-topbar .tee-badge     { grid-column: 3; grid-row: 1; justify-self: end; position: static; transform: none; max-width: 100%; }
@media (max-width: 379px) {
  .hole-topbar .tee-badge { font-size: 0; gap: 0; padding: 7px; }      /* solo el punto de color */
  .hole-topbar .tee-badge .dot { width: 12px; height: 12px; }
  .hole-title { font-size: 16px; }
}


/* ============================================================
   Botones de llamada (anuncios del club)
   ============================================================ */
.ad-club .ad-ctas { display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 2; }
.ad-club .ad-cta-call {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: var(--terracota, #A84A15);
  padding: 8px 14px 8px 12px; border-radius: 999px;
  text-decoration: none; min-height: 44px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  touch-action: manipulation;
}
.ad-club .ad-cta-call:active { transform: scale(.97); }
.ad-club .ad-cta-call svg { flex: 0 0 auto; }
.call-txt { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.call-lbl { font-weight: 700; font-size: 13px; }
.call-num { font-size: 11.5px; opacity: .8; font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* ============================================================
   Tarjeta del profesional (resultados)
   ============================================================ */
.pro-card {
  margin: 14px 0;
  padding: 16px 16px 18px;
  background: #FAF7F1;
  border: 1px solid rgba(176,108,52,.22);
  border-radius: var(--radius, 16px);
  text-align: center;
}
.pro-eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #8a7558; }
.pro-title { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--ink, #1F1A14); margin: 4px 0 2px; }
.pro-sub { font-size: 13px; color: var(--ink-soft, #555); margin: 0 0 12px; }
.btn-whatsapp {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; min-height: 50px;
  background: #1FA855; color: #fff;
  border-radius: 999px; text-decoration: none;
  font-weight: 700; font-size: 15px;
  box-shadow: 0 6px 16px rgba(31,168,85,.28);
  touch-action: manipulation;
}
.btn-whatsapp:active { transform: scale(.98); }

/* ============================================================
   Campo de índice con botón "+" (hándicap plus)
   ============================================================ */
.hcp-input-wrap { display: flex; gap: 6px; align-items: stretch; }
.hcp-input-wrap input { flex: 1 1 auto; min-width: 0; }
.plus-toggle {
  flex: 0 0 44px; min-height: 44px;
  border: 1.5px solid var(--border-strong, #D9D2C3);
  background: #fff; color: var(--ink-soft, #555);
  border-radius: 10px; font-size: 20px; font-weight: 700; line-height: 1;
  cursor: pointer; touch-action: manipulation;
}
.plus-toggle.active { background: var(--terracota, #A84A15); border-color: var(--terracota, #A84A15); color: #fff; }


/* ============================================================
   Anuncio Club Maker (hoyos 10 y 14) · WhatsApp a Carlos Vidal
   ============================================================ */
.ad-clubmaker {
  background: #2B2520;
  color: #fff;
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
}
.ad-clubmaker .tag {
  display: inline-block;
  font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: #E9B98F; margin-bottom: 6px;
}
.ad-clubmaker .ad-title { font-family: var(--serif); font-size: 20px; font-weight: 600; margin: 0 0 4px; line-height: 1.2; }
.ad-clubmaker .ad-sub  { font-size: 13px; opacity: .9; margin: 0 0 4px; }
.ad-clubmaker .ad-team { font-size: 12px; opacity: .7; margin: 0 0 12px; }
.ad-cta-wa {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  background: #1FA855; color: #fff;
  border-radius: 999px; text-decoration: none;
  font-weight: 700; font-size: 13.5px;
  touch-action: manipulation;
}
.ad-cta-wa:active { transform: scale(.97); }

/* Club Maker: título siempre legible sobre fondo oscuro */
.ad.ad-clubmaker .ad-title { color: #FFFFFF !important; }
.ad.ad-clubmaker .ad-sub   { color: rgba(255,255,255,.9) !important; }
.ad.ad-clubmaker .ad-team  { color: rgba(255,255,255,.7) !important; }


/* ============================================================
   Corregir hoyos desde Resultados
   ============================================================ */
.fix-card {
  margin: 14px 0;
  padding: 14px 14px 16px;
  background: #fff;
  border: 1.5px dashed rgba(168,74,21,.35);
  border-radius: var(--radius, 16px);
}
.fix-title { font-size: 14px; font-weight: 700; color: var(--ink, #1F1A14); text-align: center; margin-bottom: 10px; }
.fix-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.fix-hole {
  min-height: 44px; border-radius: 10px;
  border: 1.5px solid var(--border-strong, #D9D2C3);
  background: #FAF7F1; color: var(--ink, #1F1A14);
  font-size: 16px; font-weight: 700; cursor: pointer;
  touch-action: manipulation;
}
.fix-hole:active { background: var(--terracota, #A84A15); border-color: var(--terracota, #A84A15); color: #fff; }

/* ============================================================
   Campo de hándicap: más ancho y legible (18,4 · +3,4)
   ============================================================ */
.player-form .form-row { grid-template-columns: minmax(0,1fr) !important; gap: 10px !important; }
.hcp-input-wrap { max-width: 230px; }
.hcp-input-wrap input {
  font-size: 19px !important; font-weight: 700;
  text-align: center; letter-spacing: .03em;
  font-variant-numeric: tabular-nums;
}
.plus-toggle { flex: 0 0 54px !important; min-height: 46px; font-size: 22px; }
.plus-toggle.active + input { color: var(--terracota, #A84A15); border-color: var(--terracota, #A84A15); }


/* ============================================================
   Elegir profesor (Javier Mata · Víctor Casado)
   ============================================================ */
.pro-list { display: grid; gap: 8px; }
.pro-option {
  display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 10px 14px;
  background: #fff; color: var(--ink, #1F1A14);
  border: 1.5px solid rgba(31,168,85,.35);
  border-radius: 14px; text-decoration: none; text-align: left;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  touch-action: manipulation;
}
.pro-option:active { transform: scale(.98); background: #F2FBF5; }
.pro-wa-ico {
  flex: 0 0 40px; height: 40px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #1FA855; color: #fff;
}
.pro-opt-txt { flex: 1 1 auto; display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.pro-opt-name { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.pro-opt-sub  { font-size: 12.5px; color: #1A8E48; font-weight: 600; margin-top: 2px; }
.pro-opt-arrow { flex: 0 0 auto; font-size: 26px; color: #1FA855; line-height: 1; }

.pro-opt-phone { font-size: 12.5px; color: var(--ink-soft, #666); white-space: nowrap; margin-top: 1px; font-variant-numeric: tabular-nums; }


/* ============================================================
   La Casa del Golf (hoyos 3 y 11) · Instagram Ketia_golf (7 y 15)
   ============================================================ */
.ad-casagolf {
  background: #F3F6EE;
  border: 1.5px solid rgba(76,110,52,.28);
  color: var(--ink, #1F1A14);
}
.ad-casagolf .tag, .ad-insta .tag {
  display: inline-block; font-size: 10.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; margin-bottom: 6px;
}
.ad-casagolf .tag { color: #4C6E34; }
.ad-casagolf .ad-title, .ad-insta .ad-title { font-family: var(--serif); font-size: 20px; font-weight: 600; margin: 0 0 4px; line-height: 1.2; }
.ad-casagolf .ad-sub, .ad-insta .ad-sub { font-size: 13px; margin: 0 0 12px; opacity: .88; }
.ad-cta-mail {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 46px; padding: 7px 16px 7px 13px;
  background: #4C6E34; color: #fff;
  border-radius: 999px; text-decoration: none;
  max-width: 100%; touch-action: manipulation;
}
.ad-cta-mail .call-num { opacity: .85; word-break: break-all; }
.ad-cta-mail:active { transform: scale(.97); }
.ad-insta {
  background: linear-gradient(135deg, #FFF5EC 0%, #FBEAF0 100%);
  border: 1.5px solid rgba(193,53,132,.22);
  color: var(--ink, #1F1A14);
}
.ad-insta .tag { color: #B0337A; }
.ad-cta-insta {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  background: linear-gradient(90deg, #F58529, #DD2A7B 55%, #8134AF);
  color: #fff; border-radius: 999px; text-decoration: none;
  font-weight: 700; font-size: 14px; touch-action: manipulation;
}
.ad-cta-insta:active { transform: scale(.97); }


/* ============================================================
   Escuela infantil (hoyos 9 y 13) · Incidencias casa club (8, 12, 16)
   ============================================================ */
.ad-kids { background: #EEF5FB; border: 1.5px solid rgba(46,110,170,.25); color: var(--ink, #1F1A14); }
.ad-kids .tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #2E6EAA; margin-bottom: 6px; }
.ad-kids .ad-title, .ad-incident .ad-title { font-family: var(--serif); font-size: 20px; font-weight: 600; margin: 0 0 4px; line-height: 1.2; }
.ad-kids .ad-sub { font-size: 13px; margin: 0 0 12px; opacity: .88; }
.ad-incident { background: #fff; border: 1.5px solid rgba(190,60,40,.28); color: var(--ink, #1F1A14); }
.inc-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.inc-ico {
  flex: 0 0 34px; height: 34px; border-radius: 999px;
  background: #FCE9E5; color: #B8402A;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px;
}
.inc-txt .ad-title { font-size: 18px; }
.inc-txt .ad-sub { font-size: 13px; margin: 0; opacity: .85; }
.ad-cta-inc {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 46px; padding: 7px 16px 7px 13px;
  background: #B8402A; color: #fff;
  border-radius: 999px; text-decoration: none; touch-action: manipulation;
}
.ad-cta-inc:active { transform: scale(.97); }


/* ============================================================
   Indicador de ritmo de juego (vista de hoyo)
   ============================================================ */
.pace-chip {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 auto 10px; padding: 7px 14px;
  width: fit-content; max-width: 100%;
  border-radius: 999px;
  font-size: 13px; line-height: 1.25; text-align: center;
  border: 1.5px solid transparent;
}
.pace-chip[hidden] { display: none; }
.pace-dot { width: 10px; height: 10px; border-radius: 999px; flex: 0 0 auto; }
.pace-chip strong { font-weight: 700; }
.pace-meta { font-size: 12px; opacity: .8; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pace-chip.ok   { background: #EAF6EE; border-color: rgba(31,140,70,.3);  color: #1B6B3A; }
.pace-chip.ok   .pace-dot { background: #22A35A; }
.pace-chip.warn { background: #FFF5E0; border-color: rgba(200,140,20,.35); color: #8A5A00; }
.pace-chip.warn .pace-dot { background: #E5A21A; }
.pace-chip.late { background: #FCE9E5; border-color: rgba(190,60,40,.35); color: #A3341F; }
.pace-chip.late .pace-dot { background: #D2402A; animation: paceBlink 1.6s ease-in-out infinite; }
@keyframes paceBlink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .pace-chip.late .pace-dot { animation: none; } }


/* Tarjeta general: hoyos sin jugar, vacíos y suaves */
.scorecard-table .cell-combo:empty { background: #FBFAF7; }

/* Pantalla de inicio en blanco (el resto de pantallas no cambia) */
#screen-home { background: #FFFFFF; }
.app:has(#screen-home.active),
.slide-container:has(#screen-home.active),
body:has(#screen-home.active) { background: #FFFFFF !important; }

/* Inicio: un único blanco en todos los navegadores (sin depender de :has) */
body.home-white,
body.home-white .slide-container,
body.home-white .app,
body.home-white #screen-home { background: #FFFFFF !important; }
body.home-white .sponsors-card { background: #FFFFFF; }

/* Pedir al navegador que no aplique modo oscuro automático */
:root { color-scheme: only light; }
