:root {
  --color-bg: #000000;
  --color-surface: #141416;
  --color-surface-strong: #1d1d20;
  --color-text: #f5f5f7;
  --color-text-muted: #98989d;
  --color-text-faint: #6e6e73;

  --color-primary: #ff8a4c;
  --color-primary-dark: #ff6b1f;
  --color-blue: #0a84ff;
  --color-green: #30d158;
  --color-purple: #bf5af2;

  --color-border: rgba(255, 255, 255, 0.11);
  --color-border-strong: rgba(255, 255, 255, 0.2);

  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 24px 60px rgba(0, 0, 0, 0.5);

  font-size: 16px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  font-weight: 700;
}

p {
  margin: 0 0 1em;
  color: var(--color-text-muted);
}

a {
  color: var(--color-blue);
  text-decoration: none;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */

.site-header {
  background: rgba(10, 10, 12, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

/* Hero */

.hero {
  padding: 120px 0 88px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  max-width: 780px;
  margin: 0 auto;
  color: #fff;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 480px;
  margin: 18px auto 0;
}

/* Sections */

.section {
  padding: 56px 0 80px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.section-header h2 {
  font-size: 1.75rem;
  margin-bottom: 4px;
}

.subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.empty-note {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: -12px 0 24px;
}

/* Cards (selector) */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.card-grid > .card {
  animation: card-fade-in 3s var(--ease) both;
}

.card-grid > .card:nth-child(2) {
  animation-delay: 0.06s;
}

.card-grid > .card:nth-child(3) {
  animation-delay: 0.12s;
}

@keyframes card-fade-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card-grid > .card {
    animation: none;
  }
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease), background 0.4s var(--ease);
}

.selector-card {
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 160px;
}

.selector-card:hover {
  transform: translateY(-6px);
  background: var(--color-surface-strong);
  box-shadow: var(--shadow-card-hover);
}

.selector-card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.selector-card.surface-indoor:hover { border-color: rgba(10, 132, 255, 0.5); box-shadow: var(--shadow-card-hover), 0 0 32px rgba(10, 132, 255, 0.18); }
.selector-card.surface-grass:hover { border-color: rgba(48, 209, 88, 0.5); box-shadow: var(--shadow-card-hover), 0 0 32px rgba(48, 209, 88, 0.18); }
.selector-card.surface-beach:hover { border-color: rgba(255, 138, 76, 0.5); box-shadow: var(--shadow-card-hover), 0 0 32px rgba(255, 138, 76, 0.18); }

.card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--color-surface-strong);
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.surface-indoor .card-icon { color: var(--color-blue); }
.surface-grass .card-icon { color: var(--color-green); }
.surface-beach .card-icon { color: var(--color-primary); }

.card h3 {
  font-size: 1.15rem;
  margin: 0;
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-chevron {
  color: var(--color-text-faint);
  font-size: 1.3rem;
  transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}

.selector-card:hover .card-chevron,
.month-card.has-tournament:hover .card-chevron {
  transform: translateX(4px);
  color: var(--color-text);
}

.back-btn {
  flex-shrink: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.back-btn:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

/* Tournament timeline */

.mode-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  margin-bottom: 28px;
}

.mode-toggle-btn {
  border: none;
  background: none;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.mode-toggle-btn:hover {
  color: var(--color-text);
}

.mode-toggle-btn.is-active {
  background: var(--color-primary);
  color: #14161b;
  box-shadow: 0 0 16px rgba(255, 138, 76, 0.35);
}

.mode-toggle-btn.is-active:hover {
  color: #14161b;
}

.leagues-wrap {
  max-width: 900px;
  margin: 0 auto;
}

.card-meta-line {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 4px 0 0;
}

.timeline-wrap {
  max-width: 760px;
  margin: 0 auto;
}

.year-group {
  margin-bottom: 8px;
}

.year-heading {
  position: sticky;
  top: 60px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 18px 4px 14px;
  margin-bottom: 18px;
  z-index: 5;
}

.year-heading h3 {
  font-size: 1.7rem;
  margin: 0;
}

.month-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 40px;
}

.month-card {
  position: relative;
  width: 100%;
  height: 80px;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}

.month-card.is-empty {
  opacity: 0.62;
}

.month-card.has-tournament {
  cursor: pointer;
  border-color: rgba(255, 138, 76, 0.35);
}

.month-card.has-tournament:hover,
.month-card.has-tournament:focus-visible {
  transform: translateX(4px);
  border-color: var(--color-primary);
  background: var(--color-surface-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 138, 76, 0.16);
}

.month-card.has-tournament:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.month-card.is-current {
  border-color: var(--color-border-strong);
}

.month-card.is-current::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.month-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 108px;
  flex-shrink: 0;
}

.month-card-month {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
}

.month-card.is-empty .month-card-month {
  color: var(--color-text-muted);
}

.today-tag {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #fff;
  color: #000;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
}

.month-card-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  justify-content: flex-end;
}

.tournament-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 6px var(--color-primary);
  flex-shrink: 0;
}

.month-card-names {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  align-items: flex-end;
}

.month-card-name-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.no-data {
  color: var(--color-text-faint);
}

/* Modal */

.modal-overlay {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  background: #151516;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 420px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transform: translateY(24px) scale(0.96);
  transition: transform 0.4s var(--ease);
}

.modal-overlay.is-open .modal-sheet {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.modal-header h3 {
  font-size: 1.3rem;
  margin: 0;
}

.modal-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-surface-strong);
  border: none;
  color: var(--color-text-muted);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.modal-close:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.14);
}

.modal-detail {
  padding: 16px 0;
  border-top: 1px solid var(--color-border);
}

.modal-detail:first-of-type {
  border-top: none;
  padding-top: 4px;
}

.modal-detail h4 {
  font-size: 1.05rem;
  margin: 0 0 10px;
}

.modal-field {
  padding: 8px 0;
}

.modal-field-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
  margin-bottom: 2px;
}

.modal-field-value {
  display: block;
  font-size: 0.9rem;
  color: var(--color-text);
}

.modal-field-value a {
  color: var(--color-blue);
}

/* Footer */

.site-footer {
  padding: 32px 0 40px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-faint);
}

.footer-links {
  margin-top: 8px;
}

.footer-links a {
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.footer-links a:hover {
  color: var(--color-text);
}

.form-embed-wrap {
  max-width: 700px;
  margin: 0 auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-card);
}

.form-embed-wrap iframe {
  width: 100%;
  height: 1100px;
  border: none;
  border-radius: var(--radius-md);
  background: #fff;
  display: block;
}

@media (max-width: 640px) {
  .form-embed-wrap iframe {
    height: 1400px;
  }
}

/* Responsive */

@media (max-width: 640px) {
  .header-inner {
    height: 56px;
  }

  .hero {
    padding: 88px 0 64px;
  }

  .section-header {
    flex-wrap: wrap;
  }

  .year-heading {
    top: 56px;
  }

  .month-card {
    padding: 12px 14px;
    gap: 10px;
  }

  .month-card-left {
    min-width: 84px;
  }

  .month-card-month {
    font-size: 0.85rem;
  }

  .month-card-name-line {
    font-size: 0.82rem;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-sheet {
    max-width: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 85vh;
    max-height: 85dvh;
    transform: translateY(100%);
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }

  .modal-overlay.is-open .modal-sheet {
    transform: translateY(0);
  }
}
