/* Shared by index.html and jugados.html */
:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --text: #1c2321;
  --muted: #66706c;
  --line: #e3e7e4;
  --accent: #0f766e;
  --accent-soft: #d5efe9;
  --free: #16a34a;
  --free-soft: #dcfce7;
  --busy: #e8d9d9;
  --free-text: #14532d;
  --track: #eceeed;
  --warn-soft: #fef3c7;
  --warn-text: #78350f;
  --match: #facc15;
  --match-soft: #fef9c3;
  --match-text: #713f12;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101413;
    --surface: #181e1c;
    --text: #e7ece9;
    --muted: #94a09b;
    --line: #28302d;
    --accent: #2dd4bf;
    --accent-soft: #123a35;
    --free: #22c55e;
    --free-soft: #12301f;
    --busy: #3b2c2e;
    --free-text: #bbf7d0;
    --track: #232a28;
    --warn-soft: #3a2c10;
    --warn-text: #fde68a;
    --match: #eab308;
    --match-soft: #3a3108;
    --match-text: #fde68a;
  }
}
* { box-sizing: border-box; }
/* No double-tap zoom on iPhone when tapping buttons quickly (pinch-zoom still works). */
html { touch-action: manipulation; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px 48px; }

header {
  position: sticky; top: 0; z-index: 2;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  padding: 14px 0 10px;
  border-bottom: 1px solid var(--line);
  margin: 0 -16px 16px; padding-left: 16px; padding-right: 16px;
}
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { height: 30px; width: auto; flex: none; display: block; }
.brand-divider { width: 1px; align-self: stretch; background: var(--line); }
h1 { font-size: 18px; margin: 0; letter-spacing: -0.01em; line-height: 1.2; }
.updated { color: var(--muted); font-size: 12px; }
@media (prefers-color-scheme: dark) {
  /* Black wordmark on a transparent background: show it white on dark. */
  .logo { filter: invert(1); }
}
@media (max-width: 380px) {
  .logo { height: 24px; }
  h1 { font-size: 16px; }
  .refresh .label { display: none; }
}
button.refresh {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer;
}
button.refresh:disabled { opacity: .5; cursor: wait; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
/* The logo + title go back to the main page. */
a.brand { color: inherit; text-decoration: none; }
.brand > div:last-child { min-width: 0; }
.brand h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Signed in: avatar (or initial) + name opens /perfil; "Salir" is its own quieter button. */
a.account {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none;
  border-radius: 999px; padding: 5px 12px 5px 6px; font-size: 13px; white-space: nowrap; flex: none; min-height: 32px;
  box-sizing: border-box;
}
a.account:not(:has(.acc-av, .acc-initial)) { padding-left: 12px; }
.acc-av, .acc-initial { width: 22px; height: 22px; border-radius: 50%; flex: none; }
.acc-av { object-fit: cover; }
.acc-initial { display: grid; place-items: center; font-size: 11px; font-weight: 700;
               background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--accent); }
.acc-name { max-width: 32vw; overflow: hidden; text-overflow: ellipsis; }
a.account.logout { color: var(--muted); padding: 5px 12px; }
button.refresh { min-height: 32px; }
/* Phones: one tidy row — Salir and Actualizar become icons, the name gets shorter. */
@media (max-width: 560px) {
  .title-row { gap: 8px; }
  .brand { gap: 9px; }
  .top-actions { gap: 6px; }
  .refresh .label, a.account.logout .lbl { display: none; }
  a.account.logout { padding: 5px 8px; }
  button.refresh { padding: 5px 10px; }
  .acc-name { max-width: 22vw; }
  h1 { font-size: 16px; }
  .updated { font-size: 11px; }
}
@media (max-width: 360px) {
  .brand-divider { display: none; }
  .logo { height: 22px; }
}

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 6px 13px; font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); font-weight: 600; }
.chips.small .chip { font-size: 13px; padding: 4px 11px; }

.club {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 14px 6px; margin-bottom: 14px;
}
.club-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.club h2 { font-size: 17px; margin: 0; }
.club .count { color: var(--muted); font-size: 13px; }
.club-head .meta { display: flex; align-items: baseline; gap: 10px; }
.book {
  color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: none;
  border: 1px solid var(--accent); border-radius: 999px; padding: 2px 10px; white-space: nowrap;
}
.book:hover { background: var(--accent-soft); }

.scale { position: relative; height: 14px; font-size: 10px; color: var(--muted); }
.scale span { position: absolute; transform: translateX(-50%); }

.court { display: grid; grid-template-columns: 88px 1fr; gap: 4px 8px; padding: 9px 0; border-top: 1px solid var(--line); align-items: center; }
.court:first-of-type { border-top: 0; }
.court-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Half-hour squares: free (green), booked (grey-red), a Hazit match (yellow; striped while pending). */
.court.head { border-top: 0; padding: 0 0 2px; }
.squares { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; }
.squares i { aspect-ratio: 1; max-height: 16px; border-radius: 3px; background: var(--busy); }
.squares i.free { background: var(--free); }
.squares i.mt { background: var(--match); }
.squares i.mt.pending { background: repeating-linear-gradient(135deg, var(--match) 0 3px, var(--busy) 3px 5px); }
.sq-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.sq-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sq-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--busy); }
.sq-legend i.free { background: var(--free); } .sq-legend i.mt { background: var(--match); }
.sq-legend .note { flex-basis: 100%; }
button.slot.more { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
button.slot.more::after { content: none; }
.slots { grid-column: 2; display: flex; flex-wrap: wrap; gap: 5px; }
.slot {
  background: var(--free-soft); color: var(--free-text); border-radius: 7px;
  padding: 2px 8px; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.slot small { opacity: .75; margin-left: 4px; }

/* "Ver más": the list shows 4 at a time */
.more-btn {
  display: block; width: 100%; margin: 4px 0 14px; padding: 10px 14px; cursor: pointer;
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
  color: var(--text); font: inherit; font-weight: 600; font-size: 14px;
}
.more-btn:hover { border-style: solid; }
.more-btn .muted { font-weight: 400; color: var(--muted); }

/* Upcoming matches (created in the bot) */
.matches[hidden] { display: none; }
.matches { margin-bottom: 18px; }
.section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 8px; }
.match {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 8px; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center;
}
/* Full match: tinted card with a slightly heavier accent border. */
.match.full {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  padding: 11px 13px;  /* keeps the size identical despite the 2px border */
}
.filters { margin: 4px 0 12px; }
.filters .chips { padding-top: 0; padding-bottom: 6px; }
.match-when { font-weight: 600; font-variant-numeric: tabular-nums; }
.match-where { color: var(--muted); font-size: 13px; font-weight: 400; }
.match-players { grid-column: 1; display: flex; flex-wrap: wrap; gap: 5px; }
.player { background: var(--accent-soft); color: var(--text); border-radius: 7px; padding: 2px 8px; font-size: 13px; }
.player.free { background: none; border: 1px dashed var(--line); color: var(--muted); }
.match-side { grid-row: 1 / 3; grid-column: 2; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 6px; }
.badge { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.badge.full { color: var(--surface); background: var(--accent); border-radius: 999px; padding: 1px 9px; }
.match button {
  border: 1px solid var(--accent); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--accent); color: var(--surface); white-space: nowrap;
}
.match button.leave { background: none; color: var(--accent); }
.match button:disabled { opacity: .5; cursor: wait; }

.empty { color: var(--muted); padding: 6px 0 12px; font-size: 14px; }
.error { background: var(--warn-soft); color: var(--warn-text); border-radius: 10px; padding: 8px 10px; margin: 6px 0 10px; font-size: 14px; }
.error a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.loading { color: var(--muted); padding: 24px 0; text-align: center; }
footer { color: var(--muted); font-size: 12px; text-align: center; margin-top: 24px; }
footer a { color: inherit; }

@media (max-width: 420px) {
  .court { grid-template-columns: 1fr; }
  .slots { grid-column: 1; }
  .scale { margin-left: 0; }
}

/* Section tabs (every page) */
.tabs { display: flex; gap: 4px; margin-top: 10px; background: var(--track); border-radius: 999px; padding: 3px; }
.tabs a {
  flex: 1; text-align: center; padding: 6px 10px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: var(--muted); text-decoration: none; white-space: nowrap;
}
.tabs a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
/* Three tabs: shorter names on phones. */
.tabs .tab-short { display: none; }
@media (max-width: 560px) {
  .tabs .tab-long { display: none; }
  .tabs .tab-short { display: inline; }
  .tabs a { padding: 6px 6px; font-size: 13.5px; }
}

/* Players with an account: bold name. Bold is reserved for this. */
.tg-name { font-weight: 700; }

/* Create a match: button + bottom sheet */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.section-head .section-title { margin: 0; }
.new-btn {
  border: 0; background: var(--accent); color: var(--surface); border-radius: 999px;
  padding: 7px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 1px 2px rgb(0 0 0 / .12);
}
.notice { background: var(--accent-soft); border-radius: 10px; padding: 9px 12px; margin-bottom: 8px; font-size: 14px; }

dialog.sheet {
  border: 0; padding: 0; color: var(--text); background: var(--surface);
  width: min(520px, calc(100% - 32px)); max-height: min(88vh, 760px);
  border-radius: 20px; box-shadow: 0 20px 60px rgb(0 0 0 / .25);
  display: none; flex-direction: column; overflow: hidden;
}
dialog.sheet[open] { display: flex; }
dialog.sheet::backdrop { background: rgb(10 20 18 / .45); backdrop-filter: blur(2px); }
@media (max-width: 600px) {
  dialog.sheet {
    width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 20px 20px 0 0;
    max-height: 92vh; animation: sheet-up .22s ease-out;
  }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
body.sheet-open { overflow: hidden; }

.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.sheet-head h3 { margin: 0; font-size: 17px; }
.sheet-x {
  border: 0; background: var(--track); color: var(--muted); width: 30px; height: 30px; border-radius: 50%;
  font-size: 14px; cursor: pointer;
}
.sheet-body { padding: 4px 16px 16px; overflow-y: auto; }
.sheet-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.publish {
  width: 100%; border: 0; border-radius: 14px; padding: 14px; font: inherit; font-size: 16px; font-weight: 700;
  background: var(--accent); color: var(--surface); cursor: pointer;
}
.publish:disabled { opacity: .6; cursor: wait; }

.nf-summary {
  background: var(--accent-soft); border-radius: 14px; padding: 12px 14px; margin: 6px 0 4px;
}
.nf-when { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.nf-where { color: var(--muted); font-size: 14px; margin-top: 2px; }
.nf-field { margin-top: 16px; }
.nf-label { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.nf-label span { font-weight: 400; text-transform: none; letter-spacing: 0; }
.nf-field .chips { padding-top: 6px; }
.nf-input {
  width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; margin-top: 6px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text);
}
.nf-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--surface); }

.spots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.spot {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  border: 1px solid var(--line); border-radius: 12px; padding: 7px 8px; background: var(--surface);
}
.spot.empty { border-style: dashed; color: var(--muted); background: none; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 700;
}
/* Yellow = has an account (also the "+ name" chips to add them); grey = typed name. */
.avatar.tg { background: #f5b301; color: #3d2c00; }
.avatar.plain { background: var(--track); color: var(--muted); }
.chip.tg-chip { background: #fdf0c2; border-color: #f2d37a; color: #3d2c00; }
@media (prefers-color-scheme: dark) {
  .chip.tg-chip { background: #4a3b0f; border-color: #7a6220; color: #ffe7a3; }
}
.spot.empty .avatar { background: var(--track); color: var(--muted); }
.spot-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.spot-tag { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.spot-x { border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 2px 4px; }
.nf-add-members { margin-top: 4px; }
.nf-other { display: flex; gap: 8px; align-items: center; }
.nf-other .nf-input { flex: 1; min-width: 0; }
.nf-other button {
  margin-top: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 12px; padding: 10px 14px; font: inherit; font-size: 15px; cursor: pointer;
}

/* Free slots are buttons now (tap = create a match there) */
button.slot { border: 0; font: inherit; cursor: pointer; }
button.slot:hover, button.slot:focus-visible { box-shadow: inset 0 0 0 1.5px var(--free); }
button.slot::after { content: "+"; margin-left: 6px; font-weight: 700; opacity: .55; }

/* Sideways rows with arrows (Crear partido) */
.scroller { position: relative; }
.scroller .chips { scroll-behavior: smooth; padding-left: 2px; padding-right: 2px; }
.arrow {
  position: absolute; top: 50%; transform: translateY(-40%); z-index: 1;
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 6px rgb(0 0 0 / .15); display: grid; place-items: center; padding: 0 0 2px;
}
.arrow[hidden] { display: none; }
.arrow.left { left: -6px; }
.arrow.right { right: -6px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }

/* Court circles */
.dots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dot {
  min-width: 38px; height: 38px; border-radius: 999px; padding: 0 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer;
}
.dot.wide { padding: 0 14px; font-size: 14px; }
.dot[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); }

/* Upcoming match: pencil, pairs and win chance */
.side-top { display: flex; align-items: center; gap: 6px; }
.edit-btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; width: 30px; height: 30px;
  font-size: 13px; cursor: pointer; display: grid; place-items: center; padding: 0;
}
.vs { grid-column: 1; display: grid; gap: 5px; }
.vs-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vs-names { display: flex; flex-wrap: wrap; gap: 5px; }
.vs-pct { font-variant-numeric: tabular-nums; font-size: 15px; }
.vs-bar { display: flex; gap: 2px; height: 6px; }
.vs-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px 0 0 3px; }
.vs-bar i + i { background: var(--track); border-radius: 0 3px 3px 0; }
.vs-note { color: var(--muted); font-size: 11px; }

/* Sheet: pairs editor, delete */
.pairs-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.pair-box { border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: grid; gap: 6px; }
.pair-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 600; }
.pair-head b { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.pair-player {
  display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 10px; padding: 5px 6px; font: inherit; font-size: 14px; cursor: pointer; min-width: 0; text-align: left;
}
.pair-player small { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.pair-player[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.pair-player .avatar { width: 24px; height: 24px; font-size: 12px; }
.pairs-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 12px; }
.link-like { all: unset; color: var(--accent); font-weight: 600; font-size: 13px; cursor: pointer; }
.nf-danger { margin-top: 22px; text-align: center; }
.nf-danger button { all: unset; color: var(--warn-text); font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.match .edit-btn { background: var(--surface); color: var(--text); border: 1px solid var(--line); padding: 0; width: 30px; height: 30px; font-size: 13px; }
.match .edit-btn:hover { border-color: var(--accent); }

/* Upcoming match card (inspired by a tournament "next to play" card) */
:root { --amber: #b26a00; --amber-soft: #fff1d6; --amber-pill: #f5a524; --good: #1f7a3a; --good-soft: #dcf5e3;
        --friendly-bg: #f3eefc; --friendly-line: #8b5cf6; --friendly-text: #6d28d9; }
@media (prefers-color-scheme: dark) {
  :root { --amber: #ffb547; --amber-soft: #3a2a10; --amber-pill: #f5a524; --good: #7ee2a0; --good-soft: #163824;
          --friendly-bg: #221a33; --friendly-line: #a78bfa; --friendly-text: #c4b5fd; }
}
/* Amistoso: purple card; it has a score but no Elo and no ranking. */
.m2.friendly, .pc.friendly { background: var(--friendly-bg); border-color: color-mix(in srgb, var(--friendly-line) 35%, var(--line)); }
.pc.friendly { border-top-color: var(--friendly-line); }
.friendly-tag { font-size: 11px; font-weight: 700; color: var(--friendly-text); white-space: nowrap; }
.nf-check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; cursor: pointer;
            border: 1px solid var(--line); font-size: 14px; }
.nf-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--friendly-line); flex: none; }
.nf-check small { display: block; color: var(--muted); font-size: 12.5px; }
.nf-check:has(input:checked) { background: var(--friendly-bg); border-color: var(--friendly-line); }
.m2 {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 10px;
}
/* No side stripe (Impeccable, 2026-11-19): the next match gets a soft amber outline; friendlies keep their tint + tag */
.m2.next { border-color: color-mix(in srgb, var(--amber-pill) 55%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--amber-pill) 25%, transparent); }
.m2-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-height: 28px; }
.m2-meta.mid { opacity: .7; letter-spacing: 0; }
.m2-meta { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.m2-pill { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; white-space: nowrap; }
.m2-pill.open { background: var(--amber-pill); color: #2b1a00; }
.m2-pill.full { background: var(--accent); color: var(--surface); }
.m2-edit {
  margin-left: auto; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  width: 30px; height: 30px; font-size: 13px; cursor: pointer; padding: 0; display: grid; place-items: center;
}
.m2-body { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; margin-top: 6px; }
.m2-pairs { display: grid; gap: 8px; min-width: 0; }
.m2-pair { display: flex; align-items: center; gap: 8px; min-width: 0; }
.m2-avs { display: flex; flex: none; }
.m2-av {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  border: 2px solid var(--surface); margin-left: -7px; flex: none; box-sizing: border-box;
}
.m2-av:first-child { margin-left: 0; }
.m2-av.tg { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--accent); }
.m2-av.ph { overflow: hidden; background: var(--track); }
.m2-av.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m2-av.plain { background: var(--track); color: var(--muted); }
.m2-av.free { background: none; border: 1.5px dashed var(--line); }
.m2-names { font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m2-free { color: var(--muted); font-style: italic; }
.m2-pct {
  font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 4px; flex: none;
  background: var(--good-soft); color: var(--good); border: 1px solid color-mix(in srgb, var(--good) 35%, transparent);
  font-variant-numeric: tabular-nums;
}
.m2-when { text-align: right; line-height: 1.25; }
.m2-day { font-size: 13px; color: var(--muted); white-space: nowrap; }
.m2-est { font-size: 12px; color: var(--amber); }
.m2-count { font-size: 20px; font-weight: 800; color: var(--amber); font-variant-numeric: tabular-nums; white-space: nowrap;
  border-bottom: 1px dotted color-mix(in srgb, var(--amber) 60%, transparent); display: inline-block; }
.m2-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.m2-note { font-size: 12px; color: var(--muted); }
.m2-btn {
  border: 1px solid var(--accent); background: var(--accent); color: var(--surface); border-radius: 999px;
  padding: 6px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.m2-btn.leave { background: none; color: var(--accent); }
.m2-btn:disabled { opacity: .5; cursor: wait; }

/* Date on the upcoming card: big, in the normal text colour (black / white in dark mode) */
.m2-date { font-size: 20px; font-weight: 800; color: var(--text); white-space: nowrap; letter-spacing: -.01em; }
.m2-time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Live score on the cards */
.m2-pill.live { background: #d92d20; color: #fff; animation: live-blink 2s ease-in-out infinite; }
@keyframes live-blink { 50% { opacity: .7; } }
.m2-live { margin-left: auto; display: flex; gap: 4px; align-items: center; font-variant-numeric: tabular-nums; flex: none; }
.m2-live .ls { width: 18px; text-align: center; color: var(--muted); font-size: 14px; }
.m2-live .ls.won { color: var(--text); font-weight: 700; }
.m2-live .lg { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 5px; background: var(--track); font-weight: 800; font-size: 14px; }
.m2-live .lp { min-width: 30px; height: 22px; display: grid; place-items: center; border-radius: 5px; background: var(--amber-pill); color: #2b1a00; font-weight: 800; font-size: 13px; }
.m2-btn.score { background: #d92d20; border-color: #d92d20; color: #fff; }

/* Scorer's board: two big halves to tap */
dialog.scoreboard { height: min(92vh, 760px); }
.sb-body { flex: 1; display: grid; grid-template-rows: 1fr auto 1fr; gap: 8px; padding: 6px 14px; min-height: 0; }
.sb-side {
  border: 0; border-radius: 18px; padding: 14px; cursor: pointer; font: inherit; color: #fff; text-align: left;
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr auto; gap: 4px 10px; min-height: 0;
  -webkit-tap-highlight-color: transparent; transition: transform .05s;
}
.sb-side:active { transform: scale(.985); }
.sb-side.a { background: #0f766e; }
.sb-side.b { background: #334155; }
.sb-side:disabled { opacity: .8; cursor: default; }
.sb-names { font-size: 18px; font-weight: 700; grid-column: 1 / -1; }
.sb-score { display: flex; gap: 8px; align-items: baseline; font-variant-numeric: tabular-nums; }
.sb-set { font-size: 22px; opacity: .6; }
.sb-set.won { opacity: 1; font-weight: 700; }
.sb-games { font-size: 30px; font-weight: 800; background: rgb(255 255 255 / .18); border-radius: 8px; padding: 0 10px; }
.sb-point { font-size: 64px; font-weight: 900; line-height: 1; align-self: center; font-variant-numeric: tabular-nums; }
.sb-hint { font-size: 12px; opacity: .7; grid-column: 1 / -1; }
.sb-status { text-align: center; font-weight: 700; color: var(--muted); min-height: 20px; font-size: 14px; }
.sb-foot { display: flex; gap: 8px; padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); flex-wrap: wrap; }
.sb-foot button {
  flex: 1; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 12px;
  padding: 12px 10px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.sb-foot button.danger { color: var(--warn-text); }
.sb-foot button:disabled { opacity: .45; cursor: default; }
.sb-foot .publish { flex: 1 1 100%; }

/* Card actions: the red live-score circle (while live) and the "⋯" menu with everything else. */
.m2-actions { margin-left: auto; display: flex; gap: 6px; }
.m2-menu { position: relative; }
.m2-menu > summary { list-style: none; font-size: 18px; font-weight: 800; line-height: 1; color: var(--muted); user-select: none; }
.m2-menu > summary::-webkit-details-marker { display: none; }
.m2-menu[open] > summary { border-color: var(--accent); color: var(--text); }
.m2-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px;
  box-shadow: 0 10px 30px rgb(0 0 0 / .18); display: grid;
}
.m2-pop > a, .m2-pop > button {
  all: unset; box-sizing: border-box; display: grid; grid-template-columns: 22px 1fr; align-items: center; column-gap: 10px;
  padding: 10px; border-radius: 8px; font-size: 14px; color: var(--text); cursor: pointer;
}
.m2-pop > a:hover, .m2-pop > button:hover, .m2-pop > a:focus-visible, .m2-pop > button:focus-visible { background: var(--track); }
.m2-pop small { grid-column: 2; font-size: 12px; color: var(--muted); }
.m2-pop .mi-emoji { font-size: 15px; text-align: center; }
.m2-pop svg { justify-self: center; }
.m2-pop .wa svg { color: #1fa855; }
.m2-circle {
  border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px;
  width: 30px; height: 30px; font-size: 13px; cursor: pointer; padding: 0; display: grid; place-items: center;
}
.m2-circle:hover { border-color: var(--accent); }
/* WhatsApp green for "reservar pista por WhatsApp". */
.m2-circle.wa { color: #1fa855; text-decoration: none; }
.m2-circle.wa:hover { border-color: #25d366; }
.wa-book {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 8px;
  border: 1px solid color-mix(in srgb, #25d366 55%, var(--line)); border-radius: 14px; padding: 11px; font: inherit;
  font-size: 15px; font-weight: 600; background: color-mix(in srgb, #25d366 9%, var(--surface)); color: #1a8f48; cursor: pointer;
}
@media (prefers-color-scheme: dark) { .wa-book, .m2-circle.wa { color: #4ade80; } }
.m2-circle.live { background: #d92d20; border-color: #d92d20; color: #fff; animation: live-blink 2s ease-in-out infinite; }

/* While live, the score takes the date column's place (names need the room). */
.m2.is-live .m2-when { display: none; }
.m2.is-live .m2-body { grid-template-columns: 1fr; }

/* Our matches on the courts schedule (yellow; dashed while the booking is pending) */
a.slot.mt { background: var(--match-soft); color: var(--match-text); text-decoration: none; font-weight: 600;
            box-shadow: inset 0 0 0 1.5px var(--match); }
a.slot.mt.pending { box-shadow: none; outline: 1.5px dashed var(--match); outline-offset: -1.5px; }
a.slot.mt:hover { background: var(--match); color: #2b1a00; }
.m2.flash { animation: m2-flash 1.6s ease-out; }
@keyframes m2-flash { 0%, 40% { box-shadow: 0 0 0 3px var(--match); } 100% { box-shadow: 0 0 0 0 transparent; } }
/* Pending booking (made from "Reservar pista por WhatsApp") */
.m2.pending { border-style: dashed; border-color: var(--match); }
.m2-pill.pend { background: var(--match-soft); color: var(--match-text); box-shadow: inset 0 0 0 1px var(--match); }
.m2-foot.pend .m2-note { white-space: normal; }
.wa-note { font-size: 12.5px; color: var(--muted); margin: 6px 2px 10px; line-height: 1.35; }
/* "Entra para crear un partido" */
.login-why { color: var(--muted); font-size: 14px; line-height: 1.45; margin: 4px 0 14px; }
.login-opts { display: grid; gap: 10px; padding-bottom: 6px; }
.login-opt { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 12px; text-decoration: none;
             border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.login-opt:hover { border-color: var(--accent); }
.login-opt b { display: block; font-size: 15px; }
.login-opt small { color: var(--muted); font-size: 12.5px; }
.login-opt.g svg { flex: none; }

/* Padel icons (static/icons, from the Dypta set): before section titles, and bigger in empty states. */
img.ico { width: 20px; height: 20px; vertical-align: -5px; margin-right: 7px; }
h2.h:has(img.ico)::before { display: none; }
h2.h img.ico { width: 22px; height: 22px; margin-right: 0; }
img.ico-big { display: block; width: 52px; height: 52px; margin: 4px auto 8px; }
.empty:has(img.ico-big) { text-align: center; }
.intro:has(img.ico-big) { display: flex; gap: 12px; align-items: center; }
.intro img.ico-big { flex: none; width: 44px; height: 44px; margin: 0; }

/* "Nuevo en Hazit" on the home page: the last 3 members who joined, small round cards on the left */
.nc-list { display: flex; justify-content: flex-start; gap: 8px; }
.nc { flex: 0 1 84px; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px;
  padding: 10px 6px 8px; color: inherit; text-decoration: none; border-radius: 18px; border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 0%, var(--free-soft), var(--surface) 70%); }
.nc-av { position: relative; flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 18px; text-decoration: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--free); margin-bottom: 4px; }
.nc-av img:not(.nc-flag) { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.nc-flag { position: absolute; right: -3px; bottom: -1px; width: 17px; height: 17px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--surface); }
.nc-name { font-weight: 800; font-size: 13px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wave-btn { margin-top: 4px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px;
  padding: 3px 10px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.wave-btn[aria-pressed="true"] { background: var(--free); border-color: var(--free); color: #fff; }
.wave-btn:disabled { opacity: .6; cursor: default; }

/* Match type tag on match cards (masculino / femenino / mixto) */
.kind-tag { font-size: 11px; font-weight: 700; white-space: nowrap; padding: 1px 7px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); }
.nf-hint { display: block; margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.nf-past { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.nf-past input { font: inherit; color: var(--text, inherit); min-height: 40px; padding: 8px 12px; border: 1px solid var(--line, #d9dfdc); border-radius: 10px; background: var(--surface); color-scheme: light dark; }
.nf-past input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Match type chips in the form: femenino pink border, masculino blue border, white inside */
.chip[data-kind="femenino"] { border-color: #f08bb4; background: #fff; color: #9d174d; }
.chip[data-kind="masculino"] { border-color: #7fb0ea; background: #fff; color: #1d4f8f; }
.chip[data-kind="femenino"][aria-pressed="true"] { background: #fff; color: #be185d; border-color: #e0559a; box-shadow: inset 0 0 0 1.5px #e0559a; }
.chip[data-kind="masculino"][aria-pressed="true"] { background: #fff; color: #1d4f8f; border-color: #3b82d6; box-shadow: inset 0 0 0 1.5px #3b82d6; }
.kind-tag.k-femenino { background: #fff; color: #be185d; box-shadow: inset 0 0 0 1px #f08bb4; }
.kind-tag.k-masculino { background: #fff; color: #1d4f8f; box-shadow: inset 0 0 0 1px #7fb0ea; }
@media (prefers-color-scheme: dark) {
  .chip[data-kind="femenino"], .chip[data-kind="femenino"][aria-pressed="true"], .kind-tag.k-femenino { background: var(--surface); color: #f9a8d4; }
  .chip[data-kind="masculino"], .chip[data-kind="masculino"][aria-pressed="true"], .kind-tag.k-masculino { background: var(--surface); color: #93c5fd; }
}

/* Players in the new-match form: suggestions and search results */
.nf-suggest { margin: 10px 0 4px; font-size: 13px; }
.nf-suggest .chips { margin-top: 6px; }
.nf-results { margin-top: 8px; }
.nf-results:empty { display: none; }
.chip.typed-chip { font-style: italic; }
.chip.new-chip { border-style: dashed; }

/* "Crear partido" bar at the top of Jugados / Pistas / Disponibilidad, in the old Telegram bar's blue */
/* "＋ Crear partido" under the tabs (account.js): a blue pill in the old Telegram bar's colour, not full width. */
.create-bar { margin: -4px 0 16px; display: flex; justify-content: flex-end; }
.create-bar-btn { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; box-sizing: border-box;
  padding: 10px 18px 10px 14px; border-radius: 999px; background: #2481cc; color: #fff; text-decoration: none; font-size: 15px;
  box-shadow: 0 6px 16px -8px rgba(36, 129, 204, .9); transition: background .15s ease, transform .15s ease; }
.create-bar-btn:hover { background: #1f74b8; }
.create-bar-btn:active { transform: scale(.98); }
.create-bar-btn b { font-weight: 700; }
.create-bar-btn .cb-plus { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255, 255, 255, .2); font-size: 16px; line-height: 1; animation: cb-pulse 2.4s ease-in-out infinite; }
.create-bar-btn .cb-sub { opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.create-bar-btn .cb-go { margin-left: 2px; transition: transform .15s ease; }
.create-bar-btn:hover .cb-go { transform: translateX(3px); }
@keyframes cb-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .45); } 50% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); } }
@media (prefers-reduced-motion: reduce) { .create-bar-btn .cb-plus { animation: none; } }
@media (max-width: 420px) { .create-bar-btn .cb-sub { display: none; } }
body.sheet-open .create-bar { visibility: hidden; }

/* Your photo in the header opens this small card. */
.top-actions { position: relative; }
.acc-chev { font-size: 10px; color: var(--muted); margin-left: -2px; }
a.account[aria-expanded="true"] { border-color: var(--accent); }
.acc-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: 230px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .3); }
.acc-pop[hidden] { display: none; }
.acc-pop a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text);
  text-decoration: none; font-size: 14px; font-weight: 600; }
.acc-pop a:hover, .acc-pop a:focus-visible { background: var(--accent-soft); outline: none; }
.acc-pop .acc-head { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; font-weight: 400; }
.acc-head b { display: block; font-size: 14px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-head small { color: var(--muted); font-size: 12px; }
.acc-big { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; }
.acc-big.acc-initial { font-size: 16px; }
.acc-ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); }
.acc-pop a:hover .acc-ico { background: var(--accent); color: #fff; }
.acc-pop .acc-out .acc-ico { background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--muted); }
.acc-pop .acc-out { color: var(--muted); font-weight: 500; }


/* /pistas?embed=1: just the new-match sheet, over another page */
html.embed, html.embed body { background: transparent !important; }
html.embed body > :not(dialog) { display: none !important; }

/* "¡Partido creado!" sheet: share the match link by WhatsApp. */
.sheet-body.created { display: flex; flex-direction: column; gap: 10px; }
.created-card { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--free-soft); font-size: 14px; }
.created-card b { font-size: 16px; }
.created-why { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.share-wa { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px; border-radius: 14px;
  background: #25d366; color: #fff; text-decoration: none; font-weight: 700; font-size: 16px; }
.share-wa svg { width: 20px; height: 20px; }
.share-wa:hover { background: #1fb957; }
.share-copy { padding: 11px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.notice.mine-only { display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
/* The blue "Crear partido" pill replaces the section's own button on /pistas. */
.create-bar ~ .matches #new-match { display: none; }
.notice.mine-only a { color: var(--accent); font-weight: 600; }
html.mine-only .filters, html.mine-only #results { display: none; }
.squares i.past { opacity: .3; }
/* "Completos" on Pistas: full matches below the ones with free spots, a bit quieter. */
.full-head { margin: 18px 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.full-head span { text-transform: none; letter-spacing: 0; font-weight: 400; }
.full-head ~ .m2 { opacity: .8; }

/* Pistas libres: Playtomic-style timetable. One row per court, one square per half hour; scrolls
   sideways on phones with the court names pinned. White free, grey booked, yellow a Hazit match,
   blue the 1h30 you picked, striped the past, a blue line for now. */
:root { --tt-free: #ffffff; --tt-busy: #a9aeb3; --tt-line: #dfe3e6; --tt-sel: #2563eb; --tt-name: 34px; }
@media (prefers-color-scheme: dark) { :root { --tt-free: #1c2321; --tt-busy: #4b5258; --tt-line: #2b3431; --tt-sel: #3b82f6; } }
.tt { margin: 2px -2px 0; border: 1px solid var(--tt-line); border-radius: 12px; overflow: hidden; background: var(--surface); isolation: isolate; }
.tt-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.tt-grid { display: grid; grid-template-columns: var(--tt-name) repeat(var(--n), minmax(0, 1fr)); }
.tt-name { position: sticky; left: 0; z-index: 2; background: var(--surface); display: flex; align-items: center;
  padding: 0 4px; justify-content: center; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-right: 1px solid var(--tt-line); border-top: 1px solid var(--tt-line); height: 30px; box-sizing: border-box; }

.tt-corner { border-top: 0; height: 24px; }
.tt-h { height: 24px; display: flex; align-items: center; justify-content: center; font-size: 10.5px !important; font-size: 11px; color: var(--muted);
  font-variant-numeric: tabular-nums; border-left: 1px solid var(--tt-line); box-sizing: border-box; }
.tt-c { position: relative; display: block; height: 30px; margin: 0; padding: 0; border: 0; border-top: 1px solid var(--tt-line);
  border-left: 1px solid color-mix(in srgb, var(--tt-line) 45%, transparent); background: var(--tt-free); box-sizing: border-box; font: inherit; }
.tt-c.hr { border-left-color: var(--tt-line); }
.tt-c.busy { background: var(--tt-busy); border-left-color: color-mix(in srgb, var(--tt-busy) 70%, var(--surface)); }
button.tt-c.free { cursor: pointer; }
button.tt-c.free:hover { background: color-mix(in srgb, var(--tt-sel) 14%, var(--tt-free)); }
.tt-c.mt { background: var(--match); }
.tt-c.mt.pending { background: repeating-linear-gradient(135deg, var(--match) 0 4px, var(--tt-free) 4px 7px); }
.tt-c.sel { background: var(--tt-sel) !important; border-left-color: color-mix(in srgb, var(--tt-sel) 70%, #fff); }
.tt-c.past { background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--text) 7%, transparent) 6px 12px); }
.tt-c.past.free { background-color: var(--tt-free); }
.tt-c.now::after { content: ""; position: absolute; top: -1px; bottom: 0; left: var(--f); width: 2px; background: var(--accent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); z-index: 1; }
.tt-hint { margin: 8px 2px 4px; font-size: 12.5px; color: var(--muted); }
.tt-pick { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; padding: 8px 8px 8px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--tt-sel) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--tt-sel) 40%, var(--line)); }
.tt-pick.warn { background: color-mix(in srgb, #f59e0b 12%, var(--surface)); border-color: color-mix(in srgb, #f59e0b 45%, var(--line)); }
.tt-pick { gap: 10px; }
.tt-pick-ico { width: 30px; height: 30px; flex: none; display: block; }
.tt-pick-t { flex: 1; min-width: 0; font-size: 15px; display: flex; flex-direction: column; line-height: 1.25; }
.tt-pick-t small { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tt-go { border: 0; border-radius: 999px; padding: 8px 14px; background: var(--tt-sel); color: #fff; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; }
.tt-x { border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 4px 6px; }
.tt-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 14px; margin: 4px 2px 0; font-size: 12px; color: var(--muted); }
.tt-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tt-legend i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--tt-line); background: var(--tt-free); }
.tt-legend i.busy { background: var(--tt-busy); } .tt-legend i.mt { background: var(--match); } .tt-legend i.sel { background: var(--tt-sel); }
.tt-long { display: none; }
.tt-corner .tt-short { font-size: 9.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
/* Phones: the timetable uses the card's full width (no sideways scroll). */
@media (max-width: 699px) { .club .tt { margin: 2px -14px 0; border-radius: 0; border-left: 0; border-right: 0; } }
@media (min-width: 700px) {
  :root { --tt-name: 84px; }
  .tt-long { display: inline; } .tt-short { display: none; }
  .tt-name { justify-content: flex-start; padding: 0 8px; font-weight: 600; }
  .tt-h { font-size: 11px !important; }
}

/* Club name with the Dypta "Padel Club" crest. */
.club-head:has(.club-name) { align-items: center; margin-bottom: 10px; }
.club-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.club-t { display: flex; flex-direction: column; line-height: 1.2; white-space: nowrap; }
.club-t .count { font-size: 12.5px; font-weight: 400; margin-top: 2px; }
.club-name picture { display: contents; }
img.club-ico { width: 34px; height: 34px; margin: 0; flex: none; filter: drop-shadow(0 2px 4px rgba(11, 65, 112, .15)); }
/* Who created the match, under its date and time */
.m2-by { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.m2-by b { font-weight: 600; color: var(--text); }
/* An open ⋯ menu always sits above the next cards (faded "Completos" cards make their own layer). */
.m2:has(.m2-menu[open]) { position: relative; z-index: 20; opacity: 1 !important; }
/* The time-of-day chips are gone (the timetable always shows the whole day); [hidden] must win over .chips. */
#ranges[hidden] { display: none !important; }
/* Phones: date and time in one compact line above the players, so the names get the whole width. */
@media (max-width: 560px) {
  .m2-body { grid-template-columns: 1fr; gap: 6px; }
  .m2-when { order: -1; text-align: left; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
  .m2-date { font-size: 15px; }
  .m2-time { font-size: 14px; color: var(--text); font-weight: 600; }
  .m2-time::before { content: "· "; color: var(--muted); font-weight: 400; }
  .m2-by { margin-top: 0; }
  .m2-by::before { content: "· "; }
}
@media (max-width: 560px) {
  /* The ⋯ menu stays in the top-right corner even when the tags wrap to a second line. */
  .m2-top { position: relative; padding-right: 40px; }
  .m2-top > .m2-actions { position: absolute; top: -4px; right: 0; }
}

/* A club that blocks us for now: say so plainly and give one tap to its live courts. */
.error.blocked { display: grid; gap: 8px; }
.error.blocked .see-live { justify-self: start; background: var(--accent); color: var(--surface); text-decoration: none; font-weight: 700;
  border-radius: 10px; padding: 8px 12px; min-height: 36px; display: inline-flex; align-items: center; }

/* Match states (2026-11-19): started → «En juego»; ended → «Terminado» + 30 min to put the score in */
.m2-pill.playing { background: var(--good); color: var(--surface); }
.m2-pill.done { background: var(--track); color: var(--text); }
a.m2-btn { text-decoration: none; display: inline-block; }
.m2-pop > button.danger { color: #d92d20; border-top: 1px solid var(--line); }
/* Tap the card's white part: the big view */
.m2 { cursor: pointer; }
.m2 :is(button, a, summary) { cursor: pointer; }
dialog.m2-big { cursor: default; }
.mb { display: grid; gap: 10px; padding-top: 8px; }
.mb-when { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.mb-when b { font-size: 24px; letter-spacing: -.01em; }
.mb-time { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mb-court { color: var(--muted); font-size: 14px; }
.mb-when .m2-pill { align-self: center; }
.mb-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: relative;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 14px 10px 12px; }
.mb-p { display: grid; justify-items: center; gap: 8px; min-width: 0; text-align: center; }
.mb-av { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 800;
  overflow: hidden; background: var(--track); color: var(--muted); }
.mb-av.tg { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--accent); }
.mb-av.free { background: none; border: 2px dashed var(--line); }
.mb-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mb-name { font-size: 16px; max-width: 100%; overflow-wrap: anywhere; }
.mb-pct { position: absolute; top: 8px; right: 8px; font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
  background: var(--good-soft); color: var(--good); font-variant-numeric: tabular-nums; }
.mb-vs { text-align: center; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.mb-by { margin: 0; font-size: 13px; color: var(--muted); }
.mb-shot { width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.mb-share { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px;
  padding: 13px 16px; font: inherit; font-weight: 700; font-size: 15px; background: #25d366; color: #052e16; cursor: pointer; }
.mb-share { text-decoration: none; box-sizing: border-box; }
.mb-shot { display: block; aspect-ratio: 1200 / 630; background: #0f766e; }

/* Phosphor icons (MIT) in cards, tags, buttons and the ⋯ menu: /static/icons/ph.svg (tools/build_icons.py) */
.pi { width: 1.05em; height: 1.05em; display: inline-block; vertical-align: -.17em; flex: none; }
.m2-btn .pi, .friendly-tag .pi, .kind-tag .pi, .m2-pill .pi, .m2-note .pi { margin-right: 4px; }
.m2-pop .pi { width: 18px; height: 18px; vertical-align: 0; }
.m2-pop > button.danger .pi { color: #d92d20; }
.m2-note .pi { color: var(--muted); }
.m2-pill .pi { vertical-align: -.2em; }
.mb-share .pi { width: 20px; height: 20px; }

/* "Mis partidos": the ones you already played, under the upcoming ones */
.past-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.past-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.past-badge { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; }
.past-badge.win { background: var(--win, #0f766e); }
.past-badge.loss { background: var(--loss, #c2410c); }
.past-badge.none { background: var(--track); color: var(--muted); }
.past-main { flex: 1; min-width: 0; display: grid; gap: 2px; font-size: 14px; }
.past-main > b, .past-main > .muted { overflow: hidden; text-overflow: ellipsis; }
.past-main small { color: var(--muted); font-size: 12px; }
.past-score { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.past-add { flex: none; font-size: 13px; font-weight: 700; color: var(--accent); }
.past-more { display: block; text-align: center; text-decoration: none; margin-top: 8px; }

/* Owner only: «Admin» beside the photo, to hazit.es/admin (account.js). Icon only on phones. */
.acc-admin { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; flex: none;
  background: rgba(255,255,255,.14); color: inherit; text-decoration: none; font-size: 13px; font-weight: 600; }
.acc-admin:hover { background: rgba(255,255,255,.24); }
.acc-admin:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
@media (max-width: 520px) { .acc-admin { width: 36px; padding: 0; justify-content: center; } .acc-admin span { display: none; } }

/* Opened from a new-match email (?partido=): the match is lit up for a moment. */
.m2.flash { outline: 3px solid #ffd43b; outline-offset: 3px; animation: m2-flash 2.4s ease-out 1 forwards; }
@keyframes m2-flash { 0%, 70% { outline-color: #ffd43b; } 100% { outline-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .m2.flash { animation: none; } }
