/* Layout: one phone-width column of "sticker" cards on a polka-dot ground.
   Deliberately a single light, pastel look, so no dark palette. */
:root {
  color-scheme: light;
  --bg: #FFF3F6;
  --dot: #FFDDE6;
  --paper: #FFFFFF;
  --ink: #4A3743;
  --ink-soft: #7C6874;
  --pink: #F25C84;
  --pink-mid: #F79AB3;
  --pink-soft: #FFD6E0;
  --mint: #7ED3C1;
  --mint-soft: #DDF5EF;
  --sky: #78BCEB;
  --sky-mid: #A9D8EF;
  --sky-soft: #DDEFFC;
  --butter: #FFD66E;
  --butter-soft: #FFF3CC;
  --face: #FFE6D8;
  --hair: #5A4150;
  --line: #06C755;
  --f-display: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
  --f-body: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 2.2px, transparent 2.6px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--f-body); font-size: 15px; line-height: 1.8; overflow-wrap: anywhere;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: calc(18px + env(safe-area-inset-top, 0px)) calc(56px + env(safe-area-inset-bottom, 0px));
}
.wrap { max-width: 520px; margin: 0 auto; display: grid; gap: 16px; }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; line-height: 1.4; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
[hidden] { display: none !important; }

.sticker {
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 26px;
  box-shadow: 4px 5px 0 var(--ink); padding: 20px;
  display: grid; gap: 12px; min-width: 0; position: relative;
}
.chip {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-display); font-weight: 700; font-size: 12px; letter-spacing: .06em;
  border: 2px solid var(--ink); border-radius: 999px; padding: 2px 12px; background: var(--butter);
}
.small { font-size: 13px; color: var(--ink-soft); }
.center { text-align: center; justify-items: center; }

.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px; width: 100%;
  font-family: var(--f-display); font-weight: 900; font-size: 18px; letter-spacing: .04em;
  background: var(--pink); color: #FFFFFF; text-decoration: none; text-align: center; line-height: 1.4;
  border: 2.5px solid var(--ink); border-radius: 999px; padding: 14px 22px;
  box-shadow: 0 5px 0 var(--ink); transition: transform .1s, box-shadow .1s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn.sub { background: var(--paper); color: var(--ink); font-size: 16px; }
.btn.line { background: var(--line); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn[disabled]:active { transform: none; box-shadow: 0 5px 0 var(--ink); }
.note { font-size: 12.5px; color: var(--ink-soft); background: var(--paper); border: 2px dashed #E3C8D2; border-radius: 16px; padding: 10px 14px; }
.spark { position: absolute; width: 22px; height: 22px; }

/* intro */
.hero { text-align: center; justify-items: center; padding-block: 24px 22px; }
.hero .chip { justify-self: center; }
.hero h1 { font-size: clamp(25px, 7.6vw, 40px); font-weight: 900; }
.hero h1 .nw { white-space: nowrap; }
.hero h1 .mark { background: linear-gradient(transparent 58%, var(--butter) 58%); padding-inline: 4px; }
.hero h1 .pk { color: var(--pink); }
.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.fact { font-weight: 700; font-size: 13px; background: var(--mint-soft); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 12px; }
.sec-title { font-size: 17px; font-weight: 900; }
.stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.stages li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.stages .n { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-family: var(--f-display); font-weight: 900; }
.stages b { font-family: var(--f-display); }
.stages .cnt { font-size: 12px; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.prep { display: flex; flex-wrap: wrap; gap: 8px; }
.prep span { font-size: 13px; font-weight: 700; background: var(--sky-soft); border: 2px solid var(--ink); border-radius: 12px; padding: 4px 12px; }
.crew { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px 6px; }
.mate { display: grid; justify-items: center; gap: 4px; text-align: center; }
.bub { width: 100%; max-width: 76px; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--ink); overflow: hidden; display: grid; place-items: end center; }
.bub svg { width: 92%; height: auto; margin-bottom: -6%; }
.mate span { font-size: 10px; font-weight: 700; line-height: 1.3; }

/* progress */
.prog { display: grid; gap: 8px; }
.prog-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.back { background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 12px; font-size: 13px; font-weight: 700; }
.back.ghost { visibility: hidden; }
.steps { display: flex; gap: 6px; align-items: center; }
.steps i { width: 26px; height: 10px; border-radius: 99px; border: 2px solid var(--ink); background: var(--paper); }
.steps i.done { background: var(--mint); }
.steps i.now { background: var(--butter); width: 38px; }
.track { position: relative; height: 12px; border: 2px solid var(--ink); border-radius: 99px; background: var(--paper); margin-top: 24px; }
.track > i { position: absolute; inset: 0 auto 0 0; background: var(--mint); border-radius: 99px; transition: width .3s ease; }
.walker { position: absolute; bottom: 4px; width: 28px; transform: translateX(-50%); transition: left .3s ease; }
.walker svg { width: 28px; height: auto; display: block; }

/* stage screen */
.stage-card { padding-block: 28px; }
.stage-card .big { font-family: var(--f-display); font-weight: 900; font-size: 15px; color: var(--pink); letter-spacing: .1em; }
.stage-card h1 { font-size: clamp(26px, 7.5vw, 32px); font-weight: 900; }
.pose { width: 120px; height: auto; }

/* question */
.move { background: var(--sky-soft); border: 2px solid var(--ink); border-radius: 18px; padding: 10px 14px; display: grid; gap: 2px; }
.move b { font-family: var(--f-display); font-size: 13px; color: #2F7DBF; }
.qtext { font-size: clamp(20px, 5.6vw, 23px); font-weight: 900; }
.scale { display: grid; gap: 6px; padding-top: 4px; }
.dots { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.sd { flex: none; display: grid; place-items: center; width: 50px; height: 50px; padding: 0; background: none; border: 0; border-radius: 50%; }
.sd i { display: block; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--paper); transition: transform .12s, background .12s; }
.sd:hover i { transform: scale(1.08); }
.sd.c0 i { width: 48px; height: 48px; border-color: var(--pink); }
.sd.c1 i { width: 38px; height: 38px; border-color: var(--pink-mid); }
.sd.c2 i { width: 28px; height: 28px; border-color: #CDBFC6; }
.sd.c3 i { width: 38px; height: 38px; border-color: var(--sky-mid); }
.sd.c4 i { width: 48px; height: 48px; border-color: var(--sky); }
.sd.on.c0 i { background: var(--pink); } .sd.on.c1 i { background: var(--pink-mid); } .sd.on.c2 i { background: #CDBFC6; }
.sd.on.c3 i { background: var(--sky-mid); } .sd.on.c4 i { background: var(--sky); }
.sd.on i { box-shadow: inset 0 0 0 4px var(--paper); }
.ends { display: flex; justify-content: space-between; font-family: var(--f-display); font-weight: 700; font-size: 13px; }
.ends span:first-child { color: var(--pink); }
.ends span:last-child { color: #2F7DBF; }
.picked { text-align: center; font-weight: 700; font-size: 14px; min-height: 1.8em; }
.tip { text-align: center; }

/* analyzing */
.analyzing { text-align: center; justify-items: center; padding-block: 40px; }
.hop { display: flex; gap: 8px; justify-content: center; }
.hop .bub { width: 56px; }
.hop .bub:nth-child(2) { animation-delay: .15s; } .hop .bub:nth-child(3) { animation-delay: .3s; }

/* finished: the type stays hidden until LINE */
.mystery { position: relative; width: 150px; }
.mystery svg { width: 150px; height: auto; filter: grayscale(1) brightness(.35) opacity(.35); }
.mystery .q { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-display); font-weight: 900; font-size: 64px; color: var(--pink); text-shadow: 3px 3px 0 var(--paper); }
.done-title { font-size: clamp(22px, 6.4vw, 28px); font-weight: 900; }
.howto { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.howto li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
.howto .n { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-family: var(--f-display); font-weight: 900; background: var(--mint); }
.howto .body { display: grid; gap: 8px; min-width: 0; }
.howto b { font-family: var(--f-display); font-size: 16px; }
.code { font-family: var(--f-display); font-weight: 900; font-size: 18px; letter-spacing: .08em; background: var(--butter-soft); border: 2px dashed var(--ink); border-radius: 12px; padding: 4px 12px; justify-self: start; user-select: all; }
.preview-link { font-size: 12.5px; color: var(--ink-soft); text-align: center; }
.preview-link a { color: var(--ink); font-weight: 700; }

/* result */
.card { padding: 0; overflow: hidden; gap: 0; }
.card-top { position: relative; display: grid; justify-items: center; padding: 12px 16px 0; }
.card-label { justify-self: stretch; display: flex; justify-content: space-between; font-family: var(--f-display); font-weight: 900; font-size: 11px; letter-spacing: .14em; }
.card-figs svg { width: 150px; height: auto; }
.card-body { padding: 14px 20px 18px; display: grid; gap: 4px; text-align: center; border-top: 2.5px solid var(--ink); background: var(--paper); }
.card-body .nick { font-family: var(--f-display); font-weight: 700; font-size: 15px; color: var(--pink); }
.card-body h1 { font-size: clamp(28px, 8vw, 36px); font-weight: 900; }
.card-body .catch { font-weight: 700; font-size: 14px; }
.sticker h2 { font-size: 19px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.ic { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-size: 13px; font-family: var(--f-display); }
.feat { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.feat li { display: flex; gap: 8px; font-weight: 500; }
.feat li::before { content: ""; flex: none; width: 10px; height: 10px; margin-top: .6em; border-radius: 50%; background: var(--pink); border: 2px solid var(--ink); }
.feat.mint li::before { background: var(--mint); }
.body-map { display: grid; gap: 5px; }
.jt { display: grid; grid-template-columns: 6.2em minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; background: #FBF5F8; }
.jt .role { font-size: 11.5px; font-weight: 500; color: var(--ink-soft); }
.jt .tag { font-family: var(--f-display); font-size: 12px; font-weight: 700; border: 2px solid var(--ink); border-radius: 999px; padding: 0 10px; }
.jt.stiff { background: var(--sky-soft); } .jt.stiff .tag { background: var(--sky); }
.jt.over { background: var(--pink-soft); } .jt.over .tag { background: var(--pink); color: #FFFFFF; }
.legend { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-soft); }
.legend b { font-family: var(--f-display); color: var(--ink); }
.chain { background: var(--mint-soft); border-radius: 18px; padding: 12px 14px; }
.ex { background: var(--butter-soft); border: 2px solid var(--ink); border-radius: 18px; padding: 12px 16px; display: grid; gap: 2px; min-width: 0; }
.ex b { font-family: var(--f-display); font-size: 17px; }
.ex .why { margin-top: 6px; padding: 8px 12px; background: var(--paper); border-radius: 12px; font-size: 13.5px; display: grid; gap: 2px; }
.ex .why span { font-family: var(--f-display); font-weight: 700; font-size: 12px; color: var(--pink); }
.gift ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.gift li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; font-weight: 700; }
.gift li svg { width: 22px; height: 22px; margin-top: 3px; }

/* video */
.video { position: relative; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; border: 2.5px solid var(--ink); border-radius: 18px; overflow: hidden; background: var(--ink); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video.empty { background: var(--sky-soft); display: grid; place-items: center; text-align: center; padding: 16px; font-weight: 700; }
.video.empty .play { width: 54px; height: 54px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--paper); display: grid; place-items: center; margin: 0 auto 6px; }
.video-link { font-size: 13px; text-align: center; }
.video-link a { color: var(--ink); font-weight: 700; }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.bobbing { animation: bob 2.2s ease-in-out infinite; }
.hop .bub { animation: bob .8s ease-in-out infinite; }
@keyframes pop { from { transform: scale(.88); } to { transform: scale(1); } }
.pop { animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* 結果画面：タイプ名を見せる */
.done-title .pk { color: var(--pink); }
.pop > .bub { max-width: 120px; }
p.small.center { margin-top: -6px; }
