/* with-inspired, light-only palette. Keep font sizes on the documented scale. */
:root {
  color-scheme: light;
  --brand: #fe6970;
  --brand-lightest: #ffeded;
  --brand-lighter: #ffdcdc;
  --theme: #ff387a;
  --bg: #eaeaea;
  --white: #fff;
  --border: #ececeb;
  --text-87: rgba(0, 0, 0, .87);
  --text-80: rgba(0, 0, 0, .80);
  --text-70: rgba(0, 0, 0, .70);
  --text-60: rgba(0, 0, 0, .60);
  --text-40: rgba(0, 0, 0, .40);
  --font: "Helvetica Neue", Helvetica, "Hiragino Kaku Gothic ProN", "ヒラギノ角ゴ ProN W3", "メイリオ", Meiryo, sans-serif;
  --max-width: 700px;
  --space: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  color: var(--text-60);
  background: var(--bg);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
[hidden] { display: none !important; }

.quiz-app, .result-app { max-width: var(--max-width); min-height: 100vh; margin: 0 auto; background: var(--bg); }
.quiz-screen { min-height: 100vh; }
.quiz-cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: 24px var(--space) max(24px, env(safe-area-inset-bottom));
  color: var(--white);
  text-align: center;
  background: linear-gradient(168deg, var(--theme) 0%, var(--brand) 58%, #ffa4a4 100%);
}
.cover-inner { width: 100%; }
.cover-inner .button-invert { margin: 24px auto 0; }
.eyebrow { margin: 0 0 16px; font-size: 12px; font-weight: bold; letter-spacing: .14em; }
.quiz-cover h1 { margin: 0; font-size: 48px; line-height: 1.35; letter-spacing: .04em; }
.cover-rule { width: 40px; height: 3px; margin: 20px auto; border-radius: 2px; background: rgba(255,255,255,.75); }
.cover-lead { margin: 0; font-size: 15px; font-weight: bold; line-height: 1.9; }
.cover-note { max-width: 300px; margin: 16px auto 0; font-size: 11px; opacity: .8; }

.button {
  position: relative;
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 var(--space);
  border: 0;
  border-radius: 30px;
  color: var(--white);
  background: var(--brand);
  font-size: 20px;
  font-weight: bold;
  line-height: 50px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button::after { position: absolute; inset: 0; border-radius: inherit; background: rgba(0,0,0,.07); content: ""; opacity: 0; pointer-events: none; transition: opacity .2s; }
.button:hover::after, .button:focus-visible::after, .button:active::after { opacity: 1; }
.button-invert { max-width: 320px; color: var(--brand); background: var(--white); }
.button-x { margin-bottom: 12px; background: #000; }
.button-small { height: 44px; font-size: 16px; line-height: 44px; }
.button:disabled { cursor: not-allowed; opacity: .4; }

.quiz-questions { background: var(--bg); }
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 50px;
  padding: 0 var(--space);
  color: var(--white);
  background: var(--brand);
  font-size: 13px;
  font-weight: bold;
}
.quiz-progress { font-size: 12px; font-weight: normal; }
.question-list { padding: 70px var(--space) 24px; }
.question-card { position: relative; padding: 56px 18px 22px; border-radius: 36px; background: rgba(255,255,255,.96); text-align: center; }
.question-number { position: absolute; top: -28px; left: 50%; display: grid; width: 68px; height: 68px; place-items: center; border-radius: 50%; color: var(--white); background: var(--brand); font-size: 22px; font-weight: bold; transform: translateX(-50%); }
.question-prompt { margin: 0 0 18px; color: var(--text-87); font-size: 20px; font-weight: bold; line-height: 1.5; }
.no-break { white-space: nowrap; }
.question-options { display: flex; flex-direction: column; gap: 10px; }
.option-button { width: 100%; padding: 15px; border: 0; border-radius: 16px; color: var(--text-80); background: var(--brand-lightest); font-size: 15px; font-weight: bold; line-height: 1.6; cursor: pointer; }
.option-button:hover, .option-button:focus-visible { background: var(--brand-lighter); outline: 2px solid var(--brand); outline-offset: 2px; }
.option-button.is-selected { color: var(--white); border-color: var(--brand); background: var(--brand); }
.option-button code { font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.question-actions { margin-top: 18px; }
.quiz-error { margin: 0 var(--space) 24px; padding: 10px 12px; border-radius: 10px; color: var(--text-70); background: #fff0f2; font-size: 13px; }

.result-app[data-type="designer"] { --result-gradient-start: #ff6a7e; --result-gradient-end: #ff3b79; }
.result-app[data-type="pioneer"] { --result-gradient-start: #3cb691; --result-gradient-end: #16aab4; }
.result-app[data-type="mechanic"] { --result-gradient-start: #38bcd3; --result-gradient-end: #2880c2; }
.result-app[data-type="commander"] { --result-gradient-start: #bc72ef; --result-gradient-end: #e03be0; }
.result-header { padding: 42px var(--space) 30px; color: var(--white); background: linear-gradient(136.458315deg, var(--result-gradient-start) 19.551%, var(--result-gradient-end) 75.095%); text-align: center; }
.result-header .eyebrow { margin-bottom: 10px; opacity: .85; }
.result-header h1 { margin: 0; font-size: 36px; line-height: 1.35; }
.result-header h1 span { margin-left: 4px; font-size: 15px; }
.result-subtitle { margin: 14px 0 0; font-size: 13px; text-wrap: balance; }
.result-sticker span { display: inline-block; }
.result-header .result-sticker { width: fit-content; max-width: 100%; margin: 18px auto 0; padding: 10px 14px; border-radius: 12px; color: var(--text-87); background: var(--white); font-size: 15px; font-weight: bold; }
.result-header .share-actions { margin-top: 20px; }
.share-actions .button-x { margin-bottom: 0; }
.result-header .button-x { max-width: 260px; height: 44px; margin-inline: auto; font-size: 16px; line-height: 44px; }
.share-copy { min-height: 44px; padding: 8px 12px; border: 0; color: inherit; background: transparent; font-size: 13px; text-decoration: underline; cursor: pointer; }
.share-copy:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.share-actions .share-status { margin: 8px 0 0; font-size: 12px; color: inherit; }
.share-status:empty { display: none; }
.share-message { width: 100%; margin-top: 8px; padding: 8px; border: 1px solid var(--text-60); border-radius: 8px; color: var(--text-87); background: var(--white); font-size: 16px; }
.result-cta .share-actions { margin-bottom: 12px; }
.result-section { margin: 14px 0 0; padding: 22px var(--space); background: var(--white); }
.result-section h2 { margin: 0 0 16px; color: var(--text-87); font-size: 16px; }
.type-name { color: var(--text-87); font-size: 36px; font-weight: bold; }
.type-axis, .section-note { margin: 5px 0 0; color: var(--text-60); font-size: 13px; }
.type-tagline { margin: 14px 0 0; color: var(--text-87); font-size: 15px; font-weight: bold; line-height: 1.7; }
.axis-row + .axis-row { margin-top: 18px; }
.axis-labels { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--text-70); font-size: 12px; font-weight: bold; }
.axis-track { position: relative; height: 12px; overflow: hidden; border-radius: 8px; background: #f5f5f5; }
.axis-track::before { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--border); content: ""; }
.axis-fill { position: absolute; top: 0; bottom: 0; left: 0; width: var(--axis-position); border-radius: inherit; background: var(--type-color); opacity: .75; }
.axis-fill.is-right { right: 0; left: auto; }
.axis-count { margin-top: 4px; color: var(--text-40); font-size: 11px; text-align: right; }
.minority-list { display: grid; gap: 12px; }
.minority-item { padding: 13px; border-left: 4px solid var(--type-color); background: #fafafa; }
.minority-question { margin: 0; color: var(--text-87); font-size: 14px; font-weight: bold; }
.minority-answer, .minority-count { margin: 7px 0 0; font-size: 12px; }
.minority-count { color: var(--type-color); font-weight: bold; }
.empty-state { margin: 0; color: var(--text-70); font-size: 13px; }
.distribution-list { display: grid; gap: 18px; }
.distribution-item > p { margin: 0 0 7px; color: var(--text-70); font-size: 13px; font-weight: bold; }
.distribution-bars { display: grid; gap: 5px; }
.distribution-bar {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-80);
  background: linear-gradient(to right, var(--bar-fill) 0 var(--bar-size), var(--bar-track) var(--bar-size) 100%);
  font-size: 12px;
  line-height: 1.4;
}
.distribution-bar.left { --bar-fill: var(--brand-lighter); --bar-track: var(--brand-lightest); }
.distribution-bar.right { --bar-fill: #ddd3f5; --bar-track: #f2edff; }
.distribution-bar strong { margin-left: 4px; color: var(--text-87); white-space: nowrap; }
.result-cta { padding: 28px var(--space) 42px; text-align: center; }
.result-cta p { margin: 0 0 16px; color: var(--text-70); font-size: 14px; font-weight: bold; }

@media (min-width: 701px) {
  body { padding: 18px 0; }
  .quiz-app, .result-app { min-height: calc(100vh - 36px); border-radius: 16px; overflow: hidden; box-shadow: 0 3px 18px rgba(0,0,0,.08); }
  .quiz-cover { min-height: calc(100svh - 36px); }
}

@media (max-height: 600px) {
  .quiz-cover { padding-top: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .quiz-cover .eyebrow { margin-bottom: 12px; }
  .cover-rule { margin: 12px auto; }
  .cover-inner .button-invert { margin-top: 20px; }
}

@media (max-width: 360px) {
  .question-prompt { max-width: 220px; margin-inline: auto; }
}

/* Venue board: shown full screen on a monitor or iPad, so sizes follow the viewport instead of the text scale. */
body:has(.venue-app) { padding: 0; }
.venue-app { height: 100svh; padding: 3vmin; background: var(--bg); }
.venue-ticket { display: grid; grid-template-columns: 13vmin 5vmin 1fr; height: 100%; overflow: hidden; border-radius: 3vmin; background: var(--white); }
.venue-stub { display: flex; align-items: center; justify-content: center; gap: 1.2vmin; color: var(--white); background: var(--brand); font-size: 5.2vmin; font-weight: bold; letter-spacing: .08em; writing-mode: vertical-rl; }
.venue-stub-chips { display: flex; gap: .2em; }
.venue-stub-chips span { display: grid; width: 1.4em; height: 1.4em; place-items: center; border-radius: 50%; color: var(--brand); background: var(--white); font-size: .72em; letter-spacing: 0; }
.venue-perforation { position: relative; background: linear-gradient(#d9d9d9 50%, transparent 0) center / .5vmin 2.4vmin repeat-y; }
.venue-perforation::before, .venue-perforation::after { position: absolute; left: 50%; width: 5vmin; height: 5vmin; border-radius: 50%; background: var(--bg); content: ""; transform: translateX(-50%); }
.venue-perforation::before { top: -2.5vmin; }
.venue-perforation::after { bottom: -2.5vmin; }
.venue-body { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; padding: 4.5vmin 6vmin 2.5vmin 3vmin; }
.venue-header { display: flex; align-items: baseline; justify-content: space-between; gap: 4vmin; }
.venue-header h1 { margin: 0; color: var(--text-87); font-size: 4.4vmin; line-height: 1.3; }
.venue-total { margin: 0; color: var(--text-60); font-size: 2.6vmin; font-weight: bold; }
.venue-total strong { margin: 0 .08em 0 .25em; color: var(--text-87); font-size: 3.2em; line-height: 1; font-variant-numeric: tabular-nums; }
.venue-lines { display: grid; grid-template-rows: repeat(4, 1fr); align-items: center; margin: 0; padding: 0; list-style: none; }
.venue-line { --marker: 4.6vmin; display: grid; grid-template-columns: 27vmin 1fr 20vmin; align-items: center; gap: 3vmin; }
.venue-type h2 { margin: 0; color: var(--text-87); font-size: 5.6vmin; line-height: 1.2; white-space: nowrap; }
.venue-type h2 span { margin-left: .1em; font-size: .5em; }
.venue-type p { margin: .8vmin 0 0; color: var(--text-60); font-size: 2.2vmin; font-weight: bold; white-space: nowrap; }
.venue-track { height: 2.6vmin; border-radius: 2vmin; background: #f5f5f5; }
.venue-fill { position: relative; display: block; width: calc(var(--marker) + (100% - var(--marker)) * var(--line-ratio)); height: 100%; border-radius: inherit; background: var(--type-color); transition: width .9s cubic-bezier(.2, .7, .2, 1); }
.venue-fill::after { position: absolute; top: 50%; right: 0; width: var(--marker); height: var(--marker); border: 1.1vmin solid var(--type-color); border-radius: 50%; background: var(--white); content: ""; transform: translateY(-50%); }
.venue-line.is-changed .venue-fill::after { animation: venue-arrive 1.2s ease-out; }
.venue-count { display: grid; grid-template-columns: auto auto; align-items: baseline; justify-content: end; margin: 0; color: var(--text-60); font-size: 3.2vmin; font-weight: bold; line-height: 1.1; }
.venue-count strong { margin-right: .05em; color: var(--text-87); font-size: 2.8em; font-variant-numeric: tabular-nums; }
.venue-count span { grid-column: 1 / -1; justify-self: end; margin-top: .6vmin; font-size: .8em; font-variant-numeric: tabular-nums; }
.venue-count span:empty { display: none; }
.venue-status { margin: 0; color: var(--text-40); font-size: 1.8vmin; text-align: right; }

@keyframes venue-arrive {
  40% { transform: translateY(-50%) scale(1.45); }
}

@media (orientation: portrait) {
  .venue-ticket { grid-template-columns: 1fr; grid-template-rows: auto 5vmin 1fr; }
  .venue-stub { padding: 3vmin; font-size: 4.6vmin; writing-mode: horizontal-tb; }
  .venue-perforation { background: linear-gradient(to right, #d9d9d9 50%, transparent 0) center / 2.4vmin .5vmin repeat-x; }
  .venue-perforation::before, .venue-perforation::after { top: 50%; left: auto; transform: translateY(-50%); }
  .venue-perforation::before { left: -2.5vmin; }
  .venue-perforation::after { right: -2.5vmin; bottom: auto; }
  .venue-body { padding: 3vmin 6vmin 3vmin; }
  .venue-line { grid-template-columns: 1fr auto; grid-template-areas: "type count" "track track"; row-gap: 2vmin; }
  .venue-type { grid-area: type; }
  .venue-track { grid-area: track; }
  .venue-count { grid-area: count; }
}

@media (prefers-reduced-motion: reduce) {
  .venue-fill { transition: none; }
  .venue-line.is-changed .venue-fill::after { animation: none; }
}
