* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: #BCE7E7;
  color: #102C25;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font-family: inherit; }
button { cursor: pointer; }
.app {
  height: 100%;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: #F6EFE6;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.name-field input {
  -webkit-user-select: text;
  user-select: text;
}

.screen { display: none; }
.screen.on {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ---------- 村口 ---------- */
#screenHome {
  background: linear-gradient(180deg, #8FD0F5 0%, #FFE3A3 46%, #FF9A4A 72%, #F6EFE6 100%);
  overflow: auto;
}
.art {
  position: relative;
  flex: 1 1 auto;
  min-height: 168px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sun {
  position: absolute;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  right: -46px;
  top: -36px;
  background: radial-gradient(circle at 38% 38%, #FFF6D0 0%, #FFD56A 32%, #FF8A3D 70%, rgba(255, 138, 61, 0) 72%);
  pointer-events: none;
}
.sun-sm {
  width: 140px;
  height: 140px;
  right: -30px;
  top: 8px;
  opacity: .95;
}
.cloud {
  position: absolute;
  height: 18px;
  background: rgba(255, 255, 255, .82);
  border-radius: 20px;
  pointer-events: none;
  box-shadow: 0 6px 0 rgba(255, 255, 255, .35);
}
.cloud:before, .cloud:after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.cloud:before { width: 22px; height: 22px; left: 10px; top: -12px; }
.cloud:after { width: 28px; height: 28px; right: 12px; top: -16px; }
.c1 { width: 84px; left: 18px; top: 78px; }
.c2 { width: 64px; left: 46%; top: 46px; opacity: .75; }
.c3 { width: 72px; left: 16px; top: 72px; }
.shuriken {
  position: absolute;
  width: 28px;
  height: 28px;
  background: #F4F7FA;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  box-shadow: 0 4px 0 rgba(80, 40, 10, .12);
  z-index: 2;
  pointer-events: none;
}
.shuriken:after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #FF8A3D;
}
.s1 { left: 22px; top: 132px; animation: spin 7s linear infinite; }
.s2 { right: 28px; top: 168px; width: 18px; height: 18px; animation: spin 5s linear infinite reverse; opacity: .9; }
@keyframes spin { to { transform: rotate(360deg); } }
.mtn {
  position: absolute;
  bottom: 48px;
  width: 0;
  height: 0;
  border-left: 110px solid transparent;
  border-right: 110px solid transparent;
  border-bottom: 86px solid #938E4C;
  pointer-events: none;
  z-index: 0;
}
.m1 { left: -40px; border-bottom-color: #A49D58; }
.m2 { right: -30px; border-bottom-width: 70px; border-bottom-color: #867C3D; }
.logo-wrap {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: calc(14px + env(safe-area-inset-top)) 16px 0;
}
.logo {
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.08em;
  color: #FFFDF8;
  text-shadow: 0 3px 0 #12C6A7, 0 8px 0 rgba(120, 40, 0, .18);
}
.tagline {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #0E7A60;
}
.hero-slot {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  z-index: 2;
  padding-bottom: 42px;
  min-height: 180px;
}
.village {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  z-index: 1;
  pointer-events: none;
}
.house { width: 42px; }
.house .roof {
  display: block;
  width: 0;
  height: 0;
  margin-left: -6px;
  border-left: 27px solid transparent;
  border-right: 27px solid transparent;
  border-bottom: 16px solid #3BA36C;
}
.house .roof.alt { border-bottom-color: #286E64; }
.house .wall {
  display: block;
  height: 24px;
  background: #F6E2C4;
  border-radius: 0 0 3px 3px;
  box-shadow: inset 0 -8px 0 rgba(180, 110, 50, .15);
}
.house.tall .wall { height: 34px; }
.ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42px;
  background: linear-gradient(#624AA8, #49327A);
  z-index: 0;
}
.dock {
  position: relative;
  z-index: 4;
  margin-top: -16px;
  padding: 8px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(246, 239, 230, 0), #F6EFE6 20px);
}
.name-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 12px;
  background: #FFF9F2;
  border: 1px solid #BCE4E3;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(80, 40, 10, .06);
}
.name-field .mp-icon { width: 22px; height: 22px; color: #FF8A3D; flex: none; }
.name-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #102C25;
  font-size: 16px;
  font-weight: 800;
  outline: none;
}
.name-field input::placeholder { color: #84B8B2; font-weight: 700; }
.name-field:focus-within { border-color: #FF8A3D; }
.howto {
  margin: 12px 0;
  padding: 2px 12px;
  background: #FFF9F2;
  border: 1px solid #EADCCB;
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(80, 40, 10, .06);
}
.how {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.how + .how { border-top: 1px solid #F0E2D2; }
.how .mp-icon { width: 22px; height: 22px; color: #FF8A3D; flex: none; }
.how b { display: block; font-size: 14px; font-weight: 800; color: #102C25; }
.how span { display: block; margin-top: 1px; font-size: 12px; color: #588C86; }
.best {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  color: #588C86;
  font-size: 13px;
}
.best .mp-icon { width: 18px; height: 18px; color: #2AE5E8; }
.best b { color: #1EE8C8; font-size: 16px; }

.btn-main, .btn-ghost {
  width: 100%;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 900;
  letter-spacing: 0.06em;
}
.btn-main {
  height: 54px;
  border: 0;
  background: linear-gradient(180deg, #FFB067 0%, #FF8A3D 42%, #20F0D3 100%);
  color: #043A2F;
  font-size: 18px;
  box-shadow: 0 5px 0 #12C6A7, 0 12px 20px rgba(224, 100, 20, .28);
}
.btn-main:active { transform: translateY(4px); box-shadow: 0 1px 0 #12C6A7; }
.btn-main .mp-icon, .btn-ghost .mp-icon { width: 22px; height: 22px; }
.btn-ghost {
  height: 48px;
  background: #FFF9F2;
  border: 1px solid #BCE4E3;
  color: #346A63;
  font-size: 16px;
  box-shadow: 0 3px 0 #BCE7E7;
}
.btn-ghost:active { transform: translateY(2px); box-shadow: 0 1px 0 #BCE7E7; }

/* ---------- 忍者 ---------- */
.bob-wrap { animation: bob 1.8s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.ninja {
  position: relative;
  width: 150px;
  height: 188px;
  --hair: #183A34;
  --cloth: #FF8A3D;
  --scarf: #182A29;
  --skin: #F6C9A6;
}
.tone-hero { --hair: #F6C445; --cloth: #FF8A3D; --scarf: #182A29; --skin: #F8D0AE; }
.tone-sand { --hair: #57CDE2; --cloth: #3AC9C7; --scarf: #2B8C87; --skin: #A4F0EB; }
.tone-mist { --hair: #D5DEE8; --cloth: #8C4E51; --scarf: #E7EEF4; --skin: #B4F0E4; }
.tone-rock { --hair: #6E6A66; --cloth: #427A74; --scarf: #2C3E3C; --skin: #A0E8E2; }
.tone-cloud { --hair: #F7F4EE; --cloth: #7F4331; --scarf: #F4F4F4; --skin: #F6D0B4; }
.tone-sound { --hair: #DCE0A6; --cloth: #687034; --scarf: #E7D2F5; --skin: #B4F0E0; }
.tone-rogue { --hair: #2A2428; --cloth: #242228; --scarf: #3AD281; --skin: #9AE8DC; }
.spikes { position: absolute; left: 28px; top: 0; width: 94px; height: 52px; z-index: 1; }
.spikes span {
  position: absolute;
  bottom: 0;
  width: 18px;
  border-radius: 12px 12px 4px 4px;
  background: var(--hair);
  transform-origin: 50% 100%;
}
.spikes span:nth-child(1) { left: 0; height: 34px; transform: rotate(-36deg); }
.spikes span:nth-child(2) { left: 16px; height: 46px; transform: rotate(-16deg); }
.spikes span:nth-child(3) { left: 38px; height: 52px; }
.spikes span:nth-child(4) { left: 58px; height: 46px; transform: rotate(16deg); }
.spikes span:nth-child(5) { left: 76px; height: 34px; transform: rotate(36deg); }
.head {
  position: absolute;
  left: 36px;
  top: 38px;
  width: 78px;
  height: 66px;
  background: var(--skin);
  border-radius: 36px 36px 30px 30px;
  z-index: 2;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .05);
}
.band {
  position: absolute;
  left: -6px;
  right: -6px;
  top: 16px;
  height: 14px;
  background: #242424;
  z-index: 3;
}
.plate {
  position: absolute;
  left: 50%;
  top: -4px;
  width: 26px;
  height: 22px;
  margin-left: -13px;
  background: linear-gradient(#fff, #d9d9d9);
  border-radius: 2px;
  box-shadow: 0 1px 0 #9a9a9a;
}
.leaf {
  display: none;
  position: absolute;
  left: 7px;
  top: 3px;
  width: 11px;
  height: 14px;
  background: #7E3EAE;
  border-radius: 0 80% 70% 80%;
  transform: rotate(40deg);
}
.tone-hero .leaf { display: block; }
.eyes {
  position: absolute;
  top: 34px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  z-index: 2;
}
.eyes span {
  width: 12px;
  height: 14px;
  background: #1c1c1c;
  border-radius: 50%;
  position: relative;
  display: block;
}
.eyes span:before {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  right: 1px;
  top: 2px;
}
.tone-rogue .eyes span { background: #ff3b3b; box-shadow: 0 0 6px #ff4d4d; }
.blush {
  display: none;
  position: absolute;
  top: 42px;
  width: 10px;
  height: 6px;
  background: rgba(255, 110, 110, .45);
  border-radius: 50%;
}
.tone-hero .blush { display: block; }
.blush.l { left: 6px; }
.blush.r { right: 6px; }
.mouth {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 14px;
  height: 7px;
  margin-left: -7px;
  border-bottom: 2px solid #6AC4AE;
  border-radius: 0 0 12px 12px;
  z-index: 1;
}
.veil {
  display: none;
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 4px;
  height: 18px;
  background: var(--scarf);
  border-radius: 0 0 16px 16px;
  z-index: 2;
}
.tone-mist .veil, .tone-rogue .veil, .tone-sound .veil { display: block; }
.body {
  position: absolute;
  left: 34px;
  top: 100px;
  width: 82px;
  height: 72px;
  background: var(--cloth);
  border-radius: 18px 18px 14px 14px;
  z-index: 1;
}
.scarf {
  position: absolute;
  left: 12px;
  right: 12px;
  top: -6px;
  height: 14px;
  background: var(--scarf);
  border-radius: 8px;
}
.arm {
  position: absolute;
  top: 14px;
  width: 16px;
  height: 44px;
  background: var(--cloth);
  border-radius: 10px;
}
.arm.left { left: -12px; transform: rotate(18deg); }
.arm.right { right: -12px; transform: rotate(-18deg); }
.belt {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 14px;
  height: 7px;
  background: #182A29;
  border-radius: 4px;
}
.shadow {
  width: 78px;
  height: 12px;
  margin: -4px auto 0;
  background: rgba(60, 30, 10, .22);
  border-radius: 50%;
}

/* ---------- 对决 ---------- */
#screenBattle {
  background: linear-gradient(180deg, #9AD4F6 0%, #FFE0A0 38%, #FF9A4A 70%, #F6EFE6 100%);
  overflow: auto;
}
.stage {
  position: relative;
  flex: 1 1 150px;
  min-height: 112px;
  max-height: 220px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hud {
  position: relative;
  z-index: 6;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: calc(8px + env(safe-area-inset-top)) 16px 0;
}
.hud-side.right { text-align: right; }
.score-cap {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #307A6D;
  font-weight: 700;
}
.score-num {
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  color: #129A73;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .45);
}
.lives { display: flex; gap: 4px; margin-top: 2px; }
.life { width: 22px; height: 22px; color: rgba(122, 74, 48, .28); }
.life.on { color: #FF8A3D; }
.combo {
  margin-top: 2px;
  min-height: 16px;
  font-size: 12px;
  font-weight: 900;
  color: #0CC296;
  opacity: 0;
}
.combo.on { opacity: 1; }
.foe-wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.ridge {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -16px;
  height: 58px;
  background: #57388A;
  border-radius: 50% 50% 0 0;
  z-index: 0;
}
.foe-actor { position: relative; z-index: 1; }
#foe.fling .bob-wrap { animation: fling .55s ease forwards; }
#foe.lunge .bob-wrap { animation: lunge .42s ease; }
@keyframes fling {
  to { transform: translateY(-56px) scale(.82) rotate(-8deg); opacity: 0; }
}
@keyframes lunge {
  0% { transform: translateY(0) scale(1); }
  45% { transform: translateY(26px) scale(1.1); }
  100% { transform: translateY(0) scale(1); }
}
.cast {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}
.cast.show { animation: castIn .85s ease forwards; }
.cast.el-fire { background: radial-gradient(circle, rgba(255, 138, 61, .72), transparent 62%); }
.cast.el-water { background: radial-gradient(circle, rgba(70, 160, 255, .62), transparent 62%); }
.cast.el-lightning { background: radial-gradient(circle, rgba(255, 230, 80, .75), transparent 62%); }
.cast.el-wind { background: radial-gradient(circle, rgba(90, 220, 180, .6), transparent 62%); }
.cast.el-earth { background: radial-gradient(circle, rgba(196, 140, 70, .66), transparent 62%); }
.cast.el-shadow { background: radial-gradient(circle, rgba(150, 90, 220, .62), transparent 62%); }
.cast.el-summon { background: radial-gradient(circle, rgba(255, 186, 70, .66), transparent 62%); }
.cast.el-rasen { background: radial-gradient(circle, rgba(80, 150, 255, .7), transparent 62%); }
.cast.el-wood { background: radial-gradient(circle, rgba(70, 180, 90, .62), transparent 62%); }
.cast.el-hit { background: radial-gradient(circle, rgba(226, 59, 74, .45), transparent 64%); }
.cast-name {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #fff;
  text-align: center;
  padding: 0 12px;
  text-shadow: 0 3px 0 rgba(80, 24, 0, .4), 0 10px 18px rgba(0, 0, 0, .25);
  transform: scale(.72);
}
.cast.show .cast-name { animation: slam .4s cubic-bezier(.15, 1.35, .4, 1) forwards; }
@keyframes castIn {
  0% { opacity: 0; }
  18% { opacity: 1; }
  72% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes slam { to { transform: scale(1); } }
.float-score {
  position: absolute;
  left: 50%;
  top: 18%;
  z-index: 5;
  font-size: 22px;
  font-weight: 900;
  color: #FFFDF8;
  text-shadow: 0 2px 0 #12C6A7;
  opacity: 0;
  pointer-events: none;
}
.float-score.show { animation: floatUp .8s ease forwards; }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 8px); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -32px); }
}
.hurt {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 45%, transparent 30%, rgba(180, 20, 40, .48));
}
.hurt.show { animation: hurt .45s ease forwards; }
@keyframes hurt {
  0% { opacity: 0; }
  30% { opacity: 1; }
  100% { opacity: 0; }
}
#screenBattle.shake { animation: shake .4s linear; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.scroll {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  background: linear-gradient(180deg, #FFF9F2 0%, #F8EFE4 100%);
  border-radius: 26px 26px 0 0;
  border: 1px solid #EADCCB;
  border-bottom: 0;
  box-shadow: 0 -10px 28px rgba(80, 40, 10, .12);
  padding: 18px 16px calc(12px + env(safe-area-inset-bottom));
}
.scroll:before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 42px;
  height: 4px;
  margin-left: -21px;
  border-radius: 4px;
  background: #BCE4E3;
}
.scroll.nudge { animation: nudge .22s linear; }
@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.scroll-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.foe-name { font-size: 16px; font-weight: 900; color: #102C25; }
.foe-line { margin-top: 2px; font-size: 12px; color: #588C86; }
.wave-pill {
  flex: none;
  font-size: 12px;
  font-weight: 800;
  color: #043A2F;
  background: #FF8A3D;
  border-radius: 999px;
  padding: 4px 8px;
  box-shadow: 0 2px 0 #12C6A7;
}
.jutsu-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.jutsu-row .mp-icon { width: 22px; height: 22px; color: #FF8A3D; }
.seq-label { font-size: 12px; color: #588C86; margin-top: 8px; }
.jutsu-name { font-size: 16px; font-weight: 900; color: #129A73; line-height: 1.2; }
.chakra { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.chakra-label { width: 42px; flex: none; font-size: 12px; font-weight: 800; color: #129A73; }
.chakra-track {
  flex: 1;
  height: 12px;
  border-radius: 99px;
  background: #EFE0D0;
  border: 1px solid #BCE4E3;
  overflow: hidden;
}
.chakra-fill {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1EE8C8, #FFB15A);
}
.chakra-fill.low { background: linear-gradient(90deg, #23C457, #FF8A3D); }
.step {
  width: 36px;
  text-align: right;
  font-size: 12px;
  font-weight: 800;
  color: #346A63;
  font-variant-numeric: tabular-nums;
}
.seq { display: flex; flex-wrap: wrap; gap: 6px; min-height: 42px; margin-top: 6px; }
.seq .cell {
  min-width: 42px;
  height: 42px;
  padding: 0 6px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFF9F2;
  border: 1px solid #BCE4E3;
  color: #588C86;
  font-size: 18px;
  font-weight: 900;
}
.seq .cell.now {
  background: #FF8A3D;
  border-color: #FF8A3D;
  color: #043A2F;
  box-shadow: 0 3px 0 #12C6A7;
}
.seq .cell.done {
  background: #E5F6EA;
  border-color: #CA9AD7;
  color: #6F1F7A;
}
.pad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
  touch-action: none;
}
.pad.lock { opacity: .72; }
.seal {
  height: 58px;
  min-height: 48px;
  border-radius: 16px;
  border: 2px solid #8AE2DD;
  background: linear-gradient(180deg, #FFFDF8, #F6E4CE);
  color: #129A73;
  box-shadow: 0 3px 0 #A4E0E0, 0 8px 14px rgba(120, 60, 10, .08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  touch-action: manipulation;
}
.seal .kanji { font-size: 24px; font-weight: 900; line-height: 1; }
.seal .animal { margin-top: 2px; font-size: 10px; font-weight: 700; color: #58A09A; }
.seal.soon .animal { color: #106A5E; }
.seal:active, .seal.down {
  transform: translateY(3px);
  box-shadow: 0 0 0 #A4E0E0;
  animation: none;
}
.seal.soon {
  border-color: #20F0D3;
  background: linear-gradient(180deg, #FFD7A8, #FF8A3D);
  color: #043A2F;
  animation: glow .9s ease-in-out infinite;
}
@keyframes glow {
  50% { box-shadow: 0 3px 0 #12C6A7, 0 0 0 4px rgba(255, 138, 61, .35); }
}
.seal.good { border-color: #A93CB3; color: #73147A; background: #E9F8EE; }
.seal.bad { border-color: #3BE27A; color: #23C457; background: #FFE8EB; animation: nudge .22s linear; }

/* ---------- 战报 ---------- */
#screenEnd {
  overflow: auto;
  justify-content: center;
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 168, 80, .55), transparent 42%),
    linear-gradient(180deg, #FFD7A0 0%, #F6EFE6 46%);
}
.end-card {
  width: 100%;
  background: #FFF9F2;
  border: 1px solid #EADCCB;
  border-radius: 24px;
  box-shadow: 0 14px 32px rgba(80, 40, 10, .12);
  padding: 22px 16px 16px;
  text-align: center;
}
.end-kicker { font-size: 12px; letter-spacing: 0.22em; color: #588C86; font-weight: 700; }
.end-nick { margin-top: 4px; font-size: 14px; font-weight: 800; color: #346A63; }
.end-score {
  margin-top: 6px;
  font-size: 60px;
  font-weight: 900;
  line-height: 1;
  color: #FF8A3D;
  text-shadow: 0 4px 0 rgba(198, 83, 18, .25);
  font-variant-numeric: tabular-nums;
}
.rank {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FFD7A8, #FF8A3D);
  color: #043A2F;
  font-weight: 900;
  box-shadow: 0 3px 0 #12C6A7;
}
.rank .mp-icon { width: 18px; height: 18px; }
.ribbon {
  display: none;
  align-items: center;
  margin: 8px auto 0;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #23C457;
  color: #FFF6EA;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.ribbon.on { display: inline-flex; }
.ribbon .mp-icon { width: 14px; height: 14px; margin-right: 4px; }
.end-foe { margin-top: 8px; font-size: 13px; color: #588C86; }
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
  text-align: left;
}
.stat {
  background: #FBF3E8;
  border: 1px solid #F0E2D2;
  border-radius: 14px;
  padding: 10px 12px;
}
.stat span { display: block; font-size: 12px; color: #588C86; }
.stat b { display: block; margin-top: 2px; font-size: 18px; color: #102C25; }
.actions { display: flex; flex-direction: column; gap: 8px; }

@media (max-height: 740px) {
  .logo { font-size: 42px; }
  .tagline { font-size: 12px; }
  .hero-slot { min-height: 140px; padding-bottom: 28px; }
  .ninja.tone-hero { transform: scale(.86); }
  .how span { display: none; }
  .howto { margin: 8px 0; }
  .how { padding: 6px 0; }
}
@media (max-height: 640px) {
  .tagline { display: none; }
  .logo { font-size: 34px; }
  .ninja.tone-hero { transform: scale(.7); }
  .foe-actor { transform: scale(.78); margin-bottom: -18px; }
  .foe-line { display: none; }
  .seal { height: 50px; min-height: 44px; }
  .stage { min-height: 96px; max-height: 150px; }
  .seal .kanji { font-size: 20px; }
  .end-score { font-size: 48px; }
}
@media (max-width: 340px) {
  .seal .kanji { font-size: 20px; }
  .logo { font-size: 40px; }
}
