:root {
  color-scheme: light;
  --background: #f5f5f5;
  --foreground: #151515;
  --muted: #656565;
  --line: #222;
  --soft-line: #d7d7d7;
  --surface: #fff;
  --swatch-size: min(280px, 68vw, 33vh);
  --control-height: 168px;
  --feedback-height: 100px;
  --button-height: 58px;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
@supports (height: 100svh) { :root { --swatch-size: min(280px, 68vw, 33svh); } }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--background); }
body { margin: 0; color: var(--foreground); }
button, textarea { font: inherit; }
button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, summary:focus-visible, textarea:focus-visible { outline: 2px solid var(--foreground); outline-offset: 4px; }
h1, h2, p { margin: 0; }
h1:focus { outline: none; }
.page-shell { min-height: 100vh; min-height: 100svh; padding: max(24px, env(safe-area-inset-top)) max(40px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(40px, env(safe-area-inset-left)); display: grid; grid-template-rows: auto 1fr; }
.site-header { width: 100%; display: flex; justify-content: center; align-items: center; }
.brand { font-size: 10px; font-weight: 700; line-height: 18px; letter-spacing: .1em; }
main { display: grid; place-items: center; padding: 24px 0; }
.screen { width: min(100%, 370px); text-align: center; }
.concept { font-size: 12px; line-height: 1.6; letter-spacing: .055em; margin-bottom: 20px; color: var(--muted); }
.start-screen h1 { font-size: 76px; line-height: .98; letter-spacing: -.045em; font-weight: 900; }
.start-screen h1 span { display: block; }
.start-screen h1 span + span { margin-top: 4px; }
.question { font-size: 17px; line-height: 1.5; font-weight: 500; letter-spacing: .025em; }
.intro-heading .question { margin-top: 22px; }
.color-stage { display: flex; justify-content: center; }
.swatch { width: var(--swatch-size); height: var(--swatch-size); flex-shrink: 0; }
.intro-swatch { background: #91bc61; }
.start-screen .color-stage { margin: 28px 0 24px; }
.game-details { font-size: 11px; line-height: 18px; color: var(--muted); display: flex; justify-content: center; align-items: center; gap: 12px; margin-bottom: 15px; }
.detail-dot { color: var(--muted); }
.button { width: 100%; min-height: var(--button-height); display: flex; align-items: center; justify-content: center; padding: 14px 12px; border: 1px solid var(--line); border-radius: 0; color: var(--foreground); background: var(--surface); font-size: 15px; font-weight: 600; line-height: 1.5; transition: background-color 120ms, color 120ms; }
.button:active { background: #e8e8e8; }
.primary-button { background: var(--foreground); border-color: var(--foreground); color: #fff; }
.primary-button:active { background: #383838; }
.free-note { font-size: 10px; line-height: 15px; color: var(--muted); margin-top: 12px; }
.quiz-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.quiz-topline h1 { font-size: 21px; line-height: 1.5; font-weight: 800; letter-spacing: -.035em; }
.counter { font-size: 24px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.counter-total { font-size: 13px; color: var(--muted); font-weight: 400; }
.progress-track { margin-top: 16px; height: 2px; background: var(--soft-line); overflow: hidden; }
.progress-fill { width: 0; height: 100%; background: var(--foreground); transition: width 180ms; }
.quiz-center .color-stage { margin: 28px 0 24px; }
.quiz-controls { height: var(--control-height); margin-top: 24px; }
.answer-buttons { height: 100%; display: grid; grid-template-rows: repeat(2, 1fr); gap: 10px; }
.answer-button { white-space: nowrap; background: var(--surface); font-weight: 500; }
.feedback-panel { animation: reveal 160ms ease-out; }
.feedback-copy { height: var(--feedback-height); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; }
.feedback-title { font-size: 26px; line-height: 1.4; font-weight: 800; }
.verdict { font-size: 13px; line-height: 1.6; color: var(--muted); }
.color-name { font-size: 14px; line-height: 1.6; font-weight: 500; }
.feedback-panel .button { margin-top: 10px; }
.eyebrow { color: var(--muted); font-size: 11px; line-height: 1.5; margin-bottom: 12px; }
.result-heading h1 { font-size: 24px; font-weight: 800; letter-spacing: -.035em; }
.result-main { padding: 30px 0 34px; }
.score-line { display: flex; align-items: baseline; justify-content: center; gap: 10px; font-variant-numeric: tabular-nums; }
.score { font-size: 104px; line-height: 1; font-weight: 800; letter-spacing: -.05em; }
.score-divider { font-size: 32px; font-weight: 300; }
.score-total { font-size: 34px; font-weight: 400; }
.score-label { font-size: 12px; margin-left: 3px; color: var(--muted); }
.result-comment { font-size: 24px; line-height: 1.5; font-weight: 700; margin-top: 14px; }
.result-colors { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; width: min(100%, 290px); margin: 25px auto 8px; }
.result-color { display: block; aspect-ratio: 1; position: relative; }
.result-color::after { content: ""; display: block; position: absolute; bottom: -10px; left: calc(50% - 2px); width: 4px; height: 4px; border-radius: 50%; background: var(--foreground); }
.result-color[data-correct="false"]::after { background: transparent; border: 1px solid var(--foreground); }
.result-actions { display: grid; gap: 10px; }
.quiet-button { background: transparent; font-weight: 500; }
.share-button { background: transparent; border-color: transparent; min-height: 44px; font-size: 13px; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; }
.share-status { font-size: 12px; line-height: 1.7; color: var(--foreground); }
.share-status:empty { display: none; }
.classification-note { margin-top: 10px; font-size: 10px; line-height: 1.8; color: var(--muted); }
.modal { width: min(440px, calc(100% - 32px)); max-height: min(780px, 88vh); max-height: min(780px, 88svh); padding: 0; color: var(--foreground); background: var(--background); border: 1px solid var(--line); border-radius: 0; }
.modal::backdrop { background: #0005; }
.history-modal[open] { display: flex; flex-direction: column; }
.modal-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid var(--soft-line); flex-shrink: 0; }
.modal-heading h2 { font-size: 21px; font-weight: 700; }
.close-button { width: 44px; height: 44px; flex-shrink: 0; font-size: 27px; font-weight: 300; line-height: 1; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--foreground); }
.history-content { padding: 0 24px 18px; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.history-list { padding: 0; margin: 0; list-style: none; }
.history-row { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 13px; padding: 16px 0; border-bottom: 1px solid var(--soft-line); }
.history-swatch { width: 46px; height: 46px; margin-top: 2px; }
.history-row-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 10px; line-height: 1.5; }
.history-number { color: var(--muted); font-variant-numeric: tabular-nums; }
.history-outcome { color: var(--foreground); font-weight: 600; }
.history-outcome[data-correct="false"] { color: var(--muted); font-weight: 400; }
.history-color-name { font-size: 13px; line-height: 1.6; font-weight: 600; margin-bottom: 6px; }
.history-answer { font-size: 11px; line-height: 1.9; overflow-wrap: anywhere; }
.history-answer-label { display: inline-block; min-width: 65px; color: var(--muted); }
.history-color-code { margin-top: 4px; font-size: 10px; line-height: 1.6; color: var(--muted); font-variant-numeric: tabular-nums; }
.history-name-note { font-size: 10px; line-height: 1.8; margin-top: 18px; color: var(--muted); }
.rules { margin-top: 12px; font-size: 11px; line-height: 1.9; color: var(--muted); }
.rules summary { padding: 8px 0; cursor: pointer; touch-action: manipulation; }
.rules p { margin-top: 8px; }
.modal-bottom { padding: 14px 24px 20px; border-top: 1px solid var(--soft-line); flex-shrink: 0; }
.modal-bottom .button { min-height: 48px; font-size: 13px; }
body:has(dialog[open]) { overflow: hidden; }
.share-modal { padding-bottom: 20px; }
.share-modal .share-instructions, .share-modal textarea, .share-modal > .button, .share-modal > .share-status { margin: 20px 24px 0; width: calc(100% - 48px); }
.share-instructions { font-size: 12px; line-height: 1.8; color: var(--muted); }
.share-modal textarea { display: block; resize: none; border: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--foreground); padding: 12px; font-size: 16px; line-height: 1.7; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.noscript-message { max-width: 350px; text-align: center; font-size: 13px; line-height: 1.8; margin-top: 15px; }
@keyframes reveal { from { opacity: 0; } to { opacity: 1; } }
@media (hover: hover) { .answer-button:hover, .quiet-button:hover { background: #ebebeb; } .primary-button:hover { background: #383838; } .share-button:hover { background: #ebebeb; } .close-button:hover { background: #ebebeb; } }
@media (min-width: 1000px) and (min-height: 760px) { :root { --swatch-size: 290px; } .screen { width: 380px; } }
@media (max-width: 600px) {
  .page-shell { padding: max(20px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
  .screen { max-width: 350px; }
  .start-screen h1 { font-size: clamp(54px, 19vw, 74px); }
  main { padding-block: 20px; }
}
@media (max-height: 730px) {
  :root { --swatch-size: min(250px, 66vw, 29vh); --button-height: 53px; --control-height: 157px; --feedback-height: 94px; }
  @supports (height: 100svh) { :root { --swatch-size: min(250px, 66vw, 29svh); } }
  .page-shell { padding-top: max(16px, env(safe-area-inset-top)); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  main { padding-block: 16px; }
  .concept { margin-bottom: 15px; font-size: 11px; }
  .start-screen h1 { font-size: 58px; }
  .intro-heading .question { margin-top: 17px; }
  .start-screen .color-stage { margin-block: 22px; }
  .quiz-center .color-stage { margin: 24px 0 20px; }
  .quiz-controls { margin-top: 21px; }
  .result-main { padding-block: 23px; }
  .score { font-size: 88px; }
  .result-comment { font-size: 22px; margin-top: 12px; }
  .result-colors { margin-top: 21px; }
  .result-actions { gap: 8px; }
  .classification-note { margin-top: 5px; }
}
@media (max-height: 610px) {
  :root { --swatch-size: min(210px, 62vw, 26vh); --button-height: 48px; --control-height: 146px; --feedback-height: 88px; }
  @supports (height: 100svh) { :root { --swatch-size: min(210px, 62vw, 26svh); } }
  .page-shell { padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  main { padding-block: 12px; }
  .concept { margin-bottom: 12px; font-size: 10px; }
  .start-screen h1 { font-size: 46px; }
  .intro-heading .question { margin-top: 14px; }
  .question { font-size: 16px; }
  .start-screen .color-stage { margin-block: 19px; }
  .game-details { margin-bottom: 12px; }
  .free-note { margin-top: 10px; }
  .quiz-center .color-stage { margin: 19px 0 16px; }
  .progress-track { margin-top: 12px; }
  .quiz-controls { margin-top: 19px; }
  .button { font-size: 14px; padding-block: 10px; }
  .feedback-title { font-size: 24px; }
  .color-name { font-size: 13px; }
  .result-heading h1 { font-size: 22px; }
  .eyebrow { margin-bottom: 8px; }
  .result-main { padding: 19px 0 25px; }
  .score { font-size: 74px; }
  .result-comment { font-size: 21px; margin-top: 10px; }
  .result-actions { gap: 6px; }
  .share-button { min-height: 44px; }
  .classification-note { margin-top: 2px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
