:root {
  color-scheme: light;
  --ink: #202a25;
  --muted: #5a665f;
  --line: #d7dfd9;
  --soft: #f5f7f5;
  --accent: #176047;
  --accent-hover: #104b36;
  --error: #a52b27;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: #fff;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
}

[hidden] {
  display: none !important;
}

.site-header {
  border-bottom: 1px solid var(--line);
  padding: 16px max(20px, calc((100% - 760px) / 2));
}

.site-brand {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: .03em;
}

.page {
  width: min(100% - 40px, 760px);
  margin: 32px auto 64px;
}

h1 {
  font-size: clamp(1.4rem, 5vw, 2rem);
  line-height: 1.45;
  margin: 0 0 20px;
  letter-spacing: .01em;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 1.2rem;
  line-height: 1.5;
  margin: 32px 0 16px;
}

h3 {
  font-size: 1.05rem;
  line-height: 1.5;
  margin: 0 0 16px;
}

p {
  margin: 0 0 16px;
  overflow-wrap: anywhere;
}

.page > p {
  color: var(--muted);
}

a {
  color: var(--accent);
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}

a:hover {
  color: var(--accent-hover);
}

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

form {
  margin: 0;
}

fieldset {
  min-width: 0;
  margin: 28px 0;
  padding: 20px 16px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

legend {
  max-width: 100%;
  padding: 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
}

label {
  font-size: .95rem;
  font-weight: 600;
}

label + br {
  display: none;
}

input:not([type="checkbox"]):not([type="hidden"]), select {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  padding: 11px 12px;
  border: 1px solid #99a99e;
  border-radius: 5px;
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  background: #fff;
  color: var(--ink);
}

input::placeholder {
  color: #68746c;
  opacity: 1;
}

input[aria-invalid="true"], select[aria-invalid="true"] {
  border-color: var(--error);
}

[id$="-error"] {
  display: block;
  color: var(--error);
  font-size: .875rem;
  margin-top: 6px;
}

[id$="-error"]:empty {
  display: none;
}

[role="alert"] {
  padding: 16px;
  margin: 24px 0;
  border: 1px solid var(--error);
  border-radius: 6px;
  color: var(--error);
  background: #fff7f6;
}

[role="alert"] p {
  margin-bottom: 8px;
}

[role="alert"] ul {
  margin: 0;
  padding-left: 24px;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

label:has(input[type="checkbox"]) {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  font-weight: 400;
  cursor: pointer;
}

.sport-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 12px;
}

.sport-options label {
  min-height: 48px;
}

.sports-fieldset {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 16px 0 0;
  margin: 24px 0 8px;
}

.sports-fieldset legend {
  padding-left: 0;
  font-size: .95rem;
}

[data-participant] {
  background: #fff;
}

button, .button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  width: 100%;
  padding: 12px 18px;
  margin: 8px 0;
  border: 1px solid var(--accent);
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button:hover, .button:hover {
  background: var(--accent-hover);
  color: #fff;
}

button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.button-secondary, #add-participant {
  color: var(--accent);
  background: #fff;
}

.button-secondary:hover, #add-participant:hover {
  background: var(--soft);
  color: var(--accent);
}

[data-remove-participant] {
  background: #fff;
  color: var(--muted);
  border-color: var(--line);
  font-size: .9rem;
}

[data-remove-participant]:hover {
  background: var(--soft);
  color: var(--ink);
}

details {
  margin: 28px 0 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

summary {
  padding: 16px 0;
  font-weight: 600;
  cursor: pointer;
}

details p {
  color: var(--muted);
  font-size: .9rem;
}

.summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin: 24px 0;
}

.summary dt {
  color: var(--muted);
  font-size: .85rem;
}

.summary dd {
  margin: 0 0 16px;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.summary dd:last-child {
  margin-bottom: 0;
}

.summary dt:first-child + dd {
  font-size: 1.35rem;
  letter-spacing: .03em;
}

.participant-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: grid;
  gap: 12px;
}

.participant-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.participant-card h3 {
  overflow-wrap: anywhere;
}

.participant-details {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: 8px 16px;
  margin: 0;
  font-size: .95rem;
}

.participant-details dt {
  color: var(--muted);
}

.participant-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.status {
  display: inline-block;
  padding: 6px 12px;
  margin: 0 0 20px;
  border-radius: 4px;
  font-size: .9rem;
  background: var(--soft);
  border: 1px solid var(--line);
}

.status-paid {
  color: var(--accent);
  background: #edf6f0;
}

.status-expired {
  color: #89411c;
  background: #fff5ec;
}

.site-footer {
  margin: 40px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
}

section[aria-label="決済と返金条件"] {
  padding-top: 8px;
  margin-top: 28px;
  border-top: 1px solid var(--line);
}

section[aria-label="決済と返金条件"] h2 {
  margin-top: 12px;
  font-size: 1rem;
}

section[aria-label="決済と返金条件"] p, section[aria-label="決済と返金条件"] ul {
  font-size: .9rem;
  color: var(--muted);
}

@media (min-width: 640px) {
  .page {
    margin-top: 48px;
  }

  fieldset {
    padding: 24px 28px 12px;
  }

  .sports-fieldset {
    padding: 16px 0 0;
  }

  .sport-options {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .summary {
    grid-template-columns: 9rem minmax(0, 1fr);
    gap: 16px 24px;
    padding: 28px;
  }

  .summary dd {
    margin: 0;
  }

  .summary dt:first-child {
    align-self: center;
  }

  .participant-card {
    padding: 24px 28px;
  }

  button, .button {
    width: auto;
    min-width: 220px;
  }

  [data-remove-participant] {
    min-width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
  }
}

.required-badge {
  display: inline-block;
  flex-shrink: 0;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--error);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  line-height: 1.6;
  vertical-align: middle;
}

.policy-content {
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.consent-note {
  color: var(--muted);
  font-size: .875rem;
  overflow-wrap: anywhere;
}

.policy-content section {
  margin-top: 32px;
}

.policy-content h2 {
  font-size: 1.15rem;
  line-height: 1.6;
  margin-bottom: 12px;
}

.policy-content p {
  margin-bottom: 16px;
}

.policy-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 32px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.site-header .site-brand {
  display: inline-block;
  line-height: 0;
}

.site-header .site-brand img {
  display: block;
  width: 170px;
  height: auto;
  object-fit: contain;
}

@media(max-width:767px) {
  .site-header .site-brand img {
    width: 145px;
  }
}
