:root {
  --sea-900: #0c3d62;
  --sea-800: #1a5689;
  --sea-700: #2470a8;
  --sea-600: #2d8bc9;
  --sea-500: #5eb8e8;
  --sea-400: #89cff0;
  --sea-200: #b8e4f7;
  --sea-100: #dff3fc;
  --sea-50: #eef9ff;
  --accent: #ff7f50;
  --accent-dark: #e86a3a;
  --accent-glow: rgba(255, 127, 80, .4);
  --ink: #1a2b3c;
  --ink-soft: #3d5166;
  --ink-mute: #6b8299;
  --bg: var(--sea-50);
  --paper: #fff;
  --line: #c5dff0;
  --line-light: #e2f0fa;
  --type: var(--sea-800);
  --type-soft: var(--sea-100);
  --type-deep: var(--sea-900);
  --footer-bg: #5a6570;
  --radius: 12px;
  --radius-pill: 999px;
  --font: 'Zen Kaku Gothic New', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --font-display: 'IBM Plex Sans JP', 'Zen Kaku Gothic New', sans-serif;
  --max: 600px;
  --axis-v: #6b5b8a;
  --axis-f: #2d8bc9;
  --axis-c: #3d9a6e;
  --axis-e: #e8a838;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 18px;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.85;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  word-break: normal;
  word-break: auto-phrase;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background .3s, border-color .3s;
}
/* Blur/background live on a pseudo-element behind the text, not on the
   header itself — Safari can clip the edges of foreground text when
   backdrop-filter is applied directly to the element containing it. */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
body.view-intro .site-header::before {
  background: rgba(46, 140, 200, .55);
  border-bottom: 1px solid rgba(255, 255, 255, .25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
body:not(.view-intro) .site-header::before {
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.site-header-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.site-logo {
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
  padding: 2px 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: .08em;
  white-space: nowrap;
  overflow: visible;
}
body.view-intro .site-logo { color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.15); }
body:not(.view-intro) .site-logo { color: var(--sea-800); }
.site-tag {
  font-size: 16px;
  padding-left: 10px;
  border-left: 1px solid rgba(255,255,255,.35);
}
body.view-intro .site-tag { color: rgba(255,255,255,.85); }
body:not(.view-intro) .site-tag { color: var(--ink-mute); border-left-color: var(--line); }

.app { max-width: var(--max); margin: 0 auto; }
body.view-intro .app { max-width: none; }
.view { display: none; }
.view.active { display: block; }

/* ── Hero (案1) ── */
.hero-sea {
  position: relative;
  min-height: calc(100dvh - 52px);
  min-height: calc(100svh - 52px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 12px 48px;
  overflow: hidden;
  background: linear-gradient(180deg, #4eb0e8 0%, #2a8bc9 28%, #1a6a9e 58%, #0c4d72 82%, #083a58 100%);
}
.hero-ocean-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero-sunlight {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 45% at 50% -8%, rgba(255, 255, 255, .45) 0%, transparent 58%),
    radial-gradient(ellipse 40% 30% at 20% 5%, rgba(255, 255, 255, .18) 0%, transparent 50%),
    radial-gradient(ellipse 35% 25% at 80% 8%, rgba(255, 255, 255, .14) 0%, transparent 45%);
}
.hero-caustics {
  position: absolute;
  inset: -20%;
  opacity: .22;
  background:
    radial-gradient(ellipse 28% 18% at 22% 38%, rgba(255, 255, 255, .35) 0%, transparent 70%),
    radial-gradient(ellipse 22% 14% at 68% 52%, rgba(255, 255, 255, .28) 0%, transparent 68%),
    radial-gradient(ellipse 18% 12% at 45% 68%, rgba(255, 255, 255, .22) 0%, transparent 65%),
    radial-gradient(ellipse 24% 16% at 78% 28%, rgba(255, 255, 255, .2) 0%, transparent 70%);
  animation: causticsShift 14s ease-in-out infinite alternate;
}
@keyframes causticsShift {
  from { transform: translate(-2%, -1%) scale(1); }
  to { transform: translate(2%, 2%) scale(1.04); }
}
.hero-bubbles {
  position: absolute;
  inset: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.hero-bubbles li {
  position: absolute;
  bottom: -20px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .75) 0%, rgba(255, 255, 255, .15) 45%, rgba(255, 255, 255, .05) 100%);
  border: 1px solid rgba(255, 255, 255, .35);
  animation: bubbleRise linear infinite;
}
.hero-bubbles li:nth-child(1)  { left: 8%;  width: 10px; height: 10px; animation-duration: 9s;  animation-delay: 0s; }
.hero-bubbles li:nth-child(2)  { left: 18%; width: 14px; height: 14px; animation-duration: 11s; animation-delay: 1.2s; }
.hero-bubbles li:nth-child(3)  { left: 32%; width: 8px;  height: 8px;  animation-duration: 8s;  animation-delay: 2.5s; }
.hero-bubbles li:nth-child(4)  { left: 48%; width: 16px; height: 16px; animation-duration: 13s; animation-delay: .8s; }
.hero-bubbles li:nth-child(5)  { left: 62%; width: 11px; height: 11px; animation-duration: 10s; animation-delay: 3s; }
.hero-bubbles li:nth-child(6)  { left: 74%; width: 9px;  height: 9px;  animation-duration: 12s; animation-delay: 1.8s; }
.hero-bubbles li:nth-child(7)  { left: 86%; width: 13px; height: 13px; animation-duration: 9.5s; animation-delay: 4s; }
.hero-bubbles li:nth-child(8)  { left: 12%; width: 7px;  height: 7px;  animation-duration: 14s; animation-delay: 5s; }
.hero-bubbles li:nth-child(9)  { left: 55%; width: 12px; height: 12px; animation-duration: 11.5s; animation-delay: 2s; }
.hero-bubbles li:nth-child(10) { left: 92%; width: 8px;  height: 8px;  animation-duration: 10.5s; animation-delay: 3.5s; }
@keyframes bubbleRise {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  8% { opacity: .85; }
  90% { opacity: .5; }
  100% { transform: translateY(-105vh) translateX(12px); opacity: 0; }
}
.hero-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
}
.hero-wave-back {
  height: 160px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,70 C150,110 350,20 600,70 C850,120 1050,30 1200,65 L1200,120 L0,120 Z' fill='rgba(255,255,255,0.12)'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
  animation: waveDrift 9s ease-in-out infinite alternate;
}
.hero-wave-mid {
  height: 130px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,85 C250,35 450,105 700,55 C900,15 1100,95 1200,75 L1200,120 L0,120 Z' fill='rgba(184,228,247,0.35)'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
  animation: waveDrift 7s ease-in-out infinite alternate-reverse;
}
.hero-wave-front {
  height: 100px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,95 C200,55 400,115 650,70 C850,35 1050,100 1200,85 L1200,120 L0,120 Z' fill='rgba(255,255,255,0.55)'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
  animation: waveDrift 5s ease-in-out infinite alternate;
}
.hero-seabed {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(6, 50, 75, .45) 100%);
}
@keyframes waveDrift {
  from { transform: translateX(-3%); }
  to { transform: translateX(3%); }
}

.hero-chars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.hero-char {
  position: absolute;
  transform: rotate(var(--rot, 0deg)) scale(var(--char-scale, 1));
  animation: charFloat var(--dur, 4s) ease-in-out var(--delay, 0s) infinite;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.22));
  pointer-events: none;
}
.hero-char img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  background: transparent;
}
@keyframes charFloat {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)) scale(var(--char-scale, 1)); }
  50% { transform: translateY(-12px) rotate(calc(var(--rot, 0deg) + 5deg)) scale(var(--char-scale, 1)); }
}
/* Scale up the floating creatures on larger screens so they don't get
   lost in the wide/tall hero area — keeps the sea-to-creature balance
   consistent as viewport size grows. */
@media (min-width: 640px) {
  .hero-char { --char-scale: 1.3; }
}
@media (min-width: 960px) {
  .hero-char { --char-scale: 1.6; }
}
@media (min-width: 1280px) {
  .hero-char { --char-scale: 1.9; }
}
@media (min-width: 1600px) {
  .hero-char { --char-scale: 2.2; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-char, .hero-wave-back, .hero-wave-mid, .hero-wave-front, .hero-caustics, .hero-bubbles li { animation: none; }
  .hero-bubbles { display: none; }
}

.hero-content {
  position: relative;
  z-index: 3;
  width: min(100%, 700px);
  max-width: 700px;
  padding: 0 8px;
  text-align: center;
  color: #fff;
}
.hero-story {
  font-family: var(--font-display);
  font-size: clamp(12px, 3.2vw, 17px);
  font-weight: 500;
  line-height: 1.6;
  color: rgba(255,255,255,.96);
  text-shadow: 0 2px 16px rgba(0, 40, 80, .4), 0 1px 4px rgba(0, 0, 0, .2);
  margin-bottom: 14px;
}
.hero-kicker {
  display: inline-block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .12em;
  padding: 6px 14px;
  margin-bottom: 12px;
  background: rgba(255,255,255,.18);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  white-space: nowrap;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 5.6vw, 36px);
  line-height: 1.3;
  text-shadow: 0 2px 20px rgba(0, 40, 80, .35), 0 1px 4px rgba(0, 0, 0, .2);
}
.sp-br { display: none; }
@media (max-width: 600px) {
  .sp-br { display: block; }
}
.hero-lead {
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255,255,255,.92);
  text-wrap: pretty;
}
.hero-meta {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 8px 20px;
  margin: 18px 0 24px;
  font-size: 16px;
  font-weight: 500;
  color: rgba(255,255,255,.88);
  white-space: nowrap;
}
.hero-meta span::before { content: '●'; font-size: 14px; margin-right: 6px; opacity: .6; vertical-align: middle; }

@media (max-width: 380px) {
  .hero-kicker { white-space: normal; }
  .hero-meta { flex-wrap: wrap; white-space: normal; justify-content: center; }
}

/* ── CTA Button ── */
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 300px;
  padding: 17px 28px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .04em;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, #ff9a62 100%);
  box-shadow: 0 4px 20px var(--accent-glow), 0 2px 8px rgba(0,0,0,.12);
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--accent-glow), 0 4px 12px rgba(0,0,0,.15);
}
.btn-cta:active { transform: translateY(0); }

/* ── Intro body ── */
.intro-body {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 16px 24px;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--sea-800);
  text-align: center;
  margin-bottom: 8px;
}
.section-lead {
  font-size: 16px;
  color: var(--ink-mute);
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.75;
}
.cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
}

/* ── Type cards (仕事図鑑 style) ── */
.types-zukan { margin-bottom: 40px; }
.types-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px 14px;
  background: var(--paper);
  border: 2px solid var(--line-light);
  border-radius: var(--radius);
  text-align: center;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  cursor: pointer;
  text-decoration: none;
}
.type-card:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: var(--sea-400);
  box-shadow: 0 12px 32px rgba(26, 86, 137, .15);
}
.type-card-illust {
  width: 72px;
  height: 72px;
}
.type-card-illust .char-thumb {
  width: 72px;
  height: 72px;
}
.type-card-illust .char-thumb-fallback { font-size: 38px; }
.type-card-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  word-break: normal; word-break: auto-phrase;
  overflow-wrap: break-word;
}
.type-card-tagline {
  font-size: 16px;
  color: var(--ink-muted);
  line-height: 1.5;
}
.type-card-code {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--sea-600);
}

/* ── Axes ── */
.axes-section { margin-bottom: 32px; }
.axes-list {
  list-style: none;
  margin-top: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(26, 86, 137, .06);
}
.axes-list li {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-light);
  font-size: 16px;
}
.axes-list li:last-child { border-bottom: none; }
.axes-list .sym {
  flex: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--ac);
  background: color-mix(in srgb, var(--ac) 12%, #fff);
  border-radius: 50%;
}
.axes-list h3 { font-size: 16px; font-weight: 700; margin-bottom: 2px; color: var(--ink); }
.axes-list p { font-size: 16px; color: var(--ink-soft); line-height: 1.65; }

.disclaimer {
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  font-size: 16px;
  color: var(--ink-mute);
  line-height: 1.75;
}

/* ── Quiz ── */
body:not(.view-intro) .app { padding: 0 16px 56px; }
.quiz-page-title {
  padding: 24px 0 8px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--sea-800);
}
.quiz-sticky {
  position: sticky;
  top: 49px;
  z-index: 50;
  margin: 0 -16px;
  padding: 12px 16px;
  background: rgba(238, 249, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.quiz-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 16px;
}
.quiz-progress-meta .count { font-weight: 700; color: var(--ink); }
.quiz-progress-meta .count em { font-style: normal; color: var(--sea-600); }
.quiz-track { height: 4px; background: var(--line-light); border-radius: 2px; overflow: hidden; }
.quiz-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--sea-600), var(--sea-500));
  border-radius: 2px;
  transition: width .35s ease;
}
.quiz-hint-top { margin-top: 8px; font-size: 16px; color: var(--ink-mute); }
.quiz-milestone {
  margin-top: 8px;
  min-height: 18px;
  font-size: 16px;
  font-weight: 700;
  color: var(--sea-700);
  text-align: center;
  opacity: 0;
  transition: opacity .3s;
}
.quiz-milestone.show { opacity: 1; }
.q-card.answered .q-opt { cursor: pointer; }
.q-edit-hint {
  display: none;
  margin-top: 8px;
  font-size: 16px;
  color: var(--ink-mute);
  text-align: center;
}
.q-card.answered .q-edit-hint { display: block; }
.q-list { padding: 16px 0 90px; display: flex; flex-direction: column; gap: 20px; }
.q-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  scroll-margin-top: 110px;
  transition: opacity .25s;
  box-shadow: 0 2px 8px rgba(26, 86, 137, .04);
}
.q-card.answered { background: #fafcff; }
.q-card.current { border-color: var(--sea-500); border-left-width: 4px; }
.q-card.dim { opacity: .45; }
.q-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-light);
}
.q-num { font-size: 16px; font-weight: 700; color: var(--ink-mute); }
.q-axis { font-size: 16px; color: var(--ac); font-weight: 500; }
.q-stem {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
  line-height: 1.7;
}
.q-ab { display: flex; flex-direction: column; gap: 0; margin-bottom: 16px; border: 1px solid var(--line-light); border-radius: 8px; overflow: hidden; }
.q-line {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.75;
  border-bottom: 1px solid var(--line-light);
}
.q-line:last-child { border-bottom: none; }
.q-tag {
  flex: none;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--sea-50);
  border-radius: 4px;
}
.q-scale {
  font-size: 16px;
  color: var(--ink-mute);
  margin-bottom: 10px;
  text-align: center;
}
.q-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.q-opt {
  padding: 11px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink-soft);
  transition: background .12s, border-color .12s, color .12s;
}
.q-opt small { display: block; font-size: 16px; color: var(--ink-mute); margin-top: 3px; }
.q-opt:hover:not(:disabled) { border-color: var(--sea-500); color: var(--ink); }
.q-opt.sel { border-color: var(--sea-600); background: var(--sea-600); color: #fff; }
.q-opt.sel small { color: rgba(255,255,255,.8); }
.q-opt:disabled { cursor: default; }
.q-done-badge {
  display: none;
  margin-top: 12px;
  font-size: 16px;
  color: var(--ink-mute);
  text-align: right;
}
.q-card.answered .q-done-badge { display: block; }
.quiz-fab {
  display: none;
  margin: 32px auto 48px;
  padding: 16px 36px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 6px 24px var(--accent-glow), 0 2px 8px rgba(0,0,0,.18);
  white-space: nowrap;
  transition: box-shadow .2s ease, transform .2s ease;
}
.quiz-fab.show {
  display: block;
}
.quiz-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px var(--accent-glow), 0 4px 12px rgba(0,0,0,.22);
}

/* ── Loading ── */
.load-wrap {
  min-height: 60dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: 48px 16px;
}
.load-dots { display: flex; gap: 6px; }
.load-dots i {
  width: 8px; height: 8px;
  background: var(--sea-600);
  border-radius: 50%;
  animation: blink 1.2s ease-in-out infinite;
}
.load-dots i:nth-child(2) { animation-delay: .2s; }
.load-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100% { opacity: .2; } 40% { opacity: 1; } }
.load-wrap p { font-size: 18px; font-weight: 700; color: var(--sea-800); }
.load-wrap span { font-size: 16px; color: var(--ink-mute); }
#load-tease {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.load-tease-thumb { width: 40px; height: 40px; }

/* ── Result (sea theme) ── */
body.result-mode { background: var(--sea-100); }
body.result-mode .site-header { display: none; }
body.result-mode .app { max-width: none; padding: 0; }
body.result-mode .site-footer { display: none; }

/* ── Type detail page ── */
body.type-page { background: var(--sea-100); }
.type-detail .board-stage { min-height: auto; }
.type-back { max-width: 560px; margin: 0 auto 16px; }
.type-back-link {
  display: inline-flex;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--sea-700);
  text-decoration: none;
}
.type-back-link:hover { text-decoration: underline; }
.type-cta-lead {
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.type-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* ── Sub link (below main CTA) ── */
.btn-sub {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--sea-700);
  text-decoration: none;
  padding: 10px 18px;
  border: 1.5px solid var(--sea-300);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  transition: background .2s ease, border-color .2s ease;
}
.btn-sub:hover { background: #fff; border-color: var(--sea-500); }

/* ── Archetypes page ── */
body.arch-page { background: var(--sea-100); }
.arch-detail {
  background: linear-gradient(180deg, var(--sea-100) 0%, var(--sea-200) 50%, var(--sea-100) 100%);
  padding: 28px 20px 48px;
}
.arch-wrap { max-width: 880px; margin: 0 auto; }
.arch-hero { text-align: center; margin: 8px 0 28px; }
.arch-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 5.5vw, 30px);
  color: var(--sea-800);
  line-height: 1.4;
  margin-bottom: 12px;
}
.arch-lead { font-size: 16px; color: var(--ink-soft); line-height: 1.8; }
.arch-group {
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(45, 139, 201, .15);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(26, 86, 137, .08);
  padding: 24px 20px 26px;
  margin-bottom: 22px;
}
.arch-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.arch-badge {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--sea-500), var(--sea-700));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
}
.arch-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(18px, 4.5vw, 22px);
  color: var(--ink);
  line-height: 1.35;
}
.arch-en {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--sea-600);
  margin-top: 2px;
}
.arch-sub { font-size: 15px; font-weight: 700; color: var(--sea-700); margin-top: 6px; }
.arch-desc { font-size: 16px; line-height: 1.8; color: var(--ink-soft); margin-bottom: 18px; }
.arch-types {
  grid-template-columns: repeat(2, 1fr);
}
.arch-meta {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.arch-meta div { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.arch-meta dt {
  flex: none;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--sea-600);
  padding: 3px 10px;
  border-radius: 999px;
}
.arch-meta dd { font-size: 15px; color: var(--ink-soft); line-height: 1.7; }
.arch-cta { text-align: center; margin-top: 8px; }

#view-result.active { display: block; }

.board-stage {
  position: relative;
  min-height: 100dvh;
  padding: 28px 20px 40px;
  background: linear-gradient(180deg, var(--sea-100) 0%, var(--sea-200) 50%, var(--sea-100) 100%);
  overflow: hidden;
}
.board-watermark {
  position: absolute;
  top: 14px;
  right: 18px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .2em;
  color: rgba(26, 86, 137, .2);
}
.board-sheet {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 20px 28px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(45, 139, 201, .15);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(26, 86, 137, .1);
}
.board-reveal {
  animation: boardIn .6s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes boardIn {
  from { opacity: 0; transform: translateY(16px) rotate(-.5deg); }
  to { opacity: 1; transform: none; }
}
.board-meta { flex: 1; min-width: 0; padding-top: 4px; }
.board-label {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--sea-600);
  margin-bottom: 10px;
}
.board-stamp {
  display: inline-block;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .3em;
  padding: 6px 14px;
  margin-bottom: 14px;
  color: var(--sea-800);
  border: 2px solid var(--sea-600);
  border-radius: 4px;
  transform: rotate(-4deg);
  background: rgba(255, 255, 255, .7);
}
.board-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 7vw, 32px);
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 12px;
  border-bottom: 2px solid var(--sea-600);
  padding-bottom: 12px;
  word-break: normal; word-break: auto-phrase;
  overflow-wrap: break-word;
}
.board-tagline {
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.board-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 16px;
  font-weight: 700;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--leg, var(--type));
  border-radius: 6px;
  white-space: nowrap;
}
.legend-item .leg-sym { opacity: .85; }
.legend-item .leg-letter { color: var(--sea-700); }

.board-cutout {
  position: relative;
  flex: 0 0 min(50vw, 240px);
  width: min(50vw, 240px);
  transform: rotate(3deg);
  filter: drop-shadow(6px 10px 18px rgba(26, 86, 137, .2));
}
.tape {
  position: absolute;
  width: 48px;
  height: 16px;
  background: rgba(184, 228, 247, .9);
  border: 1px solid rgba(45, 139, 201, .15);
  z-index: 2;
  pointer-events: none;
}
.tape-tl { top: -7px; left: 12%; transform: rotate(-32deg); }
.tape-br { bottom: -6px; right: 8%; transform: rotate(18deg); }
.cutout-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
  padding: 8px;
  border: 1px solid rgba(45, 139, 201, .2);
  border-radius: 8px;
  overflow: hidden;
}
.cutout-illust {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  object-fit: contain;
  object-position: center bottom;
  z-index: 1;
}
.cutout-illust[hidden] { display: none; }
.cutout-emoji {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: clamp(72px, 20vw, 100px);
  line-height: 1;
  z-index: 0;
}
.cutout-inner.has-illust .cutout-emoji { display: none; }

.board-panel {
  max-width: 560px;
  margin: 16px auto 0;
  padding: 20px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(45, 139, 201, .12);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(26, 86, 137, .08);
}
.board-section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--sea-600);
  color: var(--sea-800);
}
.board-desc {
  font-size: 18px;
  line-height: 1.9;
  color: var(--ink-soft);
}
.board-balance-hint {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-mute);
  margin-bottom: 16px;
}
.axis-chart { display: flex; flex-direction: column; gap: 20px; }
.axis-chart-row { --ax: var(--type); }
.axis-chart-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.axis-chart-sym {
  font-size: 16px;
  font-weight: 700;
  color: var(--ax);
}
.axis-chart-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.axis-chart-verdict {
  margin-left: auto;
  font-size: 16px;
  color: var(--ink-soft);
}
.axis-chart-verdict strong {
  font-size: 18px;
  color: var(--ax);
  font-weight: 700;
}
.axis-spectrum { width: 100%; }
.spec-track {
  position: relative;
  height: 12px;
  border-radius: 6px;
  overflow: visible;
  display: flex;
  background: var(--line-light);
}
.spec-zone { flex: 1; height: 100%; }
.spec-left {
  border-radius: 6px 0 0 6px;
  background: color-mix(in srgb, var(--ax) 18%, #fff);
}
.spec-right {
  border-radius: 0 6px 6px 0;
  background: color-mix(in srgb, var(--ax) 8%, #fff);
}
.spec-threshold {
  position: absolute;
  left: 46.67%;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--ink-mute);
  opacity: .35;
  transform: translateX(-50%);
  z-index: 1;
}
.spec-dot {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  background: var(--ax);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
  transform: translateY(-50%);
  z-index: 2;
}
.spec-pcts {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 16px;
  color: var(--ink-mute);
  line-height: 1.5;
}
.spec-side { flex: 1; }
.spec-side:last-child { text-align: right; }
.spec-side b { font-weight: 700; }
.spec-side em {
  font-style: normal;
  font-weight: 700;
  margin-left: 4px;
}
.spec-side.on { color: var(--ink); }
.spec-side.on em { color: var(--ax); }

.board-actions {
  max-width: 560px;
  margin: 20px auto 0;
  text-align: center;
}
.board-share {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.share-btn {
  padding: 12px 20px;
  font-size: 18px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: var(--radius-pill);
}
.share-btn.share-toggle { background: var(--accent); color: #fff; border-color: var(--accent); width: 48px; height: 48px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; }
.share-btn.img { background: var(--sea-700); color: #fff; border-color: var(--sea-700); }
.share-expand-wrap {
  position: relative;
}
.share-panel {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: row;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  z-index: 10;
}
.share-panel[hidden] { display: none; }
.share-panel-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}
.share-panel-btn:hover { transform: scale(1.1); opacity: .9; }
.share-panel-btn.x { background: #000; color: #fff; }
.share-panel-btn.line { background: #06c755; color: #fff; }
.share-panel-btn.insta { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); color: #fff; }
.share-status {
  font-size: 16px;
  color: var(--ink-mute);
  min-height: 18px;
  margin: 12px 0 16px;
}
.aworker-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 18px 20px;
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, #ff9a62 100%);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px var(--accent-glow), 0 2px 8px rgba(0, 0, 0, .12);
  transition: transform .2s ease, box-shadow .2s ease;
}
.aworker-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--accent-glow), 0 4px 12px rgba(0, 0, 0, .15);
}
.aworker-cta:active { transform: translateY(0); }
.aworker-cta-arrow {
  flex: none;
  font-size: 22px;
  font-weight: 700;
}
.board-restart {
  margin-top: 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 18px;
  border-radius: var(--radius-pill);
}

.sw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.sw-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}
.sw-box h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-light);
}
.sw-box .item {
  font-size: 16px;
  padding: 7px 0;
  border-bottom: 1px dotted var(--line-light);
  line-height: 1.65;
  color: var(--ink-soft);
}
.sw-box .item:last-child { border: none; }

.linelist .li {
  font-size: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-light);
  line-height: 1.75;
  color: var(--ink-soft);
}
.linelist .li:last-child { border: none; }
#r-worknotes { margin-top: 10px; }
#r-worknotes:empty { margin-top: 0; }
.taglist { display: flex; flex-direction: column; gap: 0; }
.taglist span {
  font-size: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-light);
  color: var(--ink-soft);
  line-height: 1.65;
}
.taglist span:last-child { border: none; }
.compat-grid h4 { font-size: 16px; font-weight: 700; margin-bottom: 8px; color: var(--ink); }
.compat-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-light);
  line-height: 1.75;
  color: var(--ink-soft);
}
.compat-item:last-child { border-bottom: none; }
.compat-head-row { display: flex; gap: 10px; align-items: center; }
.compat-head { color: var(--sea-700); font-weight: 700; font-size: 16px; }
.compat-body { margin: 0; color: var(--ink-soft); line-height: 1.85; }
.compat-solution { font-weight: 700; color: var(--type-deep, var(--ink-main)); display: inline-block; margin-top: 8px; }
.compat-item b { color: var(--sea-700); font-weight: 700; }

.char-thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  overflow: hidden;
}
.char-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}
.char-thumb-fallback {
  font-size: 30px;
  line-height: 1;
}
.char-thumb.no-img img { display: none; }
.char-thumb:not(.no-img) .char-thumb-fallback { display: none; }
.char-thumb-sm { width: 44px; height: 44px; }
.char-thumb-md { width: 72px; height: 72px; }

.types-all-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.type-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border: 1px solid var(--line-light);
  border-radius: 8px;
  background: var(--paper);
  text-align: center;
}
.type-chip-name {
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink-soft);
  font-weight: 500;
  word-break: normal; word-break: auto-phrase;
  overflow-wrap: break-word;
}
.type-chip.you {
  border-color: var(--sea-500);
  background: var(--sea-100);
}
.type-chip.you .type-chip-name {
  color: var(--sea-800);
  font-weight: 700;
}

.btn-restart {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-weight: 500;
  font-size: 16px;
  color: var(--ink-soft);
  border-radius: var(--radius-pill);
}

/* ── Footer ── */
.site-footer {
  background: var(--footer-bg);
  color: rgba(255, 255, 255, .85);
  padding: 48px 24px 24px;
  font-size: 16px;
  line-height: 1.8;
}
.site-footer-inner {
  max-width: 900px;
  margin: 0 auto;
}

/* top: description + brand links */
.footer-top {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.footer-about {
  flex: 1;
  font-size: 15px;
  line-height: 1.9;
  opacity: .85;
}
.footer-brand-logos {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
  justify-content: center;
}
.footer-logo-img {
  display: block;
  height: 36px;
  width: auto;
  opacity: .9;
  transition: opacity .2s;
}
.footer-logo-img:hover { opacity: 1; }

/* mid: logos + social icons */
.footer-mid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 28px 0;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.footer-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 18px;
  transition: background .2s;
}
.footer-social:hover { background: rgba(255,255,255,.25); }

/* bottom: legal */
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding-top: 20px;
  text-align: center;
}
.footer-link {
  color: rgba(255,255,255,.75);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s;
}
.footer-link:hover { color: #fff; }
.footer-sep { color: rgba(255,255,255,.75); }
.footer-copy {
  width: 100%;
  text-align: center;
  opacity: .55;
  font-size: 14px;
  margin-top: 4px;
}

@media (max-width: 600px) {
  .footer-top { flex-direction: column; gap: 24px; }
  .footer-brand-links { flex-direction: row; }
  .board-sheet { flex-direction: column-reverse; align-items: center; gap: 20px; }
  .board-meta { width: 100%; }
  .board-cutout { flex: none; width: min(64vw, 260px); }
  .hero-char { opacity: .85; }
}

.sr-canvas { position: fixed; left: -9999px; top: 0; }

@media (min-width: 600px) {
  .types-grid { grid-template-columns: repeat(4, 1fr); }
  .types-all-grid { grid-template-columns: repeat(4, 1fr); }
  .type-chip-name { font-size: 16px; }
  .arch-types { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 400px) {
  .q-opts { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .q-opt { font-size: 12px; padding: 10px 2px; word-break: normal; word-break: auto-phrase; }
  .q-opt small { font-size: 11px; }
  .sw-grid { grid-template-columns: 1fr; }
}
