:root {
  --bg: #07060f;
  --bg2: #150c2c;
  --ink: #fbf7ff;
  --mute: #b5abd6;
  --pink: #ff2e88;
  --cyan: #22e4ff;
  --gold: #ffd34d;
  --gold2: #ff9d1a;
  --red: #ff3b4e;
  --line: rgba(255, 255, 255, .14);
  --card: rgba(255, 255, 255, .06);
  --display: "Dela Gothic One", "Zen Kaku Gothic New", system-ui, sans-serif;
  --body: "Zen Kaku Gothic New", system-ui, -apple-system, "Hiragino Sans", "Yu Gothic", sans-serif;
  --bar: 52px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 500;
  overflow-x: hidden;
}
button, input, textarea, output { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
kbd { font: 700 .85em/1 var(--body); padding: .15em .4em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: rgba(255,255,255,.08); }

/* ── 背景：ネオンの闘技場 ─────────────────────── */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(70% 55% at 50% 115%, rgba(255, 46, 136, .35), transparent 70%),
    radial-gradient(60% 50% at 50% -15%, rgba(34, 228, 255, .22), transparent 70%),
    linear-gradient(180deg, #0b0820 0%, var(--bg) 60%);
}
.sky::before { /* 床のグリッド */
  content: ""; position: absolute; left: -50%; right: -50%; bottom: -10%; height: 55%;
  background:
    repeating-linear-gradient(90deg, rgba(255, 46, 136, .35) 0 2px, transparent 2px 80px),
    repeating-linear-gradient(0deg, rgba(255, 46, 136, .35) 0 2px, transparent 2px 80px);
  transform: perspective(500px) rotateX(62deg);
  transform-origin: 50% 100%;
  mask-image: linear-gradient(to top, #000 10%, transparent 85%);
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 85%);
  animation: floor 3s linear infinite;
}
@keyframes floor { to { background-position: 0 80px, 0 80px; } }
.sky i { position: absolute; top: -20%; width: 34vw; height: 140%; opacity: .5;
  background: linear-gradient(180deg, rgba(255,255,255,.18), transparent 70%);
  clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%);
  transform-origin: 50% 0; animation: beam 7s ease-in-out infinite alternate;
}
.sky i:nth-child(1) { left: 2%; transform: rotate(-22deg); }
.sky i:nth-child(2) { left: 33%; animation-delay: -2.4s; opacity: .3; }
.sky i:nth-child(3) { right: 2%; transform: rotate(22deg); animation-delay: -4.8s; }
@keyframes beam { from { rotate: -10deg; } to { rotate: 10deg; } }
body[data-bg="green"] { background: #00b140; }
body[data-bg="green"] .sky { display: none; }

/* ── ヘッダー ─────────────────────── */
.bar { position: sticky; top: 0; z-index: 30; height: var(--bar); display: flex; align-items: center; gap: 12px;
  padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  background: rgba(7, 6, 15, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.home { color: var(--mute); text-decoration: none; font-weight: 700; white-space: nowrap; }
.home:hover { color: var(--ink); }
.bar__title { margin: 0; flex: 1; min-width: 0; font-family: var(--display); font-size: 15px; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar__tools { display: flex; gap: 6px; }
.tool { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.06); font-size: 14px; font-weight: 700; }
.tool:hover { background: rgba(255,255,255,.14); }
.tool[aria-pressed="true"] { background: var(--gold); color: #1b1000; border-color: var(--gold); }
body.is-playing .bar { background: rgba(7, 6, 15, .45); }
body[data-bg="green"].is-playing .bar { background: rgba(0, 0, 0, .55); }
:fullscreen body.is-playing .bar, body.is-full.is-playing .bar { opacity: 0; transition: opacity .3s; }
body.is-full.is-playing .bar:hover { opacity: 1; }
@media (max-width: 640px) {
  .tool span, .home span { display: none; }
  .tool { padding: 0 9px; }
}

main { position: relative; z-index: 1; }

/* ── 設定画面 ─────────────────────── */
.setup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 500px); gap: clamp(20px, 4vw, 56px);
  max-width: 1180px; margin: 0 auto; padding: clamp(20px, 5vw, 56px) 16px 64px; align-items: start; }
.setup__hero { position: sticky; top: calc(var(--bar) + 32px); }
.kicker { margin: 0 0 8px; font: 700 13px/1 var(--body); letter-spacing: .32em; color: var(--cyan); }
h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(32px, 4.8vw, 76px); line-height: 1.05; white-space: nowrap; letter-spacing: .01em;
  background: linear-gradient(180deg, #fff 30%, #ffc6e0 60%, var(--pink) 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(255, 46, 136, .55)); }
h1 span { display: block; font-size: .5em; color: var(--gold); -webkit-text-fill-color: var(--gold); filter: drop-shadow(0 0 12px rgba(255,211,77,.6)); }
.lead { color: #e4ddff; font-size: 16px; line-height: 1.9; margin: 18px 0 22px; max-width: 34em; }
.promise { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 34em; }
.promise li { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.04); font-size: 14px; color: var(--mute); line-height: 1.6; }
.promise b { display: block; color: var(--ink); font-size: 15px; }
.setup__card { background: linear-gradient(180deg, rgba(30, 18, 60, .86), rgba(14, 9, 30, .9)); border: 1px solid rgba(255, 46, 136, .35); border-radius: 22px; padding: clamp(18px, 3vw, 28px);
  box-shadow: 0 0 0 1px rgba(34,228,255,.08) inset, 0 30px 80px rgba(0,0,0,.5), 0 0 60px rgba(255, 46, 136, .12); }
@media (max-width: 1000px) {
  .setup { grid-template-columns: 1fr; }
  .setup__hero { position: static; }
}
.field { display: block; border: 0; margin: 0 0 22px; padding: 0; min-width: 0; }
.field__label { display: block; margin: 0 0 8px; font-weight: 900; font-size: 15px; padding: 0; }
.field__label small { font-weight: 500; color: var(--mute); margin-left: 4px; }
.field__label b { color: var(--gold); font-size: 20px; font-family: var(--display); font-weight: 400; }
input[type="text"], textarea { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.35); padding: 12px 14px; font-size: 16px; outline: none; }
textarea { resize: vertical; line-height: 1.6; min-height: 180px; }
input[type="text"]:focus, textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255,46,136,.25); }
.hint { margin: 8px 0 0; color: var(--mute); font-size: 13px; line-height: 1.7; }
.problems { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; color: #ffb3bd; }
.problems li::before { content: "⚠ "; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.row--small { gap: 8px; }
.btn { border: 1px solid var(--line); background: rgba(255,255,255,.08); border-radius: 12px; padding: 11px 18px; font-weight: 900; font-size: 15px; }
.btn:hover { background: rgba(255,255,255,.16); }
.btn--small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn--gold { background: linear-gradient(180deg, #ffe27a, var(--gold2)); color: #2a1600; border-color: transparent; box-shadow: 0 6px 20px rgba(255, 157, 26, .35); }
.btn--gold:hover { filter: brightness(1.08); background: linear-gradient(180deg, #ffe27a, var(--gold2)); }
.resume { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 20px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 211, 77, .1); border: 1px solid rgba(255, 211, 77, .35); }
.resume p { margin: 0; font-size: 14px; }

.icon-grid { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; max-height: 300px; overflow: auto; }
.icon-pick { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border-radius: 12px; border: 1px dashed transparent; background: rgba(255,255,255,.03); }
.icon-pick button { border: 0; padding: 0; background: none; border-radius: 50%; position: relative; }
.icon-pick button:focus-visible, .icon-pick.is-target { outline: none; }
.icon-pick.is-target { border-color: var(--cyan); background: rgba(34,228,255,.1); }
.icon-pick.is-drop { border-color: var(--gold); background: rgba(255,211,77,.12); }
.icon-pick .face { width: 48px; height: 48px; font-size: 20px; }
.icon-pick .face--none::after { content: "+"; position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%; background: var(--pink); color: #fff; font: 900 14px/18px var(--body); text-align: center; }
.icon-pick p { margin: 0; font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mute); }
.icon-pick .x { font-size: 11px; color: #ff9aa8; background: none; border: 0; padding: 0; text-decoration: underline; }

.face { display: block; border-radius: 50%; object-fit: cover; flex: none; background: #222; }
.face--none { display: grid; place-items: center; font-family: var(--display); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.35);
  background: radial-gradient(circle at 32% 28%, hsl(var(--h) 90% 72%), hsl(var(--h) 75% 46%) 60%, hsl(var(--h) 70% 30%)); }

.stepper { display: inline-flex; align-items: center; gap: 10px; }
.stepper output { min-width: 2.2ch; text-align: center; font-family: var(--display); font-size: 36px; color: var(--gold); line-height: 1; }
.stepper span { font-weight: 900; }
.stepper__btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.08); font-size: 24px; font-weight: 900; line-height: 1; }
.stepper__btn:disabled { opacity: .35; cursor: default; }

.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choices--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; height: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.04); font-weight: 900; cursor: pointer; }
.choice small { display: block; font-weight: 500; font-size: 12px; color: var(--mute); margin-top: 2px; }
.choice input:checked + span { border-color: var(--pink); background: rgba(255, 46, 136, .16); box-shadow: 0 0 0 1px var(--pink) inset; }
.choice input:focus-visible + span { outline: 2px solid var(--cyan); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--pink); flex: none; }
.check small { display: block; color: var(--mute); font-size: 12px; line-height: 1.6; margin-top: 2px; }

.start { position: relative; display: block; width: 100%; padding: 20px; border: 0; border-radius: 18px; overflow: hidden;
  font-family: var(--display); font-size: clamp(24px, 4vw, 30px); letter-spacing: .06em; color: #fff;
  background: linear-gradient(90deg, #ff2e88, #ff5a3c, #ff2e88); background-size: 200% 100%; animation: startbg 3s linear infinite;
  box-shadow: 0 10px 40px rgba(255, 46, 136, .5), 0 0 0 2px rgba(255,255,255,.2) inset; text-shadow: 0 3px 0 rgba(0,0,0,.25); }
.start::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.5) 50%, transparent 70%); transform: translateX(-100%); animation: shine 2.6s ease-in-out infinite; }
.start:hover { filter: brightness(1.1); }
.start:active { transform: translateY(2px); }
.start:disabled { filter: grayscale(.8) brightness(.7); cursor: not-allowed; animation: none; }
.start span { position: relative; z-index: 1; }
@keyframes startbg { to { background-position: -200% 0; } }
@keyframes shine { 60%, 100% { transform: translateX(100%); } }
.fine { color: var(--mute); font-size: 12px; line-height: 1.7; margin: 12px 0 0; }

/* ── 試合画面 ─────────────────────── */
.stage { position: relative; height: calc(100vh - var(--bar)); height: calc(100dvh - var(--bar));
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(240px, 22vw, 340px); grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "hud hud" "arena feed"; gap: 12px; padding: 12px clamp(10px, 2vw, 22px) 16px; }
body.is-full .stage { height: 100vh; height: 100dvh; margin-top: calc(var(--bar) * -1); padding-top: 14px; }
.hud { grid-area: hud; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.hud__title { margin: 0; font-family: var(--display); font-size: clamp(16px, 2.2vw, 28px); color: #fff; text-shadow: 0 0 18px rgba(255,46,136,.7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud__alive { margin: 0; display: flex; align-items: baseline; gap: 6px; padding: 4px 22px 6px; border-radius: 999px;
  background: rgba(0,0,0,.55); border: 2px solid var(--pink); box-shadow: 0 0 24px rgba(255,46,136,.55), 0 0 0 4px rgba(255,46,136,.15); }
.hud__alive span { font-weight: 900; font-size: clamp(14px, 1.6vw, 20px); }
.hud__alive b { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 5vw, 64px); line-height: 1; color: var(--gold); min-width: 1.4ch; text-align: center; text-shadow: 0 0 20px rgba(255,211,77,.7); }
.hud__alive.is-pop b { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(1.8); color: #fff; } }
.hud__sub { margin: 0; justify-self: end; color: var(--mute); font-weight: 700; font-size: clamp(12px, 1.3vw, 16px); text-align: right; }

.arena { grid-area: arena; position: relative; min-height: 0; }
.feed { grid-area: feed; min-height: 0; display: flex; flex-direction: column; border-radius: 16px; background: rgba(5, 3, 14, .62); border: 1px solid var(--line); overflow: hidden; }
.feed__head { margin: 0; padding: 10px 14px; font: 900 12px/1 var(--body); letter-spacing: .3em; color: var(--pink); border-bottom: 1px solid var(--line); }
.feed__list { list-style: none; margin: 0; padding: 6px; overflow: hidden; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.feed__list li { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.05); font-size: 13px; line-height: 1.45; animation: feedin .5s cubic-bezier(.2, 1.4, .4, 1); }
.feed__list li.is-new { background: linear-gradient(90deg, rgba(255,59,78,.35), rgba(255,59,78,.05)); }
.feed__list li.is-storm { background: linear-gradient(90deg, rgba(34,228,255,.25), rgba(34,228,255,.04)); }
.feed__list .rank { font-family: var(--display); color: var(--gold); font-size: 15px; min-width: 2.6em; }
.feed__list .who { font-weight: 900; color: #fff; }
.feed__list .ko { color: #ff8a97; font-weight: 900; }
@keyframes feedin { from { transform: translateX(40px); opacity: 0; } }
@media (max-width: 820px) {
  .stage { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) 96px; grid-template-areas: "hud" "arena" "feed"; }
  .hud { grid-template-columns: 1fr auto; }
  .hud__sub { display: none; }
  .feed__head { display: none; }
}

/* 参加者のカード */
.fighter { position: absolute; left: 0; top: 0; width: var(--s); height: calc(var(--s) * 1.2);
  transform: translate(var(--x), var(--y)); transition: transform .7s cubic-bezier(.3, 1.2, .4, 1), width .7s, height .7s;
  display: grid; grid-template-rows: 1fr auto; justify-items: center; align-items: center; padding: calc(var(--s) * .06);
  border-radius: calc(var(--s) * .14); background: linear-gradient(170deg, hsl(var(--h) 60% 22% / .92), rgba(10, 6, 24, .92));
  border: max(1px, calc(var(--s) * .02)) solid hsl(var(--h) 90% 65% / .55); box-shadow: 0 4px 14px rgba(0,0,0,.4);
  will-change: transform; }
.fighter .face { width: calc(var(--s) * .72); height: calc(var(--s) * .72); font-size: calc(var(--s) * .34); box-shadow: 0 0 0 max(1px, calc(var(--s) * .03)) rgba(255,255,255,.85); }
.fighter__name { margin: 0; max-width: 100%; font-weight: 900; font-size: max(9px, calc(var(--s) * .15)); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px #000; }
.fighter__kills { position: absolute; top: -.4em; right: -.4em; padding: .15em .45em; border-radius: 999px; font: 900 max(9px, calc(var(--s) * .13))/1.2 var(--body); background: var(--red); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.fighter__kills:empty { display: none; }
.arena.is-tiny .fighter__name { display: none; }
.arena.is-tiny .fighter { grid-template-rows: 1fr; }
.fighter.is-enter { animation: enter .6s cubic-bezier(.2, 1.4, .4, 1) both; animation-delay: var(--d, 0s); }
@keyframes enter { from { opacity: 0; transform: translate(var(--x), calc(var(--y) - 50px)) scale(.2) rotate(-20deg); } }
.fighter.is-hot { z-index: 5; border-color: #fff; background: linear-gradient(170deg, rgba(255, 59, 78, .9), rgba(90, 0, 20, .95)); box-shadow: 0 0 0 3px var(--red), 0 0 34px rgba(255, 59, 78, .9); transform: translate(var(--x), var(--y)) scale(1.12); transition: transform .08s, box-shadow .08s; }
.fighter.is-locked { z-index: 6; animation: locked .5s ease-in-out infinite alternate; }
.fighter.is-locked::after { content: ""; position: absolute; inset: -18%; border-radius: 50%; pointer-events: none;
  border: max(2px, calc(var(--s) * .035)) solid var(--red);
  background:
    linear-gradient(var(--red), var(--red)) 50% 0 / max(2px, calc(var(--s) * .035)) 22% no-repeat,
    linear-gradient(var(--red), var(--red)) 50% 100% / max(2px, calc(var(--s) * .035)) 22% no-repeat,
    linear-gradient(var(--red), var(--red)) 0 50% / 22% max(2px, calc(var(--s) * .035)) no-repeat,
    linear-gradient(var(--red), var(--red)) 100% 50% / 22% max(2px, calc(var(--s) * .035)) no-repeat;
  animation: reticle 1.2s linear infinite; filter: drop-shadow(0 0 6px var(--red)); }
@keyframes reticle { from { transform: rotate(0) scale(1.15); } 30% { transform: rotate(45deg) scale(1); } to { transform: rotate(90deg) scale(1); } }
@keyframes locked { to { box-shadow: 0 0 0 4px var(--red), 0 0 50px rgba(255,59,78,1); } }
.fighter.is-attacker { z-index: 7; box-shadow: 0 0 0 3px var(--cyan), 0 0 30px rgba(34,228,255,.9); border-color: #fff; }
.fighter.is-ko { z-index: 6; animation: ko .7s ease-out forwards; }
.fighter.is-ko::before { content: "OUT"; position: absolute; inset: 0; display: grid; place-items: center; z-index: 2;
  font-family: var(--display); font-size: calc(var(--s) * .32); color: var(--red); letter-spacing: .04em;
  text-shadow: 0 0 2px #fff, 0 0 12px rgba(255,59,78,.9); transform: rotate(-14deg); animation: stamp .35s cubic-bezier(.2, 1.8, .4, 1) both; }
@keyframes stamp { from { transform: rotate(-14deg) scale(3); opacity: 0; } }
@keyframes ko {
  0% { filter: none; }
  10% { transform: translate(calc(var(--x) + 8px), var(--y)) rotate(3deg); }
  20% { transform: translate(calc(var(--x) - 8px), var(--y)) rotate(-3deg); }
  30% { transform: translate(var(--x), var(--y)); filter: grayscale(1) brightness(.7); }
  100% { transform: translate(var(--x), var(--y)); filter: grayscale(1) brightness(.55); }
}
.fighter.is-gone { animation: gone .55s ease-in forwards; }
@keyframes gone { from { transform: translate(var(--x), var(--y)); filter: grayscale(1) brightness(.55); opacity: 1; }
  to { transform: translate(var(--x), calc(var(--y) + 60px)) rotate(18deg) scale(.4); filter: grayscale(1) brightness(.3); opacity: 0; } }
.fighter.is-winner { z-index: 8; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold), 0 0 50px rgba(255,211,77,.9); background: linear-gradient(170deg, rgba(255, 211, 77, .45), rgba(60, 30, 0, .9)); }

.dmg { position: fixed; z-index: 40; pointer-events: none; font-family: var(--display); color: #fff; -webkit-text-stroke: 2px var(--red); paint-order: stroke fill;
  text-shadow: 0 4px 0 rgba(0,0,0,.4); transform: translate(-50%, -50%); animation: dmg 1s ease-out forwards; white-space: nowrap; }
@keyframes dmg { 0% { transform: translate(-50%, -50%) scale(2.6); opacity: 0; } 15% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -150%) scale(1); opacity: 0; } }
.shot { position: fixed; z-index: 39; left: 0; top: 0; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fff 0 30%, var(--cyan) 55%, transparent 72%); box-shadow: 0 0 24px 8px rgba(34,228,255,.8); }
.shot--meteor { width: 44px; height: 44px; margin: -22px 0 0 -22px; background: radial-gradient(circle, #fff 0 25%, #ffcf4d 45%, #ff4b1f 65%, transparent 74%); box-shadow: 0 0 40px 14px rgba(255,120,30,.8); }

.attack { position: absolute; z-index: 20; left: 50%; bottom: 28px; transform: translateX(-50%); padding: 16px 44px; border-radius: 999px; border: 0;
  font-family: var(--display); font-size: clamp(26px, 4vw, 40px); color: #fff; background: linear-gradient(180deg, #ff5d73, #d4002a);
  box-shadow: 0 10px 40px rgba(255,59,78,.7), 0 0 0 3px rgba(255,255,255,.35) inset; animation: breathe 1.1s ease-in-out infinite; }
.attack small { display: block; font: 700 12px/1 var(--body); opacity: .8; margin-top: 4px; }
@keyframes breathe { 50% { transform: translateX(-50%) scale(1.06); } }

/* ── バナー ─────────────────────── */
.banner { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; text-align: center; pointer-events: none; }
.banner::before { content: ""; position: absolute; left: -10%; right: -10%; top: 50%; height: clamp(150px, 30vh, 280px); transform: translateY(-50%) skewY(-4deg);
  background: linear-gradient(90deg, transparent, rgba(0,0,0,.85) 15%, rgba(0,0,0,.85) 85%, transparent); border-block: 3px solid var(--pink);
  box-shadow: 0 0 60px rgba(255,46,136,.6); animation: band .35s cubic-bezier(.2, 1.3, .4, 1); }
.banner > * { position: relative; }
.banner__small { margin: 0; font-weight: 900; font-size: clamp(16px, 2.4vw, 28px); letter-spacing: .25em; color: var(--cyan); }
.banner__big { margin: 0; font-family: var(--display); font-size: clamp(54px, 12vw, 160px); line-height: 1.05; color: #fff;
  text-shadow: 0 0 30px rgba(255,46,136,.95), 0 6px 0 rgba(0,0,0,.4); animation: slam .5s cubic-bezier(.2, 1.4, .3, 1); }
.banner.is-gold .banner__big { color: var(--gold); text-shadow: 0 0 30px rgba(255,170,30,.95), 0 6px 0 rgba(0,0,0,.4); }
.banner.is-gold::before { border-color: var(--gold); box-shadow: 0 0 60px rgba(255,211,77,.6); }
.banner.is-out { animation: bannerout .3s ease-in forwards; }
@keyframes band { from { transform: translateY(-50%) skewY(-4deg) scaleY(0); } }
@keyframes slam { from { transform: scale(3); opacity: 0; filter: blur(12px); } }
@keyframes bannerout { to { opacity: 0; transform: scale(1.15); } }

/* ── 決勝 ─────────────────────── */
.duel { position: fixed; inset: 0; z-index: 45; display: grid; grid-template-columns: 1fr auto 1fr; grid-template-rows: auto 1fr auto; align-items: center; gap: 0 2vw; padding: 3vh 4vw;
  background:
    linear-gradient(110deg, rgba(34, 120, 255, .55) 0 49.6%, transparent 49.6% 50.4%, rgba(255, 46, 80, .55) 50.4%),
    radial-gradient(circle at 50% 50%, rgba(0,0,0,.2), rgba(0,0,0,.92)), #05030c;
  animation: duelin .6s ease-out; }
body[data-bg="green"] .duel { background: linear-gradient(110deg, rgba(34, 120, 255, .85) 0 49.6%, #00b140 49.6% 50.4%, rgba(255, 46, 80, .85) 50.4%); }
@keyframes duelin { from { clip-path: inset(50% 0 50% 0); } to { clip-path: inset(0 0 0 0); } }
.duel__title { grid-column: 1 / -1; margin: 0; text-align: center; font-family: var(--display); font-size: clamp(34px, 7vw, 90px); color: var(--gold); letter-spacing: .06em; text-shadow: 0 0 30px rgba(255,170,30,.9), 0 5px 0 rgba(0,0,0,.5); animation: slam .6s cubic-bezier(.2, 1.4, .3, 1); }
.duel__side { display: grid; justify-items: center; gap: 1.6vh; transition: transform .25s, filter .4s; }
.duel__side--a { animation: fromLeft .7s cubic-bezier(.2, 1.3, .4, 1) .15s both; }
.duel__side--b { animation: fromRight .7s cubic-bezier(.2, 1.3, .4, 1) .15s both; }
@keyframes fromLeft { from { transform: translateX(-60vw); } }
@keyframes fromRight { from { transform: translateX(60vw); } }
.duel__face .face { width: min(30vw, 40vh); height: min(30vw, 40vh); font-size: min(13vw, 17vh); box-shadow: 0 0 0 6px #fff, 0 0 60px rgba(255,255,255,.4); }
.duel__side--a .duel__face .face { box-shadow: 0 0 0 6px #fff, 0 0 60px rgba(34,140,255,.9); }
.duel__side--b .duel__face .face { box-shadow: 0 0 0 6px #fff, 0 0 60px rgba(255,46,80,.9); }
.duel__name { margin: 0; max-width: 40vw; font-family: var(--display); font-size: clamp(22px, 4vw, 52px); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 4px 0 rgba(0,0,0,.5); }
.hp { position: relative; width: min(36vw, 520px); height: clamp(18px, 3vh, 30px); border-radius: 999px; background: rgba(0,0,0,.6); border: 2px solid #fff; overflow: hidden; }
.hp i { position: absolute; inset: 0; width: 100%; border-radius: inherit; background: linear-gradient(180deg, #8dff8a, #18c23a); transition: width .45s cubic-bezier(.3, .8, .3, 1), background .3s; }
.hp i.is-mid { background: linear-gradient(180deg, #ffe680, #f0a400); }
.hp i.is-low { background: linear-gradient(180deg, #ff8a8a, #e0002a); }
.duel__side--b .hp i { left: auto; right: 0; }
.hp b { position: absolute; inset: 0; display: grid; place-items: center; font: 900 clamp(12px, 1.8vh, 18px)/1 var(--body); text-shadow: 0 1px 2px #000; }
.duel__vs { margin: 0; font-family: var(--display); font-size: clamp(50px, 9vw, 130px); color: #fff; text-shadow: 0 0 40px rgba(255,255,255,.8), 0 6px 0 rgba(0,0,0,.5); animation: vs 1.4s ease-in-out infinite; }
@keyframes vs { 50% { transform: scale(1.12) rotate(-4deg); } }
.duel__call { grid-column: 1 / -1; margin: 0; min-height: 1.4em; text-align: center; font-weight: 900; font-size: clamp(18px, 3vw, 34px); text-shadow: 0 2px 6px #000; }
.duel__side.is-lunge-r { transform: translateX(12vw) scale(1.05); }
.duel__side.is-lunge-l { transform: translateX(-12vw) scale(1.05); }
.duel__side.is-hit { animation: hit .35s; }
.duel__side.is-down { filter: grayscale(1) brightness(.45); transform: translateY(6vh) rotate(-8deg); transition: transform 1s, filter 1s; }
@keyframes hit { 0%, 100% { translate: 0; } 20% { translate: 18px 0; filter: brightness(2.5); } 40% { translate: -14px 0; } 60% { translate: 10px 0; } 80% { translate: -6px 0; } }
@media (max-width: 640px) {
  .duel { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto 1fr auto; }
  .duel__face .face { width: 30vh; height: 30vh; font-size: 13vh; }
  .duel__vs { text-align: center; font-size: 56px; }
  .hp { width: 80vw; }
  .duel__name { max-width: 90vw; }
}

/* ── 優勝 ─────────────────────── */
.victory { position: fixed; inset: 0; z-index: 46; display: grid; place-content: center; justify-items: center; gap: 1.6vh; text-align: center; padding: 20px; overflow: hidden;
  background: radial-gradient(circle at 50% 45%, rgba(255, 196, 60, .35), rgba(5,3,12,.94) 60%); animation: fadein .5s ease-out; }
body[data-bg="green"] .victory { background: radial-gradient(circle at 50% 45%, rgba(255, 196, 60, .6), #00b140 65%); }
@keyframes fadein { from { opacity: 0; } }
.victory__rays { position: absolute; left: 50%; top: 45%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax; z-index: -1;
  background: repeating-conic-gradient(rgba(255, 211, 77, .2) 0 6deg, transparent 6deg 18deg); animation: spin 24s linear infinite;
  mask-image: radial-gradient(circle, #000 10%, transparent 45%); -webkit-mask-image: radial-gradient(circle, #000 10%, transparent 45%); }
@keyframes spin { to { transform: rotate(360deg); } }
.victory__kicker { margin: 0; font-family: var(--display); font-size: clamp(48px, 11vw, 150px); line-height: 1; letter-spacing: .06em;
  background: linear-gradient(180deg, #fff6c8 10%, var(--gold) 50%, var(--gold2) 90%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px rgba(255,170,30,.8)) drop-shadow(0 6px 0 rgba(80,40,0,.6)); animation: slam .7s cubic-bezier(.2, 1.4, .3, 1); }
.victory__faces { display: flex; flex-wrap: wrap; justify-content: center; gap: 2vw; max-width: 92vw; }
.victory__face { position: relative; animation: rise .8s cubic-bezier(.2, 1.4, .4, 1) both; }
.victory__face::before { content: "👑"; position: absolute; left: 50%; top: 0; transform: translate(-50%, -62%) rotate(-8deg); font-size: calc(var(--vs) * .38); filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); animation: crown 1.2s cubic-bezier(.2, 1.6, .4, 1) .5s both; }
.victory__face .face { width: var(--vs); height: var(--vs); font-size: calc(var(--vs) * .45); box-shadow: 0 0 0 6px var(--gold), 0 0 80px rgba(255,211,77,.9); }
.victory__face p { margin: 1vh 0 0; font-family: var(--display); font-size: calc(var(--vs) * .16); max-width: calc(var(--vs) * 1.6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 3px 0 rgba(0,0,0,.6); }
@keyframes rise { from { transform: translateY(40vh) scale(.4); opacity: 0; } }
@keyframes crown { from { transform: translate(-50%, -260%) rotate(-30deg); opacity: 0; } }
.victory__name { margin: 0; font-family: var(--display); font-size: clamp(30px, 6vw, 80px); line-height: 1.1; color: #fff; text-shadow: 0 0 30px rgba(255,211,77,.8), 0 5px 0 rgba(0,0,0,.6); }
.victory__name:empty { display: none; }
.victory__sub { margin: 0; color: #ffe9b0; font-weight: 900; font-size: clamp(14px, 2vw, 22px); text-shadow: 0 2px 4px #000; }
.victory__next { margin-top: 1vh; animation: fadein .5s 2.2s both; }

/* ── 結果 ─────────────────────── */
.results { padding: clamp(24px, 5vw, 56px) 16px 64px; }
.results__inner { max-width: 880px; margin: 0 auto; text-align: center; }
.results h2 { margin: 0 0 24px; font-family: var(--display); font-weight: 400; font-size: clamp(28px, 5vw, 52px); text-shadow: 0 0 20px rgba(255,46,136,.6); }
.podium { list-style: none; margin: 0 0 28px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.podium li { display: grid; justify-items: center; gap: 8px; padding: 20px 22px 16px; min-width: 150px; border-radius: 20px; background: linear-gradient(180deg, rgba(255,211,77,.25), rgba(255,211,77,.05)); border: 1px solid rgba(255,211,77,.6); box-shadow: 0 0 40px rgba(255,211,77,.2); }
.podium .face { width: 96px; height: 96px; font-size: 42px; box-shadow: 0 0 0 4px var(--gold); }
.podium b { font-family: var(--display); font-weight: 400; font-size: 22px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium small { color: var(--gold); font-weight: 900; }
.ranking { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; text-align: left; }
.ranking li { display: grid; grid-template-columns: 3.6em 36px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(0,0,0,.4); border: 1px solid var(--line); }
.ranking .face { width: 36px; height: 36px; font-size: 16px; }
.ranking .r { font-family: var(--display); color: var(--gold); }
.ranking .n { font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking .k { font-size: 12px; color: #ff9aa8; font-weight: 900; }
.results .row { justify-content: center; margin-top: 24px; }

/* ── 演出の層 ─────────────────────── */
.flash { position: fixed; inset: 0; z-index: 60; pointer-events: none; background: #fff; opacity: 0; }
.flash.is-on { animation: flash .35s ease-out; }
.flash.is-red { background: var(--red); }
@keyframes flash { from { opacity: .85; } to { opacity: 0; } }
.fx { position: fixed; inset: 0; z-index: 55; width: 100%; height: 100%; pointer-events: none; }
.toast { position: fixed; z-index: 70; left: 50%; bottom: 24px; transform: translateX(-50%); margin: 0; padding: 12px 18px; border-radius: 12px; background: rgba(20, 12, 40, .95); border: 1px solid var(--line); font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: calc(100vw - 32px); }

@media (prefers-reduced-motion: reduce) {
  .sky::before, .sky i, .start, .start::after, .victory__rays { animation: none; }
}

/* ── 復活 ─────────────────────── */
.revive { position: fixed; inset: 0; z-index: 45; display: grid; place-content: center; justify-items: center; gap: 1.4vh; text-align: center; padding: 20px; overflow: hidden;
  background: radial-gradient(circle at 50% 55%, rgba(60, 255, 170, .28), rgba(3, 10, 12, .95) 62%); animation: fadein .4s ease-out; }
body[data-bg="green"] .revive { background: radial-gradient(circle at 50% 55%, rgba(255, 240, 160, .5), #00b140 65%); }
.revive__beam { position: absolute; left: 50%; top: -10%; width: min(60vw, 520px); height: 130%; transform: translateX(-50%); z-index: -1; opacity: .25;
  background: linear-gradient(90deg, transparent, rgba(255, 245, 190, .9) 50%, transparent); filter: blur(10px); transition: opacity .4s; }
.revive.is-hit .revive__beam { opacity: 1; animation: beamin .6s ease-out; }
@keyframes beamin { from { transform: translateX(-50%) scaleX(0); } }
.revive__title { margin: 0; font-family: var(--display); font-size: clamp(48px, 10vw, 130px); line-height: 1; letter-spacing: .08em;
  background: linear-gradient(180deg, #fff 10%, #b7ffd9 50%, #2bd68a 95%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 26px rgba(60,255,170,.8)) drop-shadow(0 5px 0 rgba(0,40,20,.7)); animation: slam .6s cubic-bezier(.2, 1.4, .3, 1); }
.revive__sub { margin: 0; color: #c9ffe5; font-weight: 900; font-size: clamp(14px, 2vw, 22px); text-shadow: 0 2px 4px #000; }
.revive__slot { display: grid; justify-items: center; gap: 1vh; margin-top: 1vh; }
.revive__face .face { width: min(30vh, 46vw); height: min(30vh, 46vw); font-size: min(13vh, 20vw); filter: grayscale(1) brightness(.6); box-shadow: 0 0 0 5px rgba(255,255,255,.4); transition: filter .3s, box-shadow .3s, transform .3s; }
.revive.is-hit .revive__face .face { filter: none; box-shadow: 0 0 0 6px #ffe98a, 0 0 90px rgba(255, 233, 138, .95); animation: revived .7s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes revived { from { transform: scale(.6); filter: brightness(4); } }
.revive__name { margin: 0; font-family: var(--display); font-size: clamp(26px, 5vw, 64px); max-width: 90vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #ddd; text-shadow: 0 4px 0 rgba(0,0,0,.6); }
.revive.is-hit .revive__name { color: #fff; text-shadow: 0 0 24px rgba(255,233,138,.9), 0 4px 0 rgba(0,0,0,.6); }
.revive__call { margin: 0; min-height: 1.4em; font-weight: 900; font-size: clamp(18px, 3vw, 34px); color: #ffe98a; text-shadow: 0 2px 6px #000; }
.fighter.is-revive { z-index: 7; animation: reborn 1s cubic-bezier(.2, 1.3, .4, 1) both; border-color: #ffe98a; box-shadow: 0 0 0 3px #ffe98a, 0 0 40px rgba(255,233,138,.9); }
.fighter.is-revive::after { content: ""; position: absolute; left: 15%; right: 15%; bottom: 40%; height: 600%; pointer-events: none;
  background: linear-gradient(to top, rgba(255, 245, 190, .9), transparent); filter: blur(4px); animation: pillar 1.1s ease-out forwards; }
@keyframes reborn { from { transform: translate(var(--x), calc(var(--y) + 60px)) scale(.2); opacity: 0; filter: brightness(4); } }
@keyframes pillar { from { opacity: 1; transform: scaleX(1.6); } to { opacity: 0; transform: scaleX(.3); } }
.feed__list li.is-revive { background: linear-gradient(90deg, rgba(60,255,170,.3), rgba(60,255,170,.04)); }
.feed__list li.is-revive .rank { color: #7dffb0; font-family: var(--body); font-weight: 900; }
