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

:root {
  --blue: #2563eb;
  --blue-light: #eff6ff;
  --blue-dark: #1d4ed8;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --green: #16a34a;
  --green-light: #f0fdf4;
  --red: #dc2626;
  --red-light: #fef2f2;
  --orange: #ea580c;
  --orange-light: #fff7ed;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--gray-800);
  background: #fff;
  line-height: 1.6;
  font-size: 16px;
}

/* ── Navigation ── */
nav {
  border-bottom: 1px solid var(--gray-200);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-logo {
  font-weight: 700;
  font-size: 1rem;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--gray-600);
  font-size: 0.85rem;
  white-space: nowrap;
}

.nav-links a:hover { color: var(--blue); }

/* ── Hero ── */
.hero {
  background: var(--blue-light);
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-800);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.hero p {
  color: var(--gray-600);
  font-size: 1.05rem;
  max-width: 540px;
  margin: 0 auto;
}

/* ── Layout ── */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main { padding: 2rem 0 4rem; }

/* ── Card ── */
.card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--gray-800);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Form ── */
.form-row {
  display: grid;
  grid-template-columns: 140px 1fr 120px 120px 80px;
  gap: 0.6rem;
  align-items: end;
}

label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-600);
  display: block;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

input[type="text"], input[type="date"], input[type="time"], select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.9rem;
  background: #fff;
  color: var(--gray-800);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus, input[type="date"]:focus, input[type="time"]:focus, select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }

.btn-ghost {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--gray-200);
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
}
.btn-ghost:hover { background: var(--red-light); border-color: var(--red); }

/* ── Participants list ── */
.participants-empty {
  color: var(--gray-400);
  font-size: 0.9rem;
  text-align: center;
  padding: 1.5rem 0;
}

.participant-item {
  display: grid;
  grid-template-columns: 140px 1fr 120px 120px 80px;
  gap: 0.6rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin-bottom: 0.4rem;
}

.participant-item .p-name {
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-item .p-now {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 1px;
}

.participant-item .p-tz {
  font-size: 0.82rem;
  color: var(--gray-600);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-item .p-hours {
  font-size: 0.82rem;
  color: var(--gray-600);
}

/* ── Results ── */
.results-card {
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 2px solid;
}

.results-card.has-overlap {
  border-color: var(--green);
  background: var(--green-light);
}

.results-card.no-overlap {
  border-color: var(--orange);
  background: var(--orange-light);
}

.results-card.waiting {
  border-color: var(--gray-200);
  background: var(--gray-50);
}

.results-card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-transform: none;
  letter-spacing: 0;
}

.overlap-window {
  background: #fff;
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
}

.overlap-row {
  font-size: 0.9rem;
  padding: 0.2rem 0;
  color: var(--gray-800);
}

.overlap-row strong { font-weight: 700; }

.overlap-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.overlap-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green);
  background: #dcfce7;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
}

/* ── Timeline ── */
.timeline-wrap { margin-top: 0.75rem; }

.timeline-hours {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--gray-400);
  margin-bottom: 0.3rem;
  padding: 0 2px;
}

.tl-row { margin-bottom: 0.5rem; }

.tl-label {
  font-size: 0.75rem;
  color: var(--gray-600);
  margin-bottom: 0.2rem;
  font-weight: 600;
}

.tl-bar {
  height: 22px;
  background: var(--gray-100);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.tl-work {
  position: absolute;
  height: 100%;
  background: var(--blue);
  opacity: 0.25;
}

.tl-overlap {
  position: absolute;
  height: 100%;
  background: var(--green);
  opacity: 0.65;
}

.tl-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--gray-600);
}

.tl-legend span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

/* ── SEO Content ── */
.content-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-200);
}

.content-section h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
}

.content-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.5rem 0 0.4rem;
}

.content-section p {
  color: var(--gray-600);
  margin-bottom: 0.75rem;
  line-height: 1.75;
}

.faq { margin-top: 1.5rem; }

.faq-item {
  border-bottom: 1px solid var(--gray-200);
  padding: 0.9rem 0;
}

.faq-item:last-child { border-bottom: none; }

.faq-item h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  margin-top: 0;
  color: var(--gray-800);
}

.faq-item p {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin: 0;
}

/* ── Notice ── */
.notice {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  border-left: 3px solid;
}

.notice-info {
  background: var(--blue-light);
  color: var(--blue-dark);
  border-color: var(--blue);
}

/* ── Temporary World Cup 2026 helper ── */
.world-cup-section {
  background: linear-gradient(180deg, #fff 0%, var(--blue-light) 100%);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.world-cup-section h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.world-cup-section p {
  color: var(--gray-600);
  margin-bottom: 1rem;
}

.world-cup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.world-cup-actions a { text-decoration: none; }

.world-cup-converter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.world-cup-converter .full-row {
  grid-column: 1 / -1;
}

.world-cup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.world-cup-time {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.75rem;
}

.world-cup-time strong,
.world-cup-time span {
  display: block;
}

.world-cup-time strong {
  font-size: 0.82rem;
  margin-bottom: 0.2rem;
}

.world-cup-time span {
  color: var(--gray-600);
  font-size: 0.86rem;
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--gray-200);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--gray-400);
  font-size: 0.83rem;
}

footer .footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-bottom: 0.75rem;
}

footer a {
  color: var(--gray-600);
  text-decoration: none;
}

footer a:hover { color: var(--blue); }

/* ── Static pages (about, privacy, etc.) ── */
.page-hero {
  background: var(--blue-light);
  padding: 2rem 1.5rem;
  text-align: center;
}

.page-hero h1 {
  font-size: 1.75rem;
  font-weight: 800;
}

.page-hero p {
  color: var(--gray-600);
  margin-top: 0.4rem;
  font-size: 1rem;
}

.page-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.page-body h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2rem 0 0.5rem;
  color: var(--gray-800);
}

.page-body p, .page-body li {
  color: var(--gray-600);
  line-height: 1.75;
  margin-bottom: 0.6rem;
}

.page-body ul { padding-left: 1.5rem; }

.page-body a { color: var(--blue); }

/* Contact form */
.contact-form { max-width: 500px; }

.field { margin-bottom: 1.25rem; }

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  display: block;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.field input[type="text"],
.field input[type="email"],
.field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.field input:focus, .field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}

.field textarea { resize: vertical; min-height: 120px; }

/* ── Mobile nav toggle ── */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--gray-600);
  padding: 0.3rem 0.6rem;
  transition: background 0.15s;
}
.nav-toggle:hover { background: var(--gray-100); }

/* ── Responsive ── */
@media (max-width: 700px) {
  .hero h1 { font-size: 1.5rem; }

  /* Mobile nav */
  .nav-toggle { display: block; }
  nav { position: relative; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    flex-direction: column;
    padding: 0.5rem 1.5rem 0.75rem;
    gap: 0;
    z-index: 9;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  }
  .nav-links.open { display: flex; }
  .nav-links li {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--gray-100);
  }
  .nav-links li:last-child { border-bottom: none; }
  .nav-links a { font-size: 0.95rem; }

  .form-row {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
  }
  .form-row > *:nth-child(2) { grid-column: 1 / -1; }
  .form-row > *:nth-child(5) { grid-column: 1 / -1; }
  .form-row > *:nth-child(5) .btn { width: 100%; }

  .participant-item {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
  }
  .participant-item > *:nth-child(2) { grid-column: 1 / -1; }
  .participant-item > *:nth-child(5) { grid-column: 1 / -1; }
  .participant-item > *:nth-child(5) .btn-ghost { width: 100%; }

  .world-cup-converter,
  .world-cup-grid {
    grid-template-columns: 1fr;
  }

  .world-cup-actions .btn {
    width: 100%;
  }
}
