/* =========================================================
   脳内メーカー風 診断サイト — INK / SPLAT スタイル
   インク・スプラッタ × 蛍光カラー × 極太スラント書体
   （スプラトゥーン的エネルギーをオリジナルで再構成）
   ========================================================= */

:root {
  --ink: #19112e;
  --ink-2: #2a1d4d;
  --ink-soft: #6a5f86;
  --paper: #fffdf6;
  --paper-2: #f4eefe;
  --line: #19112e;

  --pink: #ff2e88;
  --pink-deep: #e10e6c;
  --lime: #aaff00;
  --lime-deep: #8ad400;
  --cyan: #00e0d0;
  --purple: #8b3fff;
  --orange: #ff7a1a;
  --yellow: #ffd200;

  --accent: var(--pink);
  --accent2: var(--lime);

  --shadow-hard: 4px 4px 0 var(--ink);
  --shadow-hard-lg: 7px 7px 0 var(--ink);
  --radius: 22px;
  --radius-sm: 16px;
  --radius-xs: 12px;
  --maxw: 1080px;
  --sans: "M PLUS Rounded 1c", system-ui, sans-serif;
  --display: "Dela Gothic One", "M PLUS Rounded 1c", sans-serif;
  --serif: "Dela Gothic One", "M PLUS Rounded 1c", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  font-weight: 500;
  color: var(--paper);
  background-color: #140d26;
  background-image:
    radial-gradient(closest-side at 12% 18%, rgba(255,46,136,0.30), transparent),
    radial-gradient(closest-side at 88% 12%, rgba(170,255,0,0.22), transparent),
    radial-gradient(closest-side at 78% 82%, rgba(0,224,208,0.22), transparent),
    radial-gradient(closest-side at 18% 88%, rgba(139,63,255,0.30), transparent);
  background-attachment: fixed;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ばらまいたインク粒 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-repeat: no-repeat;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='%23ff2e88'%3E%3Cpath d='M104 26c28-4 58 14 64 44s-6 56-30 70-62 14-82-10-18-60 2-86 18-14 46-18z'/%3E%3Ccircle cx='36' cy='150' r='11'/%3E%3Ccircle cx='170' cy='52' r='8'/%3E%3Ccircle cx='150' cy='172' r='13'/%3E%3Ccircle cx='24' cy='70' r='6'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='%23aaff00'%3E%3Cpath d='M96 24c30-2 62 16 66 48s-10 54-34 68-60 12-80-12-16-60 4-84 18-18 44-20z'/%3E%3Ccircle cx='40' cy='160' r='10'/%3E%3Ccircle cx='176' cy='80' r='9'/%3E%3Ccircle cx='30' cy='54' r='7'/%3E%3C/g%3E%3C/svg%3E");
  background-position: -60px 120px, calc(100% + 70px) 60%;
  background-size: 280px, 240px;
  opacity: 0.5;
}

.app {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 80px;
}

::selection { background: var(--pink); color: #fff; }

/* スラント極太ヘッドライン共通 */
.start-title, .q-prompt, .type-name, .result-title, .rules-title, .logo-jp {
  font-weight: 900;
  letter-spacing: -0.01em;
}
/* インク看板系：ポスター極太書体 */
.start-title, .type-name, .result-title, .rules-title, .logo-jp, .q-current {
  font-family: var(--display);
  letter-spacing: 0;
}
.start-title, .type-name, .result-title { line-height: 1.3; }

/* ============ ヘッダー ============ */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 4px 22px;
  flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 13px; background: none; border: none; cursor: pointer; padding: 0; text-align: left; }
.logo-mark {
  display: grid;
  place-items: center;
  width: 50px; height: 50px;
  background: var(--pink);
  color: #fff;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 27px;
  border: 3px solid var(--paper);
  border-radius: 16px 13px 18px 12px;
  box-shadow: var(--shadow-hard);
  transform: rotate(-6deg);
}
.logo-text { display: flex; flex-direction: column; line-height: 1.18; }
.logo-jp { font-size: 21px; color: var(--paper); transform: skewX(-7deg); }
.logo-en { font-size: 9.5px; letter-spacing: 0.16em; color: var(--lime); text-transform: uppercase; font-weight: 700; }

.header-stamp {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--lime);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 7px 16px;
  box-shadow: var(--shadow-hard);
  transform: rotate(2deg);
}

/* ============ 画面共通 ============ */
.screen { animation: pop-in 0.4s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* 白パネル共通の質感 */
.start-card, .q-card, .result-vis, .breakdown, .expression, .prompt-box, .rule {
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-hard-lg);
}

/* ============ スタート画面 ============ */
.start { position: relative; padding-top: 10px; }
.start-card {
  position: relative;
  border-radius: var(--radius);
  padding: 52px 52px 44px;
  overflow: hidden;
}
.start-card::before {
  content: "";
  position: absolute;
  top: -70px; right: -70px;
  width: 300px; height: 300px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='%23aaff00'%3E%3Cpath d='M104 26c28-4 58 14 64 44s-6 56-30 70-62 14-82-10-18-60 2-86 18-14 46-18z'/%3E%3Ccircle cx='36' cy='150' r='11'/%3E%3Ccircle cx='170' cy='52' r='8'/%3E%3Ccircle cx='150' cy='172' r='13'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat;
  opacity: 0.85;
  pointer-events: none;
}

.start-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--purple);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 6px 16px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-hard);
  transform: rotate(-1.5deg);
}

.start-title {
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.18;
  margin: 0 0 20px;
  position: relative;
}
.start-title { transform: skewX(-4deg); }
.title-accent {
  color: var(--pink);
  white-space: nowrap;
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
}

.start-lead { font-size: 16px; font-weight: 600; color: var(--ink-soft); margin: 0 0 34px; max-width: 46ch; position: relative; }

.start-form {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  padding: 24px;
  background: var(--paper-2);
  border: 3px dashed var(--ink);
  border-radius: var(--radius-sm);
  position: relative;
}
.field { display: flex; flex-direction: column; gap: 8px; flex: 1 1 280px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 800; }
.field-input {
  width: 100%;
  min-width: 0;
  font-family: var(--sans);
  font-size: 17px; font-weight: 700;
  padding: 14px 18px;
  border: 3px solid var(--ink);
  border-radius: var(--radius-xs);
  background: #fff; color: var(--ink);
  outline: none;
  transition: box-shadow 0.14s, transform 0.14s;
}
.field-input:focus { box-shadow: var(--shadow-hard); transform: translate(-2px,-2px); }
.field-input::placeholder { color: var(--ink-soft); font-weight: 600; opacity: 0.6; }
.field-hint { font-size: 12px; font-weight: 600; color: var(--ink-soft); }

/* ============ ボタン ============ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--sans);
  font-size: 17px; font-weight: 900;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--pink);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 14px 30px;
  cursor: pointer;
  box-shadow: var(--shadow-hard);
  transition: transform 0.13s cubic-bezier(.2,.9,.3,1.2), box-shadow 0.13s, background 0.15s;
  white-space: nowrap;
}
.btn-primary:hover { transform: translate(-2px,-3px) rotate(-1deg); box-shadow: 6px 8px 0 var(--ink); background: var(--pink-deep); }
.btn-primary:active { transform: translate(1px,1px); box-shadow: 2px 2px 0 var(--ink); }
.btn-arrow { font-size: 19px; transition: transform 0.15s; }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }

.btn-ghost {
  font-family: var(--sans);
  font-size: 14px; font-weight: 800;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 11px 20px;
  cursor: pointer;
  transition: transform 0.13s, box-shadow 0.13s, background 0.15s;
}
.btn-ghost:hover:not(:disabled) { transform: translate(-2px,-2px); box-shadow: var(--shadow-hard); background: var(--lime); }
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

/* メタ情報 */
.start-meta { display: flex; flex-wrap: wrap; gap: 9px 14px; list-style: none; padding: 0; margin: 28px 0 0; position: relative; }
.start-meta li {
  font-size: 12.5px; font-weight: 800;
  color: var(--ink);
  background: var(--paper-2);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 5px 14px;
}

/* ルール説明 */
.start-rules { margin-top: 46px; }
.rules-title { font-size: 24px; margin: 0 0 20px; color: var(--paper); transform: skewX(-5deg); display: inline-block; }
.rules-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.rule {
  border-radius: var(--radius-sm);
  padding: 24px 22px;
  transition: transform 0.18s;
}
.rule:nth-child(1) { transform: rotate(-1.2deg); }
.rule:nth-child(2) { transform: rotate(0.8deg); }
.rule:nth-child(3) { transform: rotate(-0.6deg); }
.rule:hover { transform: translateY(-4px) rotate(0deg); }
.rule-num {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px;
  font-weight: 900; font-size: 18px;
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 13px 10px 14px 9px;
  margin-bottom: 14px;
  transform: rotate(-4deg);
}
.rule:nth-child(1) .rule-num { background: var(--pink); color: #fff; }
.rule:nth-child(2) .rule-num { background: var(--lime); }
.rule:nth-child(3) .rule-num { background: var(--cyan); }
.rule-body h3 { margin: 0 0 7px; font-size: 16px; font-weight: 900; }
.rule-body p { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); line-height: 1.7; }

/* ============ 質問画面 ============ */
.question { max-width: 720px; margin: 0 auto; }
.q-progress { margin: 6px 0 24px; }
.q-progress-track {
  height: 14px;
  background: rgba(255,255,255,0.12);
  border: 2.5px solid var(--paper);
  border-radius: 999px;
  overflow: hidden;
}
.q-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--orange), var(--yellow));
  border-radius: 999px;
  transition: width 0.45s cubic-bezier(.3,.1,.2,1);
}
.q-progress-label { display: flex; align-items: baseline; justify-content: flex-end; gap: 5px; margin-top: 10px; font-weight: 900; }
.q-current { font-size: 26px; color: var(--lime); transform: skewX(-6deg); display: inline-block; }
.q-slash { color: rgba(255,255,255,0.4); }
.q-total { font-size: 17px; color: rgba(255,255,255,0.6); }

.q-card { border-radius: var(--radius); padding: 40px 38px 32px; }
.q-tag {
  display: inline-block;
  font-size: 12px; font-weight: 900;
  letter-spacing: 0.04em;
  color: #fff; background: var(--ink);
  border-radius: 8px;
  padding: 5px 14px;
  margin-bottom: 18px;
  transform: rotate(-1.5deg);
}
.q-prompt {
  font-size: clamp(21px, 3.3vw, 28px);
  line-height: 1.5;
  margin: 0 0 28px;
  text-wrap: pretty;
}

.q-choices { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 13px; }
.choice {
  width: 100%;
  display: flex; align-items: center; gap: 16px;
  text-align: left;
  font-family: var(--sans);
  font-size: 16px; font-weight: 700;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  cursor: pointer;
  transition: transform 0.13s, box-shadow 0.13s, background 0.15s;
}
.choice:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow-hard); background: var(--lime); }
.choice.is-selected { background: var(--pink); color: #fff; box-shadow: var(--shadow-hard); transform: translate(-1px,-1px); }
.choice-key {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex-shrink: 0;
  font-weight: 900; font-size: 17px;
  background: var(--paper-2); color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 11px 8px 12px 9px;
  transform: rotate(-3deg);
}
.choice:hover .choice-key { background: #fff; color: var(--lime-deep); }
.choice.is-selected .choice-key { background: #fff; color: var(--pink); }
.choice-text { flex: 1; line-height: 1.5; }
.choice-arrow { font-size: 18px; opacity: 0; transition: opacity 0.14s, transform 0.14s; flex-shrink: 0; }
.choice:hover .choice-arrow { opacity: 1; transform: translateX(3px); }
.choice.is-selected .choice-arrow { opacity: 1; }

.q-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; flex-wrap: wrap; }
.q-hint { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }

/* ============ 結果画面 ============ */
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }

.result-vis { border-radius: var(--radius); padding: 28px 26px 26px; position: sticky; top: 20px; }
.result-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 900; letter-spacing: 0.06em;
  color: #fff; background: var(--purple);
  border: 2.5px solid var(--ink);
  border-radius: 999px; padding: 5px 14px;
  text-transform: uppercase;
}
.result-eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0.2;} }

.result-title { font-size: clamp(23px, 3.5vw, 31px); margin: 12px 0 18px; line-height: 1.25; transform: skewX(-3deg); }

.brain-stage {
  background:
    radial-gradient(closest-side at 25% 20%, rgba(255,46,136,0.20), transparent),
    radial-gradient(closest-side at 80% 80%, rgba(0,224,208,0.20), transparent),
    var(--paper-2);
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px;
  aspect-ratio: 480 / 520;
  max-width: 420px;
  margin: 0 auto;
}

.result-actions { display: flex; flex-direction: column; gap: 11px; margin-top: 22px; }
.result-actions .btn-primary { justify-content: center; }
.result-actions .btn-ghost { text-align: center; }

/* 詳細カラム */
.result-detail { display: flex; flex-direction: column; gap: 20px; }

.type-card {
  background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 55%, var(--cyan) 130%);
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: var(--shadow-hard-lg);
  position: relative;
  overflow: hidden;
}
.type-card::after {
  content: "脳";
  position: absolute; right: -12px; bottom: -46px;
  font-family: var(--serif); font-weight: 900;
  font-size: 156px; color: rgba(255,255,255,0.16); line-height: 1;
}
.type-eyebrow {
  display: inline-block;
  font-size: 11px; font-weight: 900; letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink); background: var(--lime);
  border: 2px solid var(--ink);
  border-radius: 999px; padding: 3px 12px;
  margin-bottom: 12px;
}
.type-name { font-size: clamp(26px, 4.2vw, 36px); margin: 0 0 16px; line-height: 1.22; position: relative; text-shadow: 2px 2px 0 rgba(25,17,46,0.35); }
.type-comment { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.85; color: rgba(255,255,255,0.95); position: relative; }

/* 共通セクション見出し */
.section-h { font-weight: 900; font-size: 18px; margin: 0 0 16px; display: flex; align-items: center; gap: 9px; }
.section-h::before {
  content: ""; width: 16px; height: 16px;
  background: var(--pink);
  border: 2px solid var(--ink);
  border-radius: 8px 5px 9px 4px;
  transform: rotate(-8deg);
  flex-shrink: 0;
}

.breakdown, .expression { border-radius: var(--radius); padding: 26px 24px; }

.breakdown-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.bd-row { display: grid; grid-template-columns: 40px 1fr 48px 54px; align-items: center; gap: 12px; }
.bd-word { font-family: var(--serif); font-weight: 900; font-size: 26px; text-align: center; color: var(--ink); }
.bd-row.role-main .bd-word { color: var(--pink); font-size: 30px; }
.bd-bar { height: 14px; background: var(--paper-2); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.bd-bar-fill { height: 100%; border-radius: 999px; transition: width 0.7s cubic-bezier(.3,.1,.2,1); }
.role-main .bd-bar-fill { background: var(--pink); }
.role-sub .bd-bar-fill { background: var(--cyan); }
.role-rare .bd-bar-fill { background: var(--yellow); }
.bd-ratio { font-weight: 900; font-size: 16px; text-align: right; }
.bd-role { font-size: 11px; font-weight: 800; text-align: center; color: var(--ink); background: var(--paper-2); border: 1.5px solid var(--ink); border-radius: 7px; padding: 2px 4px; }
.breakdown-note { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-top: 16px; line-height: 1.6; }

.expression p { margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.85; color: var(--ink-soft); }

/* プロンプト */
.prompt-box { padding: 0; overflow: hidden; border-radius: var(--radius); }
.prompt-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  font-family: var(--sans); font-size: 15px; font-weight: 900;
  color: var(--ink); background: var(--paper);
  border: none; padding: 22px 24px; cursor: pointer;
  transition: background 0.15s;
}
.prompt-toggle:hover { background: var(--lime); }
.prompt-toggle span:last-child { font-size: 24px; color: var(--pink); }
.prompt-body { padding: 0 24px 24px; }
.prompt-pre {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px; line-height: 1.75;
  white-space: pre-wrap; word-break: break-word;
  background: var(--ink); color: #f0ecff;
  border-radius: var(--radius-xs);
  padding: 18px; margin: 0 0 12px;
  max-height: 280px; overflow: auto;
}

.result-edit {
  align-self: flex-start;
  font-family: var(--sans); font-size: 13px; font-weight: 800;
  color: var(--paper);
  background: none; border: none;
  border-bottom: 3px solid var(--lime);
  padding: 2px 0; cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.result-edit:hover { color: var(--lime); }

.result-foot { margin-top: 30px; font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,0.6); text-align: center; line-height: 1.7; }

/* ============ サイトフッター ============ */
.site-foot {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  margin-top: 54px; padding-top: 26px;
  border-top: 2px dashed rgba(255,255,255,0.25);
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.55);
}
.foot-dot { opacity: 0.5; }

/* ============ レスポンシブ ============ */
@media (max-width: 860px) {
  .result-grid { grid-template-columns: 1fr; }
  .result-vis { position: static; }
  .rules-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .app { padding: 0 16px 56px; }
  .site-header { padding: 18px 0 18px; }
  .logo-mark { width: 44px; height: 44px; font-size: 23px; border-radius: 14px 11px 15px 10px; }
  .logo-jp { font-size: 18px; }
  .logo-en { font-size: 8.5px; }
  .start { padding-top: 4px; }
  .start-card { padding: 32px 20px 28px; box-shadow: 5px 5px 0 var(--ink); }
  .start-card::before { width: 170px; height: 170px; top: -34px; right: -48px; opacity: 0.72; }
  .start-eyebrow { font-size: 12px; padding: 5px 13px; margin-bottom: 18px; }
  .start-title { font-size: clamp(31px, 9.3vw, 38px); line-height: 1.16; margin-bottom: 18px; }
  .title-accent { white-space: normal; -webkit-text-stroke: 1.4px var(--ink); }
  .start-lead { font-size: 14.5px; line-height: 1.75; margin-bottom: 26px; }
  .start-form { padding: 16px; flex-direction: column; align-items: stretch; gap: 14px; }
  .field { flex: 1 1 auto; width: 100%; }
  .field-input { font-size: 16px; padding: 13px 15px; }
  .btn-primary { width: 100%; justify-content: center; padding: 13px 20px; font-size: 16px; }
  .start-meta { justify-content: center; gap: 8px; margin-top: 22px; }
  .start-meta li { font-size: 11.5px; padding: 4px 11px; }
  .start-rules { margin-top: 38px; }
  .rules-title { font-size: 22px; }
  .q-card { padding: 30px 20px 24px; }
  .choice { font-size: 15px; padding: 15px; gap: 12px; }
  .type-card, .breakdown, .expression { padding: 24px 20px; }
  .bd-row { grid-template-columns: 34px 1fr 48px; }
  .bd-role { display: none; }
  .header-stamp { display: none; }
  body::before { background-size: 180px, 150px; opacity: 0.4; }
}
