/* ARCANIMA — アプリ画面と演出（トークン・ボタン・ミニゲームは style.css） */

:root {
  --t-fire: #ff6a2a;
  --t-water: #2f8cff;
  --t-grass: #3fbf5f;
  --t-thunder: #ffd21f;
  --t-wind: #2ec4b6;
  --t-earth: #c9913b;
  --t-ice: #8fd8ff;
  --t-steel: #9aa6b8;
  --t-shadow: #9a5cff;
  --t-light: #ffe27a;
}

.backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, #1b2766 0%, var(--bg) 70%);
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.backdrop.on {
  filter: brightness(0.42) saturate(1.1) blur(1px);
  transform: scale(1.04);
}

.view {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  outline: none;
}

.screen {
  padding: calc(10px + env(safe-area-inset-top)) 14px calc(24px + env(safe-area-inset-bottom));
  animation: screen-in 0.28s ease;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.panel {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.panel-mini {
  background: rgba(10, 14, 40, 0.82);
  border: 2px solid var(--line-hi);
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 14px;
}

.btn.big {
  width: 100%;
  font-size: 20px;
  min-height: 58px;
}

.btn.danger {
  border-color: var(--red);
  background: linear-gradient(180deg, #ff6d86, #c9243f);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.topbar-title {
  flex: 1;
  margin: 0;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.04em;
  outline: none;
}

.topbar-sp {
  width: 44px;
}

.type-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  background: var(--tc);
  color: #0b1026;
  vertical-align: middle;
  box-shadow: 0 0 10px color-mix(in srgb, var(--tc) 50%, transparent);
}

.exp {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}

.exp-lv {
  font-family: var(--font-title);
  color: var(--gold);
  min-width: 58px;
}

.exp-bar,
.hp,
.egg-bar {
  flex: 1;
  height: 10px;
  border-radius: 99px;
  background: #0a0f2c;
  border: 1px solid var(--line);
  overflow: hidden;
  display: block;
}

.exp-bar i,
.egg-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3fe0ff, #7df9c4);
  transition: width 0.6s ease;
}

.hp i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3ddc84, #b4f25a);
  transition: width 0.5s ease;
}

.hearts {
  display: inline-flex;
  gap: 3px;
}

.heart {
  width: 20px;
  height: 20px;
  background: url('assets/items/heart.png') center / contain no-repeat;
  transition: filter 0.3s, transform 0.3s;
}

.heart.off {
  filter: grayscale(1) brightness(0.35);
  transform: scale(0.85);
}

.money {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  background: rgba(10, 14, 40, 0.8);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 3px 10px 3px 4px;
}

.coin-ico,
.crystal-ico {
  width: 22px;
  height: 22px;
  display: inline-block;
  background: url('assets/items/coin.png') center / contain no-repeat;
}

.crystal-ico {
  background-image: url('assets/items/crystal.png');
}

.anima-img {
  display: block;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.anima-img.flip {
  transform: scaleX(-1);
}

.anima-img.silhouette {
  filter: brightness(0) drop-shadow(0 0 1px rgba(160, 180, 255, 0.6));
  opacity: 0.85;
}

.item-img {
  display: block;
  object-fit: contain;
}

.tip {
  color: var(--text-dim);
  font-size: 15px;
}

.tip.good {
  color: var(--green);
  font-weight: 800;
}

.lead {
  color: var(--text-dim);
  line-height: 1.7;
}

.seg {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0 12px;
}

.seg-btn {
  flex: 1;
  min-height: 42px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--panel);
  font-weight: 800;
  cursor: pointer;
}

.seg-btn.on {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 12px rgba(255, 194, 51, 0.25);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: #1c2766;
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 800;
  z-index: 90;
  box-shadow: var(--shadow);
  animation: fade-in 0.2s;
  max-width: 92vw;
  text-align: center;
}

/* ------------------------------------------------------------ はじめ */

.start-title {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.logo-main {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(36px, 11.5vw, 64px);
  letter-spacing: 0.03em;
  background: linear-gradient(180deg, #fff6c8, var(--gold) 50%, #ff8a1a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 #5a2c00) drop-shadow(0 0 22px rgba(255, 170, 40, 0.45));
  outline: none;
}

.logo-kana {
  margin: 0;
  letter-spacing: 0.5em;
  color: var(--cyan);
  font-weight: 800;
}

.tagline {
  color: var(--text-dim);
}

.title-mons {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  margin: 12px 0 20px;
}

.title-mon {
  width: 30vw;
  max-width: 150px;
  height: 30vw;
  max-height: 150px;
  animation: bob 3s ease-in-out infinite;
}

.title-mon:nth-child(2) {
  animation-delay: -1s;
}

.title-mon:nth-child(3) {
  animation-delay: -2s;
}

@keyframes bob {
  50% {
    transform: translateY(-8px);
  }
}

.start-panel {
  min-height: 100dvh;
  display: grid;
  place-items: center;
}

.start-panel h1 {
  font-family: var(--font-title);
  font-weight: 400;
  color: var(--gold);
  margin-top: 0;
  outline: none;
}

.carry {
  line-height: 1.9;
  padding-left: 1.2em;
}

.choose-title {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(18px, 5.4vw, 24px);
  text-align: center;
  margin: 18px 0 4px;
  outline: none;
}

.choose-sub {
  text-align: center;
  color: var(--text-dim);
  margin: 0 0 12px;
}

.starter-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.starter-card {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 4px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.starter-card.picked {
  border-color: var(--tc);
  box-shadow: 0 0 20px color-mix(in srgb, var(--tc) 55%, transparent);
  transform: translateY(-4px);
}

.starter-img {
  width: 100%;
  aspect-ratio: 1;
}

.starter-name {
  font-weight: 800;
}

.starter-detail {
  margin-top: 14px;
  animation: screen-in 0.25s;
}

.starter-detail h2 {
  margin: 0 0 6px;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ------------------------------------------------------------ ホーム */

.home-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-mini {
  font-family: var(--font-title);
  color: var(--gold);
  font-size: 18px;
  letter-spacing: 0.05em;
  flex: 1;
}

.home-money {
  display: flex;
  gap: 6px;
  font-size: 15px;
}

.partner-stage {
  position: relative;
  height: min(42vh, 330px);
  display: grid;
  place-items: center;
}

.partner-aura {
  position: absolute;
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--tc) 55%, transparent), transparent 65%);
  animation: aura 4s ease-in-out infinite;
}

@keyframes aura {
  50% {
    transform: scale(1.12);
    opacity: 0.75;
  }
}

.partner-img {
  position: relative;
  align-self: end;
  width: 92%;
  height: calc(var(--sz, 1) * 100%);
  object-position: bottom;
  animation: bob 3.2s ease-in-out infinite;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.5));
}

.pc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pc-name {
  font-family: var(--font-title);
  font-size: 24px;
}

.pc-sub {
  font-size: 13px;
  color: var(--text-dim);
}

.no {
  margin-left: auto;
  color: var(--text-dim);
}

.legend-banner {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-top: 10px;
  border: 2px solid var(--gold);
  border-radius: 14px;
  background: linear-gradient(90deg, #3b1f6b, #6b3fd8, #3b1f6b);
  font-weight: 800;
  padding: 12px;
  cursor: pointer;
}

.lb-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.4), transparent 70%);
  animation: sheen 2.4s linear infinite;
}

@keyframes sheen {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

.home-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}

.home-main .btn small {
  display: block;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.75;
  margin-top: 2px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.tile {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-weight: 800;
  cursor: pointer;
  min-height: 96px;
}

.tile small {
  color: var(--text-dim);
  font-size: 12px;
}

.tile.alert {
  border-color: var(--gold);
  animation: glowp 1.6s ease-in-out infinite;
}

@keyframes glowp {
  50% {
    box-shadow: 0 0 18px rgba(255, 194, 51, 0.6);
  }
}

.tile-ico {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.tile-ico img,
.tile-anima {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.tile-ico.book::before {
  content: '📖';
  font-size: 30px;
}

.tile-ico.play::before {
  content: '🎮';
  font-size: 30px;
}

.tile-ico.chart::before {
  content: '📊';
  font-size: 30px;
}

.buildline {
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 16px;
}

/* ------------------------------------------------------------ マップ */

.map-hint {
  color: var(--text-dim);
  font-size: 14px;
  margin: -4px 0 10px;
}

.area-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.area-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 96px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 2px solid var(--line-hi);
  background-size: cover;
  background-position: center;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.area-card.locked {
  filter: grayscale(1) brightness(0.55);
  cursor: default;
}

.area-card.cleared {
  border-color: var(--gold);
}

.area-no {
  font-family: var(--font-title);
  font-size: 28px;
  color: var(--gold);
  width: 32px;
  text-align: center;
}

.area-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px;
}

.area-name {
  font-weight: 800;
  font-size: 19px;
}

.area-sub {
  color: var(--cyan);
  font-size: 14px;
  font-weight: 800;
}

.area-meta {
  color: var(--text-dim);
  font-size: 12px;
}

.area-boss {
  width: 84px;
  height: 84px;
}

.area-emblem,
.emblem-ico,
.emb {
  display: inline-block;
  width: 30px;
  height: 30px;
  background: url('assets/items/emblem.png') center / contain no-repeat;
}

.area-emblem {
  position: absolute;
  top: 6px;
  right: 6px;
}

/* ------------------------------------------------------------ バトル */

.screen.battle {
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.field {
  position: relative;
  height: min(42vh, 330px);
  background-size: cover;
  background-position: center 60%;
  overflow: hidden;
  flex-shrink: 0;
}

.field::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 12, 34, 0.3), transparent 30%, transparent 72%, rgba(8, 12, 34, 0.85));
  pointer-events: none;
}

.field.dim {
  filter: brightness(0.6);
}

.enemy-info {
  position: absolute;
  top: calc(6px + env(safe-area-inset-top));
  left: 6px;
  right: auto;
  width: min(58%, 220px);
  z-index: 4;
  background: rgba(8, 12, 34, 0.92);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.player-info {
  position: absolute;
  right: 6px;
  bottom: 8px;
  width: min(52%, 200px);
  z-index: 4;
  background: rgba(8, 12, 34, 0.92);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.ei-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.lv {
  color: var(--gold);
  font-weight: 800;
}

.boss-tag {
  background: var(--red);
  color: #fff;
  border-radius: 6px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 800;
}

.boss-tag.legend {
  background: linear-gradient(90deg, #9a5cff, #ffc233);
}

.enemy-spot {
  position: absolute;
  right: 6%;
  top: 28%;
  width: 40%;
  height: 52%;
}

.enemy-spot.big {
  width: 46%;
  height: 58%;
  top: 22%;
  right: 4%;
}

.player-spot {
  position: absolute;
  left: 4%;
  bottom: 6%;
  width: 44%;
  height: 54%;
  z-index: 1;
}

.enemy-sprite,
.player-sprite {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.enemy-sprite .anima-img,
.player-sprite .anima-img {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: calc(var(--sz, 1) * 100%);
  object-position: bottom;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.45));
}

.shadow {
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: -4px;
  height: 14px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
}

.progress-pips {
  position: absolute;
  left: 10px;
  top: calc(64px + env(safe-area-inset-top));
  display: flex;
  gap: 5px;
  z-index: 3;
}

.pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.pip.boss {
  width: 14px;
  height: 14px;
  margin-top: -2px;
}

.pip.done {
  background: var(--green);
}

.pip.now {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.appear {
  animation: appear 0.55s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes appear {
  from {
    transform: scale(0.3) translateY(30px);
    opacity: 0;
  }
}

.lunge {
  animation: lunge 0.26s ease;
}

@keyframes lunge {
  50% {
    transform: translate(28px, -14px);
  }
}

.lunge-left {
  animation: lunge-left 0.26s ease;
}

@keyframes lunge-left {
  50% {
    transform: translate(-28px, 14px);
  }
}

.hit {
  animation: hit 0.42s ease;
}

@keyframes hit {
  20%,
  60% {
    transform: translateX(-8px);
    filter: brightness(2.2);
  }
  40%,
  80% {
    transform: translateX(8px);
  }
}

.hit-big {
  animation: hit-big 0.42s ease;
}

@keyframes hit-big {
  20% {
    transform: translateX(-14px) scale(0.94);
    filter: brightness(3) saturate(0);
  }
  50% {
    transform: translateX(12px);
  }
}

.faint {
  animation: faint 0.7s ease forwards;
}

@keyframes faint {
  to {
    transform: translateY(24px);
    opacity: 0;
  }
}

.absorbed {
  transition: transform 0.45s ease, opacity 0.45s ease, filter 0.45s;
  transform: scale(0.05);
  opacity: 0;
  filter: brightness(4);
}

.shake,
.shake-soft {
  animation: shake 0.34s;
}

@keyframes shake {
  25% {
    transform: translate(-6px, 3px);
  }
  50% {
    transform: translate(5px, -4px);
  }
  75% {
    transform: translate(-3px, 2px);
  }
}

.shot {
  position: absolute;
  left: 26%;
  bottom: 28%;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 20%, var(--tc) 55%, transparent 70%);
  box-shadow: 0 0 24px var(--tc), 0 0 48px var(--tc);
  animation: shot 0.26s ease-in forwards;
}

.shot.crit {
  width: 80px;
  height: 80px;
}

@keyframes shot {
  to {
    transform: translate(46vw, -18vh) scale(1.6);
    opacity: 0.9;
  }
}

.float-text {
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translateX(-50%);
  font-family: var(--font-title);
  font-size: 26px;
  white-space: nowrap;
  color: #fff;
  text-shadow: 0 3px 0 #0b1026, 0 0 12px rgba(0, 0, 0, 0.7);
  animation: float-up 1.4s ease forwards;
}

.float-text.crit {
  font-size: 40px;
  color: var(--gold);
}

.float-text.good {
  color: #9dffb0;
}

.float-text.bad {
  color: #ffb3c0;
  top: 62%;
  font-size: 20px;
}

.float-text.lvup {
  color: var(--cyan);
  top: 50%;
}

@keyframes float-up {
  0% {
    transform: translate(-50%, 10px) scale(0.6);
    opacity: 0;
  }
  15% {
    transform: translate(-50%, 0) scale(1.1);
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -30px);
    opacity: 0;
  }
}

.thrown-stone {
  position: absolute;
  left: 22%;
  bottom: 22%;
  width: 56px;
  height: 56px;
  z-index: 5;
  filter: drop-shadow(0 0 12px #22d3c5);
  animation: throw 0.65s cubic-bezier(0.3, 0.1, 0.4, 1) forwards;
}

@keyframes throw {
  50% {
    transform: translate(26vw, -24vh) rotate(360deg);
  }
  to {
    transform: translate(46vw, -14vh) rotate(720deg);
  }
}

.thrown-stone.wobble {
  animation: wobble 0.5s ease;
}

@keyframes wobble {
  0%,
  100% {
    transform: translate(46vw, -14vh) rotate(0);
  }
  25% {
    transform: translate(46vw, -14vh) rotate(-24deg);
  }
  75% {
    transform: translate(46vw, -14vh) rotate(24deg);
  }
}

.thrown-stone.sealed {
  animation: none;
  transform: translate(46vw, -14vh) scale(1.25);
  filter: drop-shadow(0 0 24px #fff) brightness(1.6);
  transition: all 0.4s;
}

.bpanel {
  flex: 1;
  padding: 10px 12px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #0c1234, var(--bg));
}

.msg-card,
.q-card,
.result-card {
  background: var(--panel-solid);
  border: 2px solid var(--line-hi);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.msg {
  font-size: 20px;
  font-weight: 800;
  margin: 4px 0 12px;
}

.msg.big {
  font-size: 26px;
  text-align: center;
  color: var(--gold);
}

.q-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.q-no {
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 800;
}

.q-actions {
  display: flex;
  gap: 6px;
}

.mini-btn {
  border: 2px solid var(--line);
  background: #1a2358;
  border-radius: 99px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 800;
  min-height: 40px;
  cursor: pointer;
}

.mini-btn:disabled {
  opacity: 0.4;
}

.q-text {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.5;
  margin: 10px 0;
  overflow-wrap: anywhere;
}

#app[data-font='large'] .q-text {
  font-size: 30px;
}

.q-visual {
  display: flex;
  justify-content: center;
  margin: 6px 0;
}

.fig {
  max-width: 100%;
  height: auto;
}

.hint {
  background: #10204e;
  border-left: 4px solid var(--cyan);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 6px 0;
  font-size: 16px;
  animation: screen-in 0.25s;
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.choices.long {
  grid-template-columns: 1fr;
}

.choice {
  min-height: 58px;
  border-radius: 14px;
  border: 2px solid var(--line-hi);
  background: linear-gradient(180deg, #25327a, #19225c);
  font-size: 20px;
  font-weight: 800;
  padding: 8px;
  cursor: pointer;
  box-shadow: 0 4px 0 #0a1034;
}

.choice:active {
  transform: translateY(3px);
  box-shadow: none;
}

.choice.right {
  border-color: var(--green);
  background: linear-gradient(180deg, #2bbf6c, #178a4a);
}

.choice.wrong {
  border-color: #ffb3c0;
  opacity: 0.8;
}

.answer-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 8px;
  font-weight: 800;
}

.field-box {
  min-width: 120px;
  height: 56px;
  border-radius: 12px;
  border: 3px solid var(--line);
  background: #070b22;
  display: grid;
  place-items: center;
  font-family: var(--font-title);
  font-size: 30px;
  color: var(--gold);
  cursor: pointer;
}

.divrem .field-box {
  min-width: 86px;
}

.field-box.active {
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(255, 194, 51, 0.35);
}

.bump {
  animation: bump 0.16s;
}

@keyframes bump {
  50% {
    transform: scale(1.07);
  }
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.key {
  min-height: 54px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: linear-gradient(180deg, #202b6c, #161e52);
  font-family: var(--font-title);
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 3px 0 #0a1034;
}

.key:active {
  transform: translateY(2px);
  box-shadow: none;
}

.key:disabled {
  visibility: hidden;
}

.key.del {
  font-family: var(--font);
}

.key.ok {
  grid-column: 1 / -1;
  font-family: var(--font);
  font-weight: 800;
  font-size: 22px;
  background: linear-gradient(180deg, #ffd766, var(--gold) 45%, var(--gold-deep));
  color: #3a2200;
  border-color: #fff0b8;
  box-shadow: 0 4px 0 #8a5200;
}

.fb {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 6px;
}

.fb.good {
  color: var(--green);
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 32px;
}

.fb.retry {
  color: #ffd1d9;
}

.fb.study {
  color: var(--cyan);
}

.explain {
  line-height: 1.7;
  font-size: 17px;
}

.gain {
  color: var(--gold);
  font-weight: 800;
}

.cap-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cap-buttons .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-ico {
  width: 32px;
  height: 32px;
}

.result-card {
  text-align: center;
  animation: appear 0.5s;
}

.result-title {
  font-family: var(--font-title);
  font-weight: 400;
  color: var(--gold);
  font-size: 30px;
  margin: 4px 0 10px;
}

.emblem-get {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--cyan);
  font-weight: 800;
}

.emblem-ico {
  width: 44px;
  height: 44px;
}

.legend-get {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.legend-img {
  width: 200px;
  height: 200px;
}

.rewards {
  list-style: none;
  padding: 0;
  line-height: 2;
}

.perfect {
  color: var(--gold);
  font-weight: 800;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ------------------------------------------------------------ なかま・ずかん */

.mon-grid,
.dex-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mon-cell,
.dex-cell {
  position: relative;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  min-height: 132px;
}

.mon-cell {
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--tc) 28%, transparent), var(--panel) 70%);
}

.mon-cell.partner {
  border-color: var(--gold);
}

.mon-cell.partner::after {
  content: '★';
  position: absolute;
  top: 4px;
  right: 8px;
  color: var(--gold);
}

.cell-img,
.dex-img {
  width: 100%;
  height: 88px;
}

.cell-name,
.dex-name {
  font-weight: 800;
  font-size: 13px;
  text-align: center;
}

.cell-lv {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.dex-no {
  align-self: flex-start;
  font-size: 11px;
  color: var(--text-dim);
}

.dex-cell.st0 {
  opacity: 0.5;
  cursor: default;
}

.dex-q {
  height: 88px;
  display: grid;
  place-items: center;
  font-family: var(--font-title);
  font-size: 36px;
  color: var(--line-hi);
}

.dex-count {
  color: var(--text-dim);
}

.detail-stage {
  height: min(40vh, 300px);
  display: grid;
  place-items: center;
  background: radial-gradient(circle, color-mix(in srgb, var(--tc) 35%, transparent), transparent 62%);
}

.detail-img {
  width: 90%;
  height: 100%;
}

.desc {
  line-height: 1.7;
}

.evo-info {
  color: var(--cyan);
  font-weight: 800;
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.partner-tag {
  text-align: center;
  color: var(--gold);
  font-weight: 800;
}

.evo-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.evo-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0.7;
}

.evo-step.on {
  opacity: 1;
}

.line-img {
  width: 72px;
  height: 72px;
}

.evo-arrow {
  color: var(--gold);
}

.trials {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trial {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}

.trial.ready {
  border-color: var(--gold);
  animation: glowp 1.6s infinite;
}

.trial-img {
  width: 80px;
  height: 80px;
}

.trial-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
}

.got-tag {
  color: var(--gold);
  font-weight: 800;
}

/* ------------------------------------------------------------ タマゴ・ショップ・あそび */

.egg-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.egg-slot {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 190px;
  justify-content: center;
}

.egg-slot.empty {
  color: var(--text-dim);
  border-style: dashed;
}

.egg-slot.ready {
  border-color: var(--gold);
}

.egg-img {
  width: 72px;
  height: 86px;
}

.egg-bar {
  width: 100%;
  flex: none;
}

.wiggle {
  animation: wiggle 1.2s ease-in-out infinite;
}

@keyframes wiggle {
  0%,
  60%,
  100% {
    transform: rotate(0);
  }
  70% {
    transform: rotate(-10deg);
  }
  80% {
    transform: rotate(10deg);
  }
  90% {
    transform: rotate(-6deg);
  }
}

.shop-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shop-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shop-img {
  width: 60px;
  height: 60px;
}

.shop-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
}

.shop-text b {
  font-size: 17px;
}

.shop-text small {
  color: var(--text-dim);
}

.price {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
}

.shop-money {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.game-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.game-card {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  cursor: pointer;
  min-height: 170px;
}

.game-icon {
  width: 76px;
  height: 76px;
}

.gc-title {
  font-weight: 800;
}

.gc-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

.gc-best {
  font-size: 12px;
  color: var(--gold);
  font-weight: 800;
}

.loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-dim);
}

/* ------------------------------------------------------------ きろく・せってい */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat b {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 26px;
  color: var(--gold);
}

.stat span {
  font-size: 12px;
  color: var(--text-dim);
}

.sec {
  font-size: 17px;
  margin: 18px 0 8px;
}

.emblems {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.emb {
  width: 38px;
  height: 38px;
  filter: grayscale(1) brightness(0.3);
}

.emb.on {
  filter: none;
}

.days {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 110px;
  background: var(--panel);
  border-radius: 14px;
  padding: 8px;
}

.day {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

.day i {
  width: 100%;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--cyan), #2a61d8);
}

.day small {
  font-size: 10px;
  color: var(--text-dim);
}

.parent {
  margin-top: 16px;
}

.parent summary {
  font-weight: 800;
  cursor: pointer;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.parent h3 {
  font-size: 15px;
  margin: 14px 0 4px;
  color: var(--cyan);
}

.p-note {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

.ptable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ptable th,
.ptable td {
  border-bottom: 1px solid var(--line);
  padding: 5px 4px;
  text-align: left;
}

.set-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.set-list label {
  font-weight: 800;
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 6px;
}

.set-list .btn {
  margin-top: 6px;
}

.warn {
  color: #ffb3c0;
  font-weight: 800;
}

/* ============================================================ 演出 */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #03040e;
  overflow: hidden;
  animation: fade-in 0.4s;
}

.evo-rays {
  position: absolute;
  inset: -50%;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--tc) 55%, transparent) 0deg 8deg, transparent 8deg 20deg);
  opacity: 0;
  transition: opacity 0.8s;
}

.fx-evo.glow .evo-rays {
  opacity: 0.55;
  animation: spin 6s linear infinite;
}

.fx-evo.spin .evo-rays {
  animation-duration: 1.4s;
  opacity: 0.8;
}

.fx-evo.reveal .evo-rays {
  opacity: 0.6;
  animation: spin 14s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.evo-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.evo-stage,
.hatch-stage {
  position: relative;
  width: min(80vw, 380px);
  height: min(46vh, 380px);
  transition: transform 0.08s;
}

.evo-mon,
.hatch-mon,
.hatch-egg {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: calc(var(--sz, 1) * 100%);
  object-fit: contain;
  object-position: bottom;
  transform-origin: 50% 100%;
  transition: opacity 0.12s;
}

.evo-mon.off,
.hatch-mon.off,
.hatch-egg.off {
  opacity: 0;
}

.fx-evo.glow .evo-mon {
  filter: brightness(0) invert(1) drop-shadow(0 0 18px var(--tc)) drop-shadow(0 0 36px var(--tc));
}

.fx-evo.pulse .evo-stage {
  transform: scale(1.08);
}

.fx-evo.reveal .evo-mon,
.fx-hatch.reveal .hatch-mon {
  filter: drop-shadow(0 0 24px var(--tc));
  animation: reveal 0.9s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes reveal {
  from {
    transform: scale(0.6);
  }
}

.evo-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

.overlay.flash .evo-flash {
  animation: flash 0.9s ease-out;
}

@keyframes flash {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.evo-text {
  position: relative;
  margin-top: 20px;
  text-align: center;
  font-size: clamp(17px, 5vw, 22px);
  font-weight: 800;
  line-height: 1.6;
  min-height: 3.2em;
  padding: 0 16px;
  text-shadow: 0 2px 6px #000;
}

.evo-small {
  color: var(--text-dim);
}

.evo-shout {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 52px;
  color: #fff;
  text-shadow: 0 0 20px var(--tc), 0 0 40px var(--tc);
  animation: appear 0.5s;
}

.evo-name {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(30px, 10vw, 40px);
  color: var(--gold);
  text-shadow: 0 3px 0 #5a2c00, 0 0 24px var(--tc);
}

.evo-ok {
  position: relative;
  margin-top: 14px;
  z-index: 2;
  min-width: 220px;
}

/* ずかん・ひっさつプレビュー */
.overlay.fx-move {
  justify-content: stretch;
  align-items: stretch;
  padding: 0;
  background: #0a0e24;
}

.move-preview {
  flex: 1;
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.move-field.field {
  flex: 1;
  min-height: 52vh;
  position: relative;
  margin: 0;
  border-radius: 0;
  background:
    radial-gradient(ellipse at 50% 70%, color-mix(in srgb, var(--tc) 28%, transparent), transparent 55%),
    linear-gradient(180deg, #1a2248 0%, #0a0e24 100%);
}

.move-target-spot {
  top: 28% !important;
  right: 18% !important;
}

.move-target {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--tc) 80%, #fff);
  box-shadow:
    0 0 0 8px color-mix(in srgb, var(--tc) 25%, transparent),
    0 0 24px color-mix(in srgb, var(--tc) 55%, transparent);
  background:
    radial-gradient(circle at center, transparent 28%, color-mix(in srgb, var(--tc) 40%, transparent) 30% 38%, transparent 40%),
    radial-gradient(circle at center, color-mix(in srgb, var(--tc) 70%, #fff) 0 10%, transparent 12%);
}

.move-fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.move-caption {
  text-align: center;
  font-weight: 800;
  color: var(--text);
  margin: 10px 16px 0;
  text-shadow: 0 2px 6px #000;
}

.fx-move .evo-ok {
  align-self: center;
  margin: 12px 16px 28px;
}

/* おんがく（ジュークボックス） */
.screen.music .music-h {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 800;
}

.music-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.music-item {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
}

.music-item.on {
  border-color: var(--gold);
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 14%, transparent);
}

.music-note {
  margin: 0 12px 8px;
  font-size: 13px;
  font-weight: 700;
}

.hatch-egg {
  width: 60%;
  left: 20%;
}

.hatch-egg.shake1 {
  animation: wiggle 0.7s ease;
}

.hatch-egg.shake2 {
  animation: wiggle 0.5s ease 2;
}

.hatch-egg.shake3 {
  animation: wiggle 0.3s ease 3;
  filter: brightness(1.5) drop-shadow(0 0 20px var(--tc));
}

/* 動き少なめ（設定 / OS） */
#app[data-motion='less'] *,
#app[data-motion='less'] *::before,
#app[data-motion='less'] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------ バトルは 1 画面に 収める（2026-09-26 実機フィードバック） */

.screen.battle {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.screen.battle .field {
  height: clamp(150px, 25dvh, 250px);
}

.screen.battle .enemy-info {
  padding: 4px 8px;
}

.screen.battle .player-info {
  padding: 4px 8px;
}

.screen.battle .hearts .heart {
  width: 17px;
  height: 17px;
}

.bpanel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
}

.bpanel .q-card {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px;
}

.bpanel .q-head .mini-btn {
  min-height: 36px;
  padding: 4px 12px;
}

.bpanel .q-text {
  font-size: clamp(20px, 3.4dvh, 26px);
  margin: 6px 0;
}

.bpanel .q-visual .fig {
  max-height: 12dvh;
  width: auto;
}

.bpanel .hint {
  margin: 4px 0;
  padding: 6px 8px;
  font-size: 15px;
}

.bpanel .answer-line {
  flex: none;
  margin: 0;
}

.bpanel .field-box {
  height: clamp(40px, 6dvh, 52px);
  font-size: clamp(22px, 3.6dvh, 30px);
}

.bpanel .keypad {
  flex: none;
  gap: 6px;
}

.bpanel .key {
  min-height: 0;
  height: clamp(40px, 6.4dvh, 54px);
  font-size: clamp(20px, 3.4dvh, 26px);
}

.key.ok {
  grid-column: auto;
  font-size: 18px;
}

.key.ok.wide {
  grid-column: 1 / -1;
  font-size: 22px;
}

.bpanel .choices {
  flex: none;
  margin-top: 0;
}

.bpanel .choice {
  min-height: clamp(46px, 7dvh, 58px);
}

.bpanel .fbcard,
.bpanel .msg-card,
.bpanel .result-card {
  overflow-y: auto;
  min-height: 0;
}

.bpanel .q-text.long {
  font-size: clamp(16px, 2.6dvh, 21px);
  line-height: 1.55;
}

/* おしらせは 上に出す（下だと テンキーに かさなる） */
.toast {
  bottom: auto;
  top: calc(12px + env(safe-area-inset-top));
}

/* パートナー情報は 1 行（名前・Lv・ハート）にして 相手の足もとを かくさない */
.screen.battle .player-info {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  max-width: 58%;
  bottom: 4px;
  right: 4px;
}

.screen.battle .player-info .ei-row {
  margin: 0;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.screen.battle .enemy-info {
  top: calc(4px + env(safe-area-inset-top));
  left: 4px;
  width: min(55%, 200px);
}

.screen.battle .enemy-spot {
  top: 26%;
  width: 38%;
  height: 50%;
  right: 7%;
}

.screen.battle .enemy-spot.big {
  top: 20%;
  width: 44%;
  height: 56%;
  right: 5%;
}

.screen.battle .player-spot {
  width: 46%;
  height: 56%;
  left: 3%;
  bottom: 4%;
}

/* 上の画面は 元の高さ（最大 42vh）。答える部分が 入りきらない時だけ 上の画面が ちぢむ */
.screen.battle .field {
  flex: 1 1 auto;
  height: auto;
  min-height: clamp(150px, 25dvh, 250px);
  max-height: min(42vh, 330px);
}

.screen.battle .bpanel {
  flex: 0 1 auto;
  max-height: calc(100dvh - clamp(150px, 25dvh, 250px));
}

.bpanel .q-card {
  flex: 0 1 auto;
}

.screen.battle .enemy-spot {
  top: 18%;
  height: 58%;
}

/* ============================================================ オープニング */

.overlay.op,
.overlay.op-gate {
  background: #000;
  justify-content: flex-start;
}

.op-bg {
  position: absolute;
  inset: -8%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.op-bg.on {
  opacity: 1;
}

.op-bg.pan-l {
  animation: op-pan-l 7s linear forwards;
}

.op-bg.pan-r {
  animation: op-pan-r 7s linear forwards;
}

.op-bg.zoom {
  animation: op-zoom 7s ease-out forwards;
}

.op-bg.rise {
  animation: op-rise 6s ease-out forwards;
}

@keyframes op-pan-l {
  from { transform: translateX(4%) scale(1.05); }
  to { transform: translateX(-4%) scale(1.05); }
}

@keyframes op-pan-r {
  from { transform: translateX(-4%) scale(1.05); }
  to { transform: translateX(4%) scale(1.05); }
}

@keyframes op-zoom {
  from { transform: scale(1.18); }
  to { transform: scale(1.02); }
}

@keyframes op-rise {
  from { transform: translateY(6%) scale(1.1); }
  to { transform: translateY(-2%) scale(1.05); }
}

.op-dark {
  position: absolute;
  inset: 0;
  background: #02030c;
  opacity: 1;
  transition: opacity 0.8s ease;
}

.op-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.op-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.op-mon {
  position: absolute;
  transform: translate(-50%, -100%);
  aspect-ratio: 1;
  display: flex;
  justify-content: center;
}

.op-mon img {
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: contain;
  object-position: bottom;
}

.op-mon img.flip {
  transform: scaleX(-1);
}

.op-mon img.glow {
  filter: drop-shadow(0 0 14px var(--tc)) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.5));
}

.op-mon img.sil {
  filter: brightness(0) invert(1) drop-shadow(0 0 18px var(--tc)) drop-shadow(0 0 40px var(--tc));
}

.op-mon.behind img.sil {
  filter: brightness(0) drop-shadow(0 0 2px var(--tc)) drop-shadow(0 0 22px var(--tc));
  opacity: 0.75;
}

.op-mon.legend-sil img.sil {
  opacity: 0.9;
}

.op-mon.from-zoom { animation: op-in-zoom 0.6s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
.op-mon.from-l { animation: op-in-l 0.5s cubic-bezier(0.2, 1.2, 0.4, 1) both; }
.op-mon.from-r { animation: op-in-r 0.5s cubic-bezier(0.2, 1.2, 0.4, 1) both; }
.op-mon.from-b { animation: op-in-b 0.5s cubic-bezier(0.2, 1.3, 0.4, 1) both; }
.op-mon.from-fade { animation: op-in-fade 0.5s ease both; }

@keyframes op-in-zoom {
  from { transform: translate(-50%, -100%) scale(0.2); opacity: 0; }
}

@keyframes op-in-l {
  from { transform: translate(-150%, -100%); opacity: 0; }
}

@keyframes op-in-r {
  from { transform: translate(50%, -100%); opacity: 0; }
}

@keyframes op-in-b {
  from { transform: translate(-50%, -40%); opacity: 0; }
}

@keyframes op-in-fade {
  from { opacity: 0; }
}

.op-name {
  position: absolute;
  bottom: -2.4em;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--font-title);
  font-size: clamp(30px, 10vw, 44px);
  color: #fff;
  text-shadow: 0 0 16px var(--tc), 0 3px 0 #000;
  animation: op-in-b 0.5s 0.25s both;
}

.op-name small {
  display: block;
  text-align: center;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  color: var(--tc);
}

.op-slash {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 140vw;
  height: 10px;
  background: linear-gradient(90deg, transparent, #fff, var(--tc), transparent);
  box-shadow: 0 0 24px var(--tc);
  transform: translate(-50%, -50%) rotate(-24deg) scaleX(0);
  animation: op-slash 0.45s 0.25s ease-out forwards;
}

@keyframes op-slash {
  60% { transform: translate(-50%, -50%) rotate(-24deg) scaleX(1); opacity: 1; }
  to { transform: translate(-50%, -50%) rotate(-24deg) scaleX(1); opacity: 0; }
}

.op-text {
  position: absolute;
  left: 0;
  right: 0;
  top: 16%;
  text-align: center;
  padding: 0 18px;
  font-weight: 800;
  font-size: 22px;
  color: #fff;
  text-shadow: 0 2px 10px #000, 0 0 20px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.op-text.show {
  opacity: 1;
  animation: op-in-fade 0.5s;
}

.op-text.small {
  top: 80%;
  font-size: 18px;
  color: #cfd8ff;
}

.op-text.big {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(34px, 11vw, 52px);
  color: #fff6c8;
  text-shadow: 0 0 20px #ff9a1a, 0 3px 0 #5a2c00;
  animation: op-in-zoom-t 0.5s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes op-in-zoom-t {
  from { transform: scale(0.3); opacity: 0; }
}

.op-text.logo {
  top: 28%;
  animation: op-in-zoom-t 0.7s cubic-bezier(0.2, 1.6, 0.4, 1);
}

.op-logo {
  display: block;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(32px, 10.5vw, 64px);
  letter-spacing: 0.03em;
  background: linear-gradient(180deg, #fff6c8, var(--gold) 50%, #ff8a1a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 #5a2c00) drop-shadow(0 0 26px rgba(255, 170, 40, 0.6));
}

.op-kana {
  display: block;
  margin-top: 6px;
  letter-spacing: 0.5em;
  color: var(--cyan);
  font-size: 18px;
}

.op-flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.op-flash.go {
  animation: flash 0.7s ease-out;
}

.overlay.op.shake {
  animation: shake 0.3s;
}

.op-skip {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border-radius: 99px;
  padding: 8px 14px;
  font-weight: 800;
  font-size: 14px;
  min-height: 40px;
  cursor: pointer;
}

.op-start {
  position: absolute;
  left: 50%;
  bottom: calc(18% + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  min-width: 240px;
  z-index: 3;
  animation: glowp 1.6s infinite;
}

.op-gate {
  justify-content: center !important;
  background: radial-gradient(ellipse at 50% 40%, #1b2766, #03040e 70%) !important;
}

.op-gate-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: min(320px, 86vw);
}

.op-gate-kana {
  letter-spacing: 0.5em;
  color: var(--cyan);
  font-weight: 800;
  margin: 0;
}

.op-gate-skip {
  background: none;
  border: none;
  color: var(--text-dim);
  text-decoration: underline;
  font-size: 14px;
  min-height: 40px;
  cursor: pointer;
}

/* ============================================================ おしえて！レッスン */

.lesson-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 24px);
  margin: -4px 12px 2px;
  padding: 10px 12px;
  border: 2px solid var(--gold);
  border-top: none;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(90deg, #3b2a00, #6b4a00);
  font-weight: 800;
  cursor: pointer;
  animation: glowp 1.8s infinite;
}

.new-tag {
  background: var(--red);
  color: #fff;
  border-radius: 6px;
  padding: 0 6px;
  font-size: 12px;
}

.screen.lesson {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  gap: 8px;
}

.lesson-dots {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.lesson-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.lesson-dots .done {
  background: var(--green);
}

.lesson-dots .now {
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}

.teacher {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.teacher-img {
  width: 96px;
  height: 96px;
  flex: none;
  transform: scaleX(-1);
  animation: teacher-bob 3s ease-in-out infinite;
}

@keyframes teacher-bob {
  0%,
  100% {
    transform: scaleX(-1) translateY(0);
  }
  50% {
    transform: scaleX(-1) translateY(-6px);
  }
}

.bubble {
  position: relative;
  flex: 1;
  background: #fdfbf2;
  color: #141c44;
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 800;
  font-size: 17px;
  line-height: 1.6;
  box-shadow: var(--shadow);
  animation: screen-in 0.3s;
}

.bubble::before {
  content: '';
  position: absolute;
  left: -10px;
  bottom: 18px;
  border: 8px solid transparent;
  border-right-color: #fdfbf2;
}

.bubble small {
  color: #6b4a00;
}

.lesson-fig {
  display: flex;
  justify-content: center;
  min-height: 20px;
}

.lesson-fig .fig {
  max-height: 20dvh;
  width: auto;
  max-width: 100%;
}

.lesson-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guided {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
}

.g-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 800;
  opacity: 0.45;
}

.g-row.now,
.g-row.ok {
  opacity: 1;
}

.g-label {
  font-family: var(--font-title);
  font-weight: 400;
  min-width: 7.5em;
  text-align: right;
}

.g-box {
  min-width: 84px;
  height: 44px;
  border-radius: 10px;
  border: 3px solid var(--line);
  background: #070b22;
  display: grid;
  place-items: center;
  font-family: var(--font-title);
  font-size: 24px;
  color: var(--gold);
}

.g-row.now .g-box {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(255, 194, 51, 0.35);
}

.g-row.ok .g-box {
  border-color: var(--green);
  color: var(--green);
}

.g-check {
  color: var(--green);
}

.g-hint {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--cyan);
}

.lesson-keys {
  margin-top: auto;
}

.lesson-keys .key {
  height: clamp(40px, 6.4dvh, 54px);
  min-height: 0;
}

.lesson-done {
  margin-top: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.done-badge {
  font-family: var(--font-title);
  font-size: 44px;
  color: var(--gold);
  text-shadow: 0 3px 0 #5a2c00, 0 0 24px rgba(255, 170, 40, 0.5);
  animation: appear 0.6s;
}

/* ============================================================ まなぶ / ドリル */
.screen.learn,
.screen.drill {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
}

.learn-h {
  margin: 8px 0 4px;
  font-size: 15px;
  color: var(--cyan);
  font-weight: 800;
}

.learn-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.learn-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 2px 10px;
  align-items: center;
  text-align: left;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.learn-card .lc-tag {
  grid-row: 1 / 3;
  background: var(--gold);
  color: #3a2200;
  font-size: 11px;
  font-weight: 900;
  padding: 6px 8px;
  border-radius: 8px;
  align-self: center;
}

.learn-card.done .lc-tag {
  background: var(--line-hi);
  color: #fff;
}

.learn-card.drill .lc-tag {
  background: var(--cyan);
  color: #062230;
}

.learn-card .lc-title {
  font-weight: 800;
  font-size: 16px;
}

.learn-card .lc-sub {
  color: var(--text-dim);
  font-size: 12px;
}

.drill-prog {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  color: var(--text-dim);
  font-size: 13px;
}

.drill-done {
  margin-top: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.muted {
  color: var(--text-dim);
  font-size: 14px;
}

/* ○×クイズ */
.choices.ox .choice {
  min-height: clamp(70px, 11dvh, 96px);
  font-size: clamp(40px, 7dvh, 56px);
  font-family: var(--font-title);
  line-height: 1;
}

.choices.ox .choice:first-child {
  color: #ff8a8a;
}

.choices.ox .choice:last-child {
  color: #8ac8ff;
}

/* ホームの パートナー: 枠の 中に 固定（縦長の 絵でも はみ出して ボタンを ふさがない / 2026-09-26 実機） */
.partner-stage {
  overflow: hidden;
}

.partner-img {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 0;
  width: auto;
  height: calc(var(--sz, 1) * 100%);
  max-width: 92%;
  margin: 0 auto;
  object-fit: contain;
  object-position: bottom;
  pointer-events: none;
}

.partner-aura {
  pointer-events: none;
}

/* 図が 大きい 問題（グラフ・表・お金・とけい）: 上の 場面を ひくく・テンキーを すこし つめる */
.screen.battle.tallfig .field {
  min-height: clamp(96px, 15dvh, 150px);
  max-height: clamp(96px, 15dvh, 150px);
}

.screen.battle.tallfig .bpanel {
  max-height: calc(100dvh - clamp(96px, 15dvh, 150px));
}

.screen.battle.tallfig .enemy-info {
  padding: 2px 8px;
  font-size: 12px;
}

.screen.battle.tallfig .enemy-info .hp {
  height: 6px;
}

.screen.battle.tallfig .bpanel .key {
  height: clamp(36px, 5.4dvh, 48px);
}

.screen.battle.tallfig .bpanel .choice {
  min-height: clamp(40px, 6dvh, 52px);
}

.screen.battle.tallfig .bpanel .q-text {
  font-size: clamp(16px, 2.6dvh, 22px);
  margin: 4px 0;
}

@media (max-height: 700px) {
  .screen.battle.tallfig .q-visual .fig,
  .screen.battle.tallfig .q-visual svg {
    max-height: 25dvh !important;
    width: auto;
  }
}

/* ============================================================ わざ演出 */

.screen.battle {
  position: relative;
}

.bfx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 30;
}

.float-text.move {
  font-size: clamp(18px, 5vw, 24px);
  top: 26%;
}

.float-text.crit.move {
  font-size: clamp(22px, 6.5vw, 32px);
}

.float-text.low {
  top: 46%;
  font-size: 20px;
}

/* ひっさつの カットイン */
.cutin {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
  animation: cutin-bg 0.2s ease forwards;
}

@keyframes cutin-bg {
  from { background: rgba(0, 0, 0, 0); }
  to { background: rgba(2, 4, 16, 0.72); }
}

.cutin-lines {
  position: absolute;
  inset: -40%;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 255, 255, 0.55) 0deg 1.2deg, transparent 1.2deg 7deg);
  mask-image: radial-gradient(circle at 50% 50%, transparent 18%, #000 42%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 18%, #000 42%);
  animation: cutin-lines 0.12s steps(2) infinite;
}

@keyframes cutin-lines {
  to { transform: rotate(4deg); }
}

.cutin-band {
  position: absolute;
  left: -10%;
  right: -10%;
  top: 30%;
  height: 34%;
  transform: skewY(-8deg);
  background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 85%, #000), var(--tc) 45%, color-mix(in srgb, var(--tc) 55%, #fff));
  border-top: 4px solid #fff;
  border-bottom: 4px solid #fff;
  box-shadow: 0 0 40px var(--tc);
  display: flex;
  align-items: center;
  animation: cutin-band 0.28s cubic-bezier(0.2, 1.2, 0.4, 1) both;
}

@keyframes cutin-band {
  from { transform: skewY(-8deg) scaleY(0); }
}

.cutin-mon {
  position: absolute;
  left: 2%;
  height: 128%;
  max-width: 52%;
  object-fit: contain;
  object-position: left bottom;
  bottom: -6%;
  transform: skewY(8deg) scaleX(-1);
  filter: drop-shadow(0 0 16px #fff) drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6));
  animation: cutin-mon 1.1s cubic-bezier(0.1, 0.9, 0.3, 1) both;
}

@keyframes cutin-mon {
  0% { transform: skewY(8deg) scaleX(-1) translateX(80%); opacity: 0; }
  25% { transform: skewY(8deg) scaleX(-1) translateX(0); opacity: 1; }
  100% { transform: skewY(8deg) scaleX(-1) translateX(-6%) scale(1.04); opacity: 1; }
}

.cutin-text {
  position: absolute;
  right: 11%;
  left: 42%;
  transform: skewY(8deg);
  text-align: right;
  color: #fff;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.6), 0 0 18px rgba(0, 0, 0, 0.5);
}

.cutin-text small {
  display: block;
  font-weight: 800;
  font-size: clamp(12px, 3.4vw, 16px);
  animation: op-in-fade 0.3s 0.2s both;
}

.cutin-text b {
  display: block;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(17px, 5.4vw, 34px);
  line-height: 1.15;
  white-space: nowrap;
  animation: cutin-name 0.45s 0.25s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

@keyframes cutin-name {
  from { transform: scale(2.4); opacity: 0; }
}

.cutin.out {
  animation: cutin-out 0.22s ease forwards;
}

@keyframes cutin-out {
  to { opacity: 0; }
}

/* カットインの 文字を どの タイプ色でも 読めるように（黄色の 帯で 白文字が 見えにくい） */
.cutin-band {
  background: linear-gradient(90deg, var(--tc) 0%, var(--tc) 38%, color-mix(in srgb, var(--tc) 45%, #05081a) 100%);
}

.cutin-text {
  -webkit-text-stroke: 1.5px rgba(5, 8, 26, 0.85);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 rgba(5, 8, 26, 0.9), 0 0 14px rgba(5, 8, 26, 0.8);
}

/* ============================================================ ホーム演出・育成・バトル盛り */

.partner-sparkles {
  position: absolute;
  inset: 8% 10% 18%;
  pointer-events: none;
  z-index: 1;
}

.partner-sparkles i {
  position: absolute;
  left: var(--x, 50%);
  bottom: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff6c8;
  box-shadow: 0 0 8px #ffe27a;
  animation: spark-rise var(--d, 2.4s) ease-in infinite;
  animation-delay: calc(var(--i, 0) * -0.28s);
  opacity: 0.85;
}

.partner-sparkles.legend i {
  width: 7px;
  height: 7px;
  background: #fff;
  box-shadow: 0 0 10px var(--tc, #ffc233), 0 0 16px #fff6c8;
}

@keyframes spark-rise {
  0% { transform: translateY(0) scale(0.4); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(-120px) scale(1); opacity: 0; }
}

.partner-bubble {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  max-width: 82%;
  padding: 8px 14px;
  border-radius: 16px;
  background: rgba(12, 16, 36, 0.92);
  border: 2px solid color-mix(in srgb, var(--gold) 70%, #fff);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  text-align: center;
  pointer-events: none;
}

.partner-bubble.pop {
  animation: bubble-pop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

@keyframes bubble-pop {
  from { transform: translateX(-50%) scale(0.6); opacity: 0; }
}

.partner-img.partner-react {
  animation: partner-react 0.45s ease;
}

@keyframes partner-react {
  0%, 100% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-14px) scale(1.06); }
  60% { transform: translateY(-4px) scale(0.98); }
}

.home-streak {
  position: absolute;
  top: 10px;
  right: 8px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff6b3d, #ffc233);
  color: #1a1020;
  font-weight: 900;
  font-size: 13px;
  animation: glowp 1.6s ease-in-out infinite;
  pointer-events: none;
}

.home-bond-chip {
  position: absolute;
  bottom: 8px;
  left: 10px;
  z-index: 2;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid #ff8aa8;
  color: #ffc0d0;
  font-weight: 800;
  font-size: 13px;
  pointer-events: none;
}

.float-text.streak {
  color: #ffc233;
  font-size: 18px;
  top: 28%;
}

.field.ult-charge::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 70%, color-mix(in srgb, var(--gold) 35%, transparent), transparent 60%);
  animation: ult-charge 0.9s ease;
  pointer-events: none;
  z-index: 3;
}

@keyframes ult-charge {
  from { opacity: 0; }
  40% { opacity: 1; }
  to { opacity: 0.35; }
}

.field.ult-flash::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff;
  animation: ult-flash 0.45s ease;
  pointer-events: none;
  z-index: 5;
}

@keyframes ult-flash {
  from { opacity: 0.85; }
  to { opacity: 0; }
}

.cutin-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, #fff 0%, transparent 55%);
  animation: cutin-flash 0.5s ease;
  pointer-events: none;
}

@keyframes cutin-flash {
  from { opacity: 0.7; }
  to { opacity: 0; }
}

.victory-burst {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 0;
  height: 0;
  z-index: 6;
  pointer-events: none;
}

.victory-burst i {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--tc, #ffe27a);
  box-shadow: 0 0 10px var(--tc, #ffe27a);
  transform: rotate(var(--a)) translateY(0) scale(0.4);
  animation: victory-star 1.2s ease-out forwards;
  animation-delay: calc(var(--i) * 0.03s);
}

@keyframes victory-star {
  to {
    transform: rotate(var(--a)) translateY(-90px) scale(1);
    opacity: 0;
  }
}

/* ボス登場 */
.overlay.fx-boss,
.overlay.fx-cap {
  display: grid;
  place-items: center;
  background: rgba(4, 6, 18, 0.92);
}

.boss-intro,
.cap-movie {
  position: relative;
  width: min(100%, 420px);
  height: min(70dvh, 520px);
  display: grid;
  place-items: center;
}

.boss-rays,
.cap-rays {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, var(--tc), transparent 30%, var(--tc), transparent 60%, var(--tc), transparent);
  opacity: 0.35;
  animation: boss-spin 4s linear infinite;
}

@keyframes boss-spin {
  to { transform: rotate(360deg); }
}

.boss-sil {
  position: absolute;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--tc), transparent 70%);
  filter: blur(8px);
  animation: aura 1.2s ease-in-out infinite;
}

.boss-mon,
.cap-mon {
  position: relative;
  width: 72%;
  height: calc(var(--sz, 1) * 70%);
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 0 24px var(--tc));
  animation: boss-in 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both;
  z-index: 1;
}

@keyframes boss-in {
  from { transform: scale(0.2) translateY(40px); opacity: 0; filter: brightness(0); }
  55% { filter: brightness(2); }
  to { transform: scale(1) translateY(0); opacity: 1; filter: brightness(1); }
}

.boss-banner,
.cap-banner {
  position: absolute;
  bottom: 8%;
  z-index: 2;
  text-align: center;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid var(--tc);
  border-radius: 14px;
  padding: 10px 18px;
  animation: bubble-pop 0.4s 0.35s both;
}

.boss-banner small,
.cap-banner small {
  display: block;
  color: var(--gold);
  font-weight: 800;
  font-size: 13px;
}

.boss-banner b,
.cap-banner b {
  display: block;
  font-family: var(--font-title);
  font-size: 28px;
  color: #fff;
}

.overlay.fx-boss.boss-flash {
  animation: ult-flash 0.45s ease;
}

.cap-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cap-movie .evo-ok {
  position: absolute;
  bottom: -8px;
  z-index: 3;
}

/* 育成画面 */
.screen.train {
  gap: 10px;
}

.train-stage {
  position: relative;
  height: min(34vh, 260px);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.train-aura {
  position: absolute;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--tc) 50%, transparent), transparent 70%);
  animation: aura 3.5s ease-in-out infinite;
}

.train-img {
  position: relative;
  height: calc(var(--sz, 1) * 92%);
  max-width: 88%;
  object-fit: contain;
  object-position: bottom;
  animation: bob 2.8s ease-in-out infinite;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.45));
}

.bond-meter {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 6px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #ffc0d0;
}

.bond-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.bond-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ff6b9a, #ffc0d0);
  border-radius: inherit;
}

.bond-tier {
  text-align: center;
  margin: 0;
}

.train-grid {
  display: grid;
  gap: 8px;
}

.train-pick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.train-pick small {
  font-weight: 600;
  opacity: 0.85;
}

.train-play {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.tp-hud {
  display: flex;
  gap: 6px;
  font-family: var(--font-title);
  font-size: 28px;
  color: var(--gold);
}

.tp-stage {
  position: relative;
  width: 100%;
  height: min(42vh, 320px);
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--tc) 28%, transparent), rgba(0, 0, 0, 0.25));
}

.tp-mon {
  height: calc(var(--sz, 1) * 78%);
  max-width: 70%;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4));
  touch-action: manipulation;
}

.tp-mon.pet-bounce {
  animation: partner-react 0.35s ease;
}

.tp-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.train-ball {
  position: absolute;
  top: -12%;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--gold) 45%, #c45a1a);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  animation: ball-fall linear forwards;
  cursor: pointer;
}

@keyframes ball-fall {
  to { top: 110%; }
}

.sync-gauge {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 12%;
  height: 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.sync-sweet {
  position: absolute;
  left: 42%;
  width: 20%;
  top: 2px;
  bottom: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--gold) 80%, #fff);
}

.sync-needle {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 4px;
  margin-left: -2px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 0 8px #fff;
}

.sync-tap {
  width: min(100%, 280px);
}

.train-result {
  text-align: center;
  display: grid;
  gap: 8px;
  padding: 18px;
}

.train-result h2 {
  margin: 0;
  font-family: var(--font-title);
  color: var(--gold);
}

/* ============================================================ 紙芝居おうぎ・アニマ息づかい */

.storyboard {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--tc) 35%, transparent), rgba(5, 8, 26, 0.55) 70%);
  overflow: hidden;
}

.storyboard.out {
  animation: sb-out 0.22s ease forwards;
}

@keyframes sb-out {
  to { opacity: 0; }
}

.sb-panel {
  position: absolute;
  inset: 12% 8%;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.72) translateY(12px);
  filter: blur(2px);
  transition: opacity 0.18s ease, transform 0.28s cubic-bezier(0.2, 1.4, 0.4, 1), filter 0.2s ease;
}

.sb-panel.on {
  opacity: 1;
  transform: scale(1) translateY(0);
  filter: blur(0);
}

.sb-panel.dim {
  opacity: 0.25;
  transform: scale(1.08);
  filter: blur(1px);
}

.sb-svg,
.sb-img {
  width: min(78vw, 340px);
  height: auto;
  max-height: 42dvh;
  object-fit: contain;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--tc) 70%, #fff));
}

.storyboard.sb-reduced {
  background: color-mix(in srgb, var(--tc) 40%, transparent);
}

.anima-live-host {
  position: relative;
}

.anima-aura {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 4%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--tc) 50%, transparent), transparent 68%);
  animation: aura 3.6s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.anima-sparkles {
  position: absolute;
  inset: 6% 8% 14%;
  pointer-events: none;
  z-index: 2;
}

.anima-sparkles i {
  position: absolute;
  left: var(--x, 50%);
  bottom: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff6c8;
  box-shadow: 0 0 8px #ffe27a, 0 0 2px var(--tc, #ffc233);
  animation: spark-rise var(--d, 2.4s) ease-in infinite;
  animation-delay: calc(var(--i, 0) * -0.26s);
  opacity: 0.9;
}

.anima-sparkles.legend i {
  width: 7px;
  height: 7px;
  background: #fff;
  box-shadow: 0 0 10px var(--tc, #ffc233), 0 0 18px #fff6c8;
}

.anima-live-host .anima-img,
.anima-live-host > .anima-img {
  position: relative;
  z-index: 1;
}

.anima-breath:not(.flip) {
  animation: anima-breath 2.8s ease-in-out infinite;
  transform-origin: 50% 90%;
}

.anima-breath.flip {
  animation: anima-breath-flip 2.8s ease-in-out infinite;
  transform-origin: 50% 90%;
}

@keyframes anima-breath {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  40% { transform: translateY(-6px) rotate(1.2deg) scale(1.02); }
  70% { transform: translateY(-2px) rotate(-0.6deg) scale(1.01); }
}

@keyframes anima-breath-flip {
  0%, 100% { transform: scaleX(-1) translateY(0) rotate(0deg) scale(1); }
  40% { transform: scaleX(-1) translateY(-6px) rotate(-1.2deg) scale(1.02); }
  70% { transform: scaleX(-1) translateY(-2px) rotate(0.6deg) scale(1.01); }
}

.detail-stage.anima-live-host,
.train-stage.anima-live-host {
  position: relative;
}

.detail-stage .anima-sparkles,
.train-stage .anima-sparkles {
  inset: 4% 12% 22%;
}

.partner-img.anima-breath {
  /* ホームは 既存 bob を 優先 */
  animation: bob 3.2s ease-in-out infinite;
}

.field.ult-charge .anima-sparkles i {
  animation-duration: 0.9s;
  background: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .partner-sparkles i,
  .anima-sparkles i,
  .boss-rays,
  .cap-rays,
  .victory-burst i,
  .anima-breath,
  .anima-breath.flip,
  .anima-aura {
    animation: none !important;
  }
  .sb-panel {
    transition: none;
  }
}

[data-motion='less'] .partner-sparkles,
[data-motion='less'] .anima-sparkles,
[data-motion='less'] .boss-rays,
[data-motion='less'] .cap-rays,
[data-motion='less'] .anima-aura {
  display: none;
}

[data-motion='less'] .anima-breath,
[data-motion='less'] .anima-breath.flip {
  animation: none !important;
}

/* ---------------------------------------------------------------- ひっさつムービー（web/cinema.mjs） */
.cine {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 95;
  touch-action: none;
  opacity: 0;
  background: transparent;
}

/* ==== alive（web/alive.mjs: タイプごとの 待機粒子・しぐさ） ==== */
.alive-fx {
  position: absolute;
  inset: -14% -14% -6%;
  width: 128%;
  height: 120%;
  pointer-events: none;
  z-index: 3;
}

/* しぐさは 個別の transform プロパティで 呼吸（transform）に かさねる */
/* しぐさの 間は 呼吸を 止めて しぐさだけ（反転は transform に 残す） */
.g-hop { animation: g-hop 0.7s ease-out 1 !important; }
.g-stretch { animation: g-stretch 0.8s ease-in-out 1 !important; }
.g-tilt { animation: g-tilt 0.9s ease-in-out 1 !important; }
.g-sway { animation: g-sway 0.9s ease-in-out 1 !important; }
.g-shiver { animation: g-shiver 0.5s linear 1 !important; }
.g-stomp { animation: g-stomp 0.7s ease-out 1 !important; }
.anima-img.flip.g-hop,
.anima-img.flip.g-stretch,
.anima-img.flip.g-tilt,
.anima-img.flip.g-sway,
.anima-img.flip.g-shiver,
.anima-img.flip.g-stomp {
  transform: scaleX(-1);
}

@keyframes g-hop {
  0%, 100% { translate: 0 0; scale: 1 1; }
  18% { translate: 0 2%; scale: 1.06 0.92; }
  45% { translate: 0 -9%; scale: 0.96 1.06; }
  75% { translate: 0 0; scale: 1.04 0.95; }
}
@keyframes g-stretch {
  0%, 100% { scale: 1 1; }
  40% { scale: 0.95 1.07; }
  70% { scale: 1.03 0.97; }
}
@keyframes g-tilt {
  0%, 100% { rotate: 0deg; }
  30% { rotate: -6deg; }
  65% { rotate: 3deg; }
}
@keyframes g-sway {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  30% { translate: -3% 0; rotate: -3deg; }
  70% { translate: 3% 0; rotate: 3deg; }
}
@keyframes g-shiver {
  0%, 100% { translate: 0 0; }
  20% { translate: -1.5% 0; }
  40% { translate: 1.5% 0; }
  60% { translate: -1% 0; }
  80% { translate: 1% 0; }
}
@keyframes g-stomp {
  0%, 100% { translate: 0 0; scale: 1 1; }
  30% { translate: 0 -5%; scale: 0.97 1.04; }
  55% { translate: 0 1%; scale: 1.08 0.9; }
}

[data-motion='less'] .alive-fx { display: none; }
@media (prefers-reduced-motion: reduce) {
  .alive-fx { display: none; }
  .g-hop, .g-stretch, .g-tilt, .g-sway, .g-shiver, .g-stomp { animation: none !important; }
}

/* ==== growth / battle feel (gauge, goals, nick, result) ==== */
/* 2026-10-01 育成・バトルの 手ごたえ改修。ここより上の 既存ルールは なるべく さわらない。 */

/* ---- ひっさつゲージ（パートナーの ハートの 下・4 マス） */
.screen.battle .player-info {
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  max-width: 64%;
}

.pi-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

/* ながい なまえは … で きる（ハートと ゲージは かならず 見せる） */
.pi-row .ei-row {
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
}

.pi-row .ei-row b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.pi-row .ei-row .lv,
.pi-row .hearts {
  flex: none;
}

.screen.battle .pi-row .hearts {
  gap: 2px;
}

.screen.battle .pi-row .hearts .heart {
  width: 15px;
  height: 15px;
}

.sp-gauge {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 12px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  color: var(--text-dim);
  white-space: nowrap;
}

.sp-lbl {
  flex: none;
}

.sp-pips {
  display: flex;
  gap: 3px;
  flex: 1;
  min-width: 56px;
}

.sp-pips i {
  flex: 1;
  height: 7px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.sp-pips i.on {
  background: linear-gradient(90deg, #ffb020, #ffe27a);
  border-color: #ffe9a6;
  box-shadow: 0 0 6px rgba(255, 194, 51, 0.7);
}

.sp-pips i.pop {
  animation: sp-pop 0.42s cubic-bezier(0.2, 1.8, 0.4, 1);
}

@keyframes sp-pop {
  0% { transform: scaleY(0.2); filter: brightness(3); }
  60% { transform: scaleY(1.6); }
}

.sp-gauge.ready {
  color: var(--gold);
}

.sp-gauge.ready .sp-pips i {
  background: linear-gradient(90deg, #ff8a1f, #fff1a8);
  border-color: #fff;
  animation: sp-ready 0.9s ease-in-out infinite;
}

@keyframes sp-ready {
  50% { box-shadow: 0 0 10px #ffc233, 0 0 18px rgba(255, 138, 31, 0.8); filter: brightness(1.35); }
}

.sp-streak {
  flex: none;
  color: #ffb36b;
}

/* 満タン: パートナーに ためオーラ / こたえる パネルの ふちが 光る */
.player-spot.sp-charged::before,
.player-spot.sp-charged::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.player-spot.sp-charged::before {
  left: -6%;
  right: -6%;
  bottom: -8%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 70%, rgba(255, 226, 122, 0.85), rgba(255, 150, 40, 0.4) 40%, transparent 68%);
  animation: sp-aura 1.1s ease-in-out infinite;
}

/* 足もとから 立ちのぼる 光の わ */
.player-spot.sp-charged::after {
  left: 10%;
  right: 10%;
  bottom: -2%;
  height: 22%;
  border-radius: 50%;
  border: 3px solid rgba(255, 226, 122, 0.9);
  box-shadow: 0 0 14px #ffc233, inset 0 0 10px #ffc233;
  animation: sp-ring 1.1s ease-out infinite;
}

@keyframes sp-aura {
  50% { transform: scale(1.08); opacity: 0.75; }
}

@keyframes sp-ring {
  0% { transform: translateY(0) scale(0.7); opacity: 1; }
  100% { transform: translateY(-60%) scale(1.15); opacity: 0; }
}

.screen.battle.sp-ready .bpanel {
  box-shadow: inset 0 0 0 2px rgba(255, 194, 51, 0.5), inset 0 0 18px rgba(255, 194, 51, 0.22);
}

.float-text.charge-ok {
  top: auto;
  bottom: 26%;
  left: 30%;
  font-size: 17px;
  color: var(--gold);
}

.float-text.stamp {
  top: 14%;
  font-size: clamp(24px, 8vw, 32px);
  color: #fff;
  -webkit-text-stroke: 1px #ff6b3d;
  text-shadow: 0 0 14px #ff9d2e, 0 3px 0 #6b2a00;
  animation: stamp-in 1.2s ease forwards;
}

@keyframes stamp-in {
  0% { transform: translateX(-50%) scale(2.2) rotate(-8deg); opacity: 0; }
  15% { transform: translateX(-50%) scale(1) rotate(-8deg); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateX(-50%) scale(1) rotate(-8deg); opacity: 0; }
}

.float-text.bond {
  top: 50%;
  font-size: 19px;
  color: #ffc2e6;
}

/* ---- 見た目の HP 数字 */
.hp-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hp-row .hp {
  flex: 1;
}

.hp-num {
  min-width: 26px;
  text-align: right;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  color: #d8ffe6;
  font-variant-numeric: tabular-nums;
}

/* ---- ダメージ数字・ヒットストップ・のけぞり・火花 */
.float-at {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 6;
  white-space: nowrap;
  font-family: var(--font-title);
}

.float-at.on-top {
  z-index: 36;
}

.float-at.dmg {
  font-size: 26px;
  color: #fff;
  text-shadow: 0 3px 0 #0b1026, 0 0 10px rgba(0, 0, 0, 0.6);
  animation: dmg-pop 0.9s ease-out forwards;
}

.float-at.dmg.crit {
  font-size: 42px;
  color: var(--gold);
  text-shadow: 0 3px 0 #6b2a00, 0 0 18px rgba(255, 194, 51, 0.85);
  animation-duration: 1s;
}

@keyframes dmg-pop {
  0% { transform: translate(-50%, -30%) scale(0.4); opacity: 0; }
  18% { transform: translate(-50%, -60%) scale(1.25); opacity: 1; }
  35% { transform: translate(-50%, -70%) scale(1); }
  80% { opacity: 1; }
  100% { transform: translate(-50%, -125%) scale(1); opacity: 0; }
}

.hitstop {
  filter: brightness(2.6) saturate(0.35);
}

.knock-r {
  animation: knock-r 0.32s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes knock-r {
  30% { transform: translate(16px, -6px) rotate(6deg); }
}

.knock-r-big {
  animation: knock-r-big 0.44s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes knock-r-big {
  25% { transform: translate(30px, -12px) rotate(11deg) scale(0.94); }
  60% { transform: translate(8px, -2px) rotate(3deg); }
}

.knock-l {
  animation: knock-l 0.32s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes knock-l {
  30% { transform: translate(-14px, 6px) rotate(-6deg); }
}

.hit-spark {
  position: absolute;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  background: radial-gradient(circle, #fff 0 20%, #fff6c8 34%, transparent 64%);
  clip-path: polygon(50% 0, 61% 36%, 100% 50%, 61% 64%, 50% 100%, 39% 64%, 0 50%, 39% 36%);
  animation: hit-spark 0.42s ease-out forwards;
  pointer-events: none;
  z-index: 6;
}

.hit-spark.big {
  width: 100px;
  height: 100px;
  margin: -50px 0 0 -50px;
}

@keyframes hit-spark {
  0% { transform: scale(0.3) rotate(0deg); opacity: 1; }
  60% { opacity: 1; }
  100% { transform: scale(1.4) rotate(45deg); opacity: 0; }
}

/* 倒れる時: 白く 光る → ちぢむ → きらきら（victoryBurst）に なって 消える */
.faint {
  animation: faint-sparkle 0.7s ease forwards;
  transform-origin: 50% 80%;
}

@keyframes faint-sparkle {
  0% { transform: none; filter: brightness(1); opacity: 1; }
  25% { transform: scale(1.06); filter: brightness(3) saturate(0); opacity: 1; }
  100% { transform: scale(0.15) translateY(-12%); filter: brightness(3) saturate(0); opacity: 0; }
}

/* まちがえた時: ハートが ふわっと パートナーの ほうへ とんで はじける */
.heart-fly {
  position: absolute;
  width: 17px;
  height: 17px;
  z-index: 6;
  pointer-events: none;
  animation: heart-fly 0.9s ease-out forwards;
}

@keyframes heart-fly {
  0% { transform: none; opacity: 1; }
  55% { transform: translate(-46px, -34px) scale(1.25); opacity: 1; }
  100% { transform: translate(-58px, -52px) scale(1.9); opacity: 0; filter: brightness(1.8); }
}

/* パートナーの 反応 */
.joy-hop {
  animation: joy-hop 0.17s ease-out;
}

@keyframes joy-hop {
  50% { transform: translateY(-16px) scale(1.04, 0.97); }
}

.brace {
  animation: brace 0.46s ease;
  transform-origin: 50% 100%;
}

@keyframes brace {
  30% { transform: scale(1.06, 0.9); }
  70% { transform: scale(0.97, 1.07) translateY(-4px); }
}

.endure {
  animation: endure 0.52s ease;
}

@keyframes endure {
  20%, 60% { transform: translateX(-4px); filter: drop-shadow(0 0 12px #ff8ac2) brightness(1.4); }
  40%, 80% { transform: translateX(4px); }
}

.nod {
  animation: nod 0.38s ease;
  transform-origin: 50% 100%;
}

@keyframes nod {
  40% { transform: rotate(-4deg) translateY(3px); }
}

/* パートナーの ふきだし（ゆっくりで いいよ・おうえん・まだまだ！） */
.bt-say {
  position: absolute;
  left: 22%;
  bottom: 50%;
  max-width: 46%;
  z-index: 6;
  padding: 5px 10px;
  border-radius: 14px;
  background: #fff;
  color: #1b2350;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.35;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(6px) scale(0.9);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.bt-say::after {
  content: '';
  position: absolute;
  left: 14px;
  bottom: -7px;
  border: 7px solid transparent;
  border-top-color: #fff;
  border-bottom: 0;
}

.bt-say.show {
  opacity: 1;
  transform: none;
}

/* ---- 捕獲: NEW / もっている */
.cap-chip {
  position: absolute;
  top: 0;
  left: -2%;
  z-index: 3;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.5;
  pointer-events: none;
  animation: appear 0.4s;
}

.cap-chip.new {
  background: linear-gradient(90deg, #ff4d6d, #ffc233);
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 194, 51, 0.7);
}

.cap-chip.owned {
  background: rgba(8, 12, 34, 0.88);
  color: var(--text-dim);
  border: 1px solid var(--line-hi);
}

.cap-new {
  position: absolute;
  top: 3%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  font-weight: 800;
  text-shadow: 0 2px 6px #000;
  animation: cap-new-in 0.5s 0.35s both cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes cap-new-in {
  from { transform: translateX(-50%) scale(0.3); opacity: 0; }
}

.new-mark {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 28px;
  color: #fff;
  background: linear-gradient(90deg, #ff4d6d, #ffc233);
  padding: 0 14px;
  border-radius: 10px;
  text-shadow: 0 2px 0 #7a1a2c;
  box-shadow: 0 0 18px rgba(255, 194, 51, 0.7);
}

.dup-mark {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 26px;
  color: var(--cyan);
}

.cap-count {
  font-size: 14px;
  color: var(--text-dim);
}

.cap-count .cnt {
  display: inline-block;
  color: var(--gold);
  font-size: 22px;
}

.cnt.bump,
.rw-lv.bump {
  animation: cnt-bump 0.5s cubic-bezier(0.2, 1.8, 0.4, 1);
}

@keyframes cnt-bump {
  40% { transform: scale(1.6); color: #fff; }
}

/* ---- タマゴ: めずらしさで 光が かわる / ★ */
.fx-hatch .hatch-egg.glow {
  filter: drop-shadow(0 0 14px var(--glow, #fff)) drop-shadow(0 0 28px var(--glow, #fff));
}

.fx-hatch .hatch-egg.glow.shake3 {
  filter: brightness(1.5) drop-shadow(0 0 22px var(--glow, #fff)) drop-shadow(0 0 44px var(--glow, #fff));
}

.hatch-stars {
  display: block;
  color: var(--gold);
  font-size: 22px;
  letter-spacing: 4px;
  line-height: 1.2;
}

.hatch-stars i {
  font-style: normal;
  color: rgba(255, 255, 255, 0.2);
}

.evo-text .new-mark,
.evo-text .dup-mark {
  display: block;
  width: fit-content;
  margin: 0 auto 4px;
  font-size: 18px;
  line-height: 1.5;
}

/* ---- しんか: ひっさつが おうぎに パワーアップ */
.evo-ult {
  position: relative;
  z-index: 3;
  margin: 6px 16px 0;
  padding: 8px 18px;
  border-radius: 14px;
  text-align: center;
  background: linear-gradient(90deg, rgba(255, 106, 42, 0.25), rgba(255, 194, 51, 0.35), rgba(255, 106, 42, 0.25));
  border: 2px solid var(--gold);
  box-shadow: 0 0 24px rgba(255, 194, 51, 0.5);
  animation: appear 0.5s;
}

.evo-ult small {
  display: block;
  color: var(--gold);
  font-weight: 900;
}

.evo-ult b {
  display: block;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(20px, 6.5vw, 26px);
}

.evo-ult span {
  font-size: 13px;
  color: var(--text-dim);
}

/* ---- ニックネーム */
.overlay.fx-nick {
  justify-content: flex-start;
  padding: calc(20px + env(safe-area-inset-top)) 16px 16px;
  background: rgba(3, 4, 14, 0.94);
  overflow-y: auto;
}

.nick-card {
  width: min(100%, 360px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  animation: appear 0.35s;
}

.nick-stage {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, color-mix(in srgb, var(--tc) 45%, transparent), transparent 68%);
}

.nick-img {
  width: 112px;
  height: 112px;
  object-fit: contain;
}

.nick-q {
  margin: 0;
  font-weight: 900;
  font-size: 18px;
}

.nick-input {
  width: 100%;
  font: inherit;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid var(--line-hi);
  background: #0a0f2c;
  color: var(--text);
}

.nick-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 194, 51, 0.25);
}

.nick-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
}

.nick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.nick-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 6px;
}

.nick-species {
  color: var(--text-dim);
  font-size: 13px;
}

.nick-btn {
  min-height: 34px;
  margin-left: auto;
  padding: 4px 14px;
  font-size: 14px;
}

/* ---- 結果画面: スタンプ・けいけんちバー・ランクアップ・つぎの めあて */
.bpanel .result-card {
  padding: 8px 12px;
}

.bpanel .result-title {
  font-size: clamp(22px, 7vw, 28px);
  margin: 0 0 2px;
}

/* 結果の あいだは 上の 場面を ひくく して 1 画面に おさめる */
.screen.battle.result-mode .field {
  min-height: 84px;
  max-height: 84px;
}

.screen.battle.result-mode .bpanel {
  max-height: calc(100dvh - 84px);
}

.screen.battle.result-mode .enemy-info,
.screen.battle.result-mode .player-info,
.screen.battle.result-mode .progress-pips {
  display: none;
}

.bpanel .result-card .emblem-get {
  margin: 2px 0;
  font-size: 14px;
}

.bpanel .result-actions {
  gap: 8px;
}

.bpanel .result-actions .btn.big {
  min-height: 46px;
  padding: 8px 16px;
  font-size: 17px;
}

.stamps {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 0 0 2px;
}

.stamp {
  display: inline-grid;
  place-items: center;
  animation: stamp-down 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

@keyframes stamp-down {
  0% { transform: scale(2.6) rotate(calc(var(--rot, 0deg) - 10deg)); opacity: 0; }
  60% { transform: scale(0.92) rotate(var(--rot, 0deg)); opacity: 1; }
  100% { transform: scale(1) rotate(var(--rot, 0deg)); opacity: 1; }
}

.stamp-emblem {
  --rot: 0deg;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: radial-gradient(circle, rgba(255, 194, 51, 0.28), transparent 70%);
  animation-delay: 0.5s;
}

.stamp-emblem .emblem-ico {
  width: 36px;
  height: 36px;
}

.stamp-perfect {
  --rot: -8deg;
  padding: 4px 12px;
  border: 3px solid var(--gold);
  border-radius: 10px;
  color: var(--gold);
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 20px;
  box-shadow: 0 0 14px rgba(255, 194, 51, 0.5);
  animation-delay: 0.8s;
}

.bpanel .rewards {
  margin: 4px 0;
  line-height: 1.6;
}

.rw-exp {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
  margin: 2px 0;
}

.rw-lv {
  display: inline-block;
  min-width: 54px;
  text-align: left;
  font-weight: 900;
  color: var(--gold);
}

.rw-exp .exp-bar {
  flex: 1;
}

.rw-gain {
  font-size: 14px;
  font-weight: 800;
  color: var(--cyan);
}

.cu {
  font-variant-numeric: tabular-nums;
}

.rank-up {
  margin: 4px 0;
  font-weight: 900;
  color: var(--gold);
  animation: appear 0.5s 1.2s both;
}

.rank-up small {
  display: block;
  color: #fff;
  font-weight: 800;
}

.next-goals {
  margin: 4px 0 8px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(63, 224, 255, 0.08);
  border: 1px solid rgba(63, 224, 255, 0.3);
}

.next-goals small {
  color: var(--cyan);
  font-weight: 900;
}

.next-goals p {
  margin: 1px 0;
  font-weight: 800;
  font-size: 14px;
}

/* ---- ホーム: しんかの かげ・つぎの めあて */
.evo-goal {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 4px;
}

.eg-sil {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(63, 224, 255, 0.28), rgba(10, 15, 44, 0.9) 70%);
  border: 1px solid rgba(63, 224, 255, 0.45);
}

.eg-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.eg-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.eg-body b {
  font-size: 15px;
  color: var(--cyan);
}

.eg-body small {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold);
}

.eg-bar {
  display: block;
  height: 7px;
  border-radius: 99px;
  background: #0a0f2c;
  border: 1px solid var(--line);
  overflow: hidden;
}

.eg-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #9a5cff, #3fe0ff);
}

.pc-goal {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 800;
}

.pc-goal small {
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(63, 224, 255, 0.14);
  color: var(--cyan);
  font-size: 11px;
}

/* ---- そだてる: きずなの いいこと */
.bond-perks {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
  position: relative;
  z-index: 2;
}

.bond-perks li b {
  margin-right: 6px;
}

.bond-perks li.on {
  color: #ffc2e6;
  font-weight: 800;
}

/* 動き少なめ: ダメージ数字は 動かさず 数字だけ 見せる（消えるのは タイマー） */
#app[data-motion='less'] .float-at.dmg {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .float-at.dmg {
    animation: none !important;
  }
}

/* ---- ずかん: しぼりこみ・すんでいる ばしょ・しれんの 進み具合 */
.dex-prog {
  position: relative;
  height: 8px;
  margin: -4px 0 8px;
  border-radius: 99px;
  background: #0a0f2c;
  border: 1px solid var(--line);
  overflow: hidden;
}

.dex-prog i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #3ddc84, #b4f25a);
}

.dex-prog i.seen {
  background: rgba(168, 179, 224, 0.35);
}

.dex-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 8px;
  margin-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.dex-filters::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  min-height: 34px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 2px solid var(--tc, var(--line-hi));
  background: rgba(10, 15, 44, 0.85);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.chip.on {
  background: var(--tc, var(--line-hi));
  color: #0b1026;
}

.chip.only {
  --tc: var(--gold);
}

.dex-empty {
  text-align: center;
}

.dex-read {
  margin-left: auto;
  min-height: 36px;
}

.where {
  margin: 6px 0 8px;
}

.where small {
  color: var(--cyan);
  font-weight: 900;
}

.where-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.where-chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(63, 224, 255, 0.12);
  border: 1px solid rgba(63, 224, 255, 0.4);
  font-size: 13px;
  font-weight: 800;
}

.where-chip.boss {
  background: rgba(255, 77, 109, 0.14);
  border-color: rgba(255, 77, 109, 0.5);
}

.where-chip.legend {
  background: rgba(154, 92, 255, 0.18);
  border-color: rgba(255, 194, 51, 0.6);
}

.where-chip.egg {
  background: rgba(255, 244, 220, 0.1);
  border-color: rgba(255, 244, 220, 0.45);
}

.trial-prog {
  display: block;
  height: 6px;
  margin-top: 3px;
  border-radius: 99px;
  background: #0a0f2c;
  border: 1px solid var(--line);
  overflow: hidden;
}

.trial-prog i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #9a5cff, #ffc233);
}

.trial-num {
  color: var(--text-dim);
  font-size: 12px;
}

/* ---- あそび: メダル・NEW */
.game-card {
  position: relative;
}

.gc-new {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff4d6d, #ffc233);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.gc-medals {
  display: flex;
  gap: 5px;
  margin-top: 2px;
}

.medal {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.22);
}

.medal.m1.on {
  background: radial-gradient(circle at 35% 30%, #ffd1a1, #c46a2c 70%);
  border-color: #ffb27a;
}

.medal.m2.on {
  background: radial-gradient(circle at 35% 30%, #ffffff, #9aa6b8 70%);
  border-color: #e3e9f5;
}

.medal.m3.on,
.medal-total .medal {
  background: radial-gradient(circle at 35% 30%, #fff4b8, #e0a400 70%);
  border-color: #ffe27a;
  box-shadow: 0 0 6px rgba(255, 194, 51, 0.6);
}

.gc-next {
  font-size: 11px;
  color: var(--text-dim);
}

.medal-total {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 900;
  color: var(--gold);
  font-size: 14px;
}

/* ==== learning (question.mjs / drill / lesson) ==== */

/* 問題カードの 上の 行: ボタンの 字を 折りかえさない */
.q-head .q-no {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.q-actions {
  flex: none;
}

.q-actions .mini-btn {
  white-space: nowrap;
}

/* 算数の 分数は たての 形（教科書と おなじ）/ web/question.mjs の stackFractions */
.frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  line-height: 1.05;
  font-size: 0.78em;
  margin: 0 0.1em;
}

.frac-n,
.frac-d {
  display: block;
  padding: 0 0.18em;
}

.frac-n {
  border-bottom: 0.09em solid currentColor;
  padding-bottom: 0.04em;
}

.frac-d {
  padding-top: 0.04em;
}

.choice .frac {
  font-size: 0.85em;
}

.fb-choices .choice .frac {
  font-size: 1em;
}

/* リベンジ（まちがえた 問題を もう 1 回） */
.q-no.retry-tag {
  flex: none;
  overflow: visible;
  color: var(--gold);
  font-size: 15px;
  text-shadow: 0 0 10px rgba(255, 194, 51, 0.45);
}

.q-card.is-retry {
  border-color: var(--gold);
}

.fb.good.revenge {
  font-size: 28px;
  color: var(--gold);
}

/* 答えの あとの カード（教える 画面）: 選択肢・図・かいせつ・つぎは こう かんがえよう */
.fbcard {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fb-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.fb-head .fb {
  flex: 1;
  min-width: 0;
  margin: 0;
  line-height: 1.35;
}

.fb-head .fb.retry,
.fb-head .fb.study {
  font-size: 20px;
}

.fb-head .mini-btn {
  flex: none;
  min-height: 36px;
  padding: 4px 10px;
}

.fbcard .explain {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
}

.fbcard .gain {
  margin: 0;
}

.fb-choices {
  margin: 0;
  gap: 6px;
}

.fb-choices .choice,
.screen.battle.tallfig .bpanel .fb-choices .choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 4px 8px;
  font-size: 15px;
  line-height: 1.25;
  box-shadow: none;
  cursor: default;
}

.fb-choices .choice:not(.right):not(.wrong) {
  opacity: 0.55;
}

.fb-choices .choice.wrong,
.choice.wrong {
  border-color: #ff9aa8;
  background: linear-gradient(180deg, #d4405a, #97223a);
}

.fb-choices.ox .choice {
  min-height: 42px;
  font-size: 28px;
}

.fb-mark {
  font-style: normal;
  font-size: 0.8em;
  font-weight: 900;
  color: #fff;
}

.fb-fig {
  margin: 0;
}

.fbcard .fb-fig .fig,
.fbcard .fb-fig svg {
  max-height: 16dvh !important;
  width: auto;
}

.fb-think {
  margin: 0;
  border-left-color: var(--gold);
  font-size: 15px;
}

.fb-think b {
  color: var(--gold);
  font-size: 13px;
}

.fb-actions {
  flex: none;
  display: flex;
  gap: 8px;
}

.fb-actions .btn {
  flex: 1;
  min-width: 0;
}

.fb-actions .btn.big {
  min-height: 52px;
  padding: 8px 12px;
}

.fb-actions .btn.cyan {
  min-height: 52px;
  padding: 8px 10px;
  font-size: 15px;
  letter-spacing: 0;
}

.fb-actions.two .btn {
  font-size: 16px;
  white-space: nowrap;
  letter-spacing: 0;
}

/* マスター★（あがった ときの 行 / まなぶの カード / きろくの まなびの ちず） */
.star-up {
  margin: 0;
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(255, 194, 51, 0.14);
  color: var(--gold);
  font-weight: 800;
  font-size: 16px;
  animation: appear 0.5s;
}

.star-up b,
.lc-star,
.sm-stars,
.sm-chip b {
  color: var(--gold);
}

.star-map {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sm-unit {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.sm-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.sm-sub {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 800;
}

.sm-title {
  flex: 1;
  font-size: 16px;
}

.sm-stars {
  font-weight: 800;
  font-size: 14px;
}

.sm-bar {
  display: block;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.sm-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ffd766, var(--gold));
}

.sm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 12px;
  color: var(--text-dim);
}

/* まなぶ: きょうの ふくしゅう（いちばん 上） */
.learn-card.review {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(255, 194, 51, 0.16), var(--panel));
}

.learn-card.review .lc-tag {
  background: var(--gold);
  color: #3a2200;
}

.learn-card.review.done .lc-tag {
  background: var(--green);
  color: #062a14;
}

.learn-card:disabled {
  opacity: 0.55;
  cursor: default;
}

/* レッスン: 2 回 まちがえたら 答えを うすく 見せて いっしょに 入れる */
.g-ghost {
  opacity: 0.35;
}

.g-hint.together {
  color: var(--gold);
  font-weight: 800;
}

/* レッスンの「いっしょに とく」画面を 360x640 に おさめる（先生・図・欄・テンキー） */
.screen.lesson.step-guided {
  gap: 6px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

.screen.lesson.step-guided .topbar {
  margin-bottom: 0;
}

.screen.lesson.step-guided .teacher-img {
  width: 64px;
  height: 64px;
}

.screen.lesson.step-guided .bubble {
  padding: 8px 12px;
  font-size: 16px;
  line-height: 1.45;
}

.screen.lesson.step-guided .bubble small {
  font-size: 12px;
}

.screen.lesson.step-guided .lesson-fig .fig {
  max-height: 14dvh;
}

.screen.lesson.step-guided .guided {
  gap: 4px;
  padding: 8px 10px;
}

.screen.lesson.step-guided .g-row {
  font-size: 20px;
}

.screen.lesson.step-guided .g-box {
  height: 38px;
}

.screen.lesson.step-guided .g-hint {
  font-size: 14px;
}

.screen.lesson.step-guided .lesson-keys {
  gap: 6px;
}

.screen.lesson.step-guided .lesson-keys .key {
  height: clamp(38px, 6dvh, 52px);
}

/* ドリル: 1 画面（360×640）に おさめる。答える ところは バトルと おなじ .bpanel の 形 */
.screen.drill {
  height: 100dvh;
  min-height: 0;
  gap: 6px;
  padding-left: 10px;
  padding-right: 10px;
  padding-bottom: 0;
}

.screen.drill .topbar {
  margin-bottom: 0;
}

.screen.drill .topbar-title {
  font-size: clamp(16px, 5.4vw, 22px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ドリルは 上の 場面が ないので、答えの あとの 図を 大きめに */
.screen.drill .fbcard .fb-fig .fig,
.screen.drill .fbcard .fb-fig svg {
  max-height: 24dvh !important;
}

/* LINE の 中の ブラウザなど 低い 画面: 図の 問題で カードが 中で スクロールしないように */
@media (max-height: 600px) {
  .screen.drill .fbcard .fb-fig .fig,
  .screen.drill .fbcard .fb-fig svg {
    max-height: 15dvh !important;
  }

  .screen.battle.tallfig .q-visual .fig,
  .screen.battle.tallfig .q-visual svg {
    max-height: 19dvh !important;
  }

  .fbcard .fb-fig .fig,
  .fbcard .fb-fig svg {
    max-height: 13dvh !important;
  }

  .fbcard .explain {
    font-size: 15px;
    line-height: 1.5;
  }
}

.screen.drill .drill-panel {
  flex: 1 1 auto;
  min-height: 0;
  background: none;
  padding: 0 0 calc(10px + env(safe-area-inset-bottom));
}

/* ==== integration（ホームの まなぶ の ふくしゅうバッジ） ==== */
.btn[data-nav='learn'] {
  position: relative;
}
.nav-dot {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: #ff5a6e;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
/* ==== grades（4〜6 年の 学年拡張: 地図・まなぶの 学年見出し） ==== */
.map-grade,
.learn-grade {
  margin: 14px 4px 6px;
  font-size: 15px;
  font-weight: 800;
  color: var(--gold, #ffd76a);
  letter-spacing: 0.04em;
  grid-column: 1 / -1;
}
.map-grade:first-child {
  margin-top: 4px;
}

/* ==== learning 2 (visuals, example, analytics, listening) ==== */
/* たての ひっ算: はじめから 出すので 少し 大きめ（低い 画面では ちぢむ） */
.q-visual.q-hissan .fig,
.screen.battle.tallfig .q-visual.q-hissan .fig {
  max-height: 29dvh !important;
  width: auto;
}
.fig-hissan {
  max-width: 100%;
  height: auto;
}
.fbcard .fb-fig .fig-hissan,
.screen.drill .fbcard .fb-fig .fig-hissan {
  max-height: 22dvh !important;
}
@media (max-height: 600px) {
  .q-visual.q-hissan .fig,
  .screen.battle.tallfig .q-visual.q-hissan .fig {
    max-height: 24dvh !important;
  }
}
/* はじめての スキル: みほん / おしえて！を みる？ */
.intro-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-color: var(--cyan);
}
.intro-tag {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--cyan);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.3;
}
.intro-tag small {
  display: block;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 800;
}
.ex-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: rgba(63, 224, 255, 0.06);
}
.ex-q {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.ex-a {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}
.ex-a b {
  color: var(--gold);
  font-size: 22px;
}
.ex-box .explain {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}
.ex-fig {
  margin: 0;
}
.ex-fig .fig {
  max-height: 18dvh !important;
  width: auto;
}
.intro-offer {
  margin: 0;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(63, 224, 255, 0.1);
  color: var(--cyan);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.4;
}
.intro-offer small {
  display: block;
  color: var(--text-dim);
  font-size: 12px;
}
.bpanel .intro-card {
  overflow-y: auto;
  min-height: 0;
}
/* きいて えらぶ（えいご） */
.listen-q {
  font-size: clamp(17px, 2.8dvh, 22px);
}
.listen-btn {
  display: block;
  margin: 2px auto 4px;
  padding: 8px 26px;
  min-height: 52px;
  border: 2px solid var(--cyan);
  border-radius: 99px;
  background: linear-gradient(180deg, #1d3a8c, #142a66);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}
.listen-btn:active {
  transform: scale(0.96);
}
.listen-word {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
}
.listen-word b {
  color: var(--gold);
  font-size: 22px;
  letter-spacing: 0.02em;
}
.listen-word .mini-btn {
  min-height: 34px;
  padding: 2px 10px;
}
/* 保護者向けの 分析（きろく） */
.p-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 8px;
}
.p-btn {
  min-height: 42px;
  padding: 6px 12px;
  font-size: 14px;
  letter-spacing: 0;
}
.ptrend {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 96px;
  padding: 14px 2px 0;
  border-bottom: 2px solid var(--line);
}
.tday {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}
.tday i {
  display: block;
  width: 100%;
  max-width: 18px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--cyan), #1f7fa6);
}
.tday .tpct {
  font-size: 9px;
  line-height: 1;
  color: var(--text-dim);
  margin-bottom: 2px;
}
.tday small {
  position: absolute;
  bottom: -16px;
  font-size: 10px;
  color: var(--text-dim);
}
.ptrend + .p-note {
  margin-top: 20px;
}
.p-lessons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.p-lesson {
  border: 2px solid var(--line);
  border-radius: 99px;
  background: #1a2358;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 4px 10px;
  cursor: pointer;
}
.p-lesson.done {
  border-color: var(--green);
  color: var(--green);
}
.ptable.p-notes td:first-child {
  max-width: 120px;
  overflow-wrap: anywhere;
}
.ptable.p-notes td:last-child,
.ptable.p-skills td:last-child {
  white-space: nowrap;
}

/* ==== growth 2 (missions, chest, boss, shop, team) ==== */

/* ---- きょうの ミッション（ホームの チップ + シート） */
.home-ms-chip {
  position: absolute;
  bottom: 8px;
  right: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  border: 2px solid var(--cyan);
  background: rgba(6, 12, 40, 0.8);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}
.home-ms-chip.claim {
  border-color: var(--gold);
  color: var(--gold);
  animation: glowp 1.6s ease-in-out infinite;
}
.home-ms-chip.all {
  border-color: var(--green);
  color: #b8ffd6;
}
.ms-dot {
  display: inline-block;
  margin-left: 5px;
  width: 18px;
  height: 18px;
  line-height: 18px;
  border-radius: 50%;
  background: #ff5a6e;
  color: #fff;
  font-style: normal;
  font-size: 12px;
  text-align: center;
}
.overlay.fx-missions {
  justify-content: flex-start;
  padding: calc(14px + env(safe-area-inset-top)) 12px 12px;
  background: rgba(3, 4, 14, 0.92);
  overflow-y: auto;
}
.ms-sheet {
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  animation: appear 0.3s;
}
.ms-title {
  margin: 0;
  text-align: center;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 22px;
  color: var(--gold);
}
.ms-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ms-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(8, 14, 44, 0.8);
  border: 2px solid var(--line);
}
.ms-item.done {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(255, 194, 51, 0.3);
}
.ms-item.claimed {
  opacity: 0.75;
}
.ms-num {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--line);
  font-weight: 900;
}
.ms-item.done .ms-num,
.ms-item.claimed .ms-num {
  background: var(--green);
  color: #06301a;
}
.ms-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ms-body b {
  font-size: 15px;
  line-height: 1.35;
}
.ms-hint {
  font-size: 12px;
  color: var(--text-dim);
}
.ms-prog {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ms-bar {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: #0a0f2c;
  overflow: hidden;
  border: 1px solid var(--line);
}
.ms-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--green));
}
.ms-prog small {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 800;
}
.ms-side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 72px;
}
.ms-reward {
  display: flex;
  align-items: center;
  gap: 2px;
  font-weight: 900;
  font-size: 14px;
}
.ms-rw-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}
.ms-claim {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 14px;
}
.ms-got {
  font-size: 12px;
  font-weight: 900;
  color: var(--green);
}
.ms-card {
  padding: 10px;
  border-radius: 12px;
  background: rgba(40, 24, 80, 0.6);
  border: 2px dashed var(--violet);
  text-align: center;
}
.ms-card small {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 800;
}
.ms-stamps {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}
.ms-stamp {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px dashed #6b5ab8;
  color: #4a2400;
  font-size: 18px;
  font-weight: 900;
}
.ms-stamp.on {
  border: 2px solid var(--gold);
  background: radial-gradient(circle at 35% 30%, #fff3b0, var(--gold) 55%, var(--gold-deep));
}
.ms-stamp.goal {
  border-color: var(--cyan);
}
.ms-stamp.goal.on {
  background: radial-gradient(circle, #bff4ff, var(--cyan));
}
.ms-goal-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.ms-stamp.pop {
  animation: ms-stamp-pop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes ms-stamp-pop {
  0% {
    transform: scale(2.2) rotate(-20deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}
.ms-note {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}
.ms-close {
  align-self: center;
  min-width: 160px;
}
.ms-result {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--gold);
}

/* ---- たからばこ（インライン SVG / 閉じ → ふたが あいて 光の はしら） */
.enemy-sprite.chest-host {
  display: grid;
  place-items: end center;
}
.chest {
  position: relative;
  width: 92%;
  max-width: 150px;
  aspect-ratio: 12 / 11;
  cursor: pointer;
  animation: chest-idle 2.4s ease-in-out infinite;
}
.chest-svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.45));
}
.chest-lid {
  transform-box: view-box;
  transform-origin: 60px 50px;
  transition: transform 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.chest.open .chest-lid {
  transform: translate(-10px, -18px) rotate(-28deg) scaleY(0.8);
}
.chest-inner {
  opacity: 0;
  transition: opacity 0.3s;
}
.chest.open .chest-inner {
  opacity: 1;
}
.chest-gem {
  filter: drop-shadow(0 0 3px #3fe0ff);
}
.chest-light {
  position: absolute;
  left: 50%;
  bottom: 40%;
  width: 150%;
  height: 170%;
  transform: translateX(-50%) scaleY(0.2);
  transform-origin: 50% 100%;
  background:
    radial-gradient(ellipse 30% 55% at 50% 100%, rgba(255, 255, 255, 0.95), rgba(255, 226, 122, 0.55) 45%, transparent 75%),
    repeating-conic-gradient(from -30deg at 50% 100%, rgba(255, 236, 160, 0.5) 0deg 6deg, transparent 6deg 16deg);
  -webkit-mask-image: linear-gradient(to top, #000 30%, transparent 95%);
  mask-image: linear-gradient(to top, #000 30%, transparent 95%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s, transform 0.5s cubic-bezier(0.2, 1.2, 0.4, 1);
}
.chest.open .chest-light {
  opacity: 1;
  transform: translateX(-50%) scaleY(1);
}
.chest-sparks {
  position: absolute;
  inset: -20% -10% 20%;
  z-index: 2;
  pointer-events: none;
}
.chest-sparks i {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fff6c8;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: 0;
}
.chest.open .chest-sparks i {
  animation: chest-spark 1.6s ease-out infinite;
}
.chest-sparks i:nth-child(1) { left: 20%; top: 40%; animation-delay: 0s; }
.chest-sparks i:nth-child(2) { left: 70%; top: 30%; animation-delay: 0.2s; }
.chest-sparks i:nth-child(3) { left: 45%; top: 10%; animation-delay: 0.45s; }
.chest-sparks i:nth-child(4) { left: 85%; top: 55%; animation-delay: 0.7s; }
.chest-sparks i:nth-child(5) { left: 8%; top: 60%; animation-delay: 0.9s; }
.chest-sparks i:nth-child(6) { left: 58%; top: 50%; animation-delay: 1.1s; }
.chest-sparks i:nth-child(7) { left: 32%; top: 22%; animation-delay: 1.25s; }
.chest-sparks i:nth-child(8) { left: 62%; top: 4%; animation-delay: 1.4s; }
@keyframes chest-spark {
  0% { opacity: 0; transform: translateY(8px) scale(0.4); }
  30% { opacity: 1; transform: translateY(0) scale(1.1); }
  100% { opacity: 0; transform: translateY(-26px) scale(0.6) rotate(90deg); }
}
@keyframes chest-idle {
  0%, 82%, 100% { transform: rotate(0deg); }
  86% { transform: rotate(-4deg); }
  90% { transform: rotate(4deg); }
  94% { transform: rotate(-2deg); }
}
.chest.open {
  animation: none;
}
.chest.chest-wiggle {
  animation: chest-wiggle 0.46s ease;
}
@keyframes chest-wiggle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  20% { transform: translateY(-4px) rotate(-6deg); }
  45% { transform: translateY(-6px) rotate(6deg); }
  70% { transform: translateY(-2px) rotate(-3deg); }
}
.chest-prize {
  position: absolute;
  left: 58%;
  bottom: 80%;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 2px;
  transform: translateX(-50%);
  font-weight: 900;
  font-size: 20px;
  color: #fff;
  text-shadow: 0 2px 0 #10081f, 0 0 8px #ffc233;
  pointer-events: none;
}
.chest-prize-img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255, 226, 122, 0.9));
}
.chest-prize.pop {
  animation: chest-prize 0.7s cubic-bezier(0.2, 1.5, 0.4, 1);
}
@keyframes chest-prize {
  from { transform: translate(-50%, 50px) scale(0.3); opacity: 0; }
}
.pip.chest {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  transform: rotate(45deg);
  background: #b8791c;
  box-shadow: 0 0 0 2px rgba(255, 226, 122, 0.6);
}
.pip.chest.now,
.pip.chest.done {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

/* ---- かがやく アニマ（金の ひかり + きらきら / 絵は そのまま） */
.shiny-tag {
  background: linear-gradient(90deg, #ffb300, #fff3b0, #ffb300);
  color: #3a2200;
  border-radius: 6px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 900;
}
.shiny-tip {
  color: #ffe27a;
  font-weight: 900;
}
.enemy-spot.shiny .enemy-img {
  filter: drop-shadow(0 0 4px #fff3b0) drop-shadow(0 0 12px #ffc233) drop-shadow(0 6px 6px rgba(0, 0, 0, 0.4)) saturate(1.25) brightness(1.08);
}
.enemy-spot.shiny::before {
  content: '';
  position: absolute;
  inset: 5% -5% -4%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 60%, rgba(255, 214, 90, 0.5), transparent 62%);
  animation: shiny-pulse 1.8s ease-in-out infinite;
  pointer-events: none;
}
.shiny-sparks {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.shiny-sparks i {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fffbe0;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  filter: drop-shadow(0 0 4px #ffc233);
  animation: shiny-twinkle 1.5s ease-in-out infinite;
}
.shiny-sparks i:nth-child(1) { left: 10%; top: 30%; animation-delay: 0s; }
.shiny-sparks i:nth-child(2) { left: 78%; top: 18%; animation-delay: 0.3s; width: 16px; height: 16px; }
.shiny-sparks i:nth-child(3) { left: 55%; top: 62%; animation-delay: 0.6s; }
.shiny-sparks i:nth-child(4) { left: 25%; top: 75%; animation-delay: 0.9s; width: 9px; height: 9px; }
.shiny-sparks i:nth-child(5) { left: 88%; top: 58%; animation-delay: 1.1s; }
.shiny-sparks i:nth-child(6) { left: 40%; top: 8%; animation-delay: 0.45s; width: 9px; height: 9px; }
.shiny-sparks i:nth-child(7) { left: 66%; top: 40%; animation-delay: 1.3s; width: 8px; height: 8px; }
@keyframes shiny-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.3) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(45deg); }
}
@keyframes shiny-pulse {
  50% { opacity: 0.55; transform: scale(1.08); }
}
[data-motion='less'] .shiny-sparks i {
  opacity: 0.9;
  transform: none;
}
.x2 {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, #ffb300, #fff3b0);
  color: #3a2200;
  font-size: 13px;
  font-weight: 900;
}

/* ---- ボス: ★・よびな・ためこうげき（赤い オーラ + 帯）→ カウンター */
.boss-star {
  margin-left: 3px;
  font-style: normal;
  color: #ffe27a;
}
.boss-title-tip {
  color: #ffd0d8;
  font-weight: 900;
}
.boss-stars {
  color: var(--gold);
  letter-spacing: 1px;
}
.enemy-spot.charging .enemy-img {
  filter: drop-shadow(0 0 6px #ff3b3b) drop-shadow(0 0 16px #ff2a2a) drop-shadow(0 6px 6px rgba(0, 0, 0, 0.4));
}
.enemy-spot.charging::after {
  content: '';
  position: absolute;
  inset: -6% -10% -6%;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 62%, rgba(255, 60, 60, 0.55), rgba(255, 30, 30, 0.18) 45%, transparent 66%);
  animation: boss-charge 0.9s ease-in-out infinite;
  pointer-events: none;
}
@keyframes boss-charge {
  0%, 100% { transform: scale(0.92); opacity: 0.75; }
  50% { transform: scale(1.1); opacity: 1; }
}
.boss-band {
  position: absolute;
  left: 0;
  right: 0;
  top: 38%;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 8px;
  background: linear-gradient(90deg, rgba(120, 0, 10, 0), rgba(160, 10, 24, 0.92) 12%, rgba(160, 10, 24, 0.92) 88%, rgba(120, 0, 10, 0));
  border-top: 2px solid #ff8a8a;
  border-bottom: 2px solid #ff8a8a;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 0 #3a0008;
  pointer-events: none;
  animation: boss-band-in 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
  transition: top 0.35s ease, left 0.35s ease, right 0.35s ease, padding 0.35s ease;
}
.boss-band b {
  font-size: 17px;
  font-weight: 900;
}
.boss-band small {
  font-size: 14px;
  font-weight: 900;
  color: #ffe27a;
}
.boss-band.mini {
  top: calc(4px + env(safe-area-inset-top));
  left: auto;
  right: 4px;
  max-width: 44%;
  padding: 3px 8px;
  border: 2px solid #ff8a8a;
  border-radius: 10px;
  background: rgba(150, 10, 24, 0.9);
  animation: boss-band-pulse 1.2s ease-in-out infinite;
}
.boss-band.mini b {
  display: none;
}
.boss-band.mini small {
  font-size: 12px;
}
@keyframes boss-band-in {
  from { transform: scaleY(0); opacity: 0; }
}
@keyframes boss-band-pulse {
  50% { box-shadow: 0 0 12px rgba(255, 70, 70, 0.9); }
}
.float-text.counter {
  top: 22%;
  font-size: 38px;
  color: #ffdf5a;
  text-shadow: 0 3px 0 #6b0010, 0 0 14px rgba(255, 60, 60, 0.9);
}

/* ---- タマゴの 色（egg.png 1 まい + filter）・きらきらタマゴ・ショップの えらぶ シート */
.egg-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
}
.egg-tinted {
  filter: var(--egg-f, none);
}
.egg-t-fire { --egg-f: hue-rotate(-160deg) saturate(1.5); }
.egg-t-water { --egg-f: hue-rotate(36deg) saturate(1.3); }
.egg-t-grass { --egg-f: hue-rotate(-42deg) saturate(1.2); }
.egg-t-thunder { --egg-f: hue-rotate(-128deg) saturate(1.9) brightness(1.2); }
.egg-t-wind { --egg-f: hue-rotate(-12deg) saturate(0.9) brightness(1.12); }
.egg-t-earth { --egg-f: hue-rotate(-145deg) saturate(0.75) brightness(0.88); }
.egg-t-ice { --egg-f: hue-rotate(22deg) saturate(0.55) brightness(1.3); }
.egg-t-steel { --egg-f: grayscale(0.9) brightness(1.15) contrast(1.05); }
.egg-t-shadow { --egg-f: hue-rotate(88deg) saturate(1.25) brightness(0.8); }
.egg-t-light { --egg-f: hue-rotate(-140deg) saturate(0.55) brightness(1.55); }
.egg-rare { --egg-f: saturate(0.2) brightness(1.4) contrast(0.95); }
.egg-shimmer {
  position: absolute;
  inset: 0;
  -webkit-mask: url('assets/items/egg.png') center / contain no-repeat;
  mask: url('assets/items/egg.png') center / contain no-repeat;
  background:
    linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.9) 45%, transparent 60%),
    linear-gradient(160deg, rgba(255, 110, 200, 0.7), rgba(255, 230, 110, 0.65), rgba(110, 240, 200, 0.65), rgba(110, 160, 255, 0.7), rgba(220, 130, 255, 0.7));
  background-size: 250% 100%, 100% 100%;
  mix-blend-mode: overlay;
  animation: egg-sheen 2.8s linear infinite;
  pointer-events: none;
}
@keyframes egg-sheen {
  from { background-position: 120% 0, 0 0; }
  to { background-position: -120% 0, 0 0; }
}
.egg-twinkle {
  position: absolute;
  top: 6%;
  right: -4%;
  width: 14px;
  height: 14px;
  background: #fffbe0;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  filter: drop-shadow(0 0 4px #ff9be0);
  animation: shiny-twinkle 1.6s ease-in-out infinite;
  pointer-events: none;
}
.egg-twinkle.b {
  top: 58%;
  right: auto;
  left: -6%;
  width: 10px;
  height: 10px;
  animation-delay: 0.8s;
}
.fx-hatch .hatch-egg.glow.egg-tinted {
  filter: var(--egg-f) drop-shadow(0 0 14px var(--glow, #fff)) drop-shadow(0 0 28px var(--glow, #fff));
}
.fx-hatch .hatch-egg.glow.shake3.egg-tinted {
  filter: var(--egg-f) brightness(1.4) drop-shadow(0 0 22px var(--glow, #fff)) drop-shadow(0 0 44px var(--glow, #fff));
}
.egg-slots.four {
  grid-template-columns: repeat(2, 1fr);
}
.egg-slots.four .egg-slot {
  min-height: 168px;
}
.egg-name {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--tc, var(--line-hi));
  color: #0b1026;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.6;
}
.egg-name.rare {
  background: linear-gradient(90deg, #ffc8ee, #fff3b0, #b8f5ff);
}
.shop-egg {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
}
.shop-egg-img {
  width: 46px;
  height: 56px;
  object-fit: contain;
}
.shop-egg.cycle .egg-tinted {
  animation: egg-hue 5s linear infinite;
}
@keyframes egg-hue {
  from { filter: hue-rotate(-160deg) saturate(1.5); }
  to { filter: hue-rotate(200deg) saturate(1.5); }
}
.slot-plus {
  position: absolute;
  right: 0;
  bottom: 2px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--gold);
  color: #2a1600;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.5;
}
.shop-bg {
  flex: none;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  border: 2px solid var(--line-hi);
}
.pick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pick-sheet.bg .pick-grid {
  grid-template-columns: repeat(2, 1fr);
}
.pick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: rgba(8, 14, 44, 0.8);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.pick-item.on {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(255, 194, 51, 0.35);
}
.pick-item b {
  font-size: 14px;
}
.pick-item small {
  font-size: 11px;
  color: var(--text-dim);
}
.pick-egg {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--tc) 40%, transparent), transparent 70%);
}
.pick-egg-img {
  width: 38px;
  height: 46px;
  object-fit: contain;
}
.pick-bg {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
}

/* ---- かさねる（ダブりだけ / わたす 先 / たしかめる / 「ちからを うけとった！」） */
.seg-btn.dup-btn.on {
  border-color: var(--gold);
  color: var(--gold);
}
.dup-tip {
  margin: 4px 2px 8px;
  font-size: 13px;
}
.merge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 10px;
}
.merge-btn {
  flex: none;
  min-height: 40px;
  padding: 8px 16px;
}
.merge-row small {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}
.pick-mon {
  width: 64px;
  height: 64px;
  object-fit: contain;
}
.merge-card {
  align-items: center;
  text-align: center;
}
.merge-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.mp-mon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 14px;
}
.mp-img {
  width: 96px;
  height: 96px;
  object-fit: contain;
}
.mp-mon.to .mp-img {
  filter: drop-shadow(0 0 10px var(--gold));
}
.mp-arrow {
  color: var(--gold);
  font-size: 22px;
}
.merge-text {
  margin: 0;
  font-weight: 800;
  line-height: 1.5;
}
.merge-gain {
  margin: 0;
  color: var(--gold);
  font-weight: 900;
}
.overlay.fx-merge-play {
  justify-content: center;
  background: rgba(3, 4, 14, 0.98);
}
.merge-fx {
  position: relative;
  width: min(100%, 360px);
  height: min(86dvh, 480px);
}
.mf-glow {
  position: absolute;
  left: 50%;
  top: 30%;
  width: 300px;
  height: 300px;
  transform: translate(-50%, -50%) scale(0.6);
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--tc) 70%, #fff), color-mix(in srgb, var(--tc) 30%, transparent) 40%, transparent 70%);
  opacity: 0.5;
}
.mf-to {
  position: absolute;
  left: 50%;
  top: 30%;
  width: 210px;
  height: 210px;
  transform: translate(-50%, -50%);
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.5));
}
.mf-from {
  position: absolute;
  left: 4%;
  top: 62%;
  width: 104px;
  height: 104px;
  object-fit: contain;
  transition: transform 0.95s cubic-bezier(0.55, 0, 0.6, 1), opacity 0.95s, filter 0.95s;
}
.merge-fx.go .mf-from {
  transform: translate(120px, -170px) scale(0.15) rotate(30deg);
  opacity: 0;
  filter: brightness(3) drop-shadow(0 0 20px #fff);
}
.merge-fx.hit .mf-glow {
  animation: mf-burst 0.7s ease-out forwards;
}
.merge-fx.hit .mf-to {
  animation: mf-pulse 0.6s ease;
}
@keyframes mf-burst {
  0% { transform: translate(-50%, -50%) scale(0.6); opacity: 0.5; }
  40% { transform: translate(-50%, -50%) scale(1.25); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
}
@keyframes mf-pulse {
  40% { transform: translate(-50%, -50%) scale(1.12); filter: brightness(1.8) drop-shadow(0 0 24px var(--tc)); }
}
.mf-text {
  position: absolute;
  left: 0;
  right: 0;
  top: 56%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.mf-text b {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 26px;
  color: var(--gold);
  text-shadow: 0 3px 0 #2a1600;
  animation: appear 0.45s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.mf-text span {
  font-size: 14px;
  font-weight: 800;
}
.mf-text .mf-lv {
  color: var(--green);
}
.merge-fx .evo-ok {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  min-width: 180px;
}

/* ---- チーム 3 たい（たたかう 前の こうたい / ホームの うしろの 2 たい / なかま画面） */
.team-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 2px 0 10px;
}
.team-mon {
  position: relative;
  flex: 1 1 0;
  max-width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 2px 3px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--tc) 30%, transparent), rgba(8, 14, 44, 0.85) 72%);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.team-mon:disabled {
  cursor: default;
}
.team-mon.on {
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(63, 224, 255, 0.45);
}
.team-mon.adv:not(.on) {
  border-color: var(--gold);
  animation: glowp 1.4s ease-in-out infinite;
}
.team-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}
.team-mon small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
}
.team-good {
  position: absolute;
  top: -8px;
  right: -4px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gold);
  color: #2a1600;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.6;
}
.team-mon.on .team-good {
  background: var(--green);
  color: #06301a;
}
.partner-stage .partner-img {
  z-index: 1;
}
.home-mate {
  position: absolute;
  bottom: 36px;
  z-index: 0;
  width: 30%;
  height: 36%;
  object-fit: contain;
  object-position: bottom;
  pointer-events: none;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.45)) brightness(0.92);
  animation: bob 3.6s ease-in-out infinite;
}
.home-mate.l {
  left: 0;
  transform: scaleX(-1);
  animation-name: mate-bob-flip;
}
.home-mate.r {
  right: 0;
  animation-delay: -1.7s;
}
@keyframes mate-bob-flip {
  0%, 100% { transform: scaleX(-1) translateY(0); }
  50% { transform: scaleX(-1) translateY(-6px); }
}
.mon-cell.mate {
  border-color: var(--cyan);
}
.cell-team {
  position: absolute;
  top: 4px;
  left: 6px;
  z-index: 1;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--cyan);
  color: #04212c;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.6;
}
.team-strip {
  margin-top: 12px;
}
.ts-lbl {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--text-dim);
}
.ts-row {
  display: flex;
  gap: 6px;
}
.ts-cell {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 2px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--tc, #2c3c86) 28%, transparent), rgba(8, 14, 44, 0.8) 72%);
  min-height: 64px;
  justify-content: center;
}
.ts-cell.lead {
  border-color: var(--gold);
}
.ts-cell.empty {
  border-style: dashed;
  color: var(--text-dim);
}
.ts-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.ts-cell small {
  font-size: 11px;
  font-weight: 800;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rw-cheer {
  font-size: 14px;
}

/* ==== 地図・国旗（日本地図 = Natural Earth・パブリックドメイン / 国旗 = flag-icons・MIT） ==== */
.q-visual .japan-map {
  width: min(310px, 82vw);
  height: auto;
  max-height: 42dvh;
}
.q-visual .flag-fig {
  display: block;
  margin: 2px auto;
  width: min(200px, 56vw);
  height: auto;
  border-radius: 6px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 4px 10px rgba(0, 0, 0, 0.45);
  background: #fff;
}
.screen.battle.tallfig .q-visual .flag-fig {
  width: auto;
  max-height: 22dvh;
}
.choice .choice-flag {
  display: block;
  margin: 0 auto;
  width: min(84px, 22vw);
  height: auto;
  border-radius: 4px;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.8);
  background: #fff;
  pointer-events: none;
}
.fb .choice-flag,
.fb-choices .choice-flag {
  width: min(60px, 16vw);
}
.fb .choice-flag {
  display: inline-block;
  vertical-align: middle;
}
/* ==== 相手の HP = バーの 中に 数字（2026-10-01 Arche） ==== */
.enemy-info .hp.hp-in {
  position: relative;
  height: 16px;
  overflow: hidden;
}
.enemy-info .hp.hp-in .hp-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 0 2px #0a1030, 0 1px 2px #0a1030, 0 0 4px #0a1030;
  letter-spacing: 0.02em;
}
.enemy-info .hp.hp-in .hp-num small {
  font-size: 10px;
  opacity: 0.85;
  margin-left: 1px;
}
.screen.battle.tallfig .enemy-info .hp.hp-in {
  height: 12px;
}
.screen.battle.tallfig .enemy-info .hp.hp-in .hp-num {
  font-size: 10px;
}

/* ==== がぞうを たんまつに ほぞん（せってい / web/offline.mjs） ==== */
.img-dl [hidden] {
  display: none !important;
}
.img-dl .dl-bar {
  height: 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin: 4px 0 8px;
}
.img-dl .dl-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #4fd1ff, #7dffb0);
  transition: width 0.25s ease;
}
.img-dl .dl-tip {
  font-size: 12px;
  opacity: 0.75;
}

/* ==== ちょうせんステージ（src/challenge.mjs）: 時間制限の バー・つよい ボス・マップの 見出し ==== */
.q-timer {
  position: relative;
  flex: 0 0 auto;
  height: 22px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  overflow: hidden;
}
.q-timer i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: linear-gradient(90deg, #36d17c, #9dff6b);
  transition: width 0.1s linear;
}
.q-timer b {
  position: relative;
  display: block;
  text-align: center;
  font-size: 13px;
  line-height: 20px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 2px #061028, 0 0 3px #061028;
}
.q-timer.hurry {
  border-color: #ff6b6b;
  animation: timer-pulse 0.5s ease-in-out infinite alternate;
}
.q-timer.hurry i {
  background: linear-gradient(90deg, #ff4d4d, #ffb347);
}
@keyframes timer-pulse {
  to {
    box-shadow: 0 0 10px rgba(255, 77, 77, 0.8);
  }
}
@media (prefers-reduced-motion: reduce) {
  .q-timer.hurry {
    animation: none;
  }
}
.boss-tag.strong {
  background: linear-gradient(90deg, #ff3b5c, #ff8a00);
  color: #fff;
}
.timed-tag {
  margin-left: 4px;
  font-size: 13px;
}
.tip.timed-tip {
  color: #ffd166;
  font-weight: 800;
}
.fb.timeout {
  color: #ff8a8a;
}
.map-grade.challenge {
  color: #ff8a5c;
}
.map-grade.challenge small {
  display: block;
  font-size: 12px;
  color: #ffd166;
  font-weight: 700;
}
.area-card.challenge {
  border-color: #ff7a45;
  box-shadow: 0 0 0 1px rgba(255, 122, 69, 0.5), 0 0 14px rgba(255, 90, 40, 0.25);
}

/* ==== 確認（ちゅうだん・やめる / web/ui.mjs confirmBox） ==== */
.confirm-box {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 8, 24, 0.72);
}
.confirm-card {
  width: min(360px, 100%);
  display: grid;
  gap: 10px;
  padding: 18px 16px;
  border-radius: 18px;
  background: var(--panel-solid, #141d48);
  border: 2px solid var(--line-hi, #4d67d8);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  text-align: center;
}
.confirm-title {
  margin: 0;
  font-size: 19px;
  font-weight: 900;
}
.confirm-text {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.55;
  opacity: 0.9;
}
/* バトルの ⏸（場面の 右上 / 相手の 情報〔左上〕・自分の 情報〔右下〕と かさならない） */
.screen.battle.result-mode .battle-pause {
  display: none;
}
.battle-pause {
  position: absolute;
  right: 6px;
  top: calc(6px + env(safe-area-inset-top));
  z-index: 25;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(8, 14, 40, 0.72);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}
