* {
  box-sizing: border-box;
}

:root {
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --page-padding: 24px;
  --content-width: 560px;
}

body {
  margin: 0;
  padding: 0;
  color: #111;
  background: #fafafa;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", system-ui, sans-serif;
  line-height: 1.7;
}

.page {
  width: 100%;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: var(--space-6) var(--page-padding);
  text-align: center;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, var(--content-width));
}

.hero-label {
  margin: 0 0 var(--space-2);
  color: #666;
  font-size: 12px;
  letter-spacing: 0.3em;
}

.hero-event {
  margin: 0 0 var(--space-3);
  font-size: clamp(15px, 3.5vw, 18px);
  font-weight: 600;
  letter-spacing: 0.2em;
  color: #333;
}

.hero-headline {
  margin: 0 0 var(--space-4);
  font-size: clamp(28px, 7vw, 44px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.hero-dates {
  margin: 0 0 var(--space-2);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.hero-notice {
  margin: 0 0 var(--space-4);
  color: #555;
  font-size: 14px;
}

.school-link {
  display: inline-block;
  padding: 14px 36px;
  border: 2px solid #111;
  color: #fff;
  background: #111;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.school-link::after {
  content: " →";
  font-weight: 400;
}

.school-link:hover,
.school-link:focus-visible {
  color: #111;
  background: #fff;
}

.game-bonus {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding: var(--space-5) var(--page-padding) var(--space-4);
  border-top: 1px solid #e8e8e8;
  color: #888;
  text-align: center;
}

.game-bonus-tag {
  margin: 0 0 var(--space-1);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.game-bonus-title {
  margin: 0 0 var(--space-1);
  color: #666;
  font-size: 12px;
}

.game-instructions {
  margin: 0 0 var(--space-3);
  font-size: 11px;
  line-height: 1.5;
}

.hidden {
  visibility: hidden;
}

.status {
  display: flex;
  justify-content: flex-end;
  width: min(calc(100vw - 96px), 280px);
  margin: 0 auto var(--space-1);
  font-size: 11px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  flex: 1;
}

.play-area {
  width: min(calc(100vw - 96px), 280px);
  margin: 0 auto;
}

.side-status {
  margin-top: var(--space-2);
  text-align: center;
}

.sequence {
  font-family: serif;
  font-size: 16px;
  line-height: 1.5;
}

.rounds {
  margin-top: var(--space-1);
  color: #aaa;
  font-size: 10px;
  text-align: center;
}

.goal {
  font-size: 8px;
}

@media (max-width: 380px) {
  .sequence {
    font-size: 14px;
  }
}

.tile {
  aspect-ratio: 1;
  border: 1px solid #ccc;
  border-radius: 0;
  color: #555;
  background: #fff;
  font: inherit;
  font-family: serif;
  font-size: clamp(28px, 10vw, 40px);
  cursor: pointer;
}

.tile:hover,
.tile:focus-visible {
  background: #f5f5f5;
}

.tile:disabled {
  color: #bbb;
  background: #fafafa;
  cursor: default;
}

.tile span {
  display: inline-block;
}

.message {
  min-height: 1.4em;
  margin: var(--space-2) auto var(--space-1);
  font-size: 11px;
  font-weight: 600;
}

#restart {
  margin-top: var(--space-1);
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 0;
  color: #888;
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

#restart:hover,
#restart:focus-visible {
  background: #f5f5f5;
}

.site-footer {
  margin-top: 0;
  padding: var(--space-4) var(--page-padding) var(--space-6);
  border-top: 1px solid #e8e8e8;
  text-align: center;
}

.site-footer p {
  margin: 0;
  color: #bbb;
  font-size: 10px;
  letter-spacing: 0.04em;
}
