:root {
  --color-person-1: #0072b2;
  --color-person-2: #e69f00;
  /* P1の3人目以降の予備 */
  --color-person-3: #009e73;
  --color-person-4: #cc79a7;
  --color-overlap: #f0e442;
  --color-grid: #999999;
  --color-text: #222222;
  --color-text-sub: #666666;
  --color-border: #bbbbbb;
  --color-background: #ffffff;
  --color-background-sub: #f5f5f5;
  --color-active: #e8f1f8;
  --color-focus: #0072b2;
  --font-size-base: 1rem;
  --font-size-small: 0.875rem;
  --tap-size: 44px;
}

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

body {
  margin: 0;
  color: var(--color-text);
  background: var(--color-background);
  font-family: system-ui, -apple-system, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  font-size: var(--font-size-base);
  line-height: 1.6;
}

[hidden] {
  display: none !important;
}

.is-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ヘッダー・フッター */

.site-header,
.site-main,
.site-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  padding-top: 16px;
}

.site-title {
  margin: 0;
  font-size: 1.5rem;
}

.site-lead {
  margin: 4px 0 16px;
  color: var(--color-text-sub);
  font-size: var(--font-size-small);
}

.site-footer {
  margin-top: 24px;
  padding-bottom: 16px;
  color: var(--color-text-sub);
  font-size: var(--font-size-small);
}

.site-footer a {
  color: inherit;
}

/* 入力欄 */

.person-inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* タイムライン */

.timeline {
  margin-top: 24px;
}

.timeline-empty {
  margin: 0;
  padding: 32px 16px;
  border: 1px dashed var(--color-border);
  border-radius: 8px;
  color: var(--color-text-sub);
  text-align: center;
}

.timeline-svg {
  display: block;
  width: 100%;
  overflow: visible;
}

.timeline-grid {
  stroke: var(--color-grid);
  stroke-width: 1;
  stroke-opacity: 0.4;
}

.timeline-axis {
  stroke: var(--color-grid);
  stroke-width: 1;
}

.timeline-tick-label {
  fill: var(--color-text-sub);
  font-size: 12px;
}

.timeline-overlap {
  fill: var(--color-overlap);
  fill-opacity: 0.35;
}

.timeline-line {
  stroke-width: 6;
  stroke-linecap: butt;
}

.timeline-line.is-dashed {
  stroke-dasharray: 6 4;
}

.timeline-line.is-person-1 {
  stroke: var(--color-person-1);
}

.timeline-line.is-person-2 {
  stroke: var(--color-person-2);
}

.timeline-arrow.is-person-1 {
  fill: var(--color-person-1);
}

.timeline-arrow.is-person-2 {
  fill: var(--color-person-2);
}

.timeline-name {
  fill: var(--color-text);
  font-size: 14px;
  font-weight: bold;
}

.timeline-year {
  fill: var(--color-text);
  font-size: 12px;
}

/* 結果の文章 */

.result {
  margin-top: 16px;
}

.result-text {
  margin: 0 0 4px;
  font-size: 1.0625rem;
}

.result-note {
  margin: 8px 0 0;
  color: var(--color-text-sub);
  font-size: var(--font-size-small);
}

/* PC向け */

@media (min-width: 600px) {
  .site-title {
    font-size: 1.75rem;
  }

  .person-inputs {
    flex-direction: row;
  }

  .person-input-slot {
    flex: 1;
    min-width: 0;
  }
}
