/* Zona de socios — Sierra Morena Sport Club.
   Misma identidad que la web pública (navy, crema, terracota, amarillo
   pelota, esquinas de 2px): el socio no debe notar que cambia de sitio. */

:root {
  --navy:   #1d3143;
  --navy-2: #2f4a5f;
  --cream:  #f1ebdf;
  --paper:  #f8f5ef;
  --ink:    #16222d;
  --ink-soft: #4a5866;
  --terra:  #b3602d;
  --ball:   #e6ef3a;
  --pitch:  #2f5b45;
  --line:   rgba(22, 34, 45, .16);

  --serif: "Bodoni Moda", Didot, Georgia, serif;
  --sans:  Archivo, "Helvetica Neue", Arial, sans-serif;
  --radius: 2px;

  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
/* `display:flex` gana al atributo hidden del HTML si no se fuerza. */
[hidden] { display: none !important; }
html, body { margin: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  font-variant-numeric: tabular-nums;
  padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px));
}

h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.05; }
h2 { font-family: var(--serif); font-size: 30px; letter-spacing: -.015em; margin-bottom: 12px; }
h3 { font-family: var(--sans); font-variation-settings: "wdth" 80; font-weight: 600; font-size: 17px; }
button, input, select { font: inherit; color: inherit; }
input[type=checkbox] { accent-color: var(--navy); width: 18px; height: 18px; }
a { color: var(--navy); }

.kicker {
  font-variation-settings: "wdth" 75; font-weight: 600; font-size: 12px;
  letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft);
}

/* ── cabecera ───────────────────────────────────────────────── */

header.app {
  background: var(--navy); color: var(--cream);
  padding: calc(13px + env(safe-area-inset-top, 0px)) var(--g, 18px) 13px;
  display: flex; align-items: center; gap: 12px;
}
header.app h1 { font-family: var(--serif); font-size: 19px; letter-spacing: -.01em; }
header.app h1 em { font-style: italic; }
header.app .quien { margin-left: auto; font-size: 13px; color: rgba(241, 235, 223, .65); }
header.app .volver { color: rgba(241, 235, 223, .65); text-decoration: none; font-size: 13px;
  font-variation-settings: "wdth" 85; border-bottom: 1px solid rgba(241, 235, 223, .3); }

main { padding: 20px 18px 28px; max-width: 760px; margin: 0 auto; }

/* ── pestañas ───────────────────────────────────────────────── */

nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; background: var(--cream); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
nav.tabs a {
  flex: 1; text-align: center; padding: 12px 4px 14px; text-decoration: none;
  font-size: 12px; font-variation-settings: "wdth" 80; font-weight: 600;
  letter-spacing: .04em; color: var(--ink-soft);
}
nav.tabs a.on { color: var(--navy); box-shadow: inset 0 3px 0 var(--terra); }

/* ── las horas: lo único que el socio viene a tocar ─────────── */

.pista {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 14px;
}
.pista header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.pista .deporte { font-size: 12px; color: var(--ink-soft); font-variation-settings: "wdth" 85; }

.horas { display: flex; flex-wrap: wrap; gap: 6px; }

.hora {
  font-variation-settings: "wdth" 80; font-weight: 600; font-size: 15px;
  padding: 10px 12px; border-radius: var(--radius); cursor: pointer;
  background: #fff; color: var(--navy); border: 1.5px solid var(--navy);
  transition: background .12s, color .12s;
}
.hora:hover { background: var(--navy); color: var(--cream); }
.hora:active { transform: translateY(1px); }
.hora[disabled] {
  background: var(--cream); border-color: transparent; color: var(--ink-soft);
  cursor: default; font-weight: 400;
}
.hora.mia { background: var(--ball); border-color: var(--ink); color: var(--ink); }
.hora.recien { animation: cuaja .45s ease-out; }
@keyframes cuaja { from { background: #fff; color: var(--navy); } to { background: var(--ball); color: var(--ink); } }

/* ── controles ──────────────────────────────────────────────── */

.tira { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; }
.tira button {
  flex: 0 0 auto; padding: 9px 13px; border-radius: var(--radius);
  border: 1px solid var(--line); background: #fff; cursor: pointer; line-height: 1.2;
  font-variation-settings: "wdth" 85; text-align: center; color: var(--ink);
}
.tira button.on { background: var(--navy); color: var(--cream); border-color: var(--navy); }
.tira button b { display: block; font-size: 17px; font-variation-settings: "wdth" 75; }
.tira button small { font-size: 11px; opacity: .7; }

.btn {
  display: inline-block; padding: 12px 20px; border: 1px solid var(--navy);
  border-radius: var(--radius); background: var(--navy); color: var(--cream);
  font-weight: 600; font-variation-settings: "wdth" 88; cursor: pointer;
  letter-spacing: .02em;
}
.btn.suave { background: #fff; color: var(--navy); }
.btn.peligro { background: var(--terra); border-color: var(--terra); color: var(--cream); }
.btn.pelota { background: var(--ball); border-color: var(--ink); color: var(--ink); }
.btn[disabled] { opacity: .45; cursor: default; }

input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=date], input[type=time], input[type=number], input[type=datetime-local], select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff; margin: 4px 0 14px;
}
label { font-size: 13px; color: var(--ink-soft); }
:focus-visible { outline: 2px solid var(--terra); outline-offset: 3px; }

/* ── listas ─────────────────────────────────────────────────── */

.ficha {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px;
}
.ficha .cuando { font-variation-settings: "wdth" 80; font-weight: 600; font-size: 17px; }
.ficha .con { font-size: 13px; color: var(--ink-soft); }
.ficha .fin { margin-left: auto; text-align: right; }

.vacio { text-align: center; color: var(--ink-soft); padding: 44px 20px; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 10px; text-align: left; border-bottom: 1px solid var(--line); font-size: 15px; }
th { font-size: 11px; color: var(--ink-soft); font-weight: 600;
     letter-spacing: .12em; text-transform: uppercase; }
td.num, th.num { text-align: right; font-variation-settings: "wdth" 80; font-weight: 600; }

.aviso { background: var(--ball); color: var(--ink); padding: 11px 15px;
         border-radius: var(--radius); margin-bottom: 16px; }
.error { background: #f6e3d8; color: var(--terra); padding: 11px 15px;
         border-radius: var(--radius); margin-bottom: 16px; }

/* ── hoja de confirmación ───────────────────────────────────── */

dialog {
  border: none; border-top: 3px solid var(--terra); border-radius: 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  width: 100%; max-width: 560px; margin: auto auto 0;
  background: var(--paper); color: var(--ink);
}
dialog::backdrop { background: rgba(29, 49, 67, .55); }
dialog h2 { margin-bottom: 2px; }
.jugador { display: flex; align-items: center; gap: 8px; padding: 8px 0;
           border-bottom: 1px solid var(--line); }
.jugador button { background: none; border: none; color: var(--terra); cursor: pointer; margin-left: auto; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

@media (min-width: 760px) {
  body { padding-bottom: 0; }
  nav.tabs { position: static; border-top: none; border-bottom: 1px solid var(--line);
             max-width: 760px; margin: 0 auto; background: transparent; }
  main { padding-top: 24px; }
}
