:root {
  --bg: #f2f7f2;
  --panel: rgba(255, 255, 255, 0.88);
  --text: #213229;
  --muted: #63756a;
  --line: rgba(92, 118, 100, 0.16);
  --soft: #eef5ef;
  --accent: #4f7359;
  --accent-strong: #35513f;
  --accent-warm: #9fb39f;
  --shadow: 0 24px 60px rgba(33, 50, 41, 0.1);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Plus Jakarta Sans", "Noto Sans SC", "Noto Sans JP", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(173, 198, 179, 0.34), transparent 36%),
    radial-gradient(circle at bottom right, rgba(141, 176, 150, 0.18), transparent 28%),
    linear-gradient(180deg, #f8fbf8 0%, #f2f7f2 48%, #edf3ee 100%);
}

.ambient {
  position: fixed;
  width: 38vw;
  height: 38vw;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.36;
  pointer-events: none;
  z-index: 0;
}

.ambient-left {
  left: -12vw;
  top: 8vh;
  background: rgba(204, 219, 208, 0.95);
}

.ambient-right {
  right: -16vw;
  bottom: 6vh;
  background: rgba(186, 209, 192, 0.9);
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1060px;
  margin: 0 auto;
  padding: 28px 16px 56px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--panel);
  backdrop-filter: blur(12px);
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.hero,
.test-wrap,
.result-wrap {
  padding: 24px;
}

.hero {
  min-height: 74vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  right: -72px;
  top: -72px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(135, 170, 142, 0.24), rgba(135, 170, 142, 0.02));
}

.hero-topline {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.lang-floating {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 12;
  box-shadow: 0 16px 30px rgba(33, 50, 41, 0.08);
}

.lang-btn,
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    opacity 0.16s ease;
}

.lang-btn {
  min-width: 42px;
  padding: 8px 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.lang-btn.active {
  color: #fff;
  background: var(--accent-strong);
  box-shadow: 0 10px 28px rgba(53, 81, 63, 0.18);
}

.hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.28fr 0.72fr;
  gap: 20px;
  align-items: end;
  margin-top: 28px;
}

.hero-copy {
  display: grid;
  gap: 18px;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

#heroTitle {
  max-width: 10ch;
  font-size: clamp(44px, 8vw, 86px);
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.hero-subtitle {
  max-width: 46rem;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  padding: 14px 20px;
  border-radius: 16px;
  font-weight: 800;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  color: #fff;
  background: var(--accent-strong);
  box-shadow: 0 18px 36px rgba(53, 81, 63, 0.18);
}

.btn-secondary {
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
}

.credit-box,
.hero-panel,
.question,
.type-box,
.analysis-box,
.dim-box,
.note-box,
.author-box,
.poster-box,
.dim-item {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 248, 0.9));
}

.credit-box {
  padding: 16px 18px;
  border-radius: 18px;
  max-width: 34rem;
}

.credit-box p + p {
  margin-top: 6px;
  color: var(--muted);
}

.hero-panel {
  padding: 20px;
  border-radius: 22px;
}

.hero-panel h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

.hero-panel ul {
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.85;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.progress {
  flex: 1;
  min-width: 220px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e9efea;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #96b59d, #4f7359);
  transition: width 0.22s ease;
}

.progress-text,
.hint {
  color: var(--muted);
  font-size: 13px;
}

.question-list {
  display: grid;
  gap: 16px;
}

.question {
  padding: 18px;
  border-radius: 22px;
}

.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.question-title {
  font-size: 16px;
  line-height: 1.7;
}

.options {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.option:hover {
  border-color: rgba(79, 115, 89, 0.34);
  background: rgba(245, 250, 246, 0.98);
}

.option input {
  margin-top: 2px;
  accent-color: var(--accent-strong);
  transform: scale(1.08);
}

.option-code {
  min-width: 22px;
  color: var(--accent-strong);
  font-weight: 800;
}

.actions-bottom,
.result-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.result-layout {
  display: grid;
  gap: 18px;
}

.result-top {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
}

.poster-box,
.type-box,
.analysis-box,
.dim-box,
.note-box {
  border-radius: 22px;
  padding: 18px;
}

.poster-box {
  min-height: 280px;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at top right, rgba(135, 170, 142, 0.28), rgba(135, 170, 142, 0) 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 248, 244, 0.96));
}

.poster-box::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  right: -40px;
  bottom: -40px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(135, 170, 142, 0.18), rgba(135, 170, 142, 0));
}

.poster-core {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.poster-tag {
  display: inline-flex;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.poster-code {
  font-size: clamp(44px, 8vw, 88px);
  line-height: 0.88;
  letter-spacing: -0.06em;
}

.poster-name {
  color: var(--muted);
  font-size: 16px;
}

.poster-caption {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.type-kicker {
  color: var(--accent-strong);
  font-size: 12px;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.type-name {
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.match {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--accent-strong);
  font-weight: 800;
}

.type-subname,
.analysis-box p,
.note-box p,
.author-content p,
.dim-item p {
  line-height: 1.85;
}

.type-subname {
  margin-top: 18px;
  color: var(--muted);
}

.analysis-box h3,
.dim-box h3,
.note-box h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

.dim-list {
  display: grid;
  gap: 12px;
}

.dim-item {
  padding: 14px;
  border-radius: 16px;
}

.dim-item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.dim-item-name {
  font-weight: 800;
  font-size: 14px;
}

.dim-item-score {
  color: var(--accent-strong);
  font-weight: 800;
  font-size: 13px;
}

.author-box {
  overflow: hidden;
  border-radius: 22px;
}

.author-box summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px;
  cursor: pointer;
  font-weight: 800;
}

.author-box summary::-webkit-details-marker {
  display: none;
}

.author-box summary::after {
  content: attr(data-fold);
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--accent-strong);
  font-size: 12px;
}

.author-box[open] summary::after {
  content: attr(data-open);
}

.author-content {
  padding: 0 18px 18px;
  border-top: 1px solid var(--line);
}

.author-content p + p {
  margin-top: 12px;
}

@media (max-width: 900px) {
  .hero-layout,
  .result-top {
    grid-template-columns: 1fr;
  }

  #heroTitle {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 14px 12px 42px;
  }

  .hero,
  .test-wrap,
  .result-wrap {
    padding: 16px;
  }

  #heroTitle {
    font-size: 42px;
  }

  .question-title {
    font-size: 15px;
  }

  .actions-bottom,
  .result-actions {
    align-items: stretch;
  }

  .action-row,
  .result-actions {
    width: 100%;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .lang-floating {
    top: 12px;
    right: 12px;
  }
}
