:root { --u: min(1vw, 1.35vh); --gold: #ffd23c; --ink: #10143f; --panel: rgba(255,255,255,.1); --line: rgba(255,255,255,.28); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0f3a; color: #fff; touch-action: manipulation;
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Maru Gothic Pro", "BIZ UDGothic", "Yu Gothic", "Meiryo", system-ui, sans-serif; font-weight: 800; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
svg { display: block; width: 100%; height: 100%; overflow: visible; }
#app { position: fixed; inset: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }

/* そら */
.sky { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 110%, #3a2a8c 0%, #171a5c 45%, #080a2c 100%); overflow: hidden; }
.stars { position: absolute; inset: -50%; background-repeat: repeat; }
.s1 { background-image: radial-gradient(1.6px 1.6px at 20px 30px, #fff, transparent), radial-gradient(1.2px 1.2px at 90px 120px, #cfe3ff, transparent), radial-gradient(2px 2px at 160px 70px, #fff, transparent), radial-gradient(1.2px 1.2px at 130px 180px, #ffe9a3, transparent); background-size: 220px 220px; animation: drift 90s linear infinite; opacity: .9; }
.s2 { background-image: radial-gradient(2.4px 2.4px at 60px 40px, #fff, transparent), radial-gradient(1.8px 1.8px at 250px 210px, #bfe9ff, transparent), radial-gradient(2.2px 2.2px at 180px 300px, #fff, transparent); background-size: 380px 380px; animation: drift 150s linear infinite reverse, twinkle 3.5s ease-in-out infinite; }
.nebula { position: absolute; inset: 0; background: radial-gradient(40% 30% at 18% 22%, rgba(255,90,180,.18), transparent 70%), radial-gradient(45% 35% at 85% 70%, rgba(60,200,255,.16), transparent 70%); }
@keyframes drift { to { transform: translate(220px, 220px); } }
@keyframes twinkle { 50% { opacity: .45; } }

.screen { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.screen.on { display: flex; animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: scale(.98); } }
.ic { display: inline-block; width: 1em; height: 1em; }

/* ボタン */
.big-btn { display: inline-flex; align-items: center; gap: .5em; padding: .55em 1.3em; font-size: calc(var(--u) * 6.4); border-radius: 999px; color: #5a2a00;
  background: linear-gradient(#ffe77a, #ffb300); box-shadow: 0 .16em 0 #c77700, 0 .5em 1em rgba(0,0,0,.35); border: .09em solid #fff; }
.big-btn.alt { background: linear-gradient(#b9f0ff, #4fb8ff); box-shadow: 0 .16em 0 #1c6fc0, 0 .5em 1em rgba(0,0,0,.35); color: #06305e; }
.big-btn:active, .round-btn:active, .choice:active { transform: translateY(.1em) scale(.97); }
.pulse { animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.07); } }
.round-btn { width: calc(var(--u) * 10); height: calc(var(--u) * 10); min-width: 44px; min-height: 44px; border-radius: 50%; background: rgba(255,255,255,.16); border: 2px solid var(--line); display: grid; place-items: center; font-size: calc(var(--u) * 5.4); flex: none; }
.round-btn.off { opacity: .4; }

/* たいとる */
#title { justify-content: space-evenly; }
.logo { display: flex; flex-direction: column; align-items: center; line-height: 1.1; text-align: center; }
.logo-a { font-size: calc(var(--u) * 13); color: #fff; letter-spacing: .04em; text-shadow: 0 .06em 0 #e53935, 0 .12em 0 #8c1010, 0 .2em .35em rgba(0,0,0,.6); }
.logo-b { font-size: calc(var(--u) * 8.4); color: var(--gold); text-shadow: 0 .08em 0 #a35a00, 0 .2em .3em rgba(0,0,0,.6); margin-top: .15em; }
.title-heroes { display: flex; align-items: flex-end; justify-content: center; height: 36vh; gap: 1vw; }
.title-heroes > div { height: 80%; aspect-ratio: 200/260; animation: bob 2.4s ease-in-out infinite; }
.title-heroes > div:nth-child(2) { height: 100%; animation-delay: -.8s; }
.title-heroes > div:nth-child(3) { animation-delay: -1.6s; }
@keyframes bob { 50% { transform: translateY(-4%); } }
.timer { animation: timer 1.2s ease-in-out infinite; }
@keyframes timer { 50% { filter: brightness(1.6) drop-shadow(0 0 4px #7fe9ff); } }

/* うえの バー */
.bar { width: 100%; display: flex; align-items: center; gap: calc(var(--u) * 2); padding: calc(var(--u) * 2) calc(var(--u) * 3); flex: none; }
.bar-title { flex: 1; text-align: center; font-size: calc(var(--u) * 6); text-shadow: 0 2px 4px rgba(0,0,0,.5); white-space: nowrap; }
.chip { display: flex; align-items: center; gap: .3em; background: rgba(0,0,0,.35); border: 2px solid var(--line); border-radius: 999px; padding: .15em .7em .15em .4em; font-size: calc(var(--u) * 5.6); color: var(--gold); flex: none; }
.mini-star { width: 1.1em; height: 1.1em; display: inline-block; }

/* ほしの ちず */
.planets { flex: 1; width: 100%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: calc(var(--u) * 1.5); padding: 0 calc(var(--u) * 3) calc(var(--u) * 3); min-height: 0; }
@media (max-aspect-ratio: 1/1) { .planets { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow-y: auto; grid-auto-rows: auto; } .planet .p-img { flex: none; height: 15vh; } }
@media (max-aspect-ratio: 1/1) and (min-width: 600px) { .planets { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.planet { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; border-radius: calc(var(--u) * 4); }
.planet .p-img { position: relative; flex: 1; min-height: 0; width: 100%; max-height: 30vh; animation: bob 3.2s ease-in-out infinite; }
.planet:nth-child(odd) .p-img { animation-delay: -1.4s; }
.planet { min-width: 0; cursor: pointer; } .h-card { cursor: pointer; } .planet .p-img svg, .h-card .h-img svg, .kz-field > button > svg { position: absolute; inset: 4%; width: 92%; height: 92%; }
.planet .p-name { font-size: calc(var(--u) * 4.4); white-space: nowrap; text-shadow: 0 2px 3px rgba(0,0,0,.7); }
.planet .p-lv { display: flex; gap: .25em; height: calc(var(--u) * 2.4); margin-top: .2em; }
.planet .p-lv i { width: calc(var(--u) * 2.2); height: calc(var(--u) * 2.2); border-radius: 50%; background: rgba(255,255,255,.22); }
.planet .p-lv i.on { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.planet.locked .p-img { filter: grayscale(1) brightness(.45); animation: none; }
.planet .p-lock { position: absolute; top: 28%; left: 50%; width: calc(var(--u) * 9); height: calc(var(--u) * 9); transform: translate(-50%, -50%); color: #fff; opacity: .85; }
.planet .p-new { position: absolute; top: 4%; right: 12%; width: 22%; animation: pulse 1s infinite; }
.planet .p-hand { position: absolute; right: 8%; bottom: 18%; width: 30%; aspect-ratio: 1; animation: tapHint 1.1s ease-in-out infinite; pointer-events: none; }
@keyframes tapHint { 50% { transform: translate(-12%, -12%) scale(.9); } }

/* なかま */
.team-grid { flex: 1; width: 100%; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: calc(var(--u) * 2); padding: 0 calc(var(--u) * 3) calc(var(--u) * 3); min-height: 0; overflow-y: auto; }
@media (max-aspect-ratio: 1/1) { .team-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: auto; } .h-card .h-img { flex: none; height: 16vh; } }
.h-card { position: relative; background: var(--panel); border: 3px solid var(--line); border-radius: calc(var(--u) * 3); display: flex; flex-direction: column; align-items: center; padding: 2% 2%; }
.h-card .h-img { position: relative; flex: 1; min-height: 0; width: 100%; }
.h-card { min-width: 0; min-height: 0; }
.h-card .h-name { font-size: calc(var(--u) * 3.6); white-space: nowrap; }
.h-card.sel { border-color: var(--gold); background: rgba(255,210,60,.22); box-shadow: 0 0 18px rgba(255,210,60,.6); }
.h-card.lock .h-img { filter: brightness(0) invert(.25); }
.h-card .h-need { position: absolute; top: 4%; right: 6%; display: flex; align-items: center; gap: .2em; font-size: calc(var(--u) * 3.6); color: var(--gold); }

/* あそぶ がめん */
#play { align-items: stretch; }
.battle { position: relative; flex: none; height: 22vh; display: flex; align-items: flex-end; gap: calc(var(--u) * 2); padding: calc(var(--u) * 1.5) calc(var(--u) * 3) 0; }
.battle #homeBtn { align-self: flex-start; }
.b-hero, .b-kaiju { height: 100%; flex: none; }
.b-hero { aspect-ratio: 200/260; }
.b-kaiju { aspect-ratio: 1; }
.b-hero svg, .b-kaiju svg { height: 100%; width: 100%; }
.b-hero { animation: bob 2s ease-in-out infinite; }
.b-kaiju { animation: stomp 1.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes stomp { 50% { transform: scale(1.04, .96); } }
.b-kaiju.hit { animation: hit .5s ease; }
@keyframes hit { 20% { transform: translateX(8%) rotate(8deg); filter: brightness(2.2); } 60% { transform: translateX(-3%) rotate(-3deg); } }
.b-kaiju.taunt { animation: taunt .6s ease; }
@keyframes taunt { 25% { transform: rotate(-9deg) scale(1.08); } 75% { transform: rotate(9deg) scale(1.08); } }
.b-kaiju.away { animation: away 1.3s ease-in forwards; }
@keyframes away { 30% { transform: scale(1.15) rotate(10deg); filter: brightness(2.5); } 100% { transform: translate(60vw, -70vh) rotate(720deg) scale(.1); opacity: 0; } }
.b-hero.cheer { animation: cheer .5s ease 2; }
@keyframes cheer { 50% { transform: translateY(-14%); } }
.gauge { flex: 1; align-self: center; display: flex; justify-content: center; gap: calc(var(--u) * 1.6); }
.gauge i { width: calc(var(--u) * 6.4); height: calc(var(--u) * 6.4); max-width: 13%; aspect-ratio: 1; height: auto; border-radius: 50%; border: 3px solid var(--line); background: rgba(0,0,0,.35); transition: .3s; }
.gauge i.on { background: radial-gradient(circle at 35% 30%, #fff, #35d6ff 45%, #1a8fd0); border-color: #fff; box-shadow: 0 0 14px #35d6ff; transform: scale(1.12); }
.beam-line { position: absolute; left: 20%; right: 18%; top: 48%; height: 14%; border-radius: 999px; transform-origin: 0 50%; transform: scaleX(0); pointer-events: none;
  background: linear-gradient(#fff, #7fe9ff 30%, #35b6ff 50%, #7fe9ff 70%, #fff); box-shadow: 0 0 30px #35d6ff, 0 0 60px #35d6ff; }
.beam-line.fire { animation: fire 1.1s ease-out forwards; }
@keyframes fire { 0% { transform: scaleX(0); } 25% { transform: scaleX(1); } 80% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }

.prompt { flex: none; display: flex; align-items: center; gap: calc(var(--u) * 2); margin: calc(var(--u) * 1.2) calc(var(--u) * 3); padding: calc(var(--u) * 1) calc(var(--u) * 2); background: rgba(0,0,0,.38); border: 2px solid var(--line); border-radius: calc(var(--u) * 4); }
.prompt #promptText { flex: 1; font-size: calc(var(--u) * 4.2); line-height: 1.25; }
.say-btn { width: calc(var(--u) * 8); height: calc(var(--u) * 8); background: linear-gradient(#b9f0ff, #4fb8ff); color: #06305e; border-color: #fff; }
.area { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; gap: calc(var(--u) * 1.5); padding: 0 calc(var(--u) * 3) calc(var(--u) * 2.5); }
.finale { position: absolute; inset: 22vh 0 0 0; display: none; place-items: center; background: rgba(8,10,44,.72); z-index: 5; }
.finale.on { display: grid; animation: fadeIn .3s; }
.beam-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1em; width: min(56vw, 46vh); height: min(56vw, 46vh); border-radius: 50%; font-size: min(9vw, 7.5vh); color: #fff;
  background: radial-gradient(circle at 35% 30%, #fff 0%, #35d6ff 30%, #1668d8 100%); border: .12em solid #fff; box-shadow: 0 0 40px #35d6ff, 0 0 90px rgba(53,214,255,.7); animation: pulse .9s ease-in-out infinite; text-shadow: 0 2px 6px #0a2a70; }
.beam-btn .ic { font-size: 1.8em; }

/* えらぶ カード */
.scene { flex: 1.2; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; gap: calc(var(--u) * 2); }
.choices { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; gap: calc(var(--u) * 3); }
.choices.solo { flex: 1; }
.choices.wrap { flex-wrap: wrap; align-content: center; }
.choice { position: relative; flex: 1 1 0; max-width: 34vh; height: 100%; max-height: 34vh; min-width: 0; background: rgba(255,255,255,.13); border: 4px solid var(--line); border-radius: calc(var(--u) * 4); display: grid; place-items: center; padding: calc(var(--u) * 1.6); transition: transform .15s, opacity .3s, border-color .2s; box-shadow: 0 6px 0 rgba(0,0,0,.28); }
.choices.wide .choice { max-width: none; max-height: none; }
.choice > * { max-width: 100%; max-height: 100%; min-height: 0; }
.choice > svg, .choice > div > svg { width: auto; height: 100%; max-width: 100%; aspect-ratio: 1; }
.choice.miss { animation: shake .45s; opacity: .28; pointer-events: none; border-style: dashed; }
@keyframes shake { 20% { transform: translateX(-7%) rotate(-3deg); } 50% { transform: translateX(7%) rotate(3deg); } 80% { transform: translateX(-4%); } }
.choice.hit { border-color: var(--gold); background: rgba(255,210,60,.3); animation: pop .5s; box-shadow: 0 0 26px rgba(255,210,60,.8); }
@keyframes pop { 40% { transform: scale(1.14); } }
.choice.glow { border-color: var(--gold); animation: glow 1s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 28px var(--gold); transform: scale(1.05); } }
.locked-in .choice { pointer-events: none; }
.badge { position: absolute; top: -6%; right: -6%; width: 28%; min-width: 30px; aspect-ratio: 1; border-radius: 50%; background: var(--gold); color: #5a2a00; display: grid; place-items: center; font-size: calc(var(--u) * 4.4); border: 3px solid #fff; z-index: 2; }

/* すうじ カード */
.num { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .08em; line-height: 1; height: 100%; width: 100%; }
.num b { font-size: min(calc(var(--u) * 13), 15vh); font-family: "Arial Rounded MT Bold", "Hiragino Maru Gothic ProN", sans-serif; text-shadow: 0 3px 0 rgba(0,0,0,.3); }
.dots { display: grid; grid-template-columns: repeat(5, 1fr); gap: calc(var(--u) * .7); }
.dots i { width: calc(var(--u) * 2.3); height: calc(var(--u) * 2.3); border-radius: 50%; background: var(--gold); border: 1.5px solid #fff; }
.dots i.e { background: rgba(255,255,255,.14); border-color: transparent; }

/* あつまり（どっとの まとまり） */
.group { width: 100%; height: 100%; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); gap: 2%; }
.group > div { display: grid; place-items: center; min-height: 0; min-width: 0; }
.group svg { width: auto; height: 100%; max-width: 100%; aspect-ratio: 1; }
.cnt { position: absolute; bottom: -4%; left: 50%; transform: translateX(-50%); background: #fff; color: var(--ink); border-radius: 999px; padding: 0 .55em; font-size: calc(var(--u) * 6); border: 3px solid var(--gold); animation: pop .4s; z-index: 2; }

/* かず（えねるぎー） */
.kz-top { flex: none; display: flex; align-items: center; justify-content: center; gap: calc(var(--u) * 3); width: 100%; }
.kz-target { background: #fff; color: var(--ink); border-radius: calc(var(--u) * 3); padding: .1em .6em; display: flex; align-items: center; gap: .5em; border: 4px solid var(--gold); }
.kz-target { flex: none; flex-direction: column; gap: 0 !important; padding: .1em .4em .3em !important; } .kz-target b { font-size: calc(var(--u) * 10); line-height: 1.1; font-family: "Arial Rounded MT Bold", sans-serif; }
.kz-target .dots i { background: #35b6ff; border-color: #0a67b0; } .kz-target .dots i.e { background: #e4e8f2; }
.kz-field { flex: 1; min-height: 0; width: 100%; display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(2, 1fr); gap: 1%; }
@media (max-aspect-ratio: 1/1) { .kz-field { grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(3, 1fr); } }
.kz-field > button, .kz-tray > button { position: relative; min-height: 0; min-width: 0; display: grid; place-items: center; }
.kz-field svg { animation: floaty 2.6s ease-in-out infinite; }
.kz-field > button:nth-child(odd) svg { animation-delay: -1.3s; }
@keyframes floaty { 50% { transform: translateY(-9%) rotate(6deg); } }
.kz-bottom { flex: none; width: 100%; display: flex; align-items: center; justify-content: center; gap: calc(var(--u) * 3); }
.kz-tray { display: grid; grid-template-columns: repeat(5, 1fr); gap: calc(var(--u) * .8); padding: calc(var(--u) * 1.2); background: rgba(0,0,0,.4); border: 3px solid var(--line); border-radius: calc(var(--u) * 3); }
.kz-tray > button { width: calc(var(--u) * 6.6); height: calc(var(--u) * 6.6); border-radius: 50%; border: 2.5px dashed rgba(255,255,255,.3); }
.kz-tray > button.need { border: 3px solid var(--gold); box-shadow: 0 0 10px var(--gold); }
.kz-tray > button svg { animation: pop .3s; }
.fire-btn { flex: none; width: calc(var(--u) * 17); height: calc(var(--u) * 17); border-radius: 50%; font-size: calc(var(--u) * 3.8); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; text-shadow: 0 2px 4px #0a2a70;
  background: radial-gradient(circle at 35% 30%, #fff 0%, #35d6ff 32%, #1668d8 100%); border: 4px solid #fff; box-shadow: 0 0 22px #35d6ff; }
.fire-btn .ic { font-size: 1.7em; }
.fire-btn:disabled { filter: grayscale(.9) brightness(.6); box-shadow: none; }
.fire-btn.ready { animation: pulse 1s infinite; }

/* ならび */
.seq { display: flex; align-items: center; justify-content: center; gap: calc(var(--u) * 1); width: 100%; height: 100%; max-height: 24vh; }
.seq > div { flex: 1 1 0; max-width: 20vh; aspect-ratio: 1; min-width: 0; display: grid; place-items: center; position: relative; }
.seq > div.q { border: 4px dashed #fff; border-radius: 22%; background: rgba(0,0,0,.35); font-size: calc(var(--u) * 8); color: var(--gold); animation: glow 1.2s infinite; }
.seq > div.ping { animation: pop .35s; }
.bridge { position: absolute; left: 0; right: 0; bottom: 6%; height: 10%; background: linear-gradient(90deg, transparent, rgba(127,233,255,.5), transparent); border-radius: 999px; }

/* みち */
.mc-top { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: calc(var(--u) * 5); width: 100%; }
.roulette { height: 90%; max-height: 30vh; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(#ff5a5f 0 25%, #ffc93c 0 50%, #45c96b 0 75%, #3d8bff 0); border: 5px solid #fff; display: grid; place-items: center; box-shadow: 0 0 20px rgba(255,255,255,.4); }
.roulette .r-in { width: 66%; height: 66%; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; }
.roulette .r-in b { font-size: min(calc(var(--u) * 12), 13vh); line-height: 1; font-family: "Arial Rounded MT Bold", sans-serif; }
.roulette.spin { animation: spin .8s cubic-bezier(.2,.7,.3,1); }
@keyframes spin { to { transform: rotate(1080deg); } }
.feet { display: flex; gap: .2em; font-size: calc(var(--u) * 6); color: var(--gold); min-height: 1em; }
.feet .ic.used { opacity: .25; }
.jump-btn { height: 80%; max-height: 26vh; aspect-ratio: 1; border-radius: 50%; background: linear-gradient(#b6ff9c, #2fbf5a); border: 5px solid #fff; color: #06431b; font-size: calc(var(--u) * 3); display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 8px 0 #1b7d39; }
.jump-btn .ic { font-size: 2em; }
.track { flex: none; width: 100%; display: grid; grid-template-columns: repeat(11, 1fr); gap: .6%; align-items: end; padding-top: 12vh; position: relative; }
.track { --sh: max(11vh, 48px); }
.stone { position: relative; height: var(--sh); border-radius: 28% 28% 22% 22%; background: linear-gradient(#8f96c9, #4b4f86); border: 2.5px solid #c9cdf5; display: grid; place-items: center; font-size: min(calc(var(--u) * 5.2), 5vh); font-family: "Arial Rounded MT Bold", sans-serif; box-shadow: 0 5px 0 #2a2c58; }
.stone.past { background: linear-gradient(#ffe77a, #ffb300); color: #5a2a00; border-color: #fff; }
.stone.next { animation: glow 1s infinite; border-color: var(--gold); }
.stone.goal { background: linear-gradient(#ff9a9a, #e53935); }
.stone.wob { animation: shake .4s; }
.stone .mark { position: absolute; top: -44%; left: 50%; transform: translateX(-50%); width: 60%; color: var(--gold); animation: pop .4s; }
.walker { position: absolute; bottom: calc(var(--sh) - 3px); width: calc(100% / 11); height: 12vh; transition: left .28s ease; pointer-events: none; display: grid; place-items: center; }
.walker svg { height: 100%; width: auto; aspect-ratio: 200/260; }
.walker.hop svg { animation: hop .28s ease; }
@keyframes hop { 50% { transform: translateY(-35%); } }
.track-kaiju { position: absolute; right: 0; bottom: calc(var(--sh) - 3px); width: calc(100% / 11); height: 9vh; pointer-events: none; }

/* じゅんばん */
.bars { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: calc(var(--u) * 2); }
.bar-row { position: relative; flex: 1 1 0; max-height: 11vh; min-height: 0; background: rgba(255,255,255,.1); border: 3px solid var(--line); border-radius: calc(var(--u) * 3); display: flex; align-items: center; padding: 0 3%; }
.bar-row i { display: block; height: 46%; border-radius: 999px; background: linear-gradient(#fff, #7fe9ff 35%, #35b6ff 65%, #fff); box-shadow: 0 0 14px #35d6ff; }
.bar-row.miss { animation: shake .45s; opacity: .28; pointer-events: none; } .bar-row.hit { border-color: var(--gold); background: rgba(255,210,60,.3); }
.bar-row.glow { border-color: var(--gold); animation: glow 1s infinite; }
.space { position: relative; width: 100%; height: 100%; }
.space .sp-hero { position: absolute; left: 0; top: 50%; height: 60%; aspect-ratio: 200/260; transform: translateY(-50%); }
.space .choice { position: absolute; width: 12%; box-shadow: none; height: auto; aspect-ratio: 1; flex: none; padding: 1%; border-radius: 50%; transform: translate(-50%, -50%); }
.space .choice:active { transform: translate(-50%, -50%) scale(.95); }
.sizer { display: grid; place-items: end center; width: 100%; height: 100%; }

/* まとりくす */
.matrix { display: grid; gap: calc(var(--u) * 1.2); height: 100%; aspect-ratio: 1; max-width: 100%; padding: calc(var(--u) * 1.2); background: rgba(0,0,0,.3); border-radius: calc(var(--u) * 3); border: 2px solid var(--line); }
.matrix > div { background: rgba(255,255,255,.1); border-radius: 16%; display: grid; place-items: center; padding: 8%; min-height: 0; min-width: 0; }
.scene.tall { max-height: none; flex: 1.7; }
.matrix > div { overflow: hidden; }
.matrix > div.q { border: 3px dashed #fff; font-size: calc(var(--u) * 4.5); line-height: 1; color: var(--gold); animation: glow 1.2s infinite; }

/* めいろ */
.mz-wrap { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; gap: calc(var(--u) * 5); }
@media (max-aspect-ratio: 1/1) { .mz-wrap { flex-direction: column; gap: calc(var(--u) * 3); } }
.mz-grid { position: relative; display: grid; gap: 3px; height: 100%; max-height: 100%; max-width: 100%; aspect-ratio: 1; background: rgba(0,0,0,.35); padding: 5px; border-radius: calc(var(--u) * 3); border: 3px solid var(--line); }
@media (max-aspect-ratio: 1/1) { .mz-grid { height: auto; width: min(92%, 44vh); } }
.mz-cell { position: relative; background: rgba(255,255,255,.1); border-radius: 12%; display: grid; place-items: center; min-height: 0; min-width: 0; }
.mz-cell .dot { width: 26%; height: 26%; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); animation: pulse 1s infinite; }
.mz-cell svg { width: 86%; height: 86%; }
.mz-hero { position: absolute; transition: left .22s ease, top .22s ease; display: grid; place-items: center; pointer-events: none; z-index: 2; }
.mz-hero svg { height: 92%; width: auto; aspect-ratio: 200/260; }
.mz-hero.bump { animation: shake .35s; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: calc(var(--u) * 1); width: min(40vh, 44vw); aspect-ratio: 1; flex: none; }
@media (max-aspect-ratio: 1/1) { .pad { width: min(26vh, 60vw); } }
.pad button { border-radius: 26%; background: linear-gradient(#ffe77a, #ffb300); color: #5a2a00; border: 3px solid #fff; box-shadow: 0 5px 0 #c77700; display: grid; place-items: center; font-size: calc(var(--u) * 7); padding: 14%; }
.pad button:active { transform: translateY(4px); box-shadow: 0 1px 0 #c77700; }
.pad .ic { width: 100%; height: 100%; }

/* かくれんぼ */
.kk-row { position: relative; display: flex; align-items: center; justify-content: center; gap: calc(var(--u) * 1); width: 100%; height: 100%; max-height: 22vh; }
.kk-row > .st { flex: 1 1 0; max-width: 16vh; aspect-ratio: 1; min-width: 0; transition: opacity .4s; }
.kk-row > .st.ping { animation: pop .35s; }
.kk-row > .st.hid { opacity: 0; flex: 0 0 0; max-width: 0; margin-left: calc(var(--u) * -1); }
.kk-row.peek > .st.hid { opacity: .4; flex: 1 1 0; max-width: 16vh; margin-left: 0; }
.kk-row.open > .st.hid { opacity: 1; flex: 1 1 0; max-width: 16vh; margin-left: 0; }
.kk-all { flex: none; background: #fff; color: var(--ink); border-radius: calc(var(--u) * 3); border: 4px solid var(--gold); padding: 0 .5em; font-size: calc(var(--u) * 9); font-family: "Arial Rounded MT Bold", sans-serif; display: flex; align-items: center; gap: .2em; }
.kk-all .mini-star { width: .8em; height: .8em; }
.kk-thief { position: relative; flex: none; height: 80%; max-height: 20vh; aspect-ratio: 1; opacity: 0; transform: translateX(40%); transition: .5s; }
.kk-thief.in { opacity: 1; transform: none; }

/* けっか */
#result { justify-content: space-evenly; text-align: center; }
.res-title { font-size: calc(var(--u) * 10); color: var(--gold); text-shadow: 0 .08em 0 #a35a00, 0 .2em .3em rgba(0,0,0,.6); }
.res-stars { display: flex; gap: calc(var(--u) * 3); height: 18vh; align-items: center; }
.res-stars > div { height: 100%; aspect-ratio: 1; opacity: .18; filter: grayscale(1); transition: .2s; }
.res-stars > div.on { opacity: 1; filter: none; animation: starIn .6s cubic-bezier(.3,1.6,.5,1); }
@keyframes starIn { from { transform: scale(0) rotate(-180deg); } }
.res-extra { min-height: 22vh; display: flex; align-items: center; justify-content: center; gap: calc(var(--u) * 4); font-size: calc(var(--u) * 5.6); }
.res-extra .new-hero { height: 22vh; display: flex; align-items: center; gap: calc(var(--u) * 3); background: rgba(255,210,60,.2); border: 4px solid var(--gold); border-radius: calc(var(--u) * 4); padding: 1vh 3vw; animation: starIn .7s cubic-bezier(.3,1.4,.5,1); }
.res-extra .new-hero .nh-img { height: 100%; aspect-ratio: 200/260; }
.res-extra .lvup { color: #7fe9ff; animation: pulse 1s infinite; }
.res-btns { display: flex; justify-content: center; gap: calc(var(--u) * 3); }
@media (max-aspect-ratio: 1/1) { .res-btns { flex-direction: column; align-items: center; } }
.res-btns .big-btn { font-size: calc(var(--u) * 4.4); white-space: nowrap; }
@media (max-aspect-ratio: 1/1) { .res-btns .big-btn { font-size: calc(var(--u) * 6); } }

/* えふぇくと */
#fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 20; }
.cf { position: absolute; top: -5%; width: 1.6vmin; height: 2.6vmin; border-radius: 20%; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(115vh) rotate(900deg); } }
.spark { position: absolute; width: 5vmin; height: 5vmin; margin: -2.5vmin; animation: spark .7s ease-out forwards; }
@keyframes spark { from { transform: translate(0, 0) scale(.4); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(1.2) rotate(180deg); opacity: 0; } }
.flash { position: absolute; inset: 0; background: #fff; animation: flash .5s ease-out forwards; }
@keyframes flash { from { opacity: .85; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .stars, .p-img, .title-heroes > div { animation: none !important; } }

/* ついか */
.wob { animation: shake .45s; }
.pop { animation: pop .35s; }
.choices.col { flex-direction: column; align-items: stretch; gap: calc(var(--u) * 2); }
.choices.col .bar-row { width: 100%; }
.choices.six .choice { flex: 0 0 28%; height: 44%; }
.choices.space { display: block; position: relative; }
.sp-line { position: absolute; left: 10%; right: 2%; top: 50%; border-top: 4px dotted rgba(255,255,255,.45); }
.mc-side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--u) * 1.5); height: 100%; min-width: 30%; }
.scene { max-height: 30vh; }
.scene > svg { max-height: 100%; }
.kz-field > button { height: 100%; }
.kk-thief .bag { position: absolute; left: -18%; top: -10%; width: 46%; aspect-ratio: 1; border-radius: 50%; background: #fff; color: #10143f; display: grid; place-items: center; font-size: calc(var(--u) * 5); border: 3px solid var(--gold); animation: pulse 1s infinite; }
.roulette { height: auto; width: min(40vw, 28vh); max-height: none; }
.gauge { min-width: 0; }
/* たてむき（すまほ） */
@media (max-aspect-ratio: 1/1) {
  .battle { height: 15vh; gap: calc(var(--u) * 1.5); }
  .finale { inset: 15vh 0 0 0; }
  .gauge { gap: calc(var(--u) * 1); }
  .gauge i { max-width: 16%; }
  .choices.wide { flex-direction: column; }
  .choices.wide .choice { width: 100%; }
  .choice { max-height: 24vh; }
  .choices.wrap { gap: calc(var(--u) * 2.5); }
  .kz-tray > button { width: calc(var(--u) * 8.6); height: calc(var(--u) * 8.6); }
  .kz-bottom { gap: calc(var(--u) * 2); }
  .fire-btn { width: calc(var(--u) * 19); height: calc(var(--u) * 19); }
  .feet { font-size: calc(var(--u) * 9); }
  .jump-btn { font-size: calc(var(--u) * 4.4); height: auto; width: min(38vw, 24vh); max-height: none; }
  .space .choice { width: 17%; }
  .space .sp-hero { height: 34%; }
  .kk-all { font-size: calc(var(--u) * 11); }
}
/* よこむきの すまほ（せが ひくい） */
@media (min-aspect-ratio: 1/1) and (max-height: 480px) {
  .battle { height: 24vh; }
  .prompt { margin-top: 2px; margin-bottom: 2px; padding-top: 2px; padding-bottom: 2px; }
  .say-btn { min-width: 36px; min-height: 36px; }
}
