/* Basketball court reservation page. Builds on css/styles.css (same palette and fonts). */

.court-wrap { max-width: 760px; margin-inline: auto; display: grid; gap: 18px; }
.court-wrap h2 { font-size: 1.4rem; margin: 0 0 8px; }
.court-wrap h3 { font-size: 1.1rem; margin: 0 0 6px; }
.court-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(14px, 3.5vw, 24px); box-shadow: var(--shadow-sm); }
.court-card--gold { border-top: 6px solid var(--gold-600); }
.court-rules { margin: 0; padding-left: 1.15em; display: grid; gap: 4px; }
.court-back { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; padding: 8px 2px; min-height: 44px; border: 0; background: none; color: var(--royal); font-size: 1rem; cursor: pointer; }
.court-back svg { width: 18px; height: 18px; }
.court-find { display: grid; gap: 10px; }
@media (min-width: 560px) { .court-find { grid-template-columns: 1fr auto; align-items: end; } .court-find .field { margin: 0; } }

/* ---------- the calendar ---------- */
.cal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.cal-head h2 { margin: 0; }
.cal-legend { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: .84rem; color: var(--ink-soft); }
.cal-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal-dow { text-align: center; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); padding: 2px 0 4px; }
.cal-cell { position: relative; min-height: 64px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; padding: 6px 2px 4px; font: inherit; color: var(--ink-soft); text-align: center; cursor: default; }
.cal-num { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.1; }
.cal-note { font-size: .66rem; line-height: 1.15; font-weight: 700; letter-spacing: .02em; }
.cal-cell.is-today { box-shadow: inset 0 0 0 2px var(--sky); }
.cal-cell.is-off { opacity: .45; }
.cal-cell.is-closed { background: repeating-linear-gradient(-45deg, #f1ead2 0 6px, #f8f2de 6px 12px); opacity: .85; }
.cal-cell.is-open { cursor: pointer; background: var(--white); border-color: var(--gold-600); color: var(--navy-800); box-shadow: 0 2px 0 var(--gold-600); transition: transform .12s, box-shadow .12s; }
.cal-cell.is-open:hover { transform: translateY(-2px); box-shadow: 0 4px 0 var(--gold-600); }
.cal-cell.is-open .cal-note { color: var(--ok); }
.cal-cell.is-full .cal-note { color: var(--err); }
.cal-cell.is-selected { background: var(--navy-800); color: var(--gold); border-color: var(--navy-800); box-shadow: 0 2px 0 var(--navy-900); }
.cal-cell.is-selected .cal-note { color: #ffd95e; }
.cal-cell:focus-visible { outline: 3px solid var(--gold-600); outline-offset: 2px; }
.cal-month { grid-column: 1 / -1; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--royal); padding: 6px 2px 0; }

/* ---------- slots ---------- */
.slots { display: grid; gap: 10px; margin-top: 4px; }
.slot { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); }
.slot-time { font-family: var(--font-display); font-size: 1.15rem; color: var(--navy-800); }
.slot-sub { grid-column: 1; font-size: .88rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.slot .btn { grid-row: 1 / span 2; grid-column: 2; }
.slot.is-open { border-color: var(--gold-600); background: var(--white); }
.chip-state { display: inline-block; padding: 2px 11px; border-radius: 999px; font-weight: 700; font-size: .8rem; }
.chip-state.open { background: var(--ok-bg); color: var(--ok); }
.chip-state.pending { background: var(--warn-bg); color: #6b4700; }
.chip-state.booked { background: var(--err-bg); color: var(--err); }
.ref { font-family: var(--font-display); letter-spacing: .04em; color: var(--navy-800); }

/* ---------- request form ---------- */
.court-summary { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 12px 16px; background: var(--navy-800); color: var(--white); border-radius: var(--radius); border: 2px solid var(--gold-600); }
.court-summary strong { font-family: var(--font-display); font-weight: 400; font-size: 1.15rem; color: var(--gold); }
.court-summary span { display: inline-flex; gap: 6px; align-items: center; }
.court-summary svg { width: 18px; height: 18px; color: var(--gold); }
.cg { border: 2px solid var(--line); border-left: 6px solid var(--gold-600); border-radius: var(--radius); background: var(--cream); padding: 12px 12px 4px; margin-bottom: 12px; position: relative; }
.cg-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.cg-top strong { font-family: var(--font-display); font-weight: 400; font-size: 1.05rem; color: var(--navy-800); }
.cg .field { margin-bottom: 12px; }
.cg input[type=text] { background: var(--white); }
.cg-type { display: grid; gap: 8px; margin-bottom: 12px; }
@media (min-width: 560px) { .cg-type { grid-template-columns: 1fr 1fr; } }
.cg-type .choice span { min-height: 48px; background: var(--white); }
.cg.is-locked { border-left-color: var(--navy-800); background: var(--paper); padding-bottom: 12px; display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.cg.is-locked svg { width: 18px; height: 18px; color: var(--ink-soft); flex: none; }
.cg-meta { font-size: .85rem; color: var(--ink-soft); }
.fee-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; align-items: baseline; padding: 12px 16px; border-radius: var(--radius); background: var(--sky-soft); border: 1.5px solid var(--sky); color: var(--navy-800); font-weight: 700; }
.fee-line b { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; }
.pay { border: 2px dashed var(--gold-600); border-radius: var(--radius-lg); padding: 16px; background: var(--cream); display: grid; gap: 12px; }
.pay-qr { justify-self: center; width: min(260px, 70vw); aspect-ratio: 1; object-fit: contain; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 8px; }
.proof-prev { display: grid; grid-template-columns: 84px 1fr auto; gap: 12px; align-items: center; background: var(--white); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; }
.proof-prev img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.proof-prev small { color: var(--ink-soft); }
.court-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 600px) { .court-actions .btn { width: 100%; } }

/* ---------- ticket + status ---------- */
.big-ticket { font-family: var(--font-display); font-size: clamp(1.9rem, 9vw, 2.6rem); letter-spacing: .06em; color: var(--gold); margin: 6px 0 2px; word-break: break-all; }
.keep-note { font-size: .92rem; color: #d6e0f5; margin: 6px 0 0; }
.status-head { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: space-between; align-items: center; }
.status-big { font-size: 1rem; padding: 6px 18px; }
.reason { padding: 12px 14px; border-radius: 12px; background: var(--err-bg); border: 1.5px solid var(--err); color: #5b0b0d; }
.reason.ok { background: var(--ok-bg); border-color: var(--ok); color: #123d22; }
.g-table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 0; }
.g-table th { text-align: left; background: var(--navy-800); color: var(--gold); padding: 8px 10px; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.g-table td { padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.tag-res, .tag-non, .tag-add { display: inline-block; font-size: .72rem; font-weight: 700; border-radius: 6px; padding: 1px 7px; }
.tag-res { background: var(--ok-bg); color: var(--ok); } .tag-non { background: var(--warn-bg); color: #6b4700; } .tag-add { background: var(--sky-soft); color: var(--navy-700); }
.addon { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 10px; background: var(--paper); }
.addon-h { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: space-between; }

.callout[hidden], .court-wrap [hidden] { display: none !important; }
.court-jump { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--cream); border: 1.5px solid var(--gold-600); border-radius: var(--radius); }
.court-jump span { font-weight: 700; color: var(--navy-800); }

/* ---------- atmosphere: court-floor hero + bouncing balls (see js/court-fx.js) ---------- */
.court-hero { min-height: 190px; display: grid; align-items: center; }
.court-hero::before { background:
  radial-gradient(ellipse 60% 70% at 50% 0%, rgba(249,201,55,.34), transparent 62%),
  radial-gradient(circle at 50% 135%, transparent 0 74px, rgba(249,201,55,.38) 74px 76px, transparent 76px),
  radial-gradient(circle at 50% 135%, transparent 0 128px, rgba(249,201,55,.2) 128px 130px, transparent 130px),
  linear-gradient(180deg, var(--navy-800), var(--navy-900)); }
.court-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 14px; height: 2px; z-index: 0; background: linear-gradient(90deg, transparent, rgba(249,201,55,.8) 18%, rgba(249,201,55,.8) 82%, transparent); box-shadow: 0 0 14px rgba(249,201,55,.5); mask-image: none; -webkit-mask-image: none; inset: auto 0 14px 0; background-image: linear-gradient(90deg, transparent, rgba(249,201,55,.8) 18%, rgba(249,201,55,.8) 82%, transparent); }
.court-hero .wrap { position: relative; z-index: 2; padding-block: 18px 40px; }
.court-hero h1 { text-shadow: 0 2px 18px rgba(3,21,48,.7); }
.court-hero p { text-shadow: 0 1px 10px rgba(3,21,48,.8); }
.fx-canvas { display: block; pointer-events: none; }
.fx-hero { position: absolute; inset: 0; z-index: 1; }
.fx-page { position: fixed; inset: 0; z-index: 0; }
body.court-fx .sa-bar, body.court-fx main, body.court-fx .sa-foot { position: relative; z-index: 1; }
body.court-fx { background: var(--paper); }
body.court-fx .court-card { background: rgba(255,255,255,.93); }
.fx-toggle { position: absolute; right: 10px; bottom: 22px; z-index: 3; min-height: 36px; padding: 4px 14px; border-radius: 999px; border: 1.5px solid rgba(249,201,55,.7); background: rgba(3,21,48,.55); color: var(--gold); font: 700 .78rem var(--font-body); cursor: pointer; backdrop-filter: blur(2px); }
.fx-toggle:hover:not([disabled]) { background: rgba(249,201,55,.2); }
.fx-toggle[disabled] { opacity: .6; cursor: default; }
@media (max-width: 600px) { .court-hero { min-height: 170px; } .court-hero .wrap { padding-block: 12px 38px; } .fx-toggle { bottom: 20px; min-height: 32px; } }
@media (prefers-reduced-motion: reduce) { .court-card, .cal-cell { transition: none !important; } }

/* ---------- month calendar ---------- */
.cal-nav { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-title { margin: 0; text-align: center; font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; color: var(--navy-800); }
.cal-arrow { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--navy-800); background: var(--white); color: var(--navy-800); display: grid; place-items: center; cursor: pointer; padding: 0; }
.cal-arrow svg { width: 20px; height: 20px; }
.cal-arrow:hover:not([disabled]) { background: var(--navy-800); color: var(--gold); }
.cal-arrow[disabled] { opacity: .3; cursor: default; }
.cal-blank { min-height: 1px; }
.cal { gap: 4px; }
.cal-cell { min-height: 58px; padding: 6px 1px 4px; border-radius: 10px; }
.cal-cell.is-closed.is-off { opacity: .5; }
.cal-cell.is-off .cal-note { font-size: .6rem; }
@media (max-width: 400px) { .cal { gap: 3px; } .cal-cell { min-height: 56px; border-radius: 9px; } .cal-note { font-size: .6rem; } .cal-num { font-size: 1.05rem; } .court-card:has(#cal-box) { padding-inline: 10px; } }

/* ---------- small phones: the calendar must start on the first screen ---------- */
@media (max-width: 420px) {
  .court-hero { min-height: 0; }
  .court-hero .wrap { padding-block: 10px 30px; }
  .court-hero .sa-seal { width: 56px; height: 56px; margin-bottom: 4px; }
  .court-hero h1 { font-size: 1.45rem; margin-bottom: 2px; }
  .court-hero p { font-size: .9rem; line-height: 1.35; margin: 0; }
  .court-jump { padding: 8px 10px; gap: 6px 10px; flex-wrap: nowrap; }
  .court-jump span { font-size: .88rem; line-height: 1.2; }
  .court-jump .btn { flex: none; white-space: nowrap; }
  .cal-head h2 { font-size: 1.25rem; }
  .cal-nav { margin-bottom: 6px; }
}

.cal-intro { margin: 0 0 10px; }
.choice--check { min-height: 44px; }
@media (max-width: 420px) {
  .cal-intro { font-size: .88rem; line-height: 1.35; margin-bottom: 8px; }
  .court-hero .wrap { padding-block: 8px 46px; }
  .fx-toggle { bottom: 8px; }
  .court-hero h1 { font-size: 1.35rem; }
}
@media (max-width: 360px) {
  .court-hero p { font-size: .82rem; }
  .court-jump span { font-size: .8rem; }
  .court-jump .btn { padding-inline: 12px; font-size: .85rem; }
}

.pay-how { margin: 0; text-align: center; font-size: .92rem; }
.pay-how a { font-weight: 700; }

/* ---------- cancel my request ---------- */
.btn--cancel { border-color: var(--err); color: var(--err); }
.btn--cancel:hover { background: var(--err-bg); color: var(--err); }
.btn--danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn--danger:hover { background: #8f1519; border-color: #8f1519; }
.cancel-box { margin-top: 14px; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--err); background: var(--err-bg); color: #5b0b0d; }
.cancel-box h3 { margin: 0 0 6px; color: var(--err); }
.cancel-box .court-actions { margin-top: 10px; }
.cancel-err { margin: 8px 0 0; font-weight: 700; color: var(--err); }
.cancel-err:empty { display: none; }

/* ---------- reschedule ---------- */
.manage-row { display: flex; flex-wrap: wrap; gap: 10px; }
.move-box { border-color: var(--gold-600); background: var(--cream); color: var(--ink); margin: 0 0 12px; }
.move-box h3 { color: var(--navy-800); }
