:root {
  --gold: #c9a45c;
  --gold-light: #ead7a4;
  --gold-line: rgba(201, 164, 92, 0.45);
  --night: #0c0a09;
  --text: #ece3cf;
  --text-dim: rgba(236, 227, 207, 0.7);
  --dorm-color: #1f2d52;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--night);
  color: var(--text);
  font-family: 'Shippori Mincho', serif;
  line-height: 1.9;
  letter-spacing: 0.04em;
}

[hidden] {
  display: none !important;
}

.screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
}

.sp-only {
  display: none;
}

/* 共通部品 */

/* 金の細い枠を二重にして、額縁のように見せる。 */
.panel {
  position: relative;
  width: 100%;
  max-width: 640px;
  padding: 44px 36px;
  background: rgba(12, 10, 9, 0.72);
  border: 1px solid var(--gold-line);
  backdrop-filter: blur(6px);
}

.panel::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(201, 164, 92, 0.18);
  pointer-events: none;
}

/* 左右に金の線を伸ばした見出し。 */
.ornament {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--gold);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
}

.ornament::before,
.ornament::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.ornament::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.button-gold {
  position: relative;
  display: inline-block;
  min-width: 260px;
  padding: 16px 40px;
  color: var(--gold-light);
  background: transparent;
  border: 1px solid var(--gold);
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0.3em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s, background 0.3s;
}

.button-gold::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(201, 164, 92, 0.35);
  pointer-events: none;
}

/* スマホでは指を離した後も :hover が残るので、マウスで操作する画面だけに付ける。 */
@media (hover: hover) {
  .button-gold:hover {
    color: var(--night);
    background: var(--gold);
  }
}

.button-text {
  margin-top: 24px;
  padding: 4px;
  color: var(--text-dim);
  background: none;
  border: none;
  font: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.2s;
}

@media (hover: hover) {
  .button-text:hover {
    color: var(--gold-light);
  }
}

/* 表示の演出 */

.fade-in {
  animation: fade-in 0.9s ease both;
}

.delay-1 { animation-delay: 0.5s; }
.delay-2 { animation-delay: 1s; }
.delay-3 { animation-delay: 1.4s; }

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    animation: none;
  }
}

/* トップ */

.screen-top {
  background:
    linear-gradient(180deg, rgba(12, 10, 9, 0.4) 0%, rgba(12, 10, 9, 0.82) 48%, rgba(12, 10, 9, 0.95) 100%),
    url('images/entrance.jpg') center / cover;
  text-align: center;
}

.top-inner {
  width: 100%;
  max-width: 560px;
}

.top-emblem {
  width: 96px;
}

.top-logo {
  display: block;
  width: 100%;
  max-width: 460px;
  margin: 4px auto 36px;
}

.top-title {
  margin: 4px 0 20px;
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: 0.4em;
}

.top-lead {
  margin: 0 0 16px;
  font-size: 0.95rem;
  color: var(--text-dim);
}

.nickname-field {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 28px auto 0;
}

.nickname-label {
  display: block;
  color: var(--gold);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 0.15em;
}

.nickname-field input {
  width: 100%;
  padding: 8px 4px;
  color: var(--text);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--gold-line);
  font: inherit;
  font-size: 1.05rem;
  text-align: center;
  letter-spacing: 0.1em;
  outline: none;
  transition: border-color 0.2s;
}

.nickname-field input::placeholder {
  color: rgba(236, 227, 207, 0.35);
}

.nickname-field input:focus {
  border-bottom-color: var(--gold);
}

.top-inner .button-gold {
  margin-top: 28px;
}

.top-note {
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.2em;
}

/* 質問 */

.screen-quiz {
  background:
    radial-gradient(ellipse at center, rgba(12, 10, 9, 0.6), rgba(12, 10, 9, 0.95) 70%),
    url('images/entrance.jpg') center / cover;
}

.quiz-count {
  margin: 0;
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-align: center;
  text-transform: uppercase;
}

.quiz-steps {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 32px;
  padding: 0;
  list-style: none;
}

.quiz-steps li {
  width: 7px;
  height: 7px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
  transition: background 0.3s;
}

.quiz-steps li.is-done {
  background: var(--gold);
}

.quiz-question {
  margin: 0 0 28px;
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.7;
  text-align: center;
}

.quiz-options {
  display: grid;
  gap: 12px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 20px;
  color: var(--text);
  background: rgba(236, 227, 207, 0.03);
  border: 1px solid rgba(201, 164, 92, 0.25);
  font: inherit;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
}

.quiz-option.is-selected {
  background: rgba(201, 164, 92, 0.12);
  border-color: var(--gold);
  transform: translateX(4px);
}

/* スマホでは、前の質問で触った位置にある次の選択肢が、選んだように光ってしまうため。 */
@media (hover: hover) {
  .quiz-option:hover {
    background: rgba(201, 164, 92, 0.12);
    border-color: var(--gold);
    transform: translateX(4px);
  }
}

.quiz-option-mark {
  flex: none;
  width: 1.6em;
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  text-align: center;
}

.quiz-body.is-entering {
  animation: fade-in 0.45s ease both;
}

.quiz-panel .button-text {
  display: block;
  margin: 28px auto 0;
}

/* 結果 */

.screen-result {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--dorm-color) 45%, transparent), rgba(12, 10, 9, 0.94) 55%),
    var(--dorm-lobby) center top / cover fixed;
  text-align: center;
}

.result-inner {
  width: 100%;
  max-width: 640px;
}

.result-label {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.result-emblem {
  display: block;
  width: clamp(80px, 22vw, 110px);
  margin: 24px auto 0;
  filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.5));
}

.result-name-en {
  margin: 12px 0 0;
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  font-size: clamp(2rem, 9vw, 3.4rem);
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-shadow: 0 0 30px rgba(201, 164, 92, 0.35);
}

.result-name {
  margin: 6px 0 18px;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.3em;
}

.result-inner > .ornament {
  margin-bottom: 36px;
  font-family: 'Shippori Mincho', serif;
  font-style: normal;
  font-size: 0.95rem;
  color: var(--gold-light);
}

.result-panel {
  text-align: left;
}

.result-specialty {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 0 0 16px;
  color: var(--text-dim);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
}

.result-specialty strong {
  color: var(--gold-light);
  font-size: 1.05rem;
  font-weight: 500;
}

.result-description {
  margin: 0;
}

.ornament-small {
  margin: 40px 0 24px;
}

.result-members {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.member {
  flex: 1 1 140px;
  max-width: 250px;
  margin: 0;
  text-align: center;
}

/* 立ち絵をアーチ型の窓に収め、寮の色を下から差す。 */
.member-frame {
  height: 280px;
  overflow: hidden;
  border: 1px solid var(--gold-line);
  border-radius: 140px 140px 0 0;
  background: linear-gradient(180deg, transparent 30%, color-mix(in srgb, var(--dorm-color) 70%, transparent));
}

.member img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.member figcaption {
  margin-top: 12px;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--text-dim);
}

.member strong {
  display: block;
  margin-bottom: 4px;
  color: var(--gold-light);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.2em;
}

/* 名前と続けて読まれないよう、名前の下の行に置く。 */
.member-npc {
  display: block;
  width: fit-content;
  margin: 4px auto 0;
  padding: 1px 6px;
  border: 1px solid var(--gold-line);
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
}

.member-line {
  display: block;
}

.result-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 40px;
}

@media (max-width: 480px) {
  .sp-only {
    display: inline;
  }

  .panel {
    padding: 36px 20px;
  }

  .top-title {
    font-size: 1.4rem;
  }

  .quiz-question {
    font-size: 1.15rem;
  }

  .member-frame {
    height: 220px;
  }

  /* 狭い画面ではキャッチコピーの両脇の線がごく短くなり、飾りに見えないので消す。 */
  .result-inner > .ornament::before,
  .result-inner > .ornament::after {
    display: none;
  }
}
