:root {
  color-scheme: dark;
  --bg: #101416;
  --panel: #191f20;
  --edge: #2d3737;
  --ivory: #f4f0df;
  --dim: #9daaa5;
  --gold: #ffd36e;
  --gold-hi: #ffe5a0;
  --mint: #a1e1cc;
  --mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ivory);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-width: 300px;
  overflow: hidden;
  background: radial-gradient(ellipse at 40% 0, #1d2828 0%, transparent 60%), var(--bg);
}
button { color: inherit; font: inherit; }
button:not(:disabled), summary { cursor: pointer; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.symbols { display: none; }
.shell { --hud-inset: clamp(10px, 2vw, 27px); --hud-top: 68px; height: 100vh; height: 100dvh; background: var(--bg); }
.shell:fullscreen { width: 100%; height: 100%; }
.topbar { position: absolute; z-index: 6; inset: 0 0 auto; height: var(--hud-top); padding: 0 var(--hud-inset); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; pointer-events: none; background: linear-gradient(#181020cb, #18102000); }
.brand { display: flex; gap: 12px; align-items: center; }
.brand-icon { display: grid; place-items: center; width: 39px; height: 39px; background: var(--gold); color: #20221a; border-radius: 10px; transform: skewX(-6deg); }
.brand-icon svg { width: 22px; height: 22px; fill: currentColor; transform: skewX(6deg); }
.brand-title { color: var(--ivory); font: 900 19px/1.15 system-ui, sans-serif; letter-spacing: -.045em; }
.brand-title span { color: var(--gold); }
.brand-caption { color: var(--dim); font-size: 10px; font-weight: 700; letter-spacing: .16em; margin-top: 3px; }
.header-actions { display: flex; gap: 8px; justify-self: end; pointer-events: auto; }
.fullscreen-note { position: absolute; top: calc(100% - 6px); right: var(--hud-inset); max-width: min(75vw, 290px); padding: 7px 10px; border: 1px solid var(--edge); border-radius: 6px; background: #25182a; color: var(--gold-hi); font-size: 12px; }
.icon-button { display: grid; place-items: center; width: 37px; height: 37px; padding: 0; background: #1d2526; border: 1px solid #344040; border-radius: 8px; }
.icon-button:hover:enabled { border-color: var(--gold); color: var(--gold); }
.icon-button:disabled { opacity: .42; }
.icon-button svg { width: 18px; height: 18px; }

.layout { height: 100%; }
.arena {
  height: 100%;
  min-width: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 54%, #224146, #111b23 58%, #0b1117);
}
.arena-view {
  --subtitle-room: 118px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: 100%;
}
#arena-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
#arena-canvas.dragging { cursor: grabbing; }
.stage-shade { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(#0c131984, transparent 20%, transparent 78%, #0c131983); }
.arena-bottom { position: absolute; z-index: 3; pointer-events: none; left: var(--hud-inset); bottom: var(--subtitle-room); }
.timer { background: #131c22e6; border: 1px solid #647b765e; border-radius: 8px; min-width: 112px; padding: 7px 12px; display: flex; align-items: center; gap: 8px; }
.timer svg { color: var(--mint); width: 16px; height: 16px; }
.mini-label { color: #b0bfb9; font-size: 9px; font-weight: 700; }
.timer strong { color: #fff4db; font: 800 21px/1.15 var(--mono); }
.shot-hud { font-size: 10px; min-width: 110px; color: #edeee4; letter-spacing: .1em; }
.shot-hud span { display: inline-block; width: 6px; height: 6px; background: var(--gold); margin-right: 3px; border-radius: 50%; }
.shot-track { height: 4px; background: #becbc53b; margin-top: 6px; border-radius: 8px; overflow: hidden; }
.shot-track i, .ultimate-meter i { display: block; height: 100%; width: 100%; transform-origin: left; background: var(--gold); }

.overlay { z-index: 2; position: absolute; inset: 0; display: grid; place-items: center; text-align: center; background: radial-gradient(ellipse at center, #0c151dd9, #101d2566 46%, #0e171d2b 73%); }
.overlay-content { padding: 25px 16px 29px; }
.overlay-tag { display: flex; gap: 10px; justify-content: center; align-items: center; color: var(--gold); font: 700 11px var(--mono); letter-spacing: .27em; }
.overlay-tag span { width: 27px; height: 1px; background: #ffd36e8a; }
.overlay h1 { margin: 11px 0 9px; font-size: clamp(27px, 4.5vw, 73px); font-weight: 1000; line-height: 1.13; letter-spacing: -.073em; text-shadow: 0 4px 23px #10161b; }
.overlay h1 span { color: var(--gold); }
.overlay p { color: #e3eae5; font-size: clamp(12px, 1.25vw, 17px); font-weight: 700; margin: 0 0 26px; letter-spacing: .065em; }
.start-button { display: inline-flex; gap: 9px; align-items: center; justify-content: center; min-height: 47px; min-width: 184px; padding: 0 13px 0 19px; background: var(--gold); color: #212419; border: 1px solid var(--gold-hi); box-shadow: 0 5px 25px #ffbc4f36; border-radius: 8px; font-size: 15px; font-weight: 900; }
.start-button:hover { background: var(--gold-hi); }
.start-button svg { width: 16px; height: 16px; fill: currentColor; }
.start-button .start-arrow { margin-left: auto; fill: none; opacity: .7; }
.overlay-hint { display: flex; gap: 5px; align-items: center; justify-content: center; margin-top: 16px; color: #c0d0c8; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.overlay-hint svg { width: 13px; height: 13px; }
.side { position: absolute; z-index: 3; inset: var(--hud-top) var(--hud-inset) var(--subtitle-room); pointer-events: none; }
.panel { background: #251a27e8; border: 1px solid #705367; border-radius: 10px; padding: 11px 12px; }
.mission, .arsenal { position: absolute; top: 0; width: clamp(122px, 17.5vw, 226px); }
.mission { left: 0; }
.arsenal { right: 0; }
.action, .instructions { pointer-events: auto; }
.instructions { position: absolute; right: 0; bottom: 0; width: max-content; max-width: min(235px, 75vw); max-height: min(300px, 48dvh); overflow: auto; padding: 7px 10px; }
.instructions[open] { z-index: 1; width: min(235px, 75vw); }
.instructions > summary { padding: 0; }
.instructions > summary::after { content: "+"; color: var(--mint); margin-left: 4px; }
.instructions[open] > summary::after { content: "−"; }
.section-label { display: flex; align-items: center; gap: 7px; color: #e2e8e0; font-size: 12px; font-weight: 850; letter-spacing: .075em; }
.section-label svg { width: 16px; height: 16px; color: var(--mint); }
.section-label > span { margin-left: auto; color: var(--dim); font: 10px var(--mono); }
.stat-label { color: #c1cac2; font-size: 12px; font-weight: 800; margin-top: 7px; }
.count { display: flex; align-items: baseline; gap: 7px; margin-block: 2px 9px; }
.count strong { font: 800 clamp(34px, 4.1vw, 52px)/.99 var(--mono); letter-spacing: -.09em; color: var(--gold); padding-right: 4px; }
.count small { font: 700 13px var(--mono); color: var(--dim); }
.phases { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 7px; }
.phases span { text-align: center; border-radius: 4px; background: #252d2e; border: 1px solid #36413f; color: #a0aea8; padding: 5px 0; font: 10px var(--mono); }
.phases span.current { color: #211c13; background: var(--gold); border-color: var(--gold); font-weight: 900; }
.phases span.done { color: var(--mint); border-color: #47635c; background: #223632; }
.phase-note, .meter-copy { display: flex; justify-content: space-between; align-items: center; gap: 7px; color: var(--dim); font-size: 10px; margin-top: 8px; }
.phase-note > span:first-child, .meter-copy strong { font-family: var(--mono); }
.phase-note b, .meter-copy strong { color: var(--gold); }
.action { width: 100%; display: flex; align-items: center; gap: 9px; padding: 7px; text-align: left; border-radius: 7px; margin-top: 11px; background: #22292a; border: 1px solid #3a4544; }
.action:enabled:hover { border-color: var(--gold); }
.action-icon { display: grid; place-items: center; width: 33px; height: 33px; background: #34312a; color: var(--gold); border-radius: 6px; }
.action-icon svg { width: 18px; height: 18px; }
.ultimate .action-icon svg { fill: currentColor; }
.action-copy { flex: 1; min-width: 0; }
.action-copy small { display: block; color: #aab5af; font-size: 9px; font-weight: 700; }
.action-copy strong { display: block; font-size: 13px; font-weight: 900; overflow-wrap: anywhere; }
kbd { font: 700 9px var(--mono); padding: 3px 4px; background: #13191b; border: 1px solid #455050; border-radius: 4px; color: #c7d2cc; }
.ultimate-meter { height: 5px; background: #313937; border-radius: 4px; overflow: hidden; margin-top: 7px; }
.ultimate-meter i { transform: scaleX(0); background: linear-gradient(90deg, #db9b43, #ffe194); }
.ultimate.ready { border-color: var(--gold); box-shadow: 0 0 12px #ffd36e23; }
.item .action-icon { background: #283d3c; color: var(--mint); }
.item-description { color: var(--dim); font-size: 10px; margin-top: 7px; min-height: 13px; }
.instructions p { color: var(--dim); font-size: 11px; line-height: 1.6; margin: 9px 0 6px; }
.instructions p strong { color: var(--ivory); font-size: 12px; }
summary { color: var(--mint); font-size: 11px; font-weight: 750; padding: 3px 0 0; }
.instructions ul { display: grid; gap: 8px; margin: 10px 0 1px; padding: 0; list-style: none; font-size: 10px; color: var(--dim); }
.instructions li { display: flex; gap: 8px; }
.instructions li svg { color: var(--mint); width: 15px; height: 15px; }
.instructions li b { color: var(--ivory); }

@media (max-width: 700px) {
  .shell { --hud-top: 52px; }
  .topbar { gap: 4px; }
  .brand { gap: 5px; }
  .brand-title { font-size: clamp(10px, 3vw, 15px); }
  .brand-caption { display: none; }
  .brand-icon { width: 25px; height: 25px; }
  .header-actions { gap: 4px; }
  .icon-button { width: 31px; height: 32px; }
  .icon-button svg { width: 16px; height: 16px; }
  .timer { min-width: 0; padding: 4px 7px; gap: 4px; }
  .timer svg { display: none; }
  .timer strong { font-size: 17px; }
  .mission, .arsenal { width: clamp(110px, 28vw, 152px); padding: 7px; }
  .section-label { font-size: 10px; gap: 4px; }
  .section-label svg { width: 13px; height: 13px; }
  .section-label > span, .phase-note { font-size: 8px; }
  .phase-note { gap: 4px; }
  .count { margin-bottom: 5px; }
  .count small { font-size: 10px; }
  .phases span { padding: 3px 0; font-size: 8px; }
  .action { gap: 4px; padding: 4px; min-height: 35px; margin-top: 6px; }
  .action-icon { width: 20px; height: 23px; }
  .action-icon svg { width: 14px; height: 14px; }
  .action-copy strong { font-size: 10px; }
  .action-copy small, .item-description { font-size: 8px; }
  kbd { padding: 2px; }
  .overlay h1 { font-size: clamp(28px, 7vw, 52px); }
}
@media (max-height: 500px) {
  .shell { --hud-top: 43px; }
  .panel { padding-block: 6px; }
  .phase-note, .item-description { margin-top: 4px; }
  .action { margin-top: 5px; }
  .count strong { font-size: 30px; }
}
:root {
  --bg: #19111b;
  --panel: #261b28;
  --edge: #493345;
  --gold: #ffcc78;
  --gold-hi: #ffe5ab;
  --mint: #ffac9e;
  --dim: #c5b3bc;
}
body { background: radial-gradient(ellipse at 45% 0, #3b2337 0%, transparent 60%), var(--bg); }
.brand-icon { color: #512436; font: 900 26px/1 system-ui, sans-serif; }
.icon-button { background: #2d202c; border-color: #574052; }
.arena { background: radial-gradient(ellipse at 50% 54%, #602e48, #261b34 58%, #170f20); }
.overlay { background: radial-gradient(ellipse at center, #251425ed, #2c1c327d 45%, #1d132524 72%); }
.overlay h1 { text-shadow: 0 4px 23px #241224; }
.overlay p { color: #f7dfd6; }
.start-button { background: var(--gold); color: #472238; box-shadow: 0 5px 25px #ffb97340; }
.stage-shade { background: linear-gradient(#1f10258c, transparent 20%, transparent 78%, #20102586); }
.timer { background: #26182cec; border-color: #8e617877; }
.action { background: #312431; border-color: #563d53; }
.action-icon { background: #49303a; }
.item .action-icon { background: #453142; }
.ultimate-meter { background: #4e3549; }
.phases span { background: #392a38; border-color: #523c4f; color: #d0bdc7; }
.phases span.done { color: #ffccab; border-color: #965a60; background: #5d3747; }

.battle-call {
  position: absolute;
  z-index: 4;
  inset: auto var(--hud-inset) 0;
  height: var(--subtitle-room);
  display: grid;
  place-items: end center;
  padding-bottom: clamp(9px, 2.3vh, 20px);
  pointer-events: none;
}
.call-surface {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  max-width: min(100%, 900px);
  padding: 9px clamp(11px, 2vw, 25px) 10px;
  border: 1px solid #91697b88;
  border-radius: 11px;
  background: #180f1bea;
  box-shadow: 0 5px 20px #10091570;
}
.call-copy { text-align: center; }
.call-heading { display: flex; justify-content: center; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; }
.call-heading span { color: #f0adad; font: 800 10px var(--mono); letter-spacing: .08em; }
.call-heading strong { color: var(--gold-hi); font-weight: 800; font-size: 12px; line-height: 1.2; }
.call-copy p { margin: 4px auto 0; color: #fff7ee; font-size: clamp(17px, 2.05vw, 27px); font-weight: 850; line-height: 1.28; overflow-wrap: anywhere; text-wrap: pretty; }
.battle-call[data-mode="default"] .call-copy p { color: #d7c5cc; font-size: clamp(13px, 1.5vw, 18px); font-weight: 650; }
.battle-call[data-mode="boss"] .call-surface { border-color: #97566f; background: #251522f2; }
.battle-call[data-mode="boss-item"] .call-surface { border-color: #d6a16b; background: #332031f7; }
.battle-call[data-mode="boss-item"] .call-heading { align-items: center; }
.battle-call[data-mode="boss-item"] .call-heading strong { font-size: clamp(15px, 2.05vw, 27px); color: #ffe2a0; }
.battle-call[data-mode="boss-item"] .call-copy p { font-size: clamp(13px, 1.45vw, 18px); }
#boss-item-mark { display: inline-flex; color: #ffe2a0; }
#boss-item-mark svg { width: clamp(16px, 2vw, 25px); height: clamp(16px, 2vw, 25px); }
.battle-call[data-mode="ultimate"] .call-surface { border-color: #c4845c; background: #2d191df2; }
.boss-readout { display: grid; justify-items: center; gap: 3px; min-width: 77px; padding: 6px 8px; border: 1px solid #825764; border-radius: 6px; background: #231522; }
.boss-readout span { color: #ffc0ac; font-size: 10px; font-weight: 800; }
.boss-readout strong { color: var(--gold-hi); font: 800 16px/1 var(--mono); font-variant-numeric: tabular-nums; }
.boss-readout strong:empty { display: none; }
.action-notice { margin-top: 8px; color: var(--gold-hi); font-size: 11px; font-weight: 800; }

.speech-bubble {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  width: max-content;
  max-width: min(315px, 58vw);
  padding: 8px 13px 9px;
  border: 2px solid #d39573;
  border-radius: 12px;
  background: #fff0cf;
  color: #351c35;
  box-shadow: 0 5px 16px #130c1a9c;
  pointer-events: none;
}
.speech-bubble[data-speaker="boss"] { background: #f4e3ff; border-color: #c992e4; }
.speech-bubble strong { display: block; color: #7b3e51; font-size: 11px; font-weight: 900; line-height: 1.2; }
.speech-bubble[data-speaker="boss"] strong { color: #694378; }
.speech-bubble p { margin: 4px 0 0; font-size: clamp(13px, 1.5vw, 18px); font-weight: 850; line-height: 1.32; overflow-wrap: anywhere; }
.speech-bubble::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background: inherit;
  border: solid currentColor;
  border-color: inherit;
  border-width: 0 2px 2px 0;
}
.speech-bubble[data-tail="down"]::after { left: var(--tip); bottom: -7px; transform: translateX(-50%) rotate(45deg); }
.speech-bubble[data-tail="up"]::after { left: var(--tip); top: -7px; transform: translateX(-50%) rotate(225deg); }
.speech-bubble[data-tail="left"]::after { top: var(--tip); left: -7px; transform: translateY(-50%) rotate(135deg); }
.speech-bubble[data-tail="right"]::after { top: var(--tip); right: -7px; transform: translateY(-50%) rotate(-45deg); }

.eye-cutin {
  position: absolute;
  z-index: 4;
  inset: 25% -1px 25%;
  pointer-events: none;
  overflow: hidden;
  background: #b93455;
  border-block: 3px solid #ffe1a1;
  box-shadow: 0 0 0 4px #301528, 0 18px 65px #170b1ad9;
  clip-path: polygon(0 8%, 100% 0, 100% 91%, 0 100%);
}
.eye-art { display: block; width: 100%; height: 100%; stroke: none; }
@media (max-width: 700px) {
  .arena-view { --subtitle-room: 132px; }
  .call-surface { gap: 7px; padding: 7px 9px; }
  .call-heading strong { font-size: 11px; }
  .boss-readout { min-width: 60px; padding: 5px; }
  .boss-readout span { font-size: 9px; }
  .boss-readout strong { font-size: 14px; }
}
@media (max-height: 500px) {
  .arena-view { --subtitle-room: 88px; }
  .call-surface { padding-block: 5px 7px; }
  .call-copy p { font-size: clamp(14px, 4.2vh, 20px); }
}

.story { position: absolute; inset: 0; z-index: 5; isolation: isolate; overflow: hidden; background: #17101f; color: #fff3d6; }
.story-art, .story-vignette { position: absolute; inset: 0; width: 100%; height: 100%; }
.story-art { display: block; stroke: none; }
.story-vignette { pointer-events: none; background: linear-gradient(#170c1dc2, transparent 20%, transparent 56%, #180e21f5 88%); }
.story-top { position: absolute; inset: calc(var(--hud-top) + 6px) var(--hud-inset) auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.story-top span { color: #f1cda1; font: 700 11px var(--mono); letter-spacing: .15em; }
.story-top i { display: inline-block; margin-inline: 3px; background: #e38d8f; border-radius: 50%; width: 4px; height: 4px; vertical-align: middle; }
.story-top button { display: flex; align-items: center; gap: 4px; padding: 6px 8px 6px 10px; color: #fff3d6; background: #211426eb; border: 1px solid #d49d997a; border-radius: 5px; font-size: 11px; font-weight: 800; }
.story-top button:hover { border-color: var(--gold); }
.story-top svg { width: 13px; height: 13px; }
.story-caption { position: absolute; inset: auto 15px clamp(20px, 4vw, 36px); text-align: center; }
.story-caption span { color: #ffc08e; font: 800 10px var(--mono); letter-spacing: .18em; }
.story-caption strong { display: block; margin-top: 4px; color: #ffedc3; font-size: clamp(18px, 3.3vw, 43px); line-height: 1.18; font-weight: 950; text-shadow: 0 3px 16px #251025; }
.story-caption p { margin: 7px auto 0; max-width: 620px; color: #fff2e1; font-size: clamp(12px, 1.5vw, 16px); line-height: 1.5; font-weight: 650; text-wrap: pretty; }
.story-progress { position: absolute; inset: auto 0 0; height: 4px; background: #1b1024; }
.story-progress i { display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, #df727e, #ffd48e); }
.story-shot { display: none; }
.story[data-scene="practice"] .shot-practice,
.story[data-scene="poster"] .shot-poster,
.story[data-scene="resolve"] .shot-resolve,
.story[data-scene="arena"] .shot-arena { display: inline; animation: scene-enter .62s ease-out both; }
.practice-wobble { animation: practice-wobble 2.35s ease-in-out infinite; }
.poster-sway { transform-origin: 553px 76px; animation: poster-sway 3.7s ease-in-out infinite; }
.resolve-rise { animation: resolve-rise 1.4s ease-out both; }
.curtain-left { animation: curtain-left 2.2s ease-in-out both; }
.curtain-right { animation: curtain-right 2.2s ease-in-out both; }
@keyframes scene-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes practice-wobble { 0%, 100% { transform: translateX(-15px) rotate(-7deg); } 50% { transform: translateX(15px) rotate(8deg); } }
@keyframes poster-sway { 0%, 100% { transform: rotate(-1deg); } 50% { transform: rotate(1deg); } }
@keyframes resolve-rise { from { transform: translateY(22px) scale(.98); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes curtain-left { from { transform: none; } to { transform: translateX(-290px); } }
@keyframes curtain-right { from { transform: none; } to { transform: translateX(290px); } }
@media (max-width: 700px) {
  .story-top span { font-size: 9px; }
  .story-art { top: -17px; }
}
@media (prefers-reduced-motion: reduce) {
  .story .story-shot, .story .practice-wobble, .story .poster-sway, .story .resolve-rise, .story .curtain { animation: none; }
  .curtain-left { transform: translateX(-290px); }
  .curtain-right { transform: translateX(290px); }
}
