:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #eef2f4;
  --text: #1b2028;
  --muted: #5d6875;
  --line: #d9e0e8;
  --primary: #156b7a;
  --primary-strong: #0d4f5b;
  --accent: #684156;
  --accent-soft: #f3eaf0;
  --warning: #8a5a10;
  --shadow: 0 14px 34px rgba(27, 32, 40, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.75 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.test-environment-banner {
  position: relative;
  z-index: 20;
  border-bottom: 2px solid #b42318;
  background: #ffebe9;
  color: #7a271a;
  padding: 8px 16px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.04em;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid #f0a92f;
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 248, 251, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

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

.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.nav a,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.nav a[aria-current="page"],
.button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.nav a.disabled,
.button.disabled,
.phase-pending [data-phase-link]:not([data-phase-link="headerTop"]):not([data-phase-link="headerMypage"]) {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.7;
  pointer-events: none;
}

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

.shell { padding: 28px 0 60px; }

.hero-image {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.hero-image img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-caption {
  margin: 0;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 14px;
}

.schedule-update h2 { margin-top: 0; }
.schedule-update p:last-child { margin-bottom: 0; }

.hero-image + .schedule {
  margin-top: 20px;
}

.intro {
  max-width: 900px;
  padding: 26px 0 4px;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin: 32px 0 14px;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: 0;
}

.section > h2:first-child,
.card > h2:first-child {
  margin-top: 0;
}

h3 {
  margin: 18px 0 8px;
  font-size: 18px;
}

p { margin: 0 0 14px; }

.lead {
  color: var(--muted);
  font-size: 18px;
}

.muted { color: var(--muted); }

.grid {
  display: grid;
  gap: 14px;
}

.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.schedule strong {
  display: block;
  font-size: 22px;
}

.schedule-previous {
  margin: 4px 0;
  color: var(--muted);
}

.schedule ins { text-decoration: none; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.notice {
  margin: 18px 0;
  padding: 12px 14px;
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  background: var(--surface-2);
}

.notice.warning {
  border-left-color: var(--warning);
  background: #fff7e8;
}

.section {
  margin-top: 28px;
}

.phase-status {
  padding: 16px 18px;
  border-left: 5px solid var(--primary);
  background: var(--surface);
}

.phase-status-message {
  margin: 0;
  color: var(--primary-strong);
  font-size: 20px;
  font-weight: 800;
}

.phase-status-message a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.phase-status-message a:hover,
.phase-status-message a:focus-visible {
  color: var(--text);
}

.phase-status-message a + a {
  margin-left: 0.25em;
}

.world-list {
  display: grid;
  gap: 10px;
}

.world-list p { margin: 0; }

.entry-placeholder,
.result-placeholder {
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 34px;
  color: var(--muted);
}

.footer-inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 760px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
  }

  .nav { justify-content: flex-start; }
  .grid.two,
  .grid.three { grid-template-columns: 1fr; }
  .actions { align-items: stretch; flex-direction: column; }
  .button { width: 100%; }
}
