@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;600&display=swap');

:root {
  font-size: 16px;
  --bg: #f4f6fb;
  --bg-gradient: linear-gradient(135deg, #f0f4ff 0%, #fff5f2 45%, #f8fbff 100%);
  --surface: #ffffff;
  --surface-muted: rgba(255,255,255,0.6);
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #ec4899;
  --accent-soft: #fee2e2;
  --text: #0f172a;
  --muted: #6b7280;
  --border: rgba(15, 23, 42, 0.08);
  --shadow: 0 18px 35px rgba(15,23,42,0.08);
  --radius: 1.25rem;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Outfit', 'Noto Sans JP', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-gradient);
  color: var(--text);
  line-height: 1.65;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.4);
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.04);
}
.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.site-logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.site-logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: var(--text);
}
.site-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.site-nav__link {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 500;
  transition: all 0.2s ease;
}
.site-nav__link:hover {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
}
.site-nav__link.is-active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}
.site-auth {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
}
.user-chip__label {
  font-size: 0.75rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.button,
.link-button {
  border-radius: 0.6rem;
  padding: 0.55rem 1.2rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--primary);
  color: #fff;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.button:hover {
  background: var(--primary-dark);
}
.button.ghost {
  background: transparent;
  border-color: rgba(37, 99, 235, 0.4);
  color: var(--primary);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
  letter-spacing: 0.03em;
}
.badge::before {
  content: '';
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: currentColor;
}
.badge--ghost {
  background: rgba(15,23,42,0.08);
  color: var(--text);
}

.site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(37,99,235,0.15), transparent 60%);
  pointer-events: none;
}
.hero__content {
  position: relative;
  z-index: 2;
}
.hero__badge {
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: clamp(2rem, 4vw, 2.85rem);
  margin: 0 0 1rem;
  line-height: 1.2;
}
.hero p {
  color: var(--muted);
  font-size: 1rem;
  max-width: 34rem;
}
.hero__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}
.hero__meta {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.hero__meta li {
  min-width: 140px;
}
.hero__meta strong {
  font-size: 1.5rem;
  display: block;
}
.hero__panel {
  background: linear-gradient(145deg, #1d4ed8, #9333ea);
  border-radius: var(--radius);
  padding: 2rem;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 35px rgba(79, 70, 229, 0.35);
}
.hero__panel::after {
  content: '';
  position: absolute;
  inset: -30% auto auto 20%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  filter: blur(30px);
}
.hero__panel * {
  position: relative;
  z-index: 2;
}
.hero-chart {
  margin-top: 1.5rem;
  height: 160px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  align-items: end;
}
.hero-chart span {
  display: block;
  width: 100%;
  border-radius: 0.5rem 0.5rem 0 0;
  background: rgba(255,255,255,0.7);
}
.hero-chart span:nth-child(odd) {
  background: rgba(255,255,255,0.5);
}

.section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.section__head h2 {
  margin: 0;
  font-size: 1.65rem;
}
.section__hint {
  color: var(--muted);
  max-width: 560px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.feature-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.feature-card h3 {
  margin: 0.25rem 0;
}
.feature-card p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.summary-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.summary-card__label {
  font-size: 0.85rem;
  color: var(--muted);
}
.summary-card__value {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.2;
}
.summary-card__hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.summary-card--highlight {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff;
}
.summary-card--highlight .summary-card__label {
  color: rgba(255,255,255,0.85);
}
.search-panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.search-panel__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.search-panel__field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.search-panel__field input,
.search-panel__field select {
  border-radius: 0.85rem;
  border: 1px solid var(--border);
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  background: var(--bg);
  -webkit-appearance: none;
  appearance: none;
}
.cards--search {
  margin-top: 1.25rem;
}
.hero--search {
  gap: 1.5rem;
}
.hero__panel--accent {
  background: linear-gradient(135deg, #1f2937, #111827);
  color: #fff;
}
.hero__panel--accent p,
.hero__panel--accent .muted {
  color: rgba(255,255,255,0.8);
}
.hero-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-weight: 600;
}
.search-shell {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.search-shell__results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.search-shell__results > p {
  grid-column: 1 / -1;
}
.search-shell__actions {
  text-align: center;
}
.is-hidden {
  display: none !important;
}
.result-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.result-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.result-card__title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.result-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.result-card__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
}
.button.small {
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
}
.stat-card {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 0.85rem;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.stat-card strong {
  font-size: 1.4rem;
}
.workflow-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.workflow-item {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  background: var(--surface-muted);
  display: grid;
  grid-template-columns: 2fr auto;
  gap: 0.75rem;
}
.workflow-item__main {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.workflow-item__title {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.workflow-item__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  font-size: 0.8rem;
}
.workflow-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8rem;
  background: rgba(37,99,235,0.12);
  color: var(--primary);
}
.status-chip.status-approved,
.status-chip.status-joined {
  background: rgba(16,185,129,0.2);
  color: #047857;
}
.status-chip.status-pending {
  background: rgba(245,158,11,0.2);
  color: #92400e;
}
.status-chip.status-declined,
.status-chip.status-cancelled,
.status-chip.status-withdrawn,
.status-chip.status-rejected {
  background: rgba(239,68,68,0.15);
  color: #b91c1c;
}
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.chip {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15,23,42,0.05);
  padding: 0.35rem 0.85rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}
.chip.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(37,99,235,0.3);
}
.result-card--team header {
  align-items: center;
}
.result-card--player {
  flex-direction: row;
  align-items: center;
}
.result-card--player .result-card__body {
  flex: 1;
}
.player-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(37,99,235,0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
}
.player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.result-card--match h3 {
  margin: 0;
}
.match-tag--open {
  background: rgba(245,158,11,0.18);
  color: #b45309;
}
.match-tag--done {
  background: rgba(16,185,129,0.2);
  color: #047857;
}
.match-status {
  font-weight: 600;
  font-size: 0.85rem;
  margin-left: 0.6rem;
  color: var(--muted);
}
.block--map {
  padding: 0;
  overflow: hidden;
}
.block--map .map-wrapper {
  margin: 0;
  border: none;
  border-radius: 0;
}
.map-overlay {
  display: grid;
  grid-template-columns: minmax(280px, 480px) 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-gradient);
}
.map-panel {
  background: rgba(15,23,42,0.88);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.map-panel .badge {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.map-panel .summary-card {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
}
.map-panel .summary-card__label,
.map-panel .summary-card p {
  color: rgba(255,255,255,0.75);
}
.map-panel .button.ghost {
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}
.map-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.map-quick-links a {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.4);
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
}
.map-quick-links a:hover {
  border-color: #fff;
  color: #fff;
}
.map-filter {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.5rem;
}
.map-filter__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}
.map-filter__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.map-filter__field label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
}
.map-filter__range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.3rem;
}
.map-filter input,
.map-filter select {
  border-radius: 0.75rem;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 0.5rem 0.75rem;
  background: rgba(15,23,42,0.4);
  color: #fff;
  font-family: inherit;
}
.map-filter input::placeholder {
  color: rgba(255,255,255,0.6);
}
.map-filter__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.map-helper {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
}
.button--inline {
  margin-top: 0.5rem;
  align-self: flex-start;
}
.map-view-switch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.map-view-switch .view-label {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  margin-right: 1rem;
}
.map-canvas {
  min-height: 420px;
  background: #0f172a;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  width: 100%;
}
#matchMap {
  width: 100%;
  height: 100%;
}
.muted {
  color: var(--muted);
}

.cards,
.team-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.block {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 1.75rem;
}
.block--map {
  padding: 0;
}
.block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.block__title {
  margin: 0;
  font-size: 1.5rem;
}

.team-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.team-card__logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(37,99,235,0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  background: rgba(15,23,42,0.08);
  font-size: 0.8rem;
  color: var(--muted);
}
.pill--success {
  background: rgba(16,185,129,0.15);
  color: #047857;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.timeline li {
  padding-left: 1.5rem;
  position: relative;
}
.timeline li::before {
  content: '';
  position: absolute;
  top: 0.45rem;
  left: 0.3rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.08);
}
.timeline__time {
  font-size: 0.85rem;
  color: var(--muted);
  display: block;
  margin-bottom: 0.25rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}
.dashboard-panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

form.flat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
form.flat label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
form.flat input,
form.flat textarea,
form.flat select {
  width: 100%;
  border-radius: 0.9rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(15,23,42,0.12);
  background: var(--bg);
  font-family: inherit;
  font-size: 0.95rem;
}
form.flat textarea {
  min-height: 120px;
  resize: vertical;
}

.list-muted {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--muted);
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.member-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.member-card img {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
  background: #e2e8f0;
}
.member-card strong {
  display: block;
}

.site-footer {
  margin-top: 1rem;
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.8rem 1.25rem;
  border-radius: 0.85rem;
  background: #111827;
  color: #fff;
  box-shadow: 0 14px 40px rgba(17, 24, 39, 0.25);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 999;
}
.toast--error { background: #b91c1c; }
.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.calendar-panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(240px, 1fr) 1.3fr;
}
.calendar-panel iframe {
  width: 100%;
  min-height: 320px;
  border: none;
  border-radius: 1rem;
}
.calendar-meta {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.calendar-meta__card {
  background: var(--surface-muted);
  border-radius: 1rem;
  padding: 1rem;
  backdrop-filter: blur(10px);
}
.calendar-meta__card h4 {
  margin: 0 0 0.35rem;
}
.match-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(37,99,235,0.12);
  color: var(--primary);
}
.match-tag--league {
  background: rgba(16,185,129,0.15);
  color: #047857;
}
.match-tag--cup {
  background: rgba(249,115,22,0.15);
  color: #c2410c;
}
.match-rule {
  font-size: 0.85rem;
  color: var(--muted);
}
.view-switch {
  display: inline-flex;
  gap: 0.5rem;
  background: var(--surface);
  border-radius: 999px;
  padding: 0.25rem;
  border: 1px solid var(--border);
}
.view-switch button {
  border: none;
  background: transparent;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.view-switch button.is-active {
  background: var(--primary);
  color: #fff;
}
@media (max-width: 768px) {
  .site-header__inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .site-nav {
    flex-wrap: wrap;
  }
  .site-main {
    padding: 2.25rem 1rem 3rem;
  }
  .hero {
    padding: 1.75rem;
  }
  .summary-grid {
    grid-template-columns: 1fr;
  }
  .search-panel {
    grid-template-columns: 1fr;
  }
  .calendar-panel {
    grid-template-columns: 1fr;
  }
  .map-board {
    height: auto;
  }
  .map-board__overlay {
    position: relative;
    margin: 1rem;
  }
}
