:root {
  --court-ink: #111a22;
  --court-muted: #687681;
  --court-line: #dce3e5;
  --court-paper: #fff;
  --court-base: #f4f6f1;
  --court-yellow: #ffd21e;
  --court-yellow-deep: #d6a900;
  --court-cyan: #daf3fb;
  --court-cyan-ink: #176e89;
  --court-danger: #a53a32;
  --court-success: #167153;
  --court-shadow: 0 18px 48px rgba(16, 25, 34, .1);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--court-base); scroll-padding-top: 94px; }
body {
  min-height: 100%;
  margin: 0;
  color: var(--court-ink);
  background: linear-gradient(132deg, #f1f4ed 0%, #fafbf8 52%, #edf4f1 100%);
  font-family: Inter, Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  letter-spacing: -.025em;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
:focus-visible { outline: 3px solid rgba(35, 166, 213, .32); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  padding: 10px 14px; border-radius: 8px; color: #111a22; background: var(--court-yellow);
  font-weight: 900; transform: translateY(-150%);
}
.skip-link:focus { transform: none; }
.shell { min-height: 100vh; margin-bottom: 52px !important; }
.brand { border: 0; background: transparent; cursor: pointer; }

#app { min-height: 520px; padding-top: 18px; }
.court-initial-loading {
  min-height: 360px; display: grid; place-items: center; align-content: center; gap: 12px;
  color: var(--court-muted);
}
.court-initial-loading span, .loading-ring {
  width: 28px; height: 28px; border: 3px solid #d8e1e2; border-top-color: var(--court-yellow-deep);
  border-radius: 50%; animation: court-spin .8s linear infinite;
}
@keyframes court-spin { to { transform: rotate(360deg); } }

.booking-page { width: 100%; }
.booking-hero {
  min-height: 286px; overflow: hidden; position: relative; display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
  color: #fff; border-radius: 14px; background: #111a22; box-shadow: var(--court-shadow);
}
.booking-hero::after {
  content: ""; position: absolute; right: 34%; bottom: 36px; width: 46%; height: 1px;
  background: rgba(255,210,30,.32); transform: rotate(-9deg);
}
.hero-copy { position: relative; z-index: 1; padding: 42px 38px; }
.eyebrow, .step-kicker {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px;
  color: var(--court-yellow); border: 1px solid rgba(255,210,30,.42); border-radius: 999px;
  font-size: 11px; font-weight: 950; letter-spacing: .05em;
}
.booking-hero h1 { margin: 18px 0 12px; font-size: clamp(36px, 5vw, 58px); line-height: 1.02; letter-spacing: -.06em; }
.booking-hero p { max-width: 700px; margin: 0; color: #d3dde2; font-size: 15px; line-height: 1.7; }
.hero-image {
  min-height: 260px;
  background: linear-gradient(90deg, rgba(17,26,34,.64), rgba(17,26,34,.04)), url("./facility-court.webp") center / cover no-repeat;
}

.booking-journey {
  margin: 14px 0 0; padding: 14px 18px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr));
  border: 1px solid var(--court-line); border-radius: 12px; background: rgba(255,255,255,.86);
}
.journey-step { display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 10px; align-items: center; color: #86929a; }
.journey-step + .journey-step { padding-left: 18px; border-left: 1px solid var(--court-line); }
.journey-step b { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 999px; background: #edf1f2; }
.journey-step strong, .journey-step span { display: block; }
.journey-step strong { font-size: 13px; }
.journey-step span { margin-top: 2px; font-size: 11px; }
.journey-step.active { color: var(--court-ink); }
.journey-step.active b { color: #111a22; background: var(--court-yellow); }

.panel {
  margin-top: 16px; border: 1px solid var(--court-line); border-radius: 14px;
  background: var(--court-paper); box-shadow: 0 8px 28px rgba(18,30,38,.05);
}
.panel-head { padding: 24px 26px 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.panel-head .step-kicker { min-height: auto; padding: 0; color: #a37e00; border: 0; border-radius: 0; }
.panel-head h2 { margin: 7px 0 0; font-size: 26px; letter-spacing: -.045em; scroll-margin-top: 98px; }
.panel-head p { max-width: 720px; margin: 7px 0 0; color: var(--court-muted); font-size: 14px; line-height: 1.55; }
.panel-body { padding: 22px 26px 26px; }
.location-control { min-width: 230px; }
.field { display: grid; gap: 7px; }
.field label { color: #5e6c76; font-size: 12px; font-weight: 900; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cfd9dc;
  border-radius: 9px; color: var(--court-ink); background: #fff;
}
textarea { min-height: 74px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--court-cyan-ink); box-shadow: 0 0 0 3px rgba(35,166,213,.12); outline: 0; }

/* Match the touch-input sizing verified on the player screen. Keep the
   browser's pinch zoom available; do not change buttons or native toggles. */
@media (max-width: 780px), (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),
  select,
  textarea {
    font-size: 18px !important;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    touch-action: manipulation;
  }
}

.court-product-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.court-product {
  position: relative; min-height: 176px; padding: 22px; display: grid; align-content: end; text-align: left;
  overflow: hidden; border: 1px solid #d5dfe1; border-radius: 13px; color: #fff; background: #16212a;
}
.court-product::before { content: ""; position: absolute; inset: 0; opacity: .58; background-position: center; background-size: cover; }
.court-product::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,15,20,.04), rgba(10,15,20,.9)); }
.court-product[data-court="ALPHA"]::before { background-image: url("./court-alpha.jpg"); }
.court-product[data-court="PRIVATE"]::before { background-image: url("./court-private.jpg"); }
.court-product > * { position: relative; z-index: 1; }
.court-product:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(16,25,34,.16); }
.court-product.active { border: 3px solid var(--court-yellow); padding: 20px; }
.court-product small { color: var(--court-yellow); font-weight: 900; }
.court-product h3 { margin: 6px 0 4px; font-size: 23px; }
.court-product p { margin: 0; color: #dae3e7; font-size: 13px; line-height: 1.42; }
.court-product .price { margin-top: 13px; color: #fff; font-size: 15px; font-weight: 900; }
.booking-caution {
  margin-top: 14px; padding: 13px 15px; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 12px;
  color: #66520d; border-left: 4px solid var(--court-yellow-deep); border-radius: 8px; background: #fff8d9; font-size: 13px; line-height: 1.5;
}
.booking-step-actions {
  margin-top: 18px; padding-top: 18px; display: flex; justify-content: space-between; align-items: center; gap: 18px;
  border-top: 1px solid var(--court-line);
}
.booking-step-actions span, .booking-step-actions strong { display: block; }
.booking-step-actions span { color: var(--court-muted); font-size: 11px; font-weight: 900; }
.booking-step-actions strong { margin-top: 3px; font-size: 15px; }
.primary, .secondary, .ghost {
  min-height: 44px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; font-weight: 900; text-decoration: none;
}
.primary { border: 0; color: #111a22; background: var(--court-yellow); }
.primary:hover { background: #ffdc50; }
.secondary { border: 0; color: #fff; background: #111a22; }
.secondary:hover { background: #253541; }
.ghost { border: 1px solid #cdd7da; color: var(--court-ink); background: #fff; }
.primary:disabled, .secondary:disabled { color: #7d898f; background: #dbe1e3; }

.rental-load-feedback {
  margin-bottom: 16px; padding: 14px 15px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border: 1px solid #d5e4e8; border-radius: 10px; background: #f1f8fa;
}
.rental-load-feedback.loading-state { justify-content: flex-start; }
.rental-load-feedback.error { color: #782b27; border-color: #efc1bc; background: #fff0ee; }
.rental-load-feedback strong, .rental-load-feedback p { margin: 0; }
.rental-load-feedback p { margin-top: 3px; font-size: 12px; line-height: 1.45; }
.rental-load-feedback .loading-ring { width: 22px; height: 22px; flex: 0 0 auto; }

.selected-court-strip {
  margin-bottom: 14px; padding: 12px 14px; display: flex; justify-content: space-between; gap: 16px;
  border-radius: 9px; color: #dfe7ea; background: #111a22;
}
.selected-court-strip span { color: #9eabb2; font-size: 12px; }
.week-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.week-toolbar strong { font-size: 16px; }
.week-nav { display: flex; gap: 7px; }
.week-nav button { min-width: 42px; }
.date-tabs {
  margin: 12px 0 16px; display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 7px;
}
.date-tab {
  min-height: 66px; padding: 8px 4px; display: grid; place-items: center; gap: 2px;
  border: 1px solid #d7e0e2; border-radius: 9px; color: #55636d; background: #fff;
}
.date-tab span { font-size: 11px; font-weight: 900; }
.date-tab strong { font-size: 16px; }
.date-tab.active { color: #111a22; border-color: #b18c09; background: #fff5bf; }
.date-tab.past { color: #a5adb2; background: #f4f5f5; }

.schedule-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 16px; align-items: start; }
.time-list { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.time-slot {
  min-height: 70px; padding: 10px 12px; display: grid; text-align: left; border: 1px solid #d7e0e2;
  border-radius: 9px; color: #75818a; background: #f2f4f4;
}
.time-slot strong { color: inherit; font-size: 14px; }
.time-slot span { align-self: end; font-size: 11px; }
.time-slot.open { color: var(--court-cyan-ink); border-color: #a9dbe9; background: var(--court-cyan); }
.time-slot.open:hover { border-color: #4dafcc; }
.time-slot.selected { color: #111a22; border-color: #ae8700; background: var(--court-yellow); box-shadow: inset 0 0 0 1px #ae8700; }
.time-slot.blocked { color: #fff; border-color: #53606a; background: #5d6972; }
.time-slot.closed { color: #9aa4a9; }
.schedule-empty { padding: 34px 20px; text-align: center; border: 1px dashed #cad5d8; border-radius: 10px; color: var(--court-muted); }
.schedule-empty strong, .schedule-empty p { display: block; margin: 0; }
.schedule-empty p { margin-top: 6px; font-size: 12px; }

.rental-summary {
  position: sticky; top: 90px; padding: 18px; border-radius: 12px; color: #eef4f6; background: #111a22;
}
.rental-summary h3 { margin: 0; font-size: 18px; }
.rental-summary > p { margin: 6px 0 14px; color: #aebac0; font-size: 12px; line-height: 1.45; }
.summary-ranges { display: grid; gap: 7px; }
.summary-range { padding: 9px 10px; display: flex; justify-content: space-between; gap: 10px; border-radius: 8px; background: rgba(255,255,255,.07); }
.summary-range span { color: #c2cdd2; font-size: 12px; }
.summary-range button { border: 0; color: #fff; background: transparent; font-weight: 900; }
.summary-total { margin: 14px 0; padding-top: 12px; display: flex; justify-content: space-between; border-top: 1px solid rgba(255,255,255,.15); }
.summary-total span { color: #aebac0; font-size: 12px; }
.summary-total strong { color: var(--court-yellow); font-size: 21px; }
.rental-summary .field { margin-top: 12px; }
.rental-summary .field label { color: #c6d0d4; }
.terms-choice { margin: 13px 0; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 9px; align-items: start; font-size: 12px; line-height: 1.5; }
.terms-choice input { width: 18px; min-height: 18px; margin: 0; }
.rental-summary .primary { width: 100%; }
.preview-summary { text-align: center; }
.preview-summary .preview-lock { width: 48px; height: 48px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; color: #111a22; background: var(--court-yellow); font-size: 20px; }
.rental-preview-actions { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.14); }
.rental-preview-actions p { margin: 0 0 12px; color: #c2cdd2; font-size: 12px; line-height: 1.5; }
.rental-preview-actions div { display: grid; gap: 8px; }

.footnote { margin: 15px 4px 0; color: var(--court-muted); font-size: 12px; line-height: 1.55; }
.mobile-booking-bar { display: none; }

.payment-success-page { min-height: 500px; display: grid; place-items: start center; }
.payment-success-card { width: min(760px, 100%); overflow: hidden; border: 1px solid var(--court-line); border-radius: 16px; background: #fff; box-shadow: var(--court-shadow); }
.payment-success-hero { padding: 34px; text-align: center; color: #fff; background: #111a22; }
.payment-success-mark { width: 54px; height: 54px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; color: #111a22; background: var(--court-yellow); font-size: 28px; font-weight: 900; }
.payment-success-hero span { color: var(--court-yellow); font-size: 11px; font-weight: 950; letter-spacing: .06em; }
.payment-success-hero h1 { margin: 7px 0; font-size: 31px; }
.payment-success-hero p { margin: 0; color: #c6d0d5; }
.payment-success-body { padding: 26px; }
.receipt-list { display: grid; gap: 9px; }
.receipt-row { padding: 13px 14px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; border: 1px solid #e0e6e8; border-radius: 10px; }
.receipt-row strong, .receipt-row span { display: block; }
.receipt-row span { color: var(--court-muted); font-size: 12px; }
.receipt-row strong { margin-top: 3px; }
.receipt-row > b { align-self: center; color: var(--court-success); }
.payment-success-total { margin: 18px 0; padding: 15px; display: flex; justify-content: space-between; border-radius: 10px; background: #f3f5f3; }
.payment-success-total strong { font-size: 22px; }
.payment-success-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 180; padding: 20px; display: grid; place-items: center;
  background: rgba(7,12,16,.62); backdrop-filter: blur(5px);
}
.modal { width: min(520px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; border-radius: 16px; background: #fff; box-shadow: 0 28px 90px rgba(0,0,0,.34); }
.modal-head { padding: 22px 22px 0; display: flex; justify-content: space-between; gap: 16px; }
.modal-head h2 { margin: 0; }
.modal-head p { margin: 6px 0 0; color: var(--court-muted); font-size: 13px; line-height: 1.45; }
.modal-close { width: 36px; height: 36px; border: 1px solid #d3dcde; border-radius: 50%; background: #fff; font-size: 20px; }
.modal-body { padding: 20px 22px 24px; display: grid; gap: 13px; }
.modal-body .primary { width: 100%; }
.form-error { padding: 11px 12px; color: #842e29; border: 1px solid #efb8b2; border-radius: 8px; background: #fff0ee; font-size: 12px; }

#toast-root { position: fixed; z-index: 220; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { max-width: min(420px, calc(100vw - 32px)); padding: 13px 15px; color: #fff; border-radius: 10px; background: #111a22; box-shadow: 0 14px 38px rgba(0,0,0,.24); font-size: 13px; }
.toast.error { background: #963b34; }

@media (max-width: 900px) {
  html { scroll-padding-top: 132px; }
  .booking-hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 32px 26px; }
  .hero-image { min-height: 180px; }
  .panel-head h2 { scroll-margin-top: 138px; }
  .schedule-layout { grid-template-columns: 1fr; }
  .rental-summary { position: static; }
  .time-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 700px) {
  :root { --unified-public-page-gutter: 10px; }
  #app { padding-top: 12px; }
  .booking-hero { min-height: 0; border-radius: 12px; }
  .hero-copy { padding: 28px 21px 24px; }
  .booking-hero h1 { font-size: 37px; }
  .booking-hero p { font-size: 13px; }
  .hero-image { min-height: 142px; }
  .booking-journey { padding: 12px; }
  .journey-step + .journey-step { padding-left: 10px; }
  .journey-step { grid-template-columns: 28px minmax(0,1fr); gap: 7px; }
  .journey-step b { width: 28px; height: 28px; }
  .panel-head { padding: 20px 17px 0; flex-direction: column; }
  .panel-head h2 { font-size: 23px; }
  .panel-body { padding: 17px; }
  .location-control { width: 100%; min-width: 0; }
  .court-product-grid { grid-template-columns: 1fr; }
  .court-product { min-height: 154px; }
  .booking-step-actions { align-items: stretch; flex-direction: column; }
  .booking-step-actions .primary { width: 100%; }
  .week-toolbar { align-items: flex-start; flex-direction: column; }
  .date-tabs { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; overflow: visible; padding-bottom: 5px; }
  .date-tab { min-width: 0; }
  .time-list { grid-template-columns: 1fr; }
  .time-slot { min-height: 62px; grid-template-columns: minmax(0,1fr) auto; align-items: center; }
  .time-slot span { align-self: center; text-align: right; }
  .booking-caution { grid-template-columns: 1fr; gap: 4px; }
  .rental-load-feedback { align-items: stretch; flex-direction: column; }
  .payment-success-body { padding: 18px; }
  .payment-success-hero { padding: 28px 18px; }
  .payment-success-actions { grid-template-columns: 1fr; }
  .receipt-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
