:root {
  --background: #0d1925;
  --surface: #122231;
  --surface-soft: #101e2c;
  --text: #dbe4eb;
  --text-bright: #f5f7f9;
  --muted: #8293a2;
  --accent: #8bb5d5;
  --line: rgba(169, 191, 208, 0.16);
  --success: #74b99d;
  --error: #d88484;
  --sans: 'BIZ UDPGothic', 'Yu Gothic', sans-serif;
  --mono: 'IBM Plex Mono', Consolas, monospace;
  --serif: 'Noto Serif JP', 'Yu Mincho', serif;
}

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

html {
  min-width: 1100px;
  scroll-behavior: smooth;
  background: var(--background);
}

body {
  min-width: 1100px;
  margin: 0;
  overflow-x: auto;
  background: var(--background);
  color: var(--text);
  font-family: var(--sans);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 126px;
  padding: 26px 40px;
  border-bottom: 1px solid var(--line);
}

.header-title,
.footer-title {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.9;
  text-align: center;
}

.header-title span {
  color: var(--text-bright);
}

.organization {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-bright);
  text-align: left;
  text-decoration: none;
}

.organization-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  color: var(--accent);
  font-family: var(--serif);
  font-weight: 700;
}

.organization strong,
.organization small {
  display: block;
}

.organization strong {
  font-size: 13px;
  letter-spacing: 0.1em;
}

.organization small {
  margin-top: 4px;
  color: var(--muted);
  font: 9px/1 var(--mono);
  letter-spacing: 0.12em;
}

.header-classification {
  color: var(--muted);
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.16em;
}

main {
  width: 1060px;
  margin: 0 auto;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 92px 0 88px;
  text-align: center;
}

.hero-copy {
  width: 100%;
  max-width: 1060px;
}

.eyebrow,
.document-number {
  font-family: var(--mono);
  letter-spacing: 0.14em;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
}

.document-number {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 8px;
}

.hero h1 {
  margin: 0;
  color: var(--text-bright);
  font-family: var(--serif);
  font-size: 47px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.08em;
}

.hero h1 span {
  color: inherit;
  white-space: nowrap;
}

.hero-body {
  width: 100%;
  max-width: 920px;
  margin: 34px auto 28px;
  color: var(--text-bright);
  font-size: 16px;
  line-height: 2.15;
  letter-spacing: 0.025em;
  text-align: center;
}

.text-link {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-underline-offset: 5px;
}

.text-link span {
  margin-right: 6px;
  text-decoration: none;
}

.brief-sheet {
  width: 760px;
  margin: 0 auto;
  padding: 0;
  border-top: 1px solid var(--line);
  color: var(--text);
}

.event-facts {
  display: block;
  margin: 0;
}

.event-facts div {
  display: grid;
  grid-template-columns: 190px 1fr;
  align-items: center;
  min-height: 82px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
}

.event-facts dt {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
}

.event-facts dd {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.7;
  text-align: left;
}

.event-detail-note {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.placeholder {
  color: #b8a784;
  background: transparent;
}

.trial-section {
  padding: 90px 0;
  border-top: 1px solid var(--line);
}

.details-section {
  padding: 90px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 36px;
  text-align: center;
}

.section-heading h2,
.application-copy h2 {
  margin: 0;
  color: var(--text-bright);
  font-family: var(--serif);
  font-size: 29px;
  letter-spacing: 0.07em;
}

.section-index {
  margin: 0 0 17px;
  color: var(--accent);
  font: 600 9px/1 var(--mono);
  letter-spacing: 0.15em;
}

.section-heading > div > p:last-child,
.application-copy > p:last-child {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.trial-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
  padding: 9px 14px;
  border: 1px solid var(--line);
}

.trial-progress > span {
  color: var(--muted);
  font: 8px/1 var(--mono);
  letter-spacing: 0.1em;
}

.trial-progress strong {
  color: var(--text-bright);
  font: 600 15px/1 var(--mono);
}

.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.puzzle-card {
  display: flex;
  flex-direction: column;
  min-height: 422px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  text-align: center;
}

.puzzle-card-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 25px 22px 20px;
  border-bottom: 1px solid var(--line);
}

.puzzle-card-head > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.level-number {
  color: var(--muted);
  font: 500 9px/1 var(--mono);
}

.puzzle-card-head h3 {
  margin: 0;
  color: var(--text-bright);
  font-size: 18px;
  letter-spacing: 0.12em;
}

.puzzle-status {
  color: var(--muted);
  font: 8px/1 var(--mono);
  letter-spacing: 0.1em;
}

.is-cleared .puzzle-status {
  color: var(--success);
}

.puzzle-display,
.pending-display {
  display: flex;
  flex: 1 1 auto;
  min-height: 190px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.puzzle-display--intermediate-image,
.puzzle-display--calculation {
  min-height: 248px;
  padding: 18px;
}

.puzzle-display--intermediate-image {
  min-height: 302px;
  padding: 8px 18px 10px;
}

.intermediate-puzzle-figure {
  position: relative;
  width: 250px;
  max-width: 100%;
  margin: 0;
}

.intermediate-puzzle-image {
  display: block;
  width: 100%;
  height: auto;
}

.intermediate-hint {
  position: absolute;
  z-index: 1;
  color: var(--text-bright);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0;
  writing-mode: vertical-rl;
  text-orientation: upright;
}

.intermediate-hint--dispatch {
  top: 31px;
  left: 13px;
}

.intermediate-hint--vegetable {
  top: 112px;
  left: 157px;
}

.intermediate-hint--derive {
  top: 70px;
  right: 10px;
}

.intermediate-hint--summer {
  top: 148px;
  left: 12px;
}

.symbol-puzzle {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 12px 14px;
  align-items: center;
  width: 100%;
  max-width: 310px;
  padding: 13px;
  background: transparent;
  color: var(--text-bright);
}

.calculation {
  min-width: 0;
  font-family: 'Yu Gothic', 'Noto Sans JP', sans-serif;
}

.calc-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  height: 25px;
  font-size: 21px;
  line-height: 1;
}

.calc-rule {
  margin: 2px 0 3px;
  border-top: 2px solid rgba(245, 247, 249, 0.72);
}

.number-key {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.number-key td {
  height: 27px;
  border: 1px solid rgba(245, 247, 249, 0.6);
  text-align: center;
}

.symbol-question {
  grid-column: 1 / -1;
  margin: 3px 0 0;
  font-family: 'Yu Gothic', 'Noto Sans JP', sans-serif;
  font-size: 20px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.puzzle-display p {
  margin: 0;
  color: var(--text-bright);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 2.2;
  letter-spacing: 0.1em;
}

.answer-form {
  position: relative;
  display: flex;
  min-height: 147px;
  flex-direction: column;
  justify-content: center;
  margin-top: auto;
  padding: 22px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.answer-form label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.answer-controls {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr 68px;
  max-width: 300px;
  margin: 0 auto;
}

.answer-controls input {
  min-width: 0;
  height: 41px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 0;
  outline: none;
  background: var(--background);
  color: var(--text-bright);
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
}

.answer-controls input::placeholder {
  color: #5f7180;
}

.answer-controls input:focus {
  border-color: var(--accent);
}

.answer-controls input.is-error {
  border-color: var(--error);
}

.answer-controls button {
  height: 41px;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.answer-controls button:hover {
  background: rgba(139, 181, 213, 0.08);
}

.answer-controls input:disabled,
.answer-controls button:disabled {
  border-color: var(--line);
  background: transparent;
  color: #536472;
  cursor: not-allowed;
}

.answer-feedback {
  position: absolute;
  right: 22px;
  bottom: 10px;
  left: 22px;
  min-height: 16px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.answer-feedback.is-error {
  color: var(--error);
}

.answer-feedback.is-success {
  color: var(--success);
}

.pending-code {
  margin-bottom: 17px;
  color: #657685;
  font: 8px/1 var(--mono);
  letter-spacing: 0.13em;
}

.pending-display strong {
  color: #94a3af;
  font-size: 15px;
  letter-spacing: 0.06em;
}

.pending-display p {
  margin: 11px 0 0;
  color: #687987;
  font-size: 10px;
}

.application-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 90px 40px 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-align: center;
}

.application-action {
  width: 340px;
  margin-top: 28px;
  text-align: center;
}

.primary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 64px;
  padding: 0 24px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

.primary-action:hover {
  background: rgba(139, 181, 213, 0.08);
}

.contact-block {
  display: flex;
  width: 520px;
  min-height: 250px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 48px;
  padding: 34px 0;
  border-top: 1px solid var(--line);
  text-align: center;
}

.contact-block h3 {
  margin: 0 0 18px;
  color: var(--text-bright);
  font-size: 17px;
  letter-spacing: 0.12em;
}

.contact-block address {
  color: var(--muted);
  font-size: 15px;
  font-style: normal;
  line-height: 2;
}

.site-footer {
  display: flex;
  min-height: 126px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 26px 40px;
  border-top: 1px solid var(--line);
  background: var(--background);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
