:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-muted: #f9fafb;
  --text: #1f2428;
  --muted: #6f7882;
  --line: #e5e9ec;
  --line-strong: #d5dce1;
  --accent: #1f6f68;
  --warning: #8a5a00;
  --shadow: 0 10px 24px rgba(31, 36, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 54px 20px 40px;
}

.header-inner,
.page-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.header-inner {
  position: relative;
}

.language-switch {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
}

.language-switch a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 4px;
  transition: color 160ms ease;
}

.language-switch a:hover,
.language-switch a.is-active {
  color: var(--accent);
}

.language-switch a.is-active {
  font-weight: 700;
  text-decoration: underline;
}

.nav {
  font-size: 14px;
  margin-bottom: 20px;
}

.nav a {
  text-decoration: none;
  margin-right: 10px;
  color: #333;
}

.nav a.active {
  font-weight: bold;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  font-weight: 700;
  line-height: 1.18;
}

.lead {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.notice {
  font-size: 13px;
  color: #6b7280;
  margin-top: 8px;
}

.page-shell {
  padding: 32px 0 64px;
}

.about-section {
  max-width: 800px;
  margin-bottom: 30px;
  color: var(--muted);
}

.about-section h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

.about-section p {
  margin: 0;
  font-size: 0.95rem;
}

.about-page .about-section {
  max-width: 760px;
}

.about-page .about-section p + p {
  margin-top: 14px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  border-top: 1px solid var(--line);
  padding: 24px 16px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.site-footer p {
  flex-basis: 100%;
  margin: 0;
  color: var(--text);
  font-weight: 600;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  text-underline-offset: 4px;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.site-footer .operator-link {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  padding: 6px 10px;
  color: var(--text);
  font-weight: 600;
}

.site-footer .operator-link:hover {
  border-color: var(--accent);
  background: var(--surface-muted);
  text-decoration: none;
}

.toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.toolbar h2 {
  margin: 0 0 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.filter-button:hover {
  border-color: var(--accent);
  background: var(--surface-muted);
  transform: translateY(-1px);
}

.filter-button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.result-count {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.country-list {
  display: grid;
  gap: 50px;
}

.country-section {
  display: grid;
  gap: 16px;
}

.country-heading {
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
}

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

.competition-card {
  display: flex;
  flex-direction: column;
  min-height: 348px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(31, 36, 40, 0.045);
  overflow: hidden;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.competition-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 13px;
  padding: 20px 20px 18px;
}

.category-label {
  align-self: flex-start;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--accent);
  padding: 3px 8px;
  font-size: 0.76rem;
  font-weight: 700;
}

.competition-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.42;
}

.meta-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-top: 2px;
}

.meta-row {
  display: grid;
  grid-template-columns: 138px 1fr;
  gap: 10px;
  font-size: 0.88rem;
}

.meta-row dt {
  color: var(--muted);
  font-weight: 600;
}

.meta-row dd {
  margin: 0;
  color: #3d454d;
}

.notes-block {
  display: grid;
  gap: 6px;
}

.notes-block h4 {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.notes {
  margin: 0;
  color: #5b6570;
  font-size: 0.9rem;
  white-space: pre-line;
}

.card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: auto;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.card-link:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.loading,
.empty,
.error {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 24px;
  color: var(--muted);
}

.error {
  color: var(--warning);
}

@media (max-width: 720px) {
  .site-header {
    padding: 38px 18px 30px;
  }

  .language-switch {
    position: static;
    justify-content: flex-end;
    margin-bottom: 24px;
  }

  .header-inner,
  .page-shell {
    width: min(100% - 28px, 1120px);
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .result-count {
    flex: auto;
  }

  .country-list {
    gap: 40px;
  }

  .competition-grid {
    grid-template-columns: 1fr;
  }

  .competition-card {
    min-height: auto;
  }

  .meta-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
