/* ==========================================================================
   學生端：登記 → 72 場對決 → 結果
   固定深色配色（黑底橘標題白細項），不做淺色模式。
   ========================================================================== */

/* ------------------------------------------------------------ 報頭 */

.masthead { padding-bottom: 0; }
.masthead-bar { height: var(--bar); background: var(--line); }
.masthead-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0 0;
}
.mh-brand, .mh-meta {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--fg-2);
  white-space: nowrap;
}
@media (max-width: 40rem) {
  .mh-brand { font-size: 0.42rem; letter-spacing: 0.14em; }
  .mh-meta  { font-size: 0.42rem; }
}

/* ------------------------------------------------------------ 主視覺 */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.62fr);
  gap: var(--gut);
  align-items: start;
  padding-top: clamp(2rem, 6vw, 4.5rem);
  padding-bottom: 0;
}
@media (max-width: 52rem) {
  .hero { grid-template-columns: 1fr; }
  .hero-mark { order: -1; max-width: 58vw; }
}

.hero-text { container-type: inline-size; }

/* Michroma 很寬：「ENNEAGRAM」剛好 9.78em。用容器寬度換算字級，
   標題就會永遠貼齊欄寬而不溢出。不支援容器查詢時退回 vw 版本。 */
.hero-title {
  font-size: min(9.2vw, 5.2rem);
  letter-spacing: -0.005em;
  margin: 0.2rem 0 0.4rem;
}
@supports (container-type: inline-size) {
  .hero-title { font-size: min(9.9cqw, 5.6rem); }
}
.hero-sub {
  font-size: clamp(1.1rem, 0.9rem + 1vw, 1.6rem);
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--fg);
  margin: 0;
}
.hero .rule { margin: 1.6rem 0 1.4rem; }

.hero-mark { color: var(--fg); }
.hero-mark .logomark { width: 100%; height: auto; }

/* ------------------------------------------------------------ 規格列 */

.specs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  list-style: none;
  margin: clamp(2rem, 5vw, 3.5rem) 0 2.5rem;
  padding: 1.1rem 0 0;
  border-top: var(--bar) solid var(--line);
}
@media (max-width: 40rem) { .specs { grid-template-columns: repeat(2, 1fr); } }
.specs li { display: flex; align-items: baseline; gap: 0.5rem; }
.specs b {
  font-size: clamp(1.4rem, 1rem + 1.6vw, 2.2rem);
  line-height: 1;
  color: var(--fg);
}
.specs span { font-size: 0.84rem; line-height: 1.4; }

/* ------------------------------------------------------------ 登記 */

.enroll-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: var(--gut);
  align-items: start;
}
@media (max-width: 52rem) { .enroll-grid { grid-template-columns: 1fr; } }

.enroll { display: grid; gap: 1rem; }
.enroll .btn { width: 100%; }
.enroll .consent { margin: 0; opacity: .68; }

.brief { padding-top: 0.4rem; }
.brief .small { margin: 0 0 0.9rem; }

/* ------------------------------------------------------------ 九型圖記列 */

/* 三組直排：程式設計／美術設計／策略溝通，組內三個一排 */
.mark-group { margin-bottom: 1.4rem; }
.mark-group:last-child { margin-bottom: 0; }
.mark-group-label {
  font-family: var(--f-display);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-2);
  margin: 0 0 0.6rem;
}
.mark-group-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}
@media (max-width: 26rem) { .mark-group-row { gap: 0.4rem; } }

.mark-strip figure { margin: 0; text-align: center; }

/* 盾面：實心色塊裁成盾形，圖記反白壓在上面 */
.crest {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--bg);
  padding: 0.7rem 0.5rem 1.2rem;
}
[data-surface="game"] .crest { color: var(--black); }
.mark-strip .crest { width: 100%; }
.mark-strip .mark { width: 62%; max-width: 44px; height: auto; }

/* 三組固定色，跟頁面 accent 脫鉤，用 :root 的原色，不隨頁面配色變。
   頁面固定深色背景，只有黑底那組會被背景吃掉，所以只有它需要白框；
   橘色跟白色兩組跟黑色頁面背景都分得開，不用加框。框畫在跟裁形狀
   同一層（.cardform 自己），所以框會貼著卡形走，不會被缺角切斷。 */
.mark-strip .crest.crest-code,
.mark-strip .crest.crest-art,
.mark-strip .crest.crest-strategy {
  /* 蓋掉 .crest 自己的底色（沒裁形狀的矩形），不然會從縫隙透出來 */
  background: none;
}
.mark-strip .crest.crest-code::before     { background: var(--orange); }
.mark-strip .crest.crest-strategy::before { background: var(--white); }
.mark-strip .crest.crest-code     { color: var(--black); }
.mark-strip .crest.crest-strategy { color: var(--black); }

/* 黑底這組需要白框：外層填白色，::before 內縮 3px 露出框。 */
.mark-strip .crest.crest-art {
  background: var(--white);
  color: var(--white);
}
.mark-strip .crest.crest-art::before {
  inset: 3px;
  background: var(--black);
}
/* 拉丁團名長短不一，有的一行有的兩行。固定兩行高度，
   下面的中文才會全部對齊在同一條基線上。 */
.mark-strip figcaption {
  display: block;
  margin-top: 0.45rem;
  min-height: 2.4em;
  font-family: var(--f-display);
  font-size: 0.42rem;
  line-height: 1.2;
  letter-spacing: 0.08em;
  color: var(--fg-2);
}
.mark-strip .zh {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--f-han);
  font-size: 0.68rem;
  letter-spacing: 0;
}

/* ==========================================================================
   作答
   ========================================================================== */

.qbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: var(--bar) solid var(--line);
}
.qbar .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
.ring-wrap { flex: none; width: 38px; height: 38px; color: var(--fg); }
.ring-meter { width: 100%; height: 100%; }
.ring-meter .tick { stroke: currentColor; stroke-width: 5; opacity: .25; }
.ring-meter .tick.on { opacity: 1; }

.tally { font-size: 0.78rem; letter-spacing: 0.14em; flex: none; }

.qbar-fill {
  flex: 1;
  min-width: 0;
  height: 6px;
  background: var(--line-soft);
}
.qbar-done {
  display: block;
  height: 100%;
  width: 0;
  background: var(--line);
  transition: width .3s linear;
}
.qbar-brand {
  flex: none;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--fg-2);
}
@media (max-width: 44rem) { .qbar-brand { display: none; } }

.arena { padding-top: clamp(1.6rem, 5vw, 3rem); }
.arena .eyebrow { margin-bottom: 1.2rem; }

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.8rem, 2vw, 1.4rem);
}
@media (max-width: 44rem) { .choices { grid-template-columns: 1fr; } }

/* 旗幟：左邊一根旗桿、右邊燕尾缺角，像從桿子飄出去的錦旗
   （.gonfalon 在 ordo.css 負責裁形狀）。不用邊框，滑過／選中直接把整面
   旗子變白色，靠底色反差來標示「這面被選了」。 */
.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.4rem;
  min-height: 14rem;
  padding: 1.5rem 3.2rem 1.6rem 1.6rem;
  text-align: left;
  font-family: var(--f-han);
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: background .1s linear, color .1s linear;
}
[data-surface="game"] .choice { color: var(--black); }
.choice .key {
  font-size: 1.3rem;
  letter-spacing: 0.3em;
  line-height: 1;
  color: inherit;
}
.choice .line {
  font-size: clamp(1.15rem, 0.95rem + 0.9vw, 1.55rem);
  font-weight: 700;
  line-height: 1.55;
  text-wrap: balance;
}
.choice .hint {
  position: absolute;
  left: 1.6rem;
  bottom: 1.4rem;
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  opacity: .55;
}
@media (hover: none) { .choice .hint { display: none; } }

/* 單欄時兩張卡上下疊，維持 13rem 高度就得一直捲，壓矮一點。
   這段必須排在 .choice 基礎規則之後，否則同權重會被蓋掉。 */
@media (max-width: 44rem) {
  .choice { min-height: 0; gap: 0.7rem; padding: 1.2rem 2.8rem 1.2rem 1.4rem; }
}

/* 選中／滑過：整面旗子從橘色變白色，文字跟著轉黑色才看得清楚。 */
.choice:hover, .choice:focus-visible,
.choice.chosen { background: var(--white); color: var(--black); }
.choice.chosen .key, .choice.chosen .hint { opacity: .85; }

.arena-foot {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 2px solid var(--line-soft);
}
.arena-foot .small { margin: 0 0 0 auto; }
@media (max-width: 34rem) {
  .arena-foot .small { margin: 0; flex-basis: 100%; }
}
#backBtn[disabled] { visibility: hidden; }

.swap { animation: swap .22s linear both; }
@keyframes swap { from { opacity: 0; transform: translateY(6px); } }

/* ==========================================================================
   結果
   ========================================================================== */

.verdict {
  border-bottom: var(--bar) solid var(--line);
  padding: clamp(1.6rem, 5vw, 3rem) 0 clamp(1.4rem, 4vw, 2.4rem);
  margin-bottom: 2rem;
}
.verdict-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: clamp(1rem, 3vw, 2.2rem);
  align-items: center;
  padding-bottom: 0;
}
@media (max-width: 46rem) {
  .verdict-grid { grid-template-columns: auto minmax(0, 1fr); }
  #verdictSeal { display: none; }
}

.verdict-mark {
  display: grid;
  place-items: center;
  width: clamp(78px, 15vw, 128px);
  padding: 0.9rem 0.7rem 1.8rem;
  background: var(--accent);
  color: var(--bg);
}
[data-surface="game"] .verdict-mark { color: var(--black); }
.verdict-mark .mark { width: 78%; height: auto; }

.verdict-code { font-size: clamp(0.7rem, 0.6rem + 0.5vw, 0.95rem); letter-spacing: 0.2em; }
.verdict-title {
  font-size: clamp(1.9rem, 1.1rem + 3.4vw, 3.4rem);
  margin: 0.2rem 0 0.3rem;
}
.verdict-tag { margin: 0; font-size: 1rem; }
.verdict-secondary {
  margin: 0.6rem 0 0;
  padding-top: 0.6rem;
  border-top: 2px solid var(--line-soft);
  font-size: 0.92rem;
  opacity: .85;
}
#verdictSeal { width: clamp(3.4rem, 7vw, 4.6rem); height: clamp(3.4rem, 7vw, 4.6rem); }

.profiles { display: grid; gap: 1.2rem; }
@media (min-width: 44rem) { .profiles { grid-template-columns: repeat(2, 1fr); } }

.profiles .card { display: flex; flex-direction: column; gap: 1rem; }
.profiles .p-head { display: flex; align-items: flex-start; gap: 0.9rem; }
.profiles .crest { width: 56px; flex: none; padding: 0.5rem 0.4rem 0.9rem; }
.profiles .mark { width: 100%; height: auto; }
.profiles .rank {
  font-family: var(--f-display);
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 0.2rem;
  opacity: .6;
}
.profiles h3 { margin: 0; font-size: 1.25rem; }
.profiles .p-en {
  font-family: var(--f-display);
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  opacity: .6;
}
.profiles .why {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.7;
  padding-top: 0.9rem;
  border-top: 2px solid var(--line-soft);
}
.profiles .meter {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--f-latin);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.profiles .meter .track {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, .14);
}
[data-surface="game"] .profiles .meter .track { background: rgba(255, 255, 255, .16); }
.profiles .meter .fill {
  display: block;
  height: 100%;
  width: 0;
  background: currentColor;
  transition: width .7s cubic-bezier(.2,.8,.3,1);
}
.profiles dl { margin: 0; display: grid; gap: 0.85rem; }
.profiles dt {
  font-family: var(--f-display);
  font-size: 0.53rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: .55;
  margin-bottom: 0.15rem;
}
.profiles dd { margin: 0; font-size: 0.92rem; line-height: 1.75; }

.notes { display: grid; gap: 1.1rem; }
@media (min-width: 48rem) { .notes { grid-template-columns: 1fr 1fr; } }
.notes article { border-top: 2px solid var(--line); padding-top: 0.8rem; }
.notes h3 { font-size: 1.02rem; margin-bottom: 0.3rem; }
.notes p { margin: 0; font-size: 0.92rem; }

.footnote { max-width: 44rem; opacity: .8; }
.result-foot {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
}
