:root {
  --paper: #faf8f3;
  --cream: #f5f2ea;
  --ink: #2c3a26;
  --muted: #55644a;
  --green: #3d5136;
  --green-soft: #71855f;
  --leaf: #8cc63f;
  --leaf-deep: #5d9b2f;
  --water: #5aa9d6;
  --water-soft: #cfe9f6;
  --light: #ffe68a;
  --sun: #f6b73c;
  --pvc: #ffffff;
  --foil: #cfd3d8;
  --accent: #e2725b;
  --hand: "Klee One", "Zen Maru Gothic", sans-serif;
  --body: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", sans-serif;
  --wobbly: 255px 18px 225px 18px / 18px 225px 18px 255px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--paper); color: var(--ink);
  font-family: var(--body);
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; touch-action: manipulation;
}
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }

#viewport { position: fixed; inset: 0; overflow: hidden; }
#stage {
  position: absolute; left: 50%; top: 50%; width: 1600px; height: 1000px;
  transform-origin: center center;
  background:
    linear-gradient(transparent 39px, rgba(61,81,54,.06) 40px) 0 0 / 100% 40px,
    linear-gradient(90deg, transparent 39px, rgba(61,81,54,.06) 40px) 0 0 / 40px 100%,
    var(--paper);
  overflow: hidden;
}

.hand { font-family: var(--hand); font-weight: 600; }

/* ---------- scene switching ---------- */
.scene { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .5s, visibility 0s .5s; }
.scene.active { opacity: 1; visibility: visible; transition: opacity .5s; }
.scene.active .bar, .scene.active .menu .card { animation: popIn .6s cubic-bezier(.2,1.4,.4,1) both; }

@keyframes popIn { from { opacity: 0; transform: translateY(24px) scale(.96); } }

/* ---------- common svg ---------- */
.ink { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ink.thin { stroke-width: 2; opacity: .5; }
.pvc { fill: var(--pvc); stroke: var(--ink); stroke-width: 3; }
.pipe-body { fill: var(--pvc); stroke: var(--ink); stroke-width: 3; }
.pipe-water { fill: var(--water-soft); }
.led-bar { fill: #fdfdf5; stroke: var(--ink); stroke-width: 3; }
.beam { fill: url(#beam); opacity: 0; mix-blend-mode: multiply; }
.led.on .beam, .grow-light .beam, .here-pic .beam { opacity: .9; animation: beamPulse 4s ease-in-out infinite; }
.led.on .led-bar { fill: #fffbe0; filter: drop-shadow(0 0 10px #ffe56b); }
@keyframes beamPulse { 50% { opacity: .65; } }

/* ---------- top bar ---------- */
.bar {
  position: absolute; left: 40px; right: 40px; top: 28px; height: 84px;
  display: grid; grid-template-columns: 200px 1fr 260px; align-items: center; z-index: 5;
}
.bar h2 { margin: 0; text-align: center; font-size: 46px; letter-spacing: .04em; }
.tag {
  display: inline-grid; place-items: center; width: 56px; height: 56px; margin-right: 14px;
  border: 3px solid var(--ink); border-radius: 50%; background: var(--light);
  font-size: 32px; vertical-align: 6px;
}
.back {
  justify-self: start; height: 68px; padding: 0 30px 0 56px; font-size: 26px; font-weight: 700;
  border: 3px solid var(--ink); border-radius: var(--wobbly); background: #fff; position: relative;
  box-shadow: 4px 5px 0 var(--ink);
}
.back::before {
  content: ""; position: absolute; left: 22px; top: 50%; width: 16px; height: 16px;
  border-left: 4px solid var(--ink); border-bottom: 4px solid var(--ink);
  transform: translateY(-50%) rotate(45deg);
}
.back:active, .pill:active, .card:active { transform: translate(3px,4px); box-shadow: 1px 1px 0 var(--ink); }
.pill {
  justify-self: end; height: 68px; padding: 0 30px; font-size: 26px; font-weight: 700;
  border: 3px solid var(--ink); border-radius: 40px; background: var(--leaf); color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,.25); box-shadow: 4px 5px 0 var(--ink);
}
.pill.ghost { background: #fff; color: var(--ink); text-shadow: none; }
.pill.playing { background: var(--accent); }

/* ---------- HOME ---------- */
.home-sky {
  position: absolute; left: 0; right: 0; top: 0; height: 320px;
  background: radial-gradient(ellipse 50% 100% at 30% 0, rgba(255,230,138,.7), transparent 70%);
  animation: sky 6s ease-in-out infinite;
}
@keyframes sky { 50% { opacity: .6; } }
.home-left { position: absolute; left: 70px; top: 60px; width: 720px; height: 900px; }
.kicker { margin: 0; font-size: 30px; color: var(--muted); font-weight: 700; }
.home-left h1 { margin: 6px 0 14px; font-size: 128px; line-height: 1.05; letter-spacing: .02em; }
.home-left h1 { background: linear-gradient(transparent 70%, rgba(140,198,63,.45) 70%); display: inline; }
.lead { font-size: 32px; line-height: 1.6; margin: 24px 0 0; font-weight: 700; }
.home-plant { position: absolute; left: 0; bottom: 0; width: 680px; height: 560px; overflow: visible; }
.home-day {
  position: absolute; left: 470px; bottom: 360px; font-size: 40px;
  background: #fff; border: 3px solid var(--ink); border-radius: var(--wobbly); padding: 8px 22px;
  transform: rotate(-4deg); box-shadow: 4px 5px 0 var(--ink); white-space: nowrap;
}
.home-day span { font-size: 64px; color: var(--leaf-deep); display: inline-block; min-width: 1.3em; text-align: right; }

.menu { position: absolute; right: 70px; top: 70px; width: 720px; display: grid; gap: 22px; }
.card {
  position: relative; display: grid; grid-template-columns: 110px 1fr; grid-template-rows: auto auto;
  align-items: center; text-align: left; height: 150px; padding: 0 36px 0 28px;
  background: #fff; border: 3px solid var(--ink); border-radius: var(--wobbly);
  box-shadow: 6px 7px 0 var(--ink);
}
.card:nth-child(even) { transform: rotate(.6deg); }
.card:nth-child(odd) { transform: rotate(-.5deg); }
.card svg { grid-row: 1 / 3; width: 88px; height: 88px; fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.card .ic-water { stroke: var(--water); stroke-dasharray: 8 8; animation: flow 1s linear infinite; }
.card b { font-size: 40px; align-self: end; }
.card small { font-size: 24px; color: var(--muted); align-self: start; margin-top: 4px; font-weight: 700; }
.card .num {
  position: absolute; right: 26px; top: 50%; transform: translateY(-50%);
  font-family: var(--hand); font-size: 76px; color: rgba(61,81,54,.12); font-weight: 600;
}
.c1 { background: linear-gradient(90deg, #e8f5fb, #fff 60%); }
.c2 { background: linear-gradient(90deg, #eef7e0, #fff 60%); }
.c3 { background: linear-gradient(90deg, #fff6d6, #fff 60%); }
.c4 { background: linear-gradient(90deg, #f3eee2, #fff 60%); }
.c5 { background: linear-gradient(90deg, #fde9e4, #fff 60%); }
.scene.active .menu .card:nth-child(1) { animation-delay: .05s; }
.scene.active .menu .card:nth-child(2) { animation-delay: .12s; }
.scene.active .menu .card:nth-child(3) { animation-delay: .19s; }
.scene.active .menu .card:nth-child(4) { animation-delay: .26s; }
.scene.active .menu .card:nth-child(5) { animation-delay: .33s; }

.touch-hint {
  position: absolute; right: 90px; bottom: 30px; font-size: 22px; font-weight: 700; color: var(--muted); opacity: .7;
}
@keyframes bob { 50% { transform: translateY(-8px); } }
.finger {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent); position: relative;
  box-shadow: 0 0 0 0 rgba(226,114,91,.6); animation: ping 1.6s ease-out infinite;
}
@keyframes ping { to { box-shadow: 0 0 0 26px rgba(226,114,91,0); } }

.bubbles { position: absolute; inset: 0; pointer-events: none; }
.bubbles i {
  position: absolute; bottom: -40px; border-radius: 50%;
  border: 2px solid rgba(90,169,214,.5); background: rgba(207,233,246,.35);
  animation: rise linear infinite;
}
@keyframes rise { to { transform: translate(var(--dx), -1100px); } }

/* ---------- 1. SHIKUMI ---------- */
.shikumi-body { position: absolute; left: 30px; right: 40px; top: 125px; bottom: 50px; display: grid; grid-template-columns: 1040px 1fr; grid-template-rows: 100%; gap: 30px; }
#rack { width: 100%; height: 100%; overflow: visible; }
.tube-o { fill: none; stroke: var(--ink); stroke-width: 20; stroke-linejoin: round; stroke-linecap: round; }
.tube-i { fill: none; stroke: #fff; stroke-width: 13; stroke-linejoin: round; stroke-linecap: round; }
.flow { fill: none; stroke: var(--water); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 10 18; animation: flow 1.1s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -28; } }
.tank-body { fill: #f2f6f8; stroke: var(--ink); stroke-width: 3; }
.tank-water { fill: url(#waterGrad); opacity: .85; animation: wave 3s linear infinite; }
@keyframes wave { to { transform: translateX(-100px); } }
.pump-body { fill: #6b7a62; stroke: var(--ink); stroke-width: 3; }
.impeller .ink { stroke: #fff; }
.impeller { animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fan-ring { fill: rgba(255,255,255,.7); stroke: var(--ink); stroke-width: 3; }
.blade { fill: #fff; stroke: var(--ink); stroke-width: 2.5; }
.hub { fill: var(--ink); }
.blades { animation: spin .5s linear infinite; }
.wind path { fill: none; stroke: #9fb8c8; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 60 400; animation: wind 2.4s linear infinite; }
.wind path:nth-child(2) { animation-delay: -.6s; } .wind path:nth-child(3) { animation-delay: -1.3s; } .wind path:nth-child(4) { animation-delay: -1.8s; }
@keyframes wind { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -460; } }
.photons circle { fill: #ffd84a; }
.drop path { fill: var(--water); stroke: var(--ink); stroke-width: 2.5; }
.drop { filter: drop-shadow(0 0 10px rgba(90,169,214,.9)); }

.hs { cursor: pointer; }
.hs circle { fill: var(--green-soft); stroke: #fff; stroke-width: 3; opacity: .92; }
.hs text { fill: #fff; font: 700 22px var(--body); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.hs::before { content: none; }
.hs.sel circle { fill: var(--accent); opacity: 1; }

.foil { fill: var(--foil); stroke: #8b9097; stroke-width: 1.5; }
.netcup { fill: #c9a75e; stroke: var(--ink); stroke-width: 2; }
.svg-label { font: 700 22px var(--body); fill: var(--ink); }

.info-panel {
  align-self: center; min-height: 600px; padding: 40px 36px; background: #fff;
  border: 3px solid var(--ink); border-radius: var(--wobbly); box-shadow: 6px 7px 0 var(--ink);
  font-size: 26px; line-height: 1.7; position: relative;
}
.info-panel .big { font-size: 40px; margin: 0 0 10px; }
.info-panel .hint { margin: 14px 0 0; font-size: 22px; color: var(--muted); }
.legend { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; font-weight: 700; font-size: 22px; white-space: nowrap; }
.legend b { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--green-soft); color: #fff; margin-right: 10px; font-size: 20px; }
.info-card { animation: popIn .45s cubic-bezier(.2,1.4,.4,1) both; }
.info-num { width: 60px; height: 60px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 30px; font-weight: 900; }
.info-card h3 { font-size: 42px; margin: 12px 0 6px; }
.info-pic svg { width: 100%; height: 190px; }
.info-text { margin: 8px 0 0; }

.journey-caption {
  position: absolute; right: 40px; top: 300px; width: 470px; min-height: 300px; padding: 40px 36px;
  font-size: 32px; font-weight: 700; line-height: 1.6; display: flex; align-items: center;
  background: var(--ink); color: #fff; border-radius: 28px; box-shadow: 6px 7px 0 rgba(44,58,38,.35); z-index: 6;
}
.journey-caption[hidden] { display: none; }
.journey-caption.swap { animation: popIn .4s both; }

/* ---------- 2. SODATSU ---------- */
.grow-body { position: absolute; left: 40px; right: 40px; top: 120px; height: 700px; display: grid; grid-template-columns: 900px 1fr; grid-template-rows: 100%; gap: 30px; }
#growSvg { width: 100%; height: 100%; overflow: visible; }
.grow-panel { padding: 10px 10px 0; }
.day-big { font-size: 150px; line-height: 1; color: var(--leaf-deep); }
.day-big small { font-size: 52px; color: var(--ink); margin-left: 8px; }
.stage-title { font-size: 56px; margin: 10px 0 8px; display: inline-block; background: linear-gradient(transparent 62%, var(--light) 62%); }
.stage-title.swap { animation: popIn .4s both; }
.stage-text { font-size: 28px; line-height: 1.65; min-height: 150px; margin: 0 0 16px; font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stats div { background: #fff; border: 3px solid var(--ink); border-radius: 20px; padding: 12px 16px; text-align: center; }
.stats span { display: block; font-size: 22px; color: var(--muted); font-weight: 700; }
.stats b { font-size: 54px; font-family: var(--hand); }
.stats em { font-style: normal; font-size: 22px; margin-left: 4px; font-weight: 700; }
.vs-field { margin-top: 18px; display: grid; gap: 10px; }
.vs-cap { margin: 0; font-size: 22px; font-weight: 700; color: var(--muted); }
.vs-row { display: grid; grid-template-columns: 70px 1fr 170px; align-items: center; gap: 12px; font-size: 24px; font-weight: 700; }
.vs-bar { display: block; height: 26px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; overflow: hidden; position: relative; }
.vs-bar i { position: absolute; inset: 0 auto 0 0; display: block; background: var(--leaf); transition: width .2s; }
.vs-bar.field i { background: #c7a46a; }

.timeline { position: absolute; left: 90px; right: 90px; bottom: 50px; height: 120px; }
.marks { position: relative; height: 48px; }
.marks span { position: absolute; top: 0; transform: translateX(-50%); font-size: 22px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.marks span:first-child { transform: none; }
.marks span:first-child::after { left: 3px; }
.marks span::after { content: ""; position: absolute; left: 50%; top: 34px; width: 3px; height: 16px; background: var(--muted); }
.marks span.on { color: var(--leaf-deep); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 60px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 22px; border-radius: 12px; border: 3px solid var(--ink); background: linear-gradient(90deg, var(--leaf) var(--p,0%), #fff var(--p,0%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 64px; height: 64px; margin-top: -24px; border-radius: 50%; background: #fff; border: 4px solid var(--ink); box-shadow: 3px 4px 0 var(--ink); }
input[type=range]::-moz-range-track { height: 16px; border-radius: 12px; border: 3px solid var(--ink); background: #fff; }
input[type=range]::-moz-range-progress { height: 16px; background: var(--leaf); border-radius: 12px; }
input[type=range]::-moz-range-thumb { width: 56px; height: 56px; border-radius: 50%; background: #fff; border: 4px solid var(--ink); }

.tray { fill: #e9eef0; stroke: var(--ink); stroke-width: 3; }
.tray-water { fill: var(--water-soft); }
.sponge { fill: url(#spongeTex); stroke: var(--ink); stroke-width: 2.5; }
.flow-in { fill: none; stroke: var(--water); stroke-width: 5; stroke-dasharray: 10 16; animation: flow 1.1s linear infinite; stroke-linecap: round; }
.cut-label { font: 700 22px var(--body); fill: var(--muted); }
.bubble-box { fill: var(--accent); stroke: var(--ink); stroke-width: 3; }
.bubble-text { font: 700 26px var(--body); fill: #fff; }

/* lettuce */
.leaf { stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; }
.rib { fill: none; stroke: rgba(255,255,255,.7); stroke-width: 2; stroke-linecap: round; }
.root-o { fill: none; stroke: #a89a78; stroke-width: 4; stroke-linecap: round; }
.root-i { fill: none; stroke: #fbf6e6; stroke-width: 2; stroke-linecap: round; }
.stem { fill: none; stroke: #9fc56a; stroke-width: 4; stroke-linecap: round; }
.seed { fill: #b98a4a; stroke: var(--ink); stroke-width: 2; }
.cotyledon { fill: #a9d86b; stroke: var(--ink); stroke-width: 2; }

/* ---------- 3. KANKYO ---------- */
.kankyo-body { position: absolute; left: 40px; right: 40px; top: 140px; bottom: 40px; display: grid; grid-template-columns: 300px 1fr; gap: 30px; }
.k-tabs { display: grid; gap: 22px; align-content: start; }
.k-tab {
  height: 170px; border: 3px solid var(--ink); border-radius: var(--wobbly); background: #fff;
  font-family: var(--hand); font-weight: 600; font-size: 44px; display: grid; justify-items: center; align-content: center; gap: 6px;
  box-shadow: 5px 6px 0 var(--ink); transition: background .2s, transform .2s;
}
.k-tab.active { background: var(--light); transform: translateX(14px) rotate(-1deg); }
.k-ic { width: 64px; height: 64px; display: block; border-radius: 50%; border: 3px solid var(--ink); }
.k-ic.light { background: radial-gradient(circle, #fff7c2 30%, var(--sun) 31%); }
.k-ic.water { background: var(--water); border-radius: 50% 50% 50% 0; transform: rotate(-45deg) scale(.85); }
.k-ic.wind { background: repeating-linear-gradient(0deg, #fff 0 8px, #9fb8c8 8px 12px); }
.k-ic.temp { background: linear-gradient(0deg, var(--accent) 50%, #fff 50%); border-radius: 30px; width: 34px; }
.k-stage { background: #fff; border: 3px solid var(--ink); border-radius: 28px; box-shadow: 6px 7px 0 var(--ink); display: grid; grid-template-rows: 560px 1fr; overflow: hidden; }
#kSvg { width: 100%; height: 100%; background: linear-gradient(#fdfcf6, #f4f7ee); }
.k-text { padding: 18px 40px; border-top: 3px dashed rgba(44,58,38,.3); }
.k-text h3 { margin: 0 0 4px; font-size: 40px; }
.k-text p { margin: 0; font-size: 27px; line-height: 1.6; font-weight: 500; }
.k-text.swap { animation: popIn .45s both; }
.k-lbl { font: 700 24px var(--body); fill: var(--ink); }
.k-lbl.big { font-size: 34px; }
.k-lbl.mute { fill: var(--muted); font-size: 20px; }
.particle { animation: kfloat var(--d,3s) linear infinite; animation-delay: var(--dl,0s); }
@keyframes kfloat { from { transform: translate(0,0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } to { transform: translate(var(--tx), var(--ty)); opacity: 0; } }
.sway { animation: sway 1.6s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes sway { from { transform: rotate(-4deg); } to { transform: rotate(5deg); } }
.clock-hand { transform-origin: 0 0; animation: spin 8s linear infinite; }
.mercury { transition: height 2.5s cubic-bezier(.3,1.3,.5,1), y 2.5s cubic-bezier(.3,1.3,.5,1); }

/* ---------- 4. KURABERU ---------- */
.compare { position: absolute; left: 70px; right: 70px; top: 130px; display: grid; gap: 14px; }
.cmp-head, .cmp-row { display: grid; grid-template-columns: 220px 1fr 1fr; gap: 24px; align-items: center; }
.cmp-col { text-align: center; }
.cmp-col svg { width: 330px; height: 150px; display: block; margin: 0 auto; overflow: visible; }
.cmp-col b { font-size: 44px; display: block; margin-top: -6px; }
.field-col b { color: #8a6a35; } .here-col b { color: var(--leaf-deep); }
.soil { fill: #b98d58; }
.cmp-row {
  min-height: 110px; padding: 10px 0; border-top: 3px dashed rgba(44,58,38,.25);
  opacity: 0; transform: translateX(-30px); transition: opacity .5s, transform .5s cubic-bezier(.2,1.4,.4,1);
}
.cmp-row.show { opacity: 1; transform: none; }
.cmp-label { font-size: 30px; font-weight: 900; line-height: 1.3; }
.cmp-cell { font-size: 28px; font-weight: 700; display: flex; align-items: center; gap: 16px; }
.hbar { height: 56px; width: 0; border: 3px solid var(--ink); border-radius: 30px; position: relative; transition: width 1.6s cubic-bezier(.3,1,.4,1); }
.cmp-row.show .hbar { width: var(--w); }
.hbar.f { background: repeating-linear-gradient(45deg, #d9b97f 0 14px, #cfab6c 14px 28px); }
.hbar.h { background: repeating-linear-gradient(45deg, #a6d662 0 14px, #95cb4f 14px 28px); }
.hbar span { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 30px; color: #fff; text-shadow: 0 2px 0 rgba(44,58,38,.55), 0 0 6px rgba(44,58,38,.4); opacity: 0; transition: opacity .4s 1.2s; }
.cmp-row.show .hbar span { opacity: 1; }
.drops i { width: 34px; height: 34px; background: var(--water); border: 3px solid var(--ink); border-radius: 50% 50% 50% 0; transform: rotate(-45deg) scale(0); transition: transform .35s cubic-bezier(.2,1.6,.4,1); flex: none; }
.drops { gap: 10px; flex-wrap: nowrap; }
.drops i.on { transform: rotate(-45deg) scale(1); }
.drops em { font-style: normal; margin-left: 10px; white-space: nowrap; }
.dots i { width: 30px; height: 30px; border-radius: 50%; background: var(--leaf); border: 3px solid var(--ink); transform: scale(0); transition: transform .3s cubic-bezier(.2,1.6,.4,1); flex: none; }
.dots.f i { background: #d3b175; }
.dots i.on { transform: scale(1); }
.dots { gap: 10px; }
.dots-n { order: 99; margin-left: 10px; white-space: nowrap; }
.txt { line-height: 1.4; }
.wx-cycle, .wx-sun { width: 60px; height: 60px; flex: none; border-radius: 50%; position: relative; }
.wx-sun { background: radial-gradient(circle, #fff7c2 35%, var(--light) 36%); border: 3px solid var(--ink); animation: beamPulse 2s infinite; }
.wx-cycle { border: 3px solid var(--ink); animation: wx 4.5s steps(1) infinite; }
@keyframes wx { 0% { background: radial-gradient(circle, #ffd16b 40%, #f6a83c 41%); } 33% { background: linear-gradient(#8ba3b5 50%, #5aa9d6 50%); } 66% { background: conic-gradient(#6a7d8c 0 25%, #c4d0d8 0 50%, #6a7d8c 0 75%, #c4d0d8 0); } }
.stack { display: inline-flex; flex-direction: column-reverse; gap: 5px; width: 80px; flex: none; }
.stack i { height: 14px; border: 3px solid var(--ink); border-radius: 8px; background: var(--leaf); transform: scaleX(0); transition: transform .4s; }
.stack.s1 i { background: #d3b175; }
.cmp-row.show .stack i { transform: scaleX(1); }
.cmp-row.show .stack i:nth-child(2) { transition-delay: .3s; } .cmp-row.show .stack i:nth-child(3) { transition-delay: .6s; }
.txt b { color: var(--accent); font-size: 40px; margin-left: 6px; }
.footnote { position: absolute; right: 70px; bottom: 26px; margin: 0; font-size: 20px; color: var(--muted); }
.rain { stroke: var(--water); stroke-width: 3; stroke-linecap: round; animation: rain .8s linear infinite; }
@keyframes rain { from { transform: translateY(-10px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(40px); opacity: 0; } }

/* ---------- 5. QUIZ ---------- */
.quiz-body { position: absolute; left: 160px; right: 160px; top: 160px; bottom: 60px; text-align: center; }
.quiz-progress { justify-self: end; font-size: 28px; font-weight: 900; }
.q-num { font-size: 40px; color: var(--accent); margin: 0; }
.q-text { font-size: 50px; margin: 10px 0 40px; line-height: 1.4; }
.q-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.q-choice {
  min-height: 220px; padding: 20px; background: #fff; border: 3px solid var(--ink); border-radius: var(--wobbly);
  font-size: 36px; font-weight: 900; line-height: 1.35; box-shadow: 6px 7px 0 var(--ink); transition: transform .2s, background .2s;
  animation: popIn .5s cubic-bezier(.2,1.4,.4,1) both;
}
.q-choice:nth-child(2) { animation-delay: .08s; } .q-choice:nth-child(3) { animation-delay: .16s; }
.q-choice .q-letter { display: block; font-family: var(--hand); font-size: 30px; color: var(--muted); margin-bottom: 8px; }
.q-choice.right { background: #dff1c4; transform: scale(1.04); }
.q-choice.wrong { background: #f8d9d2; animation: shake .4s; }
.q-choice.dim { opacity: .45; }
@keyframes shake { 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
.q-result { margin-top: 36px; animation: popIn .45s both; }
.q-judge { font-size: 64px; margin: 0; }
.q-judge.ok { color: var(--leaf-deep); } .q-judge.ng { color: var(--accent); }
.q-explain { font-size: 30px; line-height: 1.6; margin: 8px auto 24px; max-width: 1100px; font-weight: 500; }
.q-result .pill, .final-btns .pill { justify-self: center; }
.q-final { padding-top: 90px; animation: popIn .5s both; }
.final-score { font-size: 120px; margin: 0; color: var(--leaf-deep); }
.final-msg { font-size: 36px; font-weight: 700; margin: 10px 0 50px; }
.final-btns { display: flex; justify-content: center; gap: 30px; }
#confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ---------- tour ---------- */
.tour-banner {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 50;
  padding: 6px 20px; border-radius: 30px; background: rgba(255,255,255,.75);
  font-size: 20px; font-weight: 700; color: var(--muted);
}
.tour-banner[hidden] { display: none; }

/* ---------- 効果音ボタン ---------- */
.sound-btn {
  position: absolute; left: 14px; bottom: 12px; z-index: 60; width: 54px; height: 54px;
  border-radius: 50%; border: 3px solid var(--ink); background: #fff; display: grid; place-items: center; opacity: .8;
}
.sound-btn svg { width: 30px; height: 30px; fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.sound-btn .spk { fill: var(--ink); }
.sound-btn .slash { display: none; stroke: var(--accent); }
.sound-btn.off .wave { display: none; }
.sound-btn.off .slash { display: block; }
