:root {
  color-scheme: light;
  --bg: #f7fafb;
  --panel: rgba(255, 255, 255, 0.76);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --panel-soft: rgba(255, 255, 255, 0.58);
  --line: rgba(34, 83, 95, 0.16);
  --line-hot: rgba(34, 83, 95, 0.34);
  --text: #17242b;
  --muted: #66757c;
  --accent: #2f6f7b;
  --accent-strong: #164f5d;
  --accent-soft: rgba(47, 111, 123, 0.08);
  --cyan: var(--accent);
  --gold: var(--accent);
  --pink: var(--accent);
  --green: var(--accent);
  --danger: #9d4f58;
  --body-bg: #fbfdff;
  --shell-bg: rgba(255, 255, 255, 0.9);
  --reader-bg: rgba(255, 255, 255, 0.86);
  --digit-bg: rgba(255, 255, 255, 0.94);
  --digit-border: rgba(47, 111, 123, 0.24);
  --digit-color: var(--accent-strong);
  --digit-shadow: none;
  --digit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
  --hud-bg: rgba(255, 255, 255, 0.66);
  --message-bg: rgba(255, 255, 255, 0.7);
  --message-border: rgba(34, 83, 95, 0.14);
  --card-bg: rgba(255, 255, 255, 0.9);
  --logo-filter: none;
  --logo-blend: normal;
  --button-bg: rgba(255, 255, 255, 0.9);
  --modal-bg: rgba(255, 255, 255, 0.96);
}

/* Reference-image rebuild: anime library fighting UI */
body[data-mode="cpu"] {
  --ref-gold: #ffd27a;
  --ref-gold-strong: #ff9f2e;
  --ref-violet: #bd62ff;
  --ref-violet-soft: rgba(172, 89, 255, 0.36);
  --ref-ink: rgba(5, 7, 14, 0.86);
  --ref-panel: rgba(8, 10, 20, 0.72);
  --ref-line: rgba(255, 210, 122, 0.58);
  background:
    radial-gradient(circle at 28% 34%, rgba(255, 154, 45, 0.18), transparent 34%),
    radial-gradient(circle at 76% 40%, rgba(174, 78, 255, 0.2), transparent 36%),
    #04050a;
  color: #fff8e8;
}

body[data-mode="cpu"] .arena {
  position: relative;
  display: grid;
  place-items: center;
  width: min(calc(100vw - 20px), 1480px);
  min-height: calc(100vh - 20px);
  padding: 10px;
}

body[data-mode="cpu"] .ambient-lines,
body[data-mode="cpu"] .scan-grid {
  display: none;
}

body[data-mode="cpu"] .game-shell {
  position: relative;
  width: 100%;
  min-height: min(820px, calc(100vh - 28px));
  padding: 18px;
  border: 1px solid rgba(255, 210, 122, 0.5);
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(255, 139, 36, 0.22), transparent 31%, transparent 67%, rgba(159, 53, 255, 0.22)),
    linear-gradient(180deg, rgba(7, 8, 16, 0.12), rgba(4, 5, 10, 0.84)),
    url("image/ancient-library-bg.png") center / cover no-repeat;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 42px rgba(255, 163, 55, 0.18),
    inset 0 0 80px rgba(0, 0, 0, 0.58);
  overflow: hidden;
}

body[data-mode="cpu"] .game-shell::before {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 0;
  border: 1px solid rgba(255, 210, 122, 0.34);
  pointer-events: none;
  box-shadow:
    inset 0 0 24px rgba(255, 190, 93, 0.1),
    0 0 22px rgba(185, 77, 255, 0.1);
}

body[data-mode="cpu"] .game-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(116deg, rgba(255, 136, 31, 0.16), transparent 43%, rgba(183, 74, 255, 0.2) 58%, transparent 77%),
    radial-gradient(circle at 50% 46%, rgba(255, 112, 24, 0.18), transparent 20%);
  mix-blend-mode: screen;
  pointer-events: none;
}

body[data-mode="cpu"] #karuta,
body[data-mode="cpu"] .topbar,
body[data-mode="cpu"] .credits,
body[data-mode="cpu"] .toggle-stack {
  position: relative;
  z-index: 2;
}

body[data-mode="cpu"] .topbar {
  position: absolute;
  top: 22px;
  left: 50%;
  justify-content: center;
  width: max-content;
  margin: 0;
  transform: translateX(-50%);
}

body[data-mode="cpu"] .status-chip {
  color: var(--ref-gold);
  font-size: 1rem;
  text-shadow: 0 0 14px rgba(255, 159, 46, 0.58);
}

body[data-mode="cpu"] .sound-toggle-wrapper {
  color: rgba(255, 248, 232, 0.76);
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
}

body[data-mode="cpu"] .fighter-story {
  position: relative;
  z-index: 2;
  min-height: min(650px, calc(100vh - 132px));
  margin: 0 auto;
  align-content: center;
}

body[data-mode="cpu"] .game-hero,
body[data-mode="cpu"].fighter-flow .game-hero {
  display: none;
}

body[data-mode="cpu"] .action-row {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: -78px auto 0;
}

body[data-mode="cpu"] .action-row button,
body[data-mode="cpu"] .fighter-flow-actions button,
body[data-mode="cpu"] .character-select-info button,
body[data-mode="cpu"] #fighterSkillButton,
body[data-mode="cpu"] #fighterContinueButton,
body[data-mode="cpu"] #resultTopButton {
  min-height: 48px;
  border: 1px solid rgba(255, 224, 148, 0.74);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 230, 157, 0.95), rgba(255, 156, 45, 0.9) 52%, rgba(114, 48, 5, 0.94));
  color: #160907;
  font-weight: 900;
  box-shadow:
    0 0 18px rgba(255, 153, 38, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.36);
}

body[data-mode="cpu"] .action-row button:hover,
body[data-mode="cpu"] .fighter-flow-actions button:hover,
body[data-mode="cpu"] .character-select-info button:hover,
body[data-mode="cpu"] #fighterSkillButton:hover,
body[data-mode="cpu"] #fighterContinueButton:hover,
body[data-mode="cpu"] #resultTopButton:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 26px rgba(255, 153, 38, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

body[data-mode="cpu"] .action-row #howToButton,
body[data-mode="cpu"] .action-row #quitButton,
body[data-mode="cpu"] .action-row #restartButton,
body[data-mode="cpu"] .fighter-flow-actions button + button,
body[data-mode="cpu"] #resultTopButton {
  background:
    linear-gradient(180deg, rgba(30, 22, 37, 0.92), rgba(9, 10, 20, 0.92));
  color: #fff8e8;
}

body[data-mode="cpu"] .credits {
  color: rgba(255, 248, 232, 0.46);
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.74);
}

body[data-mode="cpu"] .credits a {
  color: rgba(255, 210, 122, 0.8);
}

body[data-mode="cpu"] .reference-title {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  min-height: 560px;
  width: min(100%, 1100px);
  margin: 0 auto;
  text-align: center;
}

body[data-mode="cpu"] .title-sigil {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: 360px;
  height: 360px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 210, 122, 0.2);
  border-radius: 50%;
  color: rgba(255, 210, 122, 0.12);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 5.4rem;
  transform: translate(-50%, -50%);
  box-shadow: inset 0 0 40px rgba(255, 210, 122, 0.08);
}

body[data-mode="cpu"] .fighter-title-copy {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 14px;
}

body[data-mode="cpu"] .fighter-eyebrow {
  color: var(--ref-gold);
  font-size: 1.05rem;
  text-shadow: 0 0 14px rgba(255, 159, 46, 0.5);
}

body[data-mode="cpu"] .fighter-title-copy h1 {
  margin: 0;
  color: #fff8e8;
  font-size: 4.8rem;
  line-height: 1.02;
  text-shadow:
    0 2px 0 rgba(62, 20, 4, 0.95),
    0 0 30px rgba(255, 159, 46, 0.64),
    0 0 58px rgba(183, 74, 255, 0.25);
}

body[data-mode="cpu"] .fighter-title-copy p:not(.fighter-eyebrow) {
  color: rgba(255, 248, 232, 0.88);
  font-size: 1.08rem;
  font-weight: 900;
}

body[data-mode="cpu"] .difficulty-select {
  position: relative;
  z-index: 2;
  grid-template-columns: repeat(3, minmax(118px, 150px));
  justify-content: center;
  margin-top: 18px;
}

body[data-mode="cpu"] .difficulty-select button {
  min-height: 72px;
  border: 1px solid rgba(255, 210, 122, 0.32);
  border-radius: 0;
  background: rgba(7, 8, 16, 0.68);
  color: #fff8e8;
  box-shadow: inset 0 0 24px rgba(255, 210, 122, 0.06);
}

body[data-mode="cpu"] .difficulty-select button.active {
  border-color: rgba(255, 210, 122, 0.82);
  background:
    linear-gradient(180deg, rgba(255, 210, 122, 0.2), rgba(255, 134, 32, 0.22)),
    rgba(7, 8, 16, 0.76);
  box-shadow: 0 0 22px rgba(255, 159, 46, 0.36);
}

body[data-mode="cpu"] .difficulty-select strong {
  color: var(--ref-gold);
  font-size: 1.35rem;
}

body[data-mode="cpu"] .difficulty-select span {
  color: rgba(255, 248, 232, 0.72);
}

body[data-mode="cpu"] .reference-select {
  width: min(100%, 1160px);
  min-height: 640px;
}

body[data-mode="cpu"] .fighter-screen-head h2 {
  margin: 0;
  color: #fff8e8;
  font-size: 3.6rem;
  line-height: 1;
  text-shadow:
    0 2px 0 rgba(52, 19, 3, 0.95),
    0 0 24px rgba(255, 159, 46, 0.58);
}

body[data-mode="cpu"] .character-select-stage {
  grid-template-columns: minmax(320px, 0.9fr) minmax(340px, 1fr);
  gap: 20px;
}

body[data-mode="cpu"] .character-full-art,
body[data-mode="cpu"] .character-select-info {
  border: 1px solid rgba(255, 210, 122, 0.42);
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(255, 210, 122, 0.08), transparent 40%),
    rgba(5, 7, 14, 0.64);
  box-shadow:
    0 0 24px rgba(255, 159, 46, 0.18),
    inset 0 0 0 1px rgba(255, 248, 232, 0.06);
  backdrop-filter: blur(8px);
}

body[data-mode="cpu"] .character-full-art {
  min-height: 430px;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 224, 148, 0.94), rgba(255, 235, 191, 0.7) 32%, rgba(8, 10, 20, 0.62) 68%),
    rgba(8, 10, 20, 0.62);
}

body[data-mode="cpu"] .character-full-art::before {
  inset: 12px;
  border-color: rgba(255, 210, 122, 0.28);
  border-radius: 0;
}

body[data-mode="cpu"] .character-full-art img {
  width: min(86%, 360px);
  filter:
    drop-shadow(0 0 18px rgba(255, 210, 122, 0.18))
    drop-shadow(0 20px 24px rgba(0, 0, 0, 0.5));
}

body[data-mode="cpu"] .character-art-name {
  position: absolute;
  left: 20px;
  bottom: 18px;
  z-index: 2;
  padding: 8px 18px;
  border: 1px solid rgba(255, 210, 122, 0.6);
  background: rgba(5, 7, 14, 0.72);
  color: #fff8e8;
  font-weight: 900;
  box-shadow: 0 0 18px rgba(255, 159, 46, 0.22);
}

body[data-mode="cpu"] .character-select-info h3 {
  color: #fff8e8;
  font-size: 3.8rem;
  text-shadow: 0 0 24px rgba(255, 159, 46, 0.38);
}

body[data-mode="cpu"] .character-select-info p,
body[data-mode="cpu"] .character-select-info dd {
  color: rgba(255, 248, 232, 0.9);
}

body[data-mode="cpu"] .character-select-info dt {
  color: var(--ref-gold);
}

body[data-mode="cpu"] .character-quote {
  padding: 12px 16px;
  border-left: 3px solid var(--ref-gold);
  background: rgba(255, 210, 122, 0.08);
}

body[data-mode="cpu"] .character-icon-row {
  grid-template-columns: repeat(3, minmax(0, 126px));
}

body[data-mode="cpu"] .character-icon-row button {
  border: 1px solid rgba(255, 210, 122, 0.34);
  border-radius: 0;
  background: rgba(5, 7, 14, 0.68);
  color: rgba(255, 248, 232, 0.78);
  box-shadow: inset 0 0 20px rgba(255, 210, 122, 0.04);
}

body[data-mode="cpu"] .character-icon-row button.active,
body[data-mode="cpu"] .character-icon-row button:hover {
  border-color: rgba(255, 210, 122, 0.8);
  background:
    linear-gradient(180deg, rgba(255, 210, 122, 0.18), rgba(178, 82, 255, 0.12)),
    rgba(5, 7, 14, 0.76);
  box-shadow: 0 0 18px rgba(255, 159, 46, 0.32);
}

body[data-mode="cpu"] .character-icon-row img {
  border-color: rgba(255, 210, 122, 0.5);
  border-radius: 0;
}

body[data-mode="cpu"] .reference-vs-screen {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  width: min(100%, 1240px);
  min-height: min(650px, calc(100vh - 140px));
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 210, 122, 0.42);
  background:
    linear-gradient(111deg, rgba(255, 145, 32, 0.26) 0 45%, rgba(4, 5, 10, 0.96) 45% 55%, rgba(166, 63, 255, 0.3) 55% 100%),
    url("image/ancient-library-bg.png") center / cover no-repeat;
  box-shadow:
    0 0 30px rgba(255, 159, 46, 0.18),
    inset 0 0 70px rgba(0, 0, 0, 0.6);
}

body[data-mode="cpu"] .reference-vs-screen::before,
body[data-mode="cpu"] .reference-vs-screen::after {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: 5;
  pointer-events: none;
}

body[data-mode="cpu"] .reference-vs-screen::before {
  border-top: 1px solid rgba(255, 210, 122, 0.54);
  border-bottom: 1px solid rgba(190, 98, 255, 0.54);
}

body[data-mode="cpu"] .reference-vs-screen::after {
  background:
    linear-gradient(90deg, rgba(255, 210, 122, 0.64), transparent 16%, transparent 84%, rgba(190, 98, 255, 0.64)) top / 100% 2px no-repeat,
    linear-gradient(90deg, rgba(255, 210, 122, 0.54), transparent 16%, transparent 84%, rgba(190, 98, 255, 0.54)) bottom / 100% 2px no-repeat;
}

body[data-mode="cpu"] .vs-energy {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.88;
  pointer-events: none;
}

body[data-mode="cpu"] .vs-energy-left {
  background:
    radial-gradient(circle at 32% 42%, rgba(255, 210, 122, 0.34), transparent 26%),
    linear-gradient(104deg, rgba(255, 122, 18, 0.28), transparent 46%);
}

body[data-mode="cpu"] .vs-energy-right {
  background:
    radial-gradient(circle at 72% 42%, rgba(190, 98, 255, 0.38), transparent 28%),
    linear-gradient(284deg, rgba(190, 45, 255, 0.3), transparent 46%);
}

body[data-mode="cpu"] .reference-vs-screen .vs-combatant {
  position: relative;
  z-index: 1;
  display: block;
  min-width: 0;
  overflow: hidden;
  text-align: left;
}

body[data-mode="cpu"] .reference-vs-screen .vs-combatant.enemy {
  text-align: right;
}

body[data-mode="cpu"] .reference-vs-screen .vs-image {
  position: absolute;
  inset: 0;
  height: auto;
}

body[data-mode="cpu"] .reference-vs-screen .vs-image img {
  position: absolute;
  bottom: -12px;
  left: 4%;
  width: min(86%, 520px);
  height: 96%;
  object-fit: contain;
  object-position: bottom center;
  filter:
    drop-shadow(0 0 18px rgba(255, 210, 122, 0.24))
    drop-shadow(0 24px 28px rgba(0, 0, 0, 0.72));
}

body[data-mode="cpu"] .reference-vs-screen .enemy .vs-image img {
  right: 0;
  left: auto;
  filter:
    drop-shadow(0 0 20px rgba(190, 98, 255, 0.32))
    drop-shadow(0 24px 28px rgba(0, 0, 0, 0.74));
}

body[data-mode="cpu"] .vs-nameplate {
  position: absolute;
  left: 42px;
  right: 36px;
  bottom: 42px;
  z-index: 3;
  min-height: 116px;
  padding: 18px 26px;
  border: 1px solid rgba(255, 210, 122, 0.7);
  background:
    linear-gradient(90deg, rgba(255, 155, 42, 0.16), transparent),
    rgba(5, 7, 14, 0.72);
  box-shadow:
    0 0 22px rgba(255, 159, 46, 0.36),
    inset 0 0 0 1px rgba(255, 248, 232, 0.08);
}

body[data-mode="cpu"] .enemy .vs-nameplate {
  border-color: rgba(203, 118, 255, 0.72);
  background:
    linear-gradient(270deg, rgba(190, 98, 255, 0.18), transparent),
    rgba(5, 7, 14, 0.72);
  box-shadow:
    0 0 24px rgba(190, 98, 255, 0.34),
    inset 0 0 0 1px rgba(255, 248, 232, 0.08);
}

body[data-mode="cpu"] .vs-nameplate h2 {
  margin: 0;
  color: #fff8e8;
  font-size: 3rem;
  line-height: 1;
  text-shadow: 0 0 22px rgba(255, 159, 46, 0.55);
}

body[data-mode="cpu"] .enemy .vs-nameplate h2 {
  text-shadow: 0 0 22px rgba(190, 98, 255, 0.58);
}

body[data-mode="cpu"] .vs-nameplate p:not(.fighter-eyebrow) {
  margin: 8px 0 0;
  color: rgba(255, 248, 232, 0.82);
  font-weight: 900;
}

body[data-mode="cpu"] .reference-vs-screen .vs-mark {
  position: relative;
  z-index: 4;
  place-self: center;
  width: 220px;
  height: 220px;
  display: grid;
  place-items: center;
  color: #fff8e8;
}

body[data-mode="cpu"] .reference-vs-screen .vs-mark::before {
  content: "";
  position: absolute;
  inset: -70px -34px;
  background:
    linear-gradient(130deg, transparent 38%, rgba(255, 95, 16, 0.92) 44%, #fff0b0 49%, rgba(255, 89, 16, 0.9) 54%, transparent 62%),
    radial-gradient(circle, rgba(255, 104, 22, 0.76), transparent 56%);
  clip-path: polygon(46% 0, 62% 35%, 100% 28%, 66% 52%, 78% 100%, 50% 63%, 20% 100%, 33% 56%, 0 28%, 39% 34%);
  filter: drop-shadow(0 0 18px rgba(255, 94, 20, 0.94));
}

body[data-mode="cpu"] .reference-vs-screen .vs-mark span {
  position: relative;
  z-index: 1;
  font-size: 5.8rem;
  line-height: 0.8;
  text-shadow:
    0 2px 0 #2a0800,
    0 0 18px rgba(255, 226, 148, 0.96),
    0 0 44px rgba(255, 86, 16, 0.94);
}

body[data-mode="cpu"] .reference-vs-screen .vs-mark small {
  position: absolute;
  bottom: 14px;
  z-index: 1;
  color: #fff0c9;
  font-size: 0.9rem;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

body[data-mode="cpu"] .reference-flow-actions {
  position: relative;
  z-index: 4;
  margin-top: -68px;
}

body[data-mode="cpu"].fighter-playing .game-shell {
  padding: 16px 18px 18px;
  background:
    linear-gradient(90deg, rgba(255, 139, 36, 0.2), transparent 34%, transparent 66%, rgba(159, 53, 255, 0.22)),
    linear-gradient(180deg, rgba(4, 5, 10, 0.36), rgba(4, 5, 10, 0.92)),
    url("image/ancient-library-bg.png") center / cover no-repeat;
}

body[data-mode="cpu"].fighter-playing .reader-panel {
  border: 1px solid rgba(255, 210, 122, 0.36);
  border-radius: 0;
  background: rgba(5, 7, 14, 0.64);
  box-shadow: inset 0 0 34px rgba(255, 210, 122, 0.06);
}

body[data-mode="cpu"] .fighter-battle-hud {
  position: relative;
  z-index: 3;
  grid-template-columns: minmax(0, 1fr) 132px minmax(0, 1fr);
  gap: 14px;
  margin: 2px 0 12px;
}

body[data-mode="cpu"] .fighter-combatant {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 210, 122, 0.42);
  background:
    linear-gradient(90deg, rgba(255, 152, 40, 0.14), transparent),
    rgba(5, 7, 14, 0.76);
  box-shadow: 0 0 18px rgba(255, 159, 46, 0.14);
}

body[data-mode="cpu"] .fighter-combatant.enemy {
  border-color: rgba(190, 98, 255, 0.46);
  background:
    linear-gradient(270deg, rgba(190, 98, 255, 0.16), transparent),
    rgba(5, 7, 14, 0.76);
  box-shadow: 0 0 18px rgba(190, 98, 255, 0.16);
}

body[data-mode="cpu"] .fighter-face {
  border: 1px solid rgba(255, 210, 122, 0.56);
  border-radius: 0;
  background: rgba(255, 248, 232, 0.9);
}

body[data-mode="cpu"] .fighter-label {
  color: rgba(255, 248, 232, 0.68);
}

body[data-mode="cpu"] .fighter-label strong {
  color: #fff8e8;
  text-shadow: 0 0 10px rgba(255, 159, 46, 0.36);
}

body[data-mode="cpu"] .hp-track,
body[data-mode="cpu"] .gauge-track {
  height: 14px;
  border: 1px solid rgba(255, 248, 232, 0.18);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.46);
}

body[data-mode="cpu"] .hp-track span,
body[data-mode="cpu"] .gauge-track span {
  border-radius: 0;
  background:
    linear-gradient(90deg, #fff2bd, #ffb13a 36%, #ff5a20);
  box-shadow: 0 0 12px rgba(255, 159, 46, 0.42);
}

body[data-mode="cpu"] .hp-track.enemy span,
body[data-mode="cpu"] .gauge-track.enemy span {
  background:
    linear-gradient(90deg, #f2d2ff, #c064ff 42%, #8f1cff);
  box-shadow: 0 0 12px rgba(190, 98, 255, 0.48);
}

body[data-mode="cpu"] .fight-clock {
  border: 1px solid rgba(255, 210, 122, 0.52);
  border-radius: 0;
  background: rgba(5, 7, 14, 0.82);
  color: #fff8e8;
  box-shadow: 0 0 20px rgba(255, 159, 46, 0.18);
}

body[data-mode="cpu"] #fightHudClock {
  color: var(--ref-gold);
  text-shadow: 0 0 14px rgba(255, 159, 46, 0.72);
}

body[data-mode="cpu"] .fighter-skill-strip {
  position: relative;
  z-index: 3;
  margin: 10px 0 10px;
}

body[data-mode="cpu"] #reading .digit {
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 210, 122, 0.18), rgba(5, 7, 14, 0.84));
  color: #fff8e8;
  box-shadow:
    0 0 18px rgba(255, 159, 46, 0.2),
    inset 0 0 0 1px rgba(255, 248, 232, 0.08);
}

body[data-mode="cpu"] #message {
  color: #fff8e8;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.8);
}

body[data-mode="cpu"] .grid {
  position: relative;
  z-index: 3;
}

body[data-mode="cpu"] .card {
  border: 1px solid rgba(255, 210, 122, 0.34);
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(255, 210, 122, 0.1), transparent 38%),
    rgba(7, 8, 16, 0.78);
  color: #fff8e8;
  box-shadow:
    0 0 14px rgba(255, 159, 46, 0.08),
    inset 0 0 0 1px rgba(255, 248, 232, 0.04);
}

body[data-mode="cpu"] .card:hover {
  border-color: rgba(255, 210, 122, 0.74);
  box-shadow:
    0 0 20px rgba(255, 159, 46, 0.24),
    inset 0 0 0 1px rgba(255, 248, 232, 0.08);
}

body[data-mode="cpu"] .card.correct {
  background:
    linear-gradient(135deg, rgba(255, 236, 170, 0.32), rgba(255, 130, 24, 0.26)),
    rgba(7, 8, 16, 0.82);
}

body[data-mode="cpu"] .result-modal {
  width: min(calc(100vw - 24px), 1480px);
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff8e8;
}

body[data-mode="cpu"] .result-modal::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
}

body[data-mode="cpu"] .result-modal .modal-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 620px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 210, 122, 0.5);
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(255, 139, 36, 0.18), transparent 32%, rgba(177, 66, 255, 0.26)),
    linear-gradient(180deg, rgba(5, 7, 14, 0.12), rgba(5, 7, 14, 0.52)),
    url("image/ancient-library-bg.png") center / cover no-repeat;
  box-shadow:
    0 0 42px rgba(190, 98, 255, 0.18),
    inset 0 0 80px rgba(0, 0, 0, 0.58);
}

body[data-mode="cpu"] .result-modal .modal-head {
  display: none;
}

body[data-mode="cpu"] .result-modal #resultDisplay {
  position: absolute;
  inset: 0;
  display: block !important;
  width: auto;
  height: auto;
  padding: 0;
}

body[data-mode="cpu"] .result-modal #battleResult,
body[data-mode="cpu"] .reference-result-screen {
  position: absolute;
  inset: 0;
}

body[data-mode="cpu"] .result-modal #resultCards {
  display: none;
}

body[data-mode="cpu"] .reference-result-screen {
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 42%, rgba(190, 98, 255, 0.36), transparent 32%),
    radial-gradient(circle at 30% 38%, rgba(255, 210, 122, 0.2), transparent 30%);
}

body[data-mode="cpu"] .reference-result-screen::before {
  content: "";
  position: absolute;
  inset: 16px;
  z-index: 5;
  border: 1px solid rgba(255, 210, 122, 0.3);
  pointer-events: none;
}

body[data-mode="cpu"] .result-aura {
  position: absolute;
  inset: -16% -8%;
  background:
    radial-gradient(circle at 70% 48%, rgba(210, 119, 255, 0.48), transparent 24%),
    conic-gradient(from 230deg at 65% 52%, transparent, rgba(179, 84, 255, 0.42), transparent, rgba(255, 227, 160, 0.28), transparent);
  filter: blur(1px);
  opacity: 0.85;
}

body[data-mode="cpu"] .outcome-lose .result-aura {
  background:
    radial-gradient(circle at 70% 48%, rgba(255, 71, 98, 0.42), transparent 25%),
    conic-gradient(from 230deg at 65% 52%, transparent, rgba(255, 76, 76, 0.32), transparent, rgba(190, 98, 255, 0.28), transparent);
}

body[data-mode="cpu"] .result-copy {
  position: absolute;
  left: 58px;
  top: 92px;
  z-index: 4;
  display: grid;
  gap: 8px;
  min-width: 420px;
  text-align: center;
}

body[data-mode="cpu"] .result-copy h3 {
  margin: 0;
  color: #fff8ff;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 6.2rem;
  line-height: 0.9;
  text-shadow:
    0 0 22px rgba(190, 98, 255, 0.8),
    0 0 44px rgba(255, 255, 255, 0.24);
}

body[data-mode="cpu"] .outcome-win .result-copy h3,
body[data-mode="cpu"] .is-final .result-copy h3 {
  text-shadow:
    0 0 22px rgba(255, 210, 122, 0.72),
    0 0 44px rgba(190, 98, 255, 0.42);
}

body[data-mode="cpu"] .result-copy strong {
  color: #fff8e8;
  font-size: 2.1rem;
  text-shadow: 0 0 20px rgba(190, 98, 255, 0.72);
}

body[data-mode="cpu"] .result-hero-art {
  position: absolute;
  right: 8%;
  bottom: -3%;
  z-index: 3;
  width: min(48%, 620px);
  height: 96%;
  display: flex;
  align-items: end;
  justify-content: center;
}

body[data-mode="cpu"] .result-hero-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  filter:
    drop-shadow(0 0 22px rgba(190, 98, 255, 0.34))
    drop-shadow(0 28px 34px rgba(0, 0, 0, 0.78));
}

body[data-mode="cpu"] .result-dialogue {
  position: absolute;
  left: 9%;
  right: 9%;
  bottom: 64px;
  z-index: 6;
  min-height: 132px;
  padding: 28px 36px 26px;
  border: 1px solid rgba(255, 210, 122, 0.6);
  background:
    linear-gradient(90deg, rgba(105, 69, 155, 0.18), transparent 56%),
    rgba(5, 7, 14, 0.72);
  box-shadow:
    0 0 24px rgba(190, 98, 255, 0.22),
    inset 0 0 0 1px rgba(255, 248, 232, 0.08);
}

body[data-mode="cpu"] .result-dialogue p {
  margin: 0;
  color: #fff8e8;
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1.45;
  text-shadow: 0 0 16px rgba(0, 0, 0, 0.78);
}

body[data-mode="cpu"] .result-scoreline {
  display: flex;
  gap: 14px;
  margin-top: 16px;
  color: rgba(255, 248, 232, 0.72);
  font-size: 0.9rem;
  font-weight: 900;
}

body[data-mode="cpu"] .result-modal .result-actions {
  position: absolute;
  right: 42px;
  bottom: 24px;
  z-index: 8;
  display: flex;
  gap: 10px;
  margin: 0;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: "Noto Sans JP", system-ui, sans-serif;
  background: var(--body-bg);
  overflow-x: hidden;
}

body[data-mode="cpu"] #scoreDisplay,
body[data-mode="cpu"] #waveDisplay,
body[data-mode="cpu"] #lifeDisplay,
body[data-mode="cpu"] #rankingWrapper,
body[data-mode="cpu"] #resultScorePanel,
body[data-mode="cpu"] #localHighScore_result,
body[data-mode="cpu"] #resultRankingContainer2,
body:not([data-mode="cpu"]) #scoreDisplayPlayer,
body:not([data-mode="cpu"]) #scoreDisplayCPU,
body:not([data-mode="cpu"]) #battleResult,
body:not([data-mode="cpu"]) .cpu-ranking-note,
body:not([data-mode="cpu"]) .cpu-level-panel,
body:not([data-mode="endless"]) #waveDisplay,
body:not([data-mode="endless"]) #lifeDisplay {
  display: none !important;
}

body[data-mode="cpu"] .cpu-ranking-note {
  display: block;
}

button,
a {
  font: inherit;
}

.arena {
  position: relative;
  width: min(1180px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 40px;
}

.ambient-lines,
.scan-grid,
#fxLayer {
  pointer-events: none;
}

.ambient-lines,
.scan-grid {
  position: fixed;
  inset: 0;
}

.ambient-lines {
  display: none;
}

.scan-grid {
  background-image:
    linear-gradient(rgba(34, 83, 95, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 83, 95, 0.028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

#fxLayer {
  position: static;
  width: 0;
  height: 0;
  overflow: visible;
}

.game-shell {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 92px);
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--shell-bg);
  box-shadow: 0 18px 44px rgba(31, 83, 103, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px) saturate(1.16);
  overflow: hidden;
}

.game-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: inherit;
  pointer-events: none;
}

.game-hero {
  display: flex;
  justify-content: center;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.game-playing .game-hero {
  display: none;
}

.game-logo {
  width: min(420px, 88vw);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: var(--logo-filter);
  mix-blend-mode: var(--logo-blend);
}

.eyebrow,
.status-chip {
  margin: 0;
  color: var(--gold);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: clamp(1rem, 2vw, 1.35rem);
  letter-spacing: 0;
}

h1 {
  margin: 4px 0 8px;
  font-size: clamp(2.2rem, 6vw, 4.9rem);
  line-height: 0.92;
  letter-spacing: 0;
  word-break: keep-all;
  text-shadow: none;
}

.tagline {
  max-width: 36em;
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 2vw, 1.18rem);
}

.topbar,
.hud,
#rankingWrapper,
#resultDisplay {
  display: flex;
  gap: 16px;
}

.topbar {
  align-items: center;
  justify-content: center;
  margin: 14px 0 18px;
  min-height: 28px;
}

.mode-actions,
.menu-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 180px));
  justify-content: center;
  align-items: stretch;
  gap: 10px;
  margin: 0 auto;
}

.mode-actions {
  width: min(100%, 640px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.game-playing .mode-actions {
  display: none;
}

.game-playing .toggle-stack {
  display: none;
}

.toggle-stack {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.sound-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

.switch input[type="checkbox"] {
  appearance: none;
  position: relative;
  width: 32px;
  height: 18px;
  margin: 0;
  border: 1px solid rgba(34, 83, 95, 0.2);
  border-radius: 999px;
  background: rgba(225, 240, 245, 0.9);
  cursor: pointer;
  transition: background 0.24s, box-shadow 0.24s;
}

.switch input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(31, 83, 103, 0.16);
  transition: transform 0.24s;
}

.switch input[type="checkbox"]:checked {
  background: var(--cyan);
  box-shadow: 0 0 0 2px rgba(47, 111, 123, 0.08);
}

.switch input[type="checkbox"]:checked::before { transform: translateX(14px); }

.action-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 180px));
  justify-content: center;
  gap: 10px;
  margin: 6px 0 18px;
}

.cpu-shell .action-row {
  grid-template-columns: repeat(auto-fit, minmax(180px, 180px));
}

.option-panel {
  position: relative;
  display: grid;
  width: min(100%, 360px);
  gap: 13px;
  margin: 24px auto 16px;
  padding: 10px 12px;
  border: 1px solid rgba(34, 83, 95, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.option-title {
  margin: 0;
  color: var(--muted);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
}

.voice-options {
  display: grid;
  grid-template-columns: auto repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.voice-options legend {
  display: contents;
  color: var(--cyan);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0;
}

.voice-choice {
  position: relative;
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.voice-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.voice-choice span {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(34, 83, 95, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  transition: border-color 0.14s, background 0.14s, color 0.14s, transform 0.14s;
}

.voice-choice:hover span {
  border-color: rgba(34, 83, 95, 0.24);
  background: rgba(255, 255, 255, 0.94);
  transform: translateY(-1px);
}

.voice-choice input:checked + span {
  border-color: rgba(34, 83, 95, 0.22);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

body.game-playing .option-panel {
  display: none;
}

#continueButton,
#startButton,
#cpuButton,
#endlessButton,
#hiscoreButton,
#quitButton,
#restartButton,
#postButton,
#resultTopButton,
#rankingButton,
#howToButton,
#nextWaveButton {
  min-width: 168px;
  padding: 13px 22px;
  border: 1px solid rgba(34, 83, 95, 0.18);
  border-radius: 6px;
  color: var(--text);
  background: var(--button-bg);
  box-shadow: 0 1px 3px rgba(31, 83, 103, 0.04);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 0.14s, border-color 0.14s, background 0.14s;
}

#cpuButton.active,
#endlessButton.active,
#hiscoreButton.active {
  color: #ffffff;
  border-color: rgba(34, 83, 95, 0.26);
  background: var(--accent);
  font-weight: 900;
}

#startButton {
  color: #ffffff;
  background: var(--accent);
  border-color: rgba(34, 83, 95, 0.26);
  font-weight: 900;
}

.mode-actions #hiscoreButton,
.mode-actions #cpuButton,
.mode-actions #endlessButton {
  min-width: 0;
  padding: 10px 12px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.mode-actions #hiscoreButton.active,
.mode-actions #cpuButton.active,
.mode-actions #endlessButton.active {
  color: var(--accent-strong);
  border-color: rgba(34, 83, 95, 0.12);
  background: var(--accent-soft);
}

#restartButton,
#quitButton,
#postButton,
#nextWaveButton { display: none; }

#quitButton,
#nextWaveButton {
  grid-column: 1 / -1;
  justify-self: center;
  width: 180px;
}

#nextWaveButton:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}

body.game-playing[data-mode="endless"].awaiting-next-wave #nextWaveButton {
  position: static;
  z-index: 1;
  width: min(100%, 230px);
  border-color: rgba(34, 83, 95, 0.18);
  background: rgba(255, 255, 255, 0.82);
  color: var(--cyan);
  transform: none;
}

body.game-playing[data-mode="endless"].awaiting-next-wave #nextWaveButton:hover {
  border-color: rgba(34, 83, 95, 0.26);
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent-strong);
  transform: translateY(-1px);
}

body.game-playing[data-mode="endless"].awaiting-next-wave #nextWaveButton:disabled {
  transform: none;
}

body.game-playing[data-mode="endless"].awaiting-next-wave #nextWaveButton[data-ready="true"]::before {
  content: none;
}

body.game-playing[data-mode="endless"].awaiting-next-wave .grid {
  align-content: center;
  align-items: center;
  justify-content: center;
}

.next-wave-panel {
  display: flex;
  width: 100%;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: var(--cyan);
  text-align: center;
}

.next-wave-ready {
  color: var(--cyan);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  visibility: hidden;
}

.next-wave-panel.is-ready .next-wave-ready {
  visibility: visible;
}

#startButton:hover,
#cpuButton:hover,
#endlessButton:hover,
#hiscoreButton:hover,
#quitButton:hover,
#restartButton:hover,
#postButton:hover,
#resultTopButton:hover,
#rankingButton:hover,
#howToButton:hover,
#nextWaveButton:hover {
  transform: translateY(-1px);
  border-color: var(--line-hot);
  background: rgba(255, 255, 255, 0.96);
}

#startButton:hover {
  color: #ffffff;
  border-color: rgba(34, 83, 95, 0.28);
  background: var(--accent-strong);
}

.mode-actions #hiscoreButton:hover,
.mode-actions #cpuButton:hover,
.mode-actions #endlessButton:hover,
.mode-actions #hiscoreButton.active:hover,
.mode-actions #cpuButton.active:hover,
.mode-actions #endlessButton.active:hover {
  transform: none;
  color: var(--accent-strong);
  border-color: rgba(34, 83, 95, 0.14);
  background: var(--accent-soft);
}

.card:hover {
  transform: translateY(-2px) !important;
  border-color: var(--line-hot);
  background: rgba(255, 255, 255, 0.96);
}

.reader-panel {
  --reader-stage-height: clamp(104px, 13vw, 150px);
  --reader-hud-height: 46px;
  --reader-message-height: 38px;
  position: relative;
  margin: 16px 0 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--reader-bg);
  min-height: calc(var(--reader-stage-height) + var(--reader-hud-height) + 32px);
}

.reader-panel.is-hidden {
  display: none;
}

.countdown-display {
  display: none;
  height: var(--reader-stage-height);
  margin: 4px 0 18px;
  align-items: center;
  justify-content: center;
  color: var(--digit-color);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: clamp(5.8rem, 14vw, 9.5rem);
  line-height: 1;
  letter-spacing: 0;
  text-shadow: var(--digit-shadow);
}

.countdown-display.active {
  display: flex;
  animation: countdownPop 0.72s ease both;
}

body[data-mode="cpu"].fighter-playing .countdown-display.round-call {
  position: absolute;
  top: 10px;
  right: 10px;
  left: 10px;
  z-index: 8;
  height: var(--reader-stage-height);
  margin: 0;
  padding: 0 22px;
  background: rgba(6, 7, 12, 0.76);
  color: #fff8e8;
  font-size: 2.65rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.82),
    0 0 24px rgba(255, 210, 122, 0.48);
  pointer-events: none;
}

body[data-mode="cpu"].fighter-playing .countdown-display.round-call-fight {
  color: #ffd27a;
  font-size: 6.2rem;
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.82),
    0 0 30px rgba(255, 159, 46, 0.72);
}

body[data-mode="cpu"].fighter-playing .countdown-display.ko-call,
body[data-mode="cpu"].fighter-playing .countdown-display.time-up-call,
body[data-mode="cpu"].fighter-playing .countdown-display.perfect-call {
  position: absolute;
  inset: 0;
  z-index: 92;
  height: auto;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 62, 54, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.36), rgba(0, 0, 0, 0.72) 46%, rgba(0, 0, 0, 0.42));
  color: #fff1d0;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 14.8rem;
  font-weight: 900;
  line-height: 0.82;
  text-align: center;
  text-shadow:
    0 7px 0 rgba(68, 7, 4, 0.95),
    0 0 22px rgba(255, 223, 123, 0.78),
    0 0 58px rgba(255, 62, 54, 0.76),
    0 0 96px rgba(255, 62, 54, 0.46);
  pointer-events: none;
  animation: koCallImpact 1.36s cubic-bezier(.16,.9,.2,1) both;
}

body[data-mode="cpu"].fighter-playing .countdown-display.time-up-call {
  background:
    radial-gradient(circle at 50% 50%, rgba(76, 180, 255, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.38), rgba(0, 11, 24, 0.76) 46%, rgba(0, 0, 0, 0.44));
  color: #eaf7ff;
  font-size: 12.2rem;
  text-shadow:
    0 7px 0 rgba(3, 19, 42, 0.95),
    0 0 22px rgba(160, 226, 255, 0.78),
    0 0 58px rgba(76, 180, 255, 0.76),
    0 0 96px rgba(76, 180, 255, 0.46);
}

body[data-mode="cpu"].fighter-playing .countdown-display.perfect-call {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 210, 122, 0.28), transparent 35%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.34), rgba(30, 16, 0, 0.76) 46%, rgba(0, 0, 0, 0.42));
  color: #fff8e8;
  font-size: 11.4rem;
  text-shadow:
    0 7px 0 rgba(67, 31, 2, 0.95),
    0 0 22px rgba(255, 244, 190, 0.82),
    0 0 58px rgba(255, 178, 44, 0.78),
    0 0 106px rgba(255, 210, 122, 0.5);
}

body[data-mode="cpu"].fighter-playing .round-win-screen {
  position: absolute;
  inset: 0;
  z-index: 94;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 210, 122, 0.24), transparent 32%),
    linear-gradient(180deg, rgba(2, 3, 8, 0.56), rgba(2, 3, 8, 0.88));
  pointer-events: none;
  animation: roundWinFade 2.4s ease both;
}

body[data-mode="cpu"].fighter-playing .round-win-screen.enemy {
  background:
    radial-gradient(circle at 50% 42%, rgba(227, 95, 116, 0.2), transparent 32%),
    linear-gradient(180deg, rgba(2, 3, 8, 0.56), rgba(2, 3, 8, 0.88));
}

body[data-mode="cpu"].fighter-playing .round-win-screen img {
  position: relative;
  z-index: 2;
  max-width: 72%;
  max-height: 90%;
  object-fit: contain;
  filter:
    drop-shadow(0 0 24px rgba(255, 210, 122, 0.38))
    drop-shadow(0 28px 34px rgba(0, 0, 0, 0.56));
  animation: roundWinImageIn 0.62s cubic-bezier(.16,.9,.2,1) both;
}

body[data-mode="cpu"].fighter-smartphone.fighter-playing .round-win-screen {
  --round-win-image-y: -76px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-playing .round-win-screen img {
  width: auto;
  height: 118%;
  max-width: none;
  max-height: none;
}

body[data-mode="cpu"].fighter-playing .round-win-screen.enemy img {
  filter:
    drop-shadow(0 0 24px rgba(227, 95, 116, 0.34))
    drop-shadow(0 28px 34px rgba(0, 0, 0, 0.56));
}

body[data-mode="cpu"].fighter-playing .round-win-copy {
  position: absolute;
  top: 50px;
  left: 50%;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 2px;
  color: #fff8e8;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  line-height: 1;
  text-align: center;
  transform: translateX(-50%);
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.8),
    0 0 22px rgba(255, 210, 122, 0.58);
}

body[data-mode="cpu"].fighter-playing .round-win-copy span {
  color: #ffd27a;
  font-size: 2rem;
}

body[data-mode="cpu"].fighter-playing .round-win-copy strong {
  font-size: 4.2rem;
  font-weight: 900;
  letter-spacing: 0;
}

body[data-mode="cpu"].fighter-playing .combo-cutin {
  position: absolute;
  top: 126px;
  right: 0;
  left: 0;
  bottom: auto;
  z-index: 68;
  display: flex;
  align-items: center;
  pointer-events: none;
  overflow: hidden;
  height: 116px;
}

body[data-mode="cpu"].fighter-playing .combo-cutin.player {
  justify-content: flex-start;
}

body[data-mode="cpu"].fighter-playing .combo-cutin.enemy {
  justify-content: flex-end;
}

body[data-mode="cpu"].fighter-playing .combo-cutin-panel {
  position: relative;
  width: 440px;
  padding: 19px 44px 20px;
  border: 0;
  background:
    linear-gradient(90deg, rgba(5, 8, 16, 0.94), rgba(68, 38, 8, 0.84) 56%, rgba(5, 8, 16, 0.12));
  color: #fff4b2;
  box-shadow:
    0 0 28px rgba(255, 193, 70, 0.26),
    inset 0 0 20px rgba(255, 239, 168, 0.08);
  clip-path: polygon(0 0, 95% 0, 100% 100%, 0 100%);
}

body[data-mode="cpu"].fighter-playing .combo-cutin.enemy .combo-cutin-panel {
  background:
    linear-gradient(270deg, rgba(5, 8, 16, 0.94), rgba(79, 18, 42, 0.86) 56%, rgba(5, 8, 16, 0.12));
  color: #ffd9ec;
  box-shadow:
    0 0 28px rgba(255, 95, 168, 0.24),
    inset 0 0 20px rgba(255, 177, 221, 0.08);
  clip-path: polygon(5% 0, 100% 0, 100% 100%, 0 100%);
}

body[data-mode="cpu"].fighter-playing .combo-cutin-panel strong {
  display: block;
}

body[data-mode="cpu"].fighter-playing .combo-cutin-panel strong {
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 5.4rem;
  font-weight: 900;
  line-height: 0.82;
  text-shadow:
    0 4px 0 rgba(0, 0, 0, 0.82);
}

body[data-mode="cpu"].fighter-playing .combo-cutin.player .combo-cutin-panel {
  margin-left: 0;
  animation: comboCutinPlayer 0.96s cubic-bezier(.16,.9,.2,1) both;
}

body[data-mode="cpu"].fighter-playing .combo-cutin.enemy .combo-cutin-panel {
  margin-right: 0;
  text-align: right;
  animation: comboCutinEnemy 0.96s cubic-bezier(.16,.9,.2,1) both;
}

#reading {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 0.5em;
  height: var(--reader-stage-height);
  margin: 4px 0 18px;
  text-align: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.18s ease;
}

#reading.is-hud-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.digit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 clamp(74px, 10vw, 112px);
  width: clamp(74px, 10vw, 112px);
  height: clamp(74px, 10vw, 112px);
  margin: 0;
  border: 1px solid var(--digit-border);
  border-radius: 8px;
  background: var(--digit-bg);
  overflow: hidden;
  text-align: center;
  box-shadow: var(--digit-box-shadow);
  contain: layout paint;
}

.digit .num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--digit-color);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: clamp(4rem, 10vw, 7rem);
  line-height: 1;
  padding-top: 0.12em;
  text-shadow: var(--digit-shadow);
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.34s cubic-bezier(.2,.9,.1,1), opacity 0.34s;
}

.hud {
  width: min(100%, 760px);
  margin: 0 auto;
  min-height: var(--reader-hud-height);
  align-items: stretch;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

#scoreDisplay,
#scoreDisplayPlayer,
#scoreDisplayCPU,
#waveDisplay,
#lifeDisplay,
#timeDisplay {
  min-width: 150px;
  padding: 10px 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: center;
  font-weight: 900;
}

#scoreDisplay { color: var(--green); }
#scoreDisplayPlayer { color: var(--green); }
#scoreDisplayCPU { color: var(--pink); }
#waveDisplay { color: var(--gold); }
#lifeDisplay { color: var(--pink); }
#timeDisplay {
  flex: 1 1 100%;
  width: 100%;
  min-width: min(100%, 420px);
  max-width: 760px;
  color: var(--cyan);
  background:
    linear-gradient(90deg, rgba(47, 111, 123, 0.18) var(--time-progress, 100%), transparent 0),
    var(--hud-bg);
}

#timeDisplay.danger { color: var(--danger); animation: pulseDanger 0.65s infinite; }

#timeDisplay.danger {
  background:
    linear-gradient(90deg, rgba(157, 79, 88, 0.2) var(--time-progress, 100%), transparent 0),
    var(--hud-bg);
}

#lifeDisplay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

body.game-playing[data-mode="endless"] #lifeDisplay {
  display: inline-flex !important;
}

body.game-playing[data-mode="endless"] #waveDisplay,
body.game-playing[data-mode="endless"] #lifeDisplay,
body.game-playing[data-mode="endless"] #scoreDisplay {
  display: inline-flex !important;
  height: 38px;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.life-label {
  margin-right: 10px;
  font-size: 0.78em;
  color: var(--muted);
}

.life-hearts {
  display: inline-flex;
  gap: 4px;
  color: var(--accent);
  font-size: 1.1em;
  line-height: 1;
}

.life-heart.is-empty {
  color: rgba(47, 111, 123, 0.36);
}

#comboDisplay {
  position: fixed;
  left: 50%;
  bottom: max(14px, calc(env(safe-area-inset-bottom) + 12px));
  z-index: 60;
  width: min(calc(100vw - 32px), 560px);
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--pink);
  text-align: center;
  overflow: visible;
  pointer-events: none;
  transform: translateX(-50%);
}

#comboDisplay span {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
  font-weight: 900;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transform-origin: center;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

#comboDisplay span.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

#message {
  display: flex;
  width: min(100%, 520px);
  min-height: var(--reader-message-height);
  margin: 14px auto 0;
  padding: 8px 14px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--message-border);
  border-radius: 6px;
  background: var(--message-bg);
  text-align: center;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

#message:empty {
  visibility: hidden;
}

#message.msg-ready { color: var(--cyan); }
#message.msg-round { color: var(--cyan); }
#message.msg-success { color: var(--green); }
#message.msg-warning { color: var(--danger); }
#message.msg-finish { color: var(--gold); }

#message .msg-main {
  margin-right: 0;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0;
}

#message .msg-main + .msg-sub {
  margin-left: 0.7em;
}

#message .msg-sub {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin: 22px 0;
}

#karuta {
  position: relative;
}

.cpu-level-panel {
  display: flex;
  width: min(100%, 520px);
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 12px auto 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.cpu-level-panel label {
  color: var(--gold);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0;
}

#cpuLevel {
  min-width: min(100%, 280px);
  padding: 10px 12px;
  border: 1px solid var(--message-border);
  border-radius: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.86);
  font: inherit;
  font-weight: 800;
}

.cpu-cursor {
  display: none;
  position: absolute;
  z-index: 6;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(47, 111, 123, 0.7);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: top 0.22s ease-out, left 0.22s ease-out;
  background:
    linear-gradient(var(--accent), var(--accent)) center / 2px 12px no-repeat,
    linear-gradient(90deg, var(--accent), var(--accent)) center / 12px 2px no-repeat,
    rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(47, 111, 123, 0.06);
  backdrop-filter: blur(1px);
}

.cpu-cursor::after {
  content: "CPU";
  position: absolute;
  top: -20px;
  left: 50%;
  padding: 2px 5px;
  border: 1px solid rgba(47, 111, 123, 0.22);
  border-radius: 4px;
  color: var(--gold);
  background: rgba(255, 255, 255, 0.88);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 0.78rem;
  line-height: 1;
  letter-spacing: 0;
  transform: translateX(-50%);
}

.cpu-cursor.pulse {
  animation: cpuPulse 0.5s ease-out 1;
}

.battle-summary {
  text-align: center;
}

.battle-summary h3 {
  margin: 0 0 12px;
  color: var(--gold);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: clamp(2.3rem, 7vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

.result-scoreline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 0 14px;
}

.result-scoreline span {
  min-width: 150px;
  padding: 10px 14px;
  border: 1px solid var(--message-border);
  border-radius: 6px;
  background: var(--hud-bg);
  font-weight: 900;
}

.speech {
  margin: 12px auto 0;
  padding: 13px 16px;
  border: 1px solid var(--message-border);
  border-radius: 8px;
  background: var(--message-bg);
  color: var(--text);
  line-height: 1.7;
}

.speech .by {
  display: block;
  margin-bottom: 4px;
  color: var(--cyan);
  font-weight: 900;
}

.speech.win,
.speech.lose,
.speech.draw { border-color: var(--message-border); }

.cpu-hit-flash .game-shell {
  animation: cpuHitFlash 0.42s ease;
}

.card {
  flex: 0 0 160px;
  width: 160px;
  position: relative;
  min-width: 0;
  min-height: 104px;
  padding: 14px;
  border: 1px solid rgba(34, 83, 95, 0.16);
  border-radius: 8px;
  color: var(--text);
  background: var(--card-bg);
  box-shadow: 0 1px 3px rgba(31, 83, 103, 0.04);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transform: none !important;
  transition: border-color 0.14s, opacity 0.18s, background 0.14s;
  will-change: auto;
}

#rankingWrapper,
#resultDisplay {
  margin: 24px 0 0;
  align-items: flex-start;
  flex-wrap: wrap;
}

#rankingWrapper > *,
#resultDisplay > * {
  flex: 1;
  min-width: min(100%, 220px);
  padding: 16px;
  border: 1px solid rgba(34, 83, 95, 0.14);
  border-radius: 8px;
  background: var(--panel-strong);
}

#resultDisplay { display: none; }

.result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 18px 0 0;
}

.result-actions #postButton,
.result-actions #resultTopButton {
  min-width: min(100%, 220px);
}

.resultheading {
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--gold);
  font-size: 1rem;
}

ol,
ul { padding-left: 1.4em; }

.highscore-entry {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}

.highscore-score { min-width: 86px; text-align: right; }

.rank-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 8px 0 12px;
}

.rank-tabs .tab-btn {
  padding: 7px 12px;
  border: 1px solid rgba(34, 83, 95, 0.14);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.68);
  cursor: pointer;
}

.rank-tabs .tab-btn.active {
  color: #ffffff;
  border-color: rgba(34, 83, 95, 0.26);
  background: var(--gold);
}

.result-score-summary {
  text-align: center;
}

.result-score-summary .score-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.result-score-summary .score-value {
  margin: 0;
  color: var(--gold);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: clamp(2.5rem, 7vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0;
}

.result-score-summary .score-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 800;
}

#highScoreEntryPanel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

#highScoreEntryPanel[hidden] {
  display: none;
}

#highScoreEntryPanel.is-checking {
  border-top-color: rgba(47, 111, 123, 0.16);
}

.highscore-form {
  display: grid;
  gap: 10px;
}

#highScoreEntryPanel.is-checking .highscore-form {
  gap: 0;
}

#highScoreEntryPanel.is-checking .highscore-form label,
#highScoreEntryPanel.is-checking .name-submit-row {
  display: none;
}

.highscore-form label {
  color: var(--cyan);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0;
}

.name-submit-row {
  display: flex;
  gap: 8px;
}

#highScoreName {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--message-border);
  border-radius: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.86);
  font: inherit;
  font-weight: 900;
}

#highScoreSubmit {
  flex: 0 0 auto;
  padding: 11px 14px;
  border: 1px solid rgba(34, 83, 95, 0.26);
  border-radius: 6px;
  color: #ffffff;
  background: var(--gold);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

#highScoreSubmit:disabled {
  opacity: 0.55;
  cursor: wait;
}

#highScoreEntryStatus {
  min-height: 1.4em;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

#highScoreEntryPanel.is-checking #highScoreEntryStatus {
  color: var(--cyan);
}

.credits {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.credits a {
  color: var(--cyan);
  font-weight: 800;
  text-decoration: none;
}

.credits a:hover {
  color: var(--gold);
}

body[data-mode="cpu"] {
  --bg: #101723;
  --body-bg: #101723;
  --shell-bg: rgba(17, 25, 38, 0.94);
  --reader-bg: rgba(247, 250, 251, 0.94);
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.95);
  --panel-soft: rgba(255, 255, 255, 0.7);
  --line: rgba(216, 164, 68, 0.22);
  --line-hot: rgba(216, 164, 68, 0.42);
  --text: #17242b;
  --muted: #6c7480;
  --accent: #287b84;
  --accent-strong: #0f5660;
  --accent-soft: rgba(40, 123, 132, 0.1);
  --gold: #b98224;
  --pink: #9d4f58;
  --green: #247b68;
  background:
    linear-gradient(180deg, rgba(216, 164, 68, 0.08), transparent 34%),
    #101723;
}

body:not([data-mode="cpu"]) #fighterStory,
body:not([data-mode="cpu"]) #fighterBattleHud,
body:not([data-mode="cpu"]) #fighterSkillStrip,
body:not([data-mode="cpu"]) .fighter-brand {
  display: none !important;
}

body[data-mode="cpu"] .game-shell {
  border-color: rgba(216, 164, 68, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 244, 244, 0.94)),
    var(--shell-bg);
}

body[data-mode="cpu"] .game-logo {
  display: none;
}

body[data-mode="cpu"].fighter-flow .game-hero {
  display: none;
}

body[data-mode="cpu"] .fighter-brand {
  display: grid;
  justify-items: center;
  color: #f4ead4;
  line-height: 0.9;
  text-align: center;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.32), 0 0 18px rgba(216, 164, 68, 0.22);
}

.fighter-brand span {
  color: #d8a444;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  letter-spacing: 0;
}

.fighter-brand strong {
  color: #fff8e8;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: clamp(3rem, 8vw, 6.6rem);
  letter-spacing: 0;
}

body[data-mode="cpu"] .cpu-level-panel {
  display: none !important;
}

body[data-mode="cpu"] #optionPanel {
  display: none !important;
}

body[data-mode="cpu"].fighter-flow .mode-actions,
body[data-mode="cpu"].fighter-flow .action-row,
body[data-mode="cpu"].fighter-result .mode-actions,
body[data-mode="cpu"].fighter-result .action-row {
  display: none;
}

body[data-mode="cpu"] #message {
  white-space: normal;
}

.fighter-story {
  display: grid;
  gap: 18px;
  margin: 14px auto 20px;
}

.fighter-story[hidden] {
  display: none !important;
}

.fighter-title-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: center;
  width: min(100%, 920px);
  margin: 0 auto;
}

.fighter-title-copy {
  min-width: 0;
}

.fighter-eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0;
}

.fighter-title-copy h1,
.fighter-screen-head h2,
.vs-combatant h2 {
  margin: 0;
  color: #13242a;
  font-size: clamp(1.9rem, 4vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.fighter-title-copy p,
.fighter-screen-head p,
.fighter-card-copy p,
.vs-combatant p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.difficulty-select {
  display: grid;
  gap: 8px;
}

.difficulty-select button,
.fighter-character-card button,
.fighter-flow-actions button,
#fighterSkillButton,
#fighterContinueButton {
  border: 1px solid rgba(34, 83, 95, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  transition: transform 0.14s, border-color 0.14s, background 0.14s;
}

.difficulty-select button {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
}

.difficulty-select strong {
  color: var(--accent-strong);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.difficulty-select span {
  color: var(--muted);
  font-size: 0.85rem;
}

.difficulty-select button.active,
.fighter-character-card button,
.fighter-flow-actions button:first-child,
#fighterSkillButton:not(:disabled),
#fighterContinueButton {
  border-color: rgba(216, 164, 68, 0.48);
  background: #b98224;
  color: #ffffff;
}

.difficulty-select button:hover,
.fighter-character-card button:hover,
.fighter-flow-actions button:hover,
#fighterSkillButton:hover,
#fighterContinueButton:hover {
  transform: translateY(-1px);
  border-color: var(--line-hot);
}

.fighter-screen-head {
  text-align: center;
}

body[data-mode="cpu"].fighter-selecting .game-shell {
  background:
    linear-gradient(90deg, rgba(7, 12, 18, 0.72), rgba(7, 12, 18, 0.24) 48%, rgba(7, 12, 18, 0.72)),
    linear-gradient(180deg, rgba(7, 12, 18, 0.18), rgba(7, 12, 18, 0.74)),
    url("image/ancient-library-bg.png") center / cover no-repeat;
  border-color: rgba(216, 164, 68, 0.44);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48), inset 0 0 0 1px rgba(255, 248, 232, 0.08);
}

.fighter-character-select {
  display: grid;
  width: min(100%, 1080px);
  min-height: min(620px, calc(100vh - 110px));
  margin: 0 auto;
  gap: 12px;
  align-content: center;
}

.fighter-character-select .fighter-screen-head {
  color: #fff8e8;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.fighter-character-select .fighter-screen-head h2 {
  color: #fff8e8;
}

.character-select-stage {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: stretch;
  min-height: 390px;
}

.character-full-art {
  position: relative;
  display: flex;
  min-height: 390px;
  align-items: end;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(216, 164, 68, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.96), rgba(231, 219, 197, 0.96)),
    rgba(255, 248, 232, 0.92);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(255, 255, 255, 0.52);
}

.character-full-art::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(185, 130, 36, 0.32);
  border-radius: 5px;
  pointer-events: none;
}

.character-full-art img {
  position: relative;
  z-index: 1;
  width: min(88%, 330px);
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.2));
}

.character-select-info {
  display: grid;
  align-content: center;
  gap: 14px;
  min-width: 0;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid rgba(216, 164, 68, 0.3);
  border-radius: 8px;
  background: rgba(13, 20, 29, 0.78);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36), inset 0 0 0 1px rgba(255, 248, 232, 0.08);
  color: #fff8e8;
  backdrop-filter: blur(8px);
}

.character-select-info h3 {
  margin: 0;
  color: #fff8e8;
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.64);
}

.character-select-info p {
  max-width: 34em;
  margin: 0;
  color: rgba(255, 248, 232, 0.86);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.8;
}

.character-select-info dl {
  display: grid;
  gap: 5px;
  margin: 2px 0 0;
}

.character-select-info dt {
  color: #d8a444;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.16rem;
  font-weight: 900;
  letter-spacing: 0;
}

.character-select-info dd {
  margin: 0;
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 900;
}

.character-select-info button {
  width: min(100%, 280px);
  min-height: 48px;
  margin-top: 8px;
  border: 1px solid rgba(216, 164, 68, 0.6);
  border-bottom-width: 4px;
  border-radius: 6px;
  background: linear-gradient(180deg, #f0c66b, #b98224);
  color: #111827;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.32);
}

.character-icon-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 116px));
  justify-content: center;
  gap: 12px;
}

.character-icon-row button {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 8px 8px 10px;
  border: 1px solid rgba(216, 164, 68, 0.28);
  border-radius: 8px;
  background: rgba(13, 20, 29, 0.72);
  color: rgba(255, 248, 232, 0.78);
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 900;
  backdrop-filter: blur(6px);
  transition: transform 0.14s, border-color 0.14s, background 0.14s;
}

.character-icon-row button:hover,
.character-icon-row button.active {
  transform: translateY(-2px);
  border-color: rgba(216, 164, 68, 0.74);
  background: rgba(255, 248, 232, 0.16);
  color: #fff8e8;
}

.character-icon-row img {
  width: 74px;
  height: 74px;
  border: 2px solid rgba(255, 248, 232, 0.5);
  border-radius: 50%;
  object-fit: cover;
  background: #fff8e8;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.32);
}

.character-icon-row button.active img {
  border-color: #d8a444;
  box-shadow: 0 0 0 3px rgba(216, 164, 68, 0.2), 0 10px 18px rgba(0, 0, 0, 0.32);
}

.fighter-character-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.fighter-character-card {
  display: grid;
  min-width: 0;
  grid-template-rows: 220px auto auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(34, 83, 95, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.fighter-portrait,
.vs-image,
.fighter-face {
  overflow: hidden;
  border: 1px solid rgba(216, 164, 68, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.fighter-portrait img,
.vs-image img,
.fighter-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 18% 48%;
}

.fighter-character-card h3 {
  margin: 0;
  color: var(--accent-strong);
  font-size: 1.2rem;
}

.fighter-skill-name {
  color: var(--gold) !important;
}

.fighter-character-card button {
  min-height: 42px;
  padding: 10px 12px;
}

.fighter-flow-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0;
}

.fighter-flow-actions button {
  min-width: 160px;
  min-height: 44px;
  padding: 10px 16px;
}

.fighter-flow-actions button + button {
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}

.fighter-vs-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 180px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.vs-combatant {
  display: grid;
  gap: 8px;
  text-align: center;
}

.vs-image {
  height: clamp(260px, 38vw, 360px);
}

.vs-mark {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--gold);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  line-height: 1;
}

.vs-mark span {
  font-size: clamp(4rem, 10vw, 7rem);
}

.vs-mark small {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 900;
}

.fighter-battle-hud {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 10px 0 12px;
}

.fighter-battle-hud.is-hidden,
.fighter-skill-strip.is-hidden {
  display: none;
}

.fighter-combatant {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.fighter-combatant.enemy {
  grid-template-columns: minmax(0, 1fr) 58px;
}

.fighter-face {
  width: 58px;
  height: 58px;
  border-radius: 50%;
}

.fighter-bars,
.skill-meter {
  min-width: 0;
}

.fighter-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.fighter-label strong {
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hp-track,
.gauge-track {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(34, 83, 95, 0.14);
  border-radius: 999px;
  background: rgba(34, 83, 95, 0.08);
}

.hp-track span,
.gauge-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.26s ease;
}

.hp-track.enemy span,
.gauge-track.enemy span {
  background: var(--pink);
}

.fighter-stage-label {
  display: grid;
  min-width: 112px;
  justify-items: center;
  color: var(--muted);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  line-height: 1;
}

.fighter-stage-label span {
  color: var(--gold);
  font-size: 1.1rem;
}

.fighter-stage-label strong {
  color: var(--accent-strong);
  font-size: 1.45rem;
  letter-spacing: 0;
}

.fighter-skill-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  margin: 8px 0 18px;
}

#fighterSkillButton {
  min-width: 104px;
  min-height: 44px;
  padding: 10px 14px;
}

#fighterSkillButton:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.skill-meter.is-pending .fighter-label strong {
  color: var(--muted);
}

.skill-revealed {
  border-color: rgba(216, 164, 68, 0.8) !important;
  box-shadow: 0 0 0 2px rgba(216, 164, 68, 0.14), 0 0 18px rgba(216, 164, 68, 0.22) !important;
}

.skill-candidate {
  border-color: rgba(104, 224, 255, 0.88) !important;
  box-shadow: 0 0 0 2px rgba(104, 224, 255, 0.18), 0 0 18px rgba(104, 224, 255, 0.3) !important;
}

.skill-removed {
  opacity: 0;
  transform: scale(0.94) !important;
}

.enemy-correct {
  border-color: rgba(157, 79, 88, 0.54);
  background: rgba(250, 238, 240, 0.96);
  box-shadow: 0 0 0 1px rgba(157, 79, 88, 0.12), 0 0 18px rgba(157, 79, 88, 0.1);
  opacity: 0;
}

.enemy-skill-flash .game-shell {
  animation: enemySkillFlash 0.78s ease;
}

@keyframes enemySkillFlash {
  45% { box-shadow: 0 14px 46px rgba(216, 164, 68, 0.16), inset 0 0 30px rgba(216, 164, 68, 0.1); }
}

.modal-note {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.game-modal {
  width: min(980px, calc(100vw - 24px));
  max-height: min(820px, calc(100vh - 24px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  box-shadow: 0 20px 52px rgba(31, 83, 103, 0.18);
}

.game-modal::backdrop {
  background: rgba(232, 244, 248, 0.68);
  backdrop-filter: blur(10px);
}

.modal-frame {
  max-height: inherit;
  overflow: auto;
  padding: clamp(16px, 3vw, 26px);
  background: var(--modal-bg);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  color: var(--gold);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 2rem;
  letter-spacing: 0;
}

.modal-close {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(34, 83, 95, 0.18);
  border-radius: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 1.4rem;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.rules-grid section {
  padding: 16px;
  border: 1px solid rgba(34, 83, 95, 0.14);
  border-radius: 8px;
  background: var(--panel-soft);
}

.rules-grid h3 {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 1rem;
}

.rules-grid p { margin: 0; color: var(--muted); }

.shake {
  border-color: rgba(157, 79, 88, 0.72);
  box-shadow: 0 0 0 1px rgba(157, 79, 88, 0.12), 0 0 10px rgba(157, 79, 88, 0.12);
}

.correct {
  border-color: rgba(47, 111, 123, 0.5);
  background: rgba(239, 247, 249, 0.96);
  box-shadow: 0 0 0 1px rgba(47, 111, 123, 0.12), 0 0 18px rgba(47, 111, 123, 0.1);
  opacity: 0;
}
.hit-flash .game-shell { animation: hitFlash 0.42s ease; }
.miss-flash .game-shell { animation: missFlash 0.36s ease; }
.finish-flash .game-shell { animation: finishFlash 0.9s ease; }

.spark,
.pop-text {
  position: fixed;
  z-index: 40;
  pointer-events: none;
}

.spark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: sparkFly 0.72s ease-out forwards;
}

.pop-text {
  color: var(--gold);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.9rem;
  text-shadow: none;
  animation: popText 0.9s ease-out forwards;
}

@keyframes pulseDanger {
  50% { box-shadow: 0 0 10px rgba(157, 79, 88, 0.18); }
}

@keyframes hitFlash {
  50% { box-shadow: 0 14px 42px rgba(47, 111, 123, 0.1), inset 0 0 22px rgba(47, 111, 123, 0.06); }
}

@keyframes missFlash {
  50% { box-shadow: 0 14px 42px rgba(157, 79, 88, 0.1), inset 0 0 22px rgba(157, 79, 88, 0.06); }
}

@keyframes finishFlash {
  35% { box-shadow: 0 14px 46px rgba(47, 111, 123, 0.1), inset 0 0 24px rgba(47, 111, 123, 0.06); }
}

@keyframes sparkFly {
  to {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

@keyframes popText {
  to {
    transform: translateY(-42px) scale(1.18);
    opacity: 0;
  }
}

@keyframes countdownPop {
  0% { transform: scale(0.82); opacity: 0; }
  35% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.96); opacity: 0.86; }
}

@keyframes koCallImpact {
  0% {
    opacity: 0;
    transform: scale(1.72) skewX(-8deg);
    filter: blur(8px) brightness(1.6);
  }
  16% {
    opacity: 1;
    transform: scale(0.92) skewX(-8deg);
    filter: blur(0) brightness(1.2);
  }
  28% {
    transform: scale(1.04) skewX(-8deg);
  }
  78% {
    opacity: 1;
    transform: scale(1) skewX(-8deg);
  }
  100% {
    opacity: 0.94;
    transform: scale(0.98) skewX(-8deg);
  }
}

@keyframes comboCutinPlayer {
  0% {
    opacity: 0;
    transform: translateX(-112%);
  }
  18% {
    opacity: 1;
    transform: translateX(0);
  }
  70% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(0);
  }
}

@keyframes comboCutinEnemy {
  0% {
    opacity: 0;
    transform: translateX(112%);
  }
  18% {
    opacity: 1;
    transform: translateX(0);
  }
  70% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(0);
  }
}

@keyframes cpuPulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 111, 123, 0.24); }
  100% { box-shadow: 0 0 0 16px rgba(47, 111, 123, 0); }
}

@keyframes cpuHitFlash {
  50% { box-shadow: 0 14px 42px rgba(47, 111, 123, 0.1), inset 0 0 22px rgba(47, 111, 123, 0.06); }
}

body[data-mode="cpu"].fighter-playing {
  background:
    radial-gradient(circle at 50% 0%, rgba(216, 164, 68, 0.16), transparent 38%),
    linear-gradient(180deg, #111827 0%, #07101a 100%);
}

body[data-mode="cpu"].fighter-playing .game-shell {
  border-color: rgba(216, 164, 68, 0.4);
  background:
    linear-gradient(135deg, rgba(216, 164, 68, 0.09), transparent 26%),
    linear-gradient(225deg, rgba(157, 79, 88, 0.12), transparent 28%),
    #111827;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

body[data-mode="cpu"].fighter-playing .game-shell::before {
  border-color: rgba(216, 164, 68, 0.16);
}

body[data-mode="cpu"].fighter-playing .action-row {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 8;
  margin: 0;
}

body[data-mode="cpu"].fighter-playing #quitButton {
  width: auto;
  min-width: 86px;
  min-height: 34px;
  padding: 7px 12px;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  box-shadow: none;
}

body[data-mode="cpu"].fighter-playing .fighter-battle-hud {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 156px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 0 0 8px;
  padding: 8px 154px 8px 8px;
  border: 1px solid rgba(216, 164, 68, 0.22);
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(36, 123, 104, 0.16), transparent 28%, transparent 72%, rgba(157, 79, 88, 0.16)),
    rgba(255, 255, 255, 0.06);
}

body[data-mode="cpu"].fighter-playing .fighter-combatant {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

body[data-mode="cpu"].fighter-playing .fighter-combatant.enemy {
  grid-template-columns: minmax(0, 1fr) 64px;
}

body[data-mode="cpu"].fighter-playing .fighter-portrait {
  display: grid;
  justify-items: center;
  gap: 5px;
}

body[data-mode="cpu"].fighter-playing .fighter-face {
  width: 64px;
  height: 64px;
  border: 2px solid rgba(216, 164, 68, 0.5);
  border-radius: 6px;
  background: #f8f2e6;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.28), 0 10px 18px rgba(0, 0, 0, 0.32);
}

body[data-mode="cpu"].fighter-playing .fighter-face img {
  object-position: 18% 42%;
}

body[data-mode="cpu"].fighter-playing .round-markers {
  display: flex;
  justify-content: center;
  gap: 5px;
  width: 64px;
  min-height: 9px;
}

body[data-mode="cpu"].fighter-playing .round-markers span {
  width: 9px;
  height: 9px;
  border: 1px solid rgba(255, 210, 122, 0.42);
  border-radius: 999px;
  background: rgba(5, 7, 14, 0.82);
  box-shadow:
    inset 0 0 4px rgba(0, 0, 0, 0.78),
    0 0 8px rgba(0, 0, 0, 0.35);
}

body[data-mode="cpu"].fighter-playing .round-markers span.is-won {
  border-color: rgba(255, 232, 154, 0.95);
  background:
    radial-gradient(circle at 35% 28%, #fff8e8, #ffd27a 42%, #b98224 100%);
  box-shadow:
    0 0 9px rgba(255, 210, 122, 0.75),
    0 0 18px rgba(255, 159, 46, 0.36);
}

body[data-mode="cpu"].fighter-playing .fighter-label {
  align-items: center;
  margin: 0 0 5px;
  color: rgba(255, 255, 255, 0.68);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 0.9rem;
  line-height: 1;
  text-transform: uppercase;
}

body[data-mode="cpu"].fighter-playing .fighter-label span {
  display: inline-flex;
  min-width: 34px;
  justify-content: center;
  padding: 3px 6px;
  border-radius: 4px;
  background: #d8a444;
  color: #111827;
  font-weight: 900;
}

body[data-mode="cpu"].fighter-playing .fighter-label strong {
  color: #fff8e8;
  font-size: 1.14rem;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.46);
}

body[data-mode="cpu"].fighter-playing .fighter-label em {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.72);
  font-style: normal;
  font-size: 0.82rem;
}

body[data-mode="cpu"].fighter-playing .hp-track {
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.36);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.42);
  transform: skewX(-12deg);
}

body[data-mode="cpu"].fighter-playing .fighter-combatant.enemy .hp-track {
  transform: skewX(12deg);
}

body[data-mode="cpu"].fighter-playing .hp-track span {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 42%),
    linear-gradient(90deg, #3ed6a7, #247b68);
  box-shadow: 0 0 16px rgba(62, 214, 167, 0.32);
}

body[data-mode="cpu"].fighter-playing .hp-track.enemy span {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 42%),
    linear-gradient(90deg, #e35f74, #9d4f58);
  box-shadow: 0 0 16px rgba(227, 95, 116, 0.28);
}

.fight-clock {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 6px;
  border: 2px solid rgba(216, 164, 68, 0.48);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.18), rgba(0, 0, 0, 0.28)),
    #111827;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.3);
  color: #fff8e8;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  line-height: 1;
}

.fight-clock span {
  color: #d8a444;
  font-size: 0.86rem;
  white-space: nowrap;
}

.fight-clock strong {
  color: #fff8e8;
  font-size: 1.14rem;
  letter-spacing: 0;
}

.fight-clock em {
  display: flex;
  width: 78px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(216, 164, 68, 0.28) var(--time-progress, 100%), transparent 0),
    rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-style: normal;
  font-size: 2.2rem;
}

.fight-clock em.danger {
  color: #ffe7e7;
  background:
    linear-gradient(90deg, rgba(227, 95, 116, 0.36) var(--time-progress, 100%), transparent 0),
    rgba(255, 255, 255, 0.08);
  animation: pulseDanger 0.65s infinite;
}

body[data-mode="cpu"].fighter-playing .reader-panel {
  --reader-stage-height: 82px;
  --reader-message-height: 32px;
  margin: 0 0 6px;
  padding: 8px;
  border-color: rgba(216, 164, 68, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(0, 0, 0, 0.22);
  min-height: calc(var(--reader-stage-height) + var(--reader-message-height) + 18px);
}

body[data-mode="cpu"].fighter-playing #reading {
  height: var(--reader-stage-height);
  margin: 0 0 8px;
}

body[data-mode="cpu"].fighter-playing .digit {
  flex-basis: 70px;
  width: 70px;
  height: 70px;
  border: 2px solid rgba(216, 164, 68, 0.24);
  background: rgba(255, 248, 232, 0.94);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.18);
}

body[data-mode="cpu"].fighter-playing .digit .num {
  color: #123542;
  font-size: 4.4rem;
}

body[data-mode="cpu"].fighter-playing .hud {
  display: none;
}

body[data-mode="cpu"].fighter-playing #message {
  width: min(100%, 560px);
  min-height: 30px;
  margin-top: 0;
  border-color: rgba(216, 164, 68, 0.2);
  background: rgba(255, 248, 232, 0.92);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.12);
}

body[data-mode="cpu"].fighter-playing .grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(216, 164, 68, 0.18);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.055) 50%, rgba(255, 255, 255, 0.055) 75%, transparent 75%) 0 0 / 24px 24px,
    rgba(0, 0, 0, 0.24);
}

body[data-mode="cpu"].fighter-playing .card {
  width: 100%;
  min-height: 58px;
  padding: 7px 8px;
  border: 1px solid rgba(216, 164, 68, 0.2);
  border-bottom-width: 3px;
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(232, 238, 237, 0.96));
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.18);
  color: #162730;
  font-size: 0.76rem;
  font-weight: 900;
}

body[data-mode="cpu"].fighter-playing .card:hover {
  border-color: rgba(216, 164, 68, 0.62);
  background: #fff8e8;
}

body[data-mode="cpu"].fighter-playing .fighter-skill-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  margin: 8px 0 0;
}

body[data-mode="cpu"].fighter-playing .skill-meter {
  min-width: 0;
}

body[data-mode="cpu"].fighter-playing .skill-meter.enemy .fighter-label {
  text-align: right;
}

body[data-mode="cpu"].fighter-playing .gauge-track {
  height: 15px;
  border: 1px solid rgba(216, 164, 68, 0.26);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.36);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.34);
}

body[data-mode="cpu"].fighter-playing .gauge-track span {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), transparent 42%),
    linear-gradient(90deg, #f2c86d, #b98224);
  box-shadow: 0 0 14px rgba(216, 164, 68, 0.32);
}

body[data-mode="cpu"].fighter-playing .gauge-track.enemy span {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent 42%),
    linear-gradient(90deg, #d87a86, #9d4f58);
}

body[data-mode="cpu"].fighter-playing #fighterSkillButton {
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 2px solid rgba(216, 164, 68, 0.52);
  border-bottom-width: 4px;
  background: linear-gradient(180deg, #f0c66b, #b98224);
  color: #111827;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

body[data-mode="cpu"].fighter-playing #fighterSkillButton:disabled {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.36);
  box-shadow: none;
}

/* Final cascade guards for the rebuilt reference UI. */
body[data-mode="cpu"] .arena {
  width: min(calc(100vw - 20px), 1480px);
  min-height: calc(100vh - 20px);
  padding: 10px;
}

body[data-mode="cpu"] .game-shell,
body[data-mode="cpu"].fighter-selecting .game-shell,
body[data-mode="cpu"].fighter-playing .game-shell,
body[data-mode="cpu"].fighter-result .game-shell {
  min-height: min(820px, calc(100vh - 28px));
  padding: 18px;
  border: 1px solid rgba(255, 210, 122, 0.5);
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(255, 139, 36, 0.22), transparent 31%, transparent 67%, rgba(159, 53, 255, 0.22)),
    linear-gradient(180deg, rgba(7, 8, 16, 0.12), rgba(4, 5, 10, 0.84)),
    url("image/ancient-library-bg.png") center / cover no-repeat;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 42px rgba(255, 163, 55, 0.18),
    inset 0 0 80px rgba(0, 0, 0, 0.58);
  overflow: hidden;
}

body[data-mode="cpu"] .game-shell::before {
  inset: 10px;
  border: 1px solid rgba(255, 210, 122, 0.34);
  border-radius: 0;
  box-shadow:
    inset 0 0 24px rgba(255, 190, 93, 0.1),
    0 0 22px rgba(185, 77, 255, 0.1);
}

body[data-mode="cpu"] .game-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(116deg, rgba(255, 136, 31, 0.16), transparent 43%, rgba(183, 74, 255, 0.2) 58%, transparent 77%),
    radial-gradient(circle at 50% 46%, rgba(255, 112, 24, 0.18), transparent 20%);
  mix-blend-mode: screen;
  pointer-events: none;
}

body[data-mode="cpu"].fighter-playing .game-shell {
  padding: 16px 18px 18px;
}

body[data-mode="cpu"] .reference-vs-screen .vs-combatant {
  background: rgba(5, 7, 14, 0.18);
}

body[data-mode="cpu"] .reference-vs-screen .vs-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 46%, rgba(5, 7, 14, 0.62)),
    linear-gradient(90deg, rgba(255, 139, 36, 0.24), transparent 48%);
  pointer-events: none;
}

body[data-mode="cpu"] .reference-vs-screen .enemy .vs-image::after {
  background:
    linear-gradient(180deg, transparent 48%, rgba(5, 7, 14, 0.58)),
    linear-gradient(270deg, rgba(190, 98, 255, 0.24), transparent 54%);
}

body[data-mode="cpu"] .reference-vs-screen .enemy .vs-image {
  background:
    radial-gradient(circle at 32% 42%, rgba(235, 185, 255, 0.34), transparent 28%),
    linear-gradient(180deg, rgba(54, 19, 72, 0.94), rgba(7, 8, 16, 0.92));
}

body[data-mode="cpu"] .reference-vs-screen .vs-image img {
  inset: 0 auto auto 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.94;
}

body[data-mode="cpu"] .reference-vs-screen .enemy .vs-image img {
  right: 0;
  left: auto;
  object-position: 18% center;
  mix-blend-mode: multiply;
  opacity: 0.9;
  filter:
    contrast(1.22)
    saturate(1.2)
    brightness(1.16)
    drop-shadow(0 0 22px rgba(190, 98, 255, 0.4));
}

body[data-mode="cpu"] .reference-vs-screen .player .vs-image img {
  object-position: 34% center;
  filter:
    contrast(1.06)
    saturate(1.1)
    drop-shadow(0 0 20px rgba(255, 210, 122, 0.24));
}

body[data-mode="cpu"] .reference-result-screen .result-hero-art {
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

body[data-mode="cpu"] .reference-result-screen .result-hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.9;
}

body[data-mode="cpu"] .reference-result-screen.player-cutin .result-hero-art img {
  transform: scaleX(-1);
  filter:
    contrast(1.08)
    saturate(1.08)
    drop-shadow(0 0 22px rgba(190, 98, 255, 0.32));
}

body[data-mode="cpu"] .reference-result-screen.enemy-art .result-hero-art img {
  object-position: 18% center;
  mix-blend-mode: multiply;
  filter:
    contrast(1.2)
    saturate(1.15)
    brightness(1.12)
    drop-shadow(0 0 22px rgba(255, 91, 108, 0.38));
}

body[data-mode="cpu"] .reference-result-screen.player-cutin .result-aura {
  z-index: 2;
  mix-blend-mode: screen;
}

body[data-mode="cpu"] .reference-result-screen .result-copy,
body[data-mode="cpu"] .reference-result-screen .result-dialogue {
  z-index: 6;
}

body[data-mode="cpu"] .result-modal .result-actions button {
  min-width: 150px;
  white-space: nowrap;
}

body[data-mode="cpu"] .reference-result-screen.victory-art-screen {
  --victory-glow-primary: rgba(85, 162, 255, 0.62);
  --victory-glow-secondary: rgba(150, 211, 255, 0.34);
  position: absolute;
  inset: 0 !important;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #05070e;
}

body[data-mode="cpu"] .result-modal #resultDisplay,
body[data-mode="cpu"] .result-modal #battleResult {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body[data-mode="cpu"] .reference-result-screen.victory-art-screen::before {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 2;
  border: 1px solid rgba(255, 210, 122, 0.36);
  pointer-events: none;
}

body[data-mode="cpu"] .victory-full-art {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

body[data-mode="cpu"] .victory-message-window {
  position: absolute;
  left: 8%;
  right: 4%;
  bottom: 5.2%;
  z-index: 4;
  display: grid;
  place-items: center;
  min-height: 17.4%;
  padding: 18px 36px;
  pointer-events: none;
  text-align: center;
}

body[data-mode="cpu"] .victory-message-window p {
  max-width: min(76%, 860px);
  margin: 0;
  white-space: pre-line;
  color: #f7fbff;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Noto Serif JP", serif;
  font-size: clamp(1.24rem, 2.08vw, 2.15rem);
  font-weight: 700;
  line-height: 1.42;
  text-wrap: balance;
  -webkit-text-stroke: 1px rgba(14, 31, 70, 0.18);
  text-shadow:
    0 2px 7px rgba(0, 0, 0, 0.88),
    0 0 11px rgba(255, 255, 255, 0.68),
    0 0 24px var(--victory-glow-primary),
    0 0 38px var(--victory-glow-secondary);
}

body[data-mode="cpu"] .victory-art-screen[data-result-character="librarian"] {
  --victory-glow-primary: rgba(53, 151, 255, 0.78);
  --victory-glow-secondary: rgba(97, 195, 255, 0.45);
}

body[data-mode="cpu"] .victory-art-screen[data-result-character="detective"] {
  --victory-glow-primary: rgba(255, 185, 63, 0.78);
  --victory-glow-secondary: rgba(255, 221, 134, 0.43);
}

body[data-mode="cpu"] .victory-art-screen[data-result-character="lily"] {
  --victory-glow-primary: rgba(172, 74, 255, 0.78);
  --victory-glow-secondary: rgba(221, 139, 255, 0.43);
}

body[data-mode="cpu"] .victory-art-screen[data-result-character="professor"] {
  --victory-glow-primary: rgba(224, 157, 94, 0.72);
  --victory-glow-secondary: rgba(255, 213, 164, 0.40);
}

body[data-mode="cpu"] .victory-art-screen[data-result-character="fightingLibrarian"] {
  --victory-glow-primary: rgba(38, 135, 255, 0.82);
  --victory-glow-secondary: rgba(75, 218, 255, 0.44);
}

body[data-mode="cpu"] .victory-art-screen[data-result-character="wind"] {
  --victory-glow-primary: rgba(133, 202, 89, 0.78);
  --victory-glow-secondary: rgba(198, 255, 149, 0.42);
}

body[data-mode="cpu"] .victory-art-screen[data-result-character="magician"] {
  --victory-glow-primary: rgba(153, 58, 255, 0.78);
  --victory-glow-secondary: rgba(209, 125, 255, 0.44);
}

body[data-mode="cpu"] .victory-art-screen[data-result-character="digital"] {
  --victory-glow-primary: rgba(29, 191, 255, 0.80);
  --victory-glow-secondary: rgba(111, 229, 255, 0.44);
}

body[data-mode="cpu"] .victory-art-screen[data-result-character="supreme"] {
  --victory-glow-primary: rgba(255, 235, 202, 0.82);
  --victory-glow-secondary: rgba(255, 255, 255, 0.48);
}

body[data-mode="cpu"] .result-modal .modal-frame:has(.victory-art-screen) {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  border: 0;
  background: #05070e;
  box-shadow: none;
}

body[data-mode="cpu"] .result-modal .modal-frame:has(.victory-art-screen) .result-actions {
  right: 34px;
  bottom: 28px;
  z-index: 5;
}

body[data-mode="cpu"] .result-modal .modal-frame:has(.victory-art-screen) .result-actions button {
  min-width: 150px;
  background:
    linear-gradient(180deg, rgba(255, 230, 157, 0.92), rgba(255, 156, 45, 0.9) 52%, rgba(114, 48, 5, 0.94));
  box-shadow:
    0 0 24px rgba(255, 153, 38, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

body[data-mode="cpu"] .result-modal .modal-frame:has(.victory-art-screen) .result-actions button + button {
  background:
    linear-gradient(180deg, rgba(30, 22, 37, 0.88), rgba(9, 10, 20, 0.92));
  color: #fff8e8;
}

body[data-mode="cpu"].fighter-vs-ready .topbar,
body[data-mode="cpu"].fighter-vs-ready .credits {
  display: none;
}

body[data-mode="cpu"].fighter-vs-ready .fighter-story {
  display: grid;
  min-height: 100%;
  margin: 0;
  align-content: stretch;
}

body[data-mode="cpu"].fighter-vs-ready .game-shell {
  padding: 0;
  background: #05070e;
}

body[data-mode="cpu"].fighter-vs-ready .game-shell::before {
  inset: 10px;
  z-index: 4;
  border-color: rgba(255, 210, 122, 0.36);
}

body[data-mode="cpu"].fighter-vs-ready .game-shell::after {
  display: none;
}

body[data-mode="cpu"] .reference-vs-screen.vs-art-screen {
  position: relative;
  display: block;
  width: 100%;
  height: min(820px, calc(100vh - 28px));
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 0;
  background: #05070e;
  box-shadow: none;
}

body[data-mode="cpu"] .reference-vs-screen.vs-art-screen::before,
body[data-mode="cpu"] .reference-vs-screen.vs-art-screen::after {
  display: none;
}

body[data-mode="cpu"] .vs-full-art {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

body[data-mode="cpu"] .vs-screen-meta {
  position: absolute;
  top: 22px;
  left: 50%;
  z-index: 3;
  padding: 6px 14px;
  border: 1px solid rgba(255, 210, 122, 0.44);
  background: rgba(5, 7, 14, 0.48);
  color: rgba(255, 248, 232, 0.86);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1rem;
  letter-spacing: 0;
  transform: translateX(-50%);
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.82);
}

body[data-mode="cpu"] .vs-art-actions {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 5;
  display: flex;
  gap: 12px;
  margin: 0;
  transform: translateX(-50%);
}

body[data-mode="cpu"] .vs-art-actions button {
  min-width: 150px;
  background:
    linear-gradient(180deg, rgba(255, 230, 157, 0.92), rgba(255, 156, 45, 0.9) 52%, rgba(114, 48, 5, 0.94));
  box-shadow:
    0 0 24px rgba(255, 153, 38, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

body[data-mode="cpu"] .vs-art-actions button + button {
  background:
    linear-gradient(180deg, rgba(30, 22, 37, 0.88), rgba(9, 10, 20, 0.92));
  color: #fff8e8;
}

/* Fixed 16:9 stage: mobile is intended for landscape play, so no responsive layout split. */
body[data-mode="cpu"] {
  --fixed-stage-width: 1366px;
  --fixed-stage-height: 768px;
  --stage-scale: var(--stage-scale-runtime, 1);
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  font-size: 16px;
}

body[data-mode="cpu"] .arena {
  position: fixed;
  left: var(--stage-left, 0);
  top: var(--stage-top, 0);
  display: grid;
  grid-template: 1fr / 1fr;
  place-items: stretch;
  width: var(--fixed-stage-width);
  max-width: none;
  height: var(--fixed-stage-height);
  min-height: 0;
  margin: 0 auto;
  padding: 0;
  aspect-ratio: 16 / 9;
  overflow: visible;
  transform: scale(var(--stage-scale));
  transform-origin: top left;
  will-change: transform;
}

body[data-mode="cpu"] .game-shell,
body[data-mode="cpu"].fighter-selecting .game-shell,
body[data-mode="cpu"].fighter-playing .game-shell,
body[data-mode="cpu"].fighter-result .game-shell,
body[data-mode="cpu"].fighter-vs-ready .game-shell {
  grid-area: 1 / 1;
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 18px;
  overflow: hidden;
}

body[data-mode="cpu"] .ambient-lines,
body[data-mode="cpu"] .scan-grid,
body[data-mode="cpu"] #fxLayer,
body[data-mode="cpu"] .game-modal,
body[data-mode="cpu"] .credits {
  grid-area: 1 / 1;
}

body[data-mode="cpu"] #fxLayer {
  position: absolute;
  inset: 0;
  z-index: 80;
  width: 100%;
  height: 100%;
  overflow: visible;
}

body[data-mode="cpu"] .spark,
body[data-mode="cpu"] .pop-text {
  position: absolute;
}

body[data-mode="cpu"] .credits {
  display: none;
}

body[data-mode="cpu"].fighter-playing .game-shell {
  padding: 16px 18px 18px;
}

body[data-mode="cpu"].fighter-vs-ready .game-shell {
  padding: 0;
}

body[data-mode="cpu"] #karuta {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body[data-mode="cpu"] .fighter-story,
body[data-mode="cpu"].fighter-vs-ready .fighter-story {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  align-content: center;
}

body[data-mode="cpu"].fighter-vs-ready .fighter-story {
  position: absolute;
  inset: 0;
  display: block;
  align-content: normal;
}

body[data-mode="cpu"] .fighter-title-panel {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  width: min(100%, 920px);
}

body[data-mode="cpu"] .fighter-character-select {
  width: min(100%, 1080px);
  min-height: 620px;
  gap: 12px;
}

body[data-mode="cpu"] .character-select-stage {
  grid-template-columns: minmax(280px, 0.82fr) minmax(280px, 1fr);
  gap: 18px;
  min-height: 390px;
}

body[data-mode="cpu"] .character-full-art {
  min-height: 390px;
  max-height: none;
}

body[data-mode="cpu"] .character-full-art img {
  width: min(88%, 330px);
}

body[data-mode="cpu"] .character-icon-row {
  grid-template-columns: repeat(3, minmax(0, 116px));
  gap: 12px;
}

body[data-mode="cpu"] .character-icon-row img {
  width: 74px;
  height: 74px;
}

body[data-mode="cpu"] .fighter-battle-hud,
body[data-mode="cpu"].fighter-playing .fighter-battle-hud {
  grid-template-columns: minmax(0, 1fr) 156px minmax(0, 1fr);
  gap: 12px;
  margin: 0 0 8px;
  padding: 8px 154px 8px 8px;
}

body[data-mode="cpu"] .fighter-stage-label {
  display: grid;
  min-width: 112px;
  justify-items: center;
  gap: 0;
}

body[data-mode="cpu"] .fighter-combatant,
body[data-mode="cpu"].fighter-playing .fighter-combatant {
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  text-align: left;
}

body[data-mode="cpu"] .fighter-combatant.enemy,
body[data-mode="cpu"].fighter-playing .fighter-combatant.enemy {
  grid-template-columns: minmax(0, 1fr) 64px;
  direction: ltr;
}

body[data-mode="cpu"] .fighter-face,
body[data-mode="cpu"].fighter-playing .fighter-face {
  width: 64px;
  height: 64px;
}

body[data-mode="cpu"].fighter-playing .reader-panel {
  --reader-stage-height: 82px;
  --reader-message-height: 32px;
}

body[data-mode="cpu"].fighter-playing .digit {
  flex-basis: 70px;
  width: 70px;
  height: 70px;
}

body[data-mode="cpu"].fighter-playing .digit .num {
  font-size: 4.4rem;
}

body[data-mode="cpu"].fighter-playing .fighter-skill-strip {
  grid-template-columns: minmax(0, 1fr) 118px minmax(0, 1fr);
  gap: 10px;
}

body[data-mode="cpu"].fighter-playing #fighterSkillButton {
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  font-size: 1.15rem;
}

body[data-mode="cpu"] .reference-vs-screen.vs-art-screen {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  min-height: 0;
}

body[data-mode="cpu"] .vs-screen-meta {
  top: 22px;
  font-size: 1rem;
}

body[data-mode="cpu"] .vs-art-actions {
  bottom: 22px;
  gap: 12px;
}

body[data-mode="cpu"] .vs-art-actions button {
  min-width: 150px;
  min-height: 48px;
  padding: 10px 16px;
}

body[data-mode="cpu"] .victory-message-window {
  left: 8%;
  right: 4%;
  bottom: 5.2%;
  min-height: 17.4%;
  padding: 18px 36px;
}

body[data-mode="cpu"] .victory-message-window p {
  max-width: min(76%, 860px);
  font-size: 2.15rem;
}

/* Keep the logical layout stable; viewport changes are handled by --stage-scale only. */
body[data-mode="cpu"] .game-shell {
  font-size: 16px;
}

body[data-mode="cpu"] .fighter-brand span {
  font-size: 2.1rem;
}

body[data-mode="cpu"] .fighter-brand strong {
  font-size: 6.6rem;
}

body[data-mode="cpu"] .fighter-title-copy h1 {
  font-size: 4.8rem;
}

body[data-mode="cpu"] .fighter-title-copy p:not(.fighter-eyebrow) {
  font-size: 1.08rem;
}

body[data-mode="cpu"] .fighter-screen-head h2 {
  font-size: 3.6rem;
}

body[data-mode="cpu"] .character-select-info {
  padding: 34px;
}

body[data-mode="cpu"] .character-select-info h3 {
  font-size: 4.2rem;
}

body[data-mode="cpu"] .vs-image {
  height: 360px;
}

body[data-mode="cpu"] .vs-mark span {
  font-size: 7rem;
}

body[data-mode="cpu"]:not(.fighter-playing) .reader-panel {
  --reader-stage-height: 150px;
}

body[data-mode="cpu"]:not(.fighter-playing) .digit {
  flex-basis: 112px;
  width: 112px;
  height: 112px;
}

body[data-mode="cpu"]:not(.fighter-playing) .digit .num {
  font-size: 9.5rem;
}

body[data-mode="cpu"] #message .msg-main {
  font-size: 2.4rem;
}

body[data-mode="cpu"] #comboDisplay {
  width: 560px;
}

body[data-mode="cpu"] .game-modal {
  width: 980px;
  max-height: 820px;
}

body[data-mode="cpu"] .modal-frame {
  padding: 26px;
}

/* Battle readability pass: keep fixed-stage values and let the stage scale uniformly. */
body[data-mode="cpu"].fighter-playing .action-row,
body[data-mode="cpu"].fighter-playing #quitButton {
  display: none !important;
}

body[data-mode="cpu"].fighter-playing .fighter-battle-hud {
  grid-template-columns: minmax(0, 1fr) 124px minmax(0, 1fr);
  gap: 14px;
  margin: 0 0 10px;
  padding: 8px;
}

body[data-mode="cpu"].fighter-playing .fighter-combatant {
  padding: 8px 10px;
}

body[data-mode="cpu"].fighter-playing .fighter-bars {
  min-width: 0;
}

body[data-mode="cpu"].fighter-playing .hp-track {
  position: relative;
  height: 32px;
  overflow: hidden;
}

body[data-mode="cpu"].fighter-playing .hp-track span {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: auto;
  height: 100%;
}

body[data-mode="cpu"].fighter-playing .hp-track.enemy span {
  right: auto;
  left: 0;
}

body[data-mode="cpu"].fighter-playing .reader-panel {
  --reader-stage-height: 106px;
  --reader-message-height: 34px;
  padding: 9px 8px;
}

body[data-mode="cpu"].fighter-playing #reading {
  gap: 12px;
  margin: 0 0 8px;
}

body[data-mode="cpu"].fighter-playing #reading .digit {
  flex: 0 0 90px;
  width: 90px;
  height: 90px;
  border-width: 3px;
  border-color: rgba(255, 223, 128, 0.72);
  background: #fff1b6;
  box-shadow:
    0 9px 0 rgba(0, 0, 0, 0.32),
    0 0 24px rgba(255, 201, 82, 0.42),
    inset 0 0 0 2px rgba(255, 255, 255, 0.42);
}

body[data-mode="cpu"].fighter-playing #reading .digit .num {
  color: #071014;
  font-size: 6rem;
  font-weight: 900;
  line-height: 0.9;
  padding-top: 0.08em;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.82),
    0 0 12px rgba(255, 248, 232, 0.72);
}

body[data-mode="cpu"].fighter-playing .grid {
  gap: 10px;
  padding: 12px;
}

body[data-mode="cpu"].fighter-playing .card {
  min-height: 96px;
  padding: 12px 13px;
  font-size: 0.92rem;
  line-height: 1.18;
}

body[data-mode="cpu"].fighter-smartphone.fighter-playing .card {
  font-size: 1rem;
}

body[data-mode="cpu"].fighter-playing #message {
  border-color: rgba(17, 24, 39, 0.28);
  background: #fff4c8;
  color: #101820;
  text-shadow: none;
}

body[data-mode="cpu"].fighter-playing #message .msg-main {
  color: #101820;
  text-shadow: none;
}

body[data-mode="cpu"].fighter-playing #message .msg-sub {
  color: #273849;
  text-shadow: none;
}

body[data-mode="cpu"].fighter-playing .fighter-skill-strip {
  position: absolute;
  right: 18px;
  bottom: 16px;
  left: 18px;
  display: grid;
  grid-template-columns: 390px 118px 390px;
  justify-content: space-between;
  align-items: end;
  gap: 0;
  margin: 0;
  z-index: 6;
}

body[data-mode="cpu"].fighter-playing .skill-meter {
  width: 390px;
}

body[data-mode="cpu"].fighter-playing .skill-meter.enemy {
  justify-self: end;
}

body[data-mode="cpu"].fighter-playing .gauge-track {
  position: relative;
  height: 18px;
  overflow: hidden;
}

body[data-mode="cpu"].fighter-playing .gauge-track span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  height: 100%;
}

body[data-mode="cpu"].fighter-playing .gauge-track.enemy span {
  right: 0;
  left: auto;
}

/* Battle readout/message pass: reserve space, keep cards fixed, and use dark glowing HUD. */
body[data-mode="cpu"].fighter-playing .reader-panel {
  --reader-stage-height: 116px;
  margin: 0 0 10px;
  padding: 16px 8px;
  border-color: rgba(255, 255, 255, 0.14);
  background: transparent;
  box-shadow: none;
  min-height: calc(var(--reader-stage-height) + 32px);
}

body[data-mode="cpu"].fighter-playing #reading {
  display: flex;
  height: var(--reader-stage-height);
  margin: 0;
  gap: 14px;
}

body[data-mode="cpu"].fighter-playing #reading.is-hud-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body[data-mode="cpu"].fighter-playing #reading .digit {
  flex: 0 0 86px;
  width: 86px;
  height: 86px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 3px;
  background: rgba(3, 5, 12, 0.58);
  box-shadow:
    0 0 16px rgba(150, 211, 255, 0.18),
    inset 0 0 18px rgba(255, 255, 255, 0.06);
}

body[data-mode="cpu"].fighter-playing #reading .digit .num {
  color: #f7fbff;
  font-size: 5.35rem;
  font-weight: 900;
  line-height: 0.9;
  padding-top: 0.08em;
  -webkit-text-stroke: 1px rgba(14, 31, 70, 0.16);
  text-shadow:
    0 2px 7px rgba(0, 0, 0, 0.88),
    0 0 11px rgba(255, 255, 255, 0.68),
    0 0 24px rgba(85, 162, 255, 0.62),
    0 0 38px rgba(150, 211, 255, 0.34);
}

body[data-mode="cpu"].fighter-playing .fighter-face img {
  object-position: center;
}

body[data-mode="cpu"].fighter-playing #message {
  width: 620px;
  min-height: 40px;
  margin: 8px auto 0;
  padding: 7px 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  background: rgba(3, 5, 12, 0.58);
  box-shadow:
    0 0 18px rgba(150, 211, 255, 0.16),
    inset 0 0 18px rgba(255, 255, 255, 0.05);
  color: #f7fbff;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Noto Serif JP", serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.24;
  text-shadow:
    0 2px 7px rgba(0, 0, 0, 0.88),
    0 0 11px rgba(255, 255, 255, 0.68),
    0 0 24px rgba(85, 162, 255, 0.62),
    0 0 38px rgba(150, 211, 255, 0.34);
}

body[data-mode="cpu"].fighter-playing #message .msg-main,
body[data-mode="cpu"].fighter-playing #message .msg-sub {
  color: #f7fbff;
  text-shadow: inherit;
}

body[data-mode="cpu"].fighter-playing #message .msg-main {
  font-size: 1.42rem;
}

body[data-mode="cpu"].fighter-playing #message .msg-sub {
  font-size: 0.96rem;
  font-weight: 700;
}

body[data-mode="cpu"].fighter-playing .grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: row;
  gap: 10px;
}

body[data-mode="cpu"].fighter-playing .card {
  grid-column: span 2;
}

body[data-mode="cpu"].fighter-playing .card:nth-child(7) {
  grid-column: 2 / span 2;
}

body[data-mode="cpu"].fighter-playing .card:nth-child(8) {
  grid-column: 4 / span 2;
}

body[data-mode="cpu"].fighter-playing .card:nth-child(9) {
  grid-column: 6 / span 2;
}

body[data-mode="cpu"].fighter-playing .card:nth-child(10) {
  grid-column: 8 / span 2;
}

body[data-mode="cpu"].fighter-playing .card:nth-child(11) {
  grid-column: 10 / span 2;
}

body[data-mode="cpu"].fighter-playing .skill-cutin {
  position: absolute;
  inset: 0;
  z-index: 88;
  display: flex;
  align-items: center;
  pointer-events: none;
  overflow: hidden;
}

body[data-mode="cpu"].fighter-playing .skill-cutin::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 8%, rgba(0, 0, 0, 0.62) 28%, rgba(0, 0, 0, 0.66) 72%, transparent 92%),
    linear-gradient(90deg, rgba(255, 210, 122, 0.18), transparent 42%, rgba(190, 98, 255, 0.18));
  opacity: 0;
  animation: skillCutinDim 1.12s ease forwards;
}

body[data-mode="cpu"].fighter-playing .skill-cutin.player {
  justify-content: flex-start;
}

body[data-mode="cpu"].fighter-playing .skill-cutin.enemy {
  justify-content: flex-end;
}

body[data-mode="cpu"].fighter-playing .skill-cutin-frame {
  position: relative;
  z-index: 1;
  width: 1020px;
  height: 574px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(3, 5, 12, 0.84);
  box-shadow:
    0 0 0 1px rgba(255, 210, 122, 0.22),
    0 0 36px rgba(255, 210, 122, 0.28),
    inset 0 0 36px rgba(255, 255, 255, 0.08);
}

body[data-mode="cpu"].fighter-playing .skill-cutin.player .skill-cutin-frame {
  margin-left: -42px;
  clip-path: polygon(0 0, 96% 0, 100% 100%, 0 100%);
  animation: skillCutinPlayer 1.12s cubic-bezier(.18,.82,.2,1) forwards;
}

body[data-mode="cpu"].fighter-playing .skill-cutin.enemy .skill-cutin-frame {
  margin-right: -42px;
  clip-path: polygon(4% 0, 100% 0, 100% 100%, 0 100%);
  animation: skillCutinEnemy 1.12s cubic-bezier(.18,.82,.2,1) forwards;
}

body[data-mode="cpu"].fighter-playing .skill-cutin-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* First-play classification training. */
.battle-tutorial-overlay {
  position: absolute;
  inset: 0;
  z-index: 96;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 177, 64, 0.15), transparent 42%),
    rgba(2, 3, 9, 0.78);
  backdrop-filter: blur(5px);
}

.battle-tutorial-panel {
  position: relative;
  display: grid;
  width: min(680px, 100%);
  gap: 13px;
  padding: 30px 34px 28px;
  border: 1px solid rgba(255, 218, 139, 0.7);
  background:
    linear-gradient(135deg, rgba(255, 174, 55, 0.13), transparent 46%),
    linear-gradient(180deg, rgba(17, 15, 27, 0.97), rgba(5, 6, 14, 0.98));
  box-shadow:
    0 0 0 1px rgba(179, 88, 255, 0.2),
    0 24px 70px rgba(0, 0, 0, 0.62),
    inset 4px 0 0 #f7a633;
  color: #fff8e8;
}

.battle-tutorial-kicker,
.battle-tutorial-step,
.battle-tutorial-special > span,
.battle-tutorial-coach > span,
.skill-tutorial-toast > span {
  color: #ffd27a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.battle-tutorial-kicker {
  font-size: 1rem;
}

.battle-tutorial-step {
  position: absolute;
  top: 30px;
  right: 34px;
  color: rgba(255, 248, 232, 0.48);
  font-size: 0.84rem;
}

.battle-tutorial-panel h2 {
  margin: 2px 0 0;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 1.75rem;
  line-height: 1.35;
  text-shadow: 0 0 18px rgba(255, 166, 49, 0.34);
}

.battle-tutorial-panel > p {
  margin: 0;
  color: rgba(255, 248, 232, 0.8);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.8;
}

.battle-tutorial-panel .battle-tutorial-note {
  color: rgba(255, 248, 232, 0.55);
  font-size: 0.76rem;
}

.battle-tutorial-example {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 214, 139, 0.25);
  background: rgba(1, 3, 10, 0.66);
}

.battle-tutorial-example span {
  display: grid;
  width: 46px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(155, 206, 255, 0.42);
  background: rgba(30, 64, 105, 0.52);
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.4rem;
}

.battle-tutorial-example i {
  margin: 0 6px;
  color: #c997ff;
  font-size: 1.8rem;
  font-style: normal;
}

.battle-tutorial-example strong {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 1.15rem;
}

.battle-tutorial-special {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 13px 16px;
  border: 1px solid rgba(255, 179, 68, 0.42);
  background: rgba(255, 155, 38, 0.1);
}

.battle-tutorial-special p {
  margin: 0;
  color: rgba(255, 248, 232, 0.76);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.65;
}

.battle-tutorial-actions {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
  margin-top: 3px;
}

.battle-tutorial-actions.single {
  grid-template-columns: minmax(0, 1fr);
}

.battle-tutorial-actions button,
.battle-tutorial-coach button {
  min-height: 48px;
  border: 1px solid rgba(255, 218, 139, 0.58);
  border-radius: 0;
  background: rgba(4, 5, 12, 0.9);
  color: #fff8e8;
  cursor: pointer;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.18rem;
  font-weight: 900;
}

.battle-tutorial-actions button:last-child {
  background: linear-gradient(180deg, #ffe49a, #f39b2f 56%, #843b08);
  color: #180b06;
}

.battle-tutorial-actions button:hover,
.battle-tutorial-coach button:hover {
  border-color: #fff1b9;
  box-shadow: 0 0 18px rgba(255, 168, 50, 0.42);
}

.battle-tutorial-coach {
  position: absolute;
  top: 118px;
  right: 22px;
  z-index: 72;
  display: grid;
  width: 360px;
  gap: 4px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 218, 139, 0.68);
  background: rgba(5, 6, 14, 0.94);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.48), inset 3px 0 0 #f7a633;
  color: #fff8e8;
  pointer-events: none;
}

.battle-tutorial-coach strong,
.battle-tutorial-coach p {
  margin: 0;
  font-family: "Noto Sans JP", sans-serif;
}

.battle-tutorial-coach strong {
  font-size: 0.96rem;
}

.battle-tutorial-coach p {
  color: rgba(255, 248, 232, 0.67);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.5;
}

.battle-tutorial-coach button {
  position: absolute;
  top: 9px;
  right: 9px;
  min-height: 28px;
  padding: 0 10px;
  font-size: 0.78rem;
  pointer-events: auto;
}

.skill-tutorial-toast {
  position: absolute;
  right: 20px;
  bottom: 78px;
  z-index: 74;
  display: grid;
  width: 340px;
  gap: 3px;
  padding: 14px 38px 14px 16px;
  border: 1px solid rgba(255, 218, 139, 0.68);
  background: rgba(5, 6, 14, 0.96);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), inset 3px 0 0 #f7a633;
  color: #fff8e8;
}

.skill-tutorial-toast strong,
.skill-tutorial-toast p {
  margin: 0;
  font-family: "Noto Sans JP", sans-serif;
}

.skill-tutorial-toast p {
  color: rgba(255, 248, 232, 0.7);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.5;
}

.skill-tutorial-toast button {
  position: absolute;
  top: 5px;
  right: 7px;
  border: 0;
  background: transparent;
  color: rgba(255, 248, 232, 0.68);
  cursor: pointer;
  font-size: 1.25rem;
}

@keyframes skillCutinDim {
  0%, 100% { opacity: 0; }
  18%, 78% { opacity: 1; }
}

@keyframes skillCutinPlayer {
  0% { opacity: 0; transform: translateX(-112%); filter: blur(4px); }
  18% { opacity: 1; transform: translateX(0); filter: blur(0); }
  78% { opacity: 1; transform: translateX(0); filter: blur(0); }
  100% { opacity: 0; transform: translateX(-112%); filter: blur(3px); }
}

@keyframes skillCutinEnemy {
  0% { opacity: 0; transform: translateX(112%); filter: blur(4px); }
  18% { opacity: 1; transform: translateX(0); filter: blur(0); }
  78% { opacity: 1; transform: translateX(0); filter: blur(0); }
  100% { opacity: 0; transform: translateX(112%); filter: blur(3px); }
}

/* These chrome elements are intentionally removed from every game screen. */
body[data-mode="cpu"] .topbar,
body[data-mode="cpu"] .status-chip,
body[data-mode="cpu"] .toggle-stack,
body[data-mode="cpu"] .sound-toggle-wrapper,
body[data-mode="cpu"] .title-sigil,
body[data-mode="cpu"] .reference-title .fighter-eyebrow {
  display: none !important;
}

/* Stylish fighter select rebuild. Kept in fixed stage units; scaling happens on the arena. */
body[data-mode="cpu"] {
  --fighter-serif: "Yu Mincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Noto Serif JP", serif;
}

body[data-mode="cpu"].fighter-selecting .game-shell {
  background:
    linear-gradient(90deg, rgba(255, 156, 45, 0.2), transparent 34%, transparent 66%, rgba(177, 73, 255, 0.2)),
    linear-gradient(180deg, rgba(4, 5, 10, 0.18), rgba(4, 5, 10, 0.84)),
    url("image/ancient-library-bg.png") center / cover no-repeat;
}

body[data-mode="cpu"] .fighter-character-select.reference-select {
  width: 1210px;
  height: 704px;
  min-height: 0;
  margin: 0 auto;
  display: grid;
  grid-template-rows: 82px 500px 92px;
  gap: 12px;
  align-content: center;
}

body[data-mode="cpu"] .fighter-character-select .fighter-screen-head {
  display: grid;
  place-items: center;
  min-height: 0;
}

body[data-mode="cpu"] .fighter-character-select .fighter-screen-head h2 {
  margin: 0;
  color: #fff6df;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 5.9rem;
  font-weight: 900;
  line-height: 0.86;
  letter-spacing: 0;
  text-shadow:
    0 3px 0 rgba(47, 12, 4, 0.95),
    0 0 18px rgba(255, 168, 50, 0.72),
    0 0 34px rgba(183, 76, 255, 0.38);
}

body[data-mode="cpu"] .character-select-stage {
  display: grid;
  grid-template-columns: 590px 520px;
  gap: 28px;
  align-items: stretch;
  min-height: 0;
  height: 500px;
}

body[data-mode="cpu"] .character-full-art {
  position: relative;
  min-height: 0;
  height: 500px;
  overflow: hidden;
  border: 1px solid rgba(255, 214, 139, 0.54);
  border-radius: 0;
  background:
    linear-gradient(115deg, rgba(255, 199, 91, 0.24), transparent 42%, rgba(156, 69, 255, 0.18)),
    linear-gradient(180deg, rgba(255, 246, 222, 0.08), rgba(5, 7, 14, 0.7)),
    rgba(5, 7, 14, 0.74);
  box-shadow:
    0 0 28px rgba(255, 159, 46, 0.3),
    inset 0 -92px 72px rgba(0, 0, 0, 0.52),
    inset 0 0 0 1px rgba(255, 248, 232, 0.08);
  backdrop-filter: blur(6px);
}

body[data-mode="cpu"] .character-full-art::before {
  inset: 12px;
  border: 1px solid rgba(255, 214, 139, 0.32);
  border-radius: 0;
}

body[data-mode="cpu"] .character-full-art::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  height: 112px;
  background: linear-gradient(180deg, transparent, rgba(3, 4, 9, 0.68));
  pointer-events: none;
}

body[data-mode="cpu"] .character-full-art img {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 1;
  width: 520px;
  max-width: none;
  max-height: none;
  height: auto;
  object-fit: contain;
  object-position: center bottom;
  transform: translate(-50%, 202px);
  filter:
    drop-shadow(0 0 18px rgba(255, 210, 122, 0.32))
    drop-shadow(0 26px 26px rgba(0, 0, 0, 0.58));
}

body[data-mode="cpu"] .character-art-name {
  left: 24px;
  bottom: 22px;
  z-index: 3;
  padding: 7px 20px 8px;
  border-color: rgba(255, 214, 139, 0.7);
  background: rgba(4, 5, 10, 0.72);
  color: #fff8e8;
  font-family: var(--fighter-serif);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow:
    0 0 12px rgba(255, 210, 122, 0.7),
    0 2px 0 rgba(0, 0, 0, 0.75);
}

body[data-mode="cpu"] .character-select-info {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  align-content: stretch;
  gap: 16px;
  height: 500px;
  min-width: 0;
  padding: 28px 30px;
  border: 1px solid rgba(255, 214, 139, 0.48);
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(255, 214, 139, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(9, 12, 24, 0.88), rgba(4, 5, 10, 0.82));
  box-shadow:
    0 0 24px rgba(185, 77, 255, 0.24),
    inset 0 0 0 1px rgba(255, 248, 232, 0.08);
  color: #fff8e8;
  backdrop-filter: blur(8px);
}

body[data-mode="cpu"] .character-select-info h3 {
  margin: 0;
  color: #fff8e8;
  font-family: var(--fighter-serif);
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: 0;
  text-shadow:
    0 0 14px rgba(255, 210, 122, 0.72),
    0 3px 0 rgba(0, 0, 0, 0.72);
}

body[data-mode="cpu"] .character-special {
  display: grid;
  gap: 6px;
  padding: 13px 16px 15px;
  border-left: 4px solid rgba(255, 168, 50, 0.9);
  background: rgba(255, 210, 122, 0.08);
  box-shadow: inset 0 0 20px rgba(255, 210, 122, 0.04);
}

body[data-mode="cpu"] .character-special span {
  color: #ffd27a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 0 12px rgba(255, 159, 46, 0.5);
}

body[data-mode="cpu"] .character-special strong {
  color: #fffaf0;
  font-family: var(--fighter-serif);
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1.24;
  letter-spacing: 0;
  text-shadow:
    0 0 12px rgba(255, 210, 122, 0.58),
    0 2px 0 rgba(0, 0, 0, 0.7);
}

body[data-mode="cpu"] .character-special p,
body[data-mode="cpu"] .character-story {
  margin: 0;
  color: rgba(255, 248, 232, 0.9);
  font-family: var(--fighter-serif);
  font-size: 1.07rem;
  font-weight: 800;
  line-height: 1.72;
  letter-spacing: 0;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.58);
}

body[data-mode="cpu"] .character-special.is-description-multiline {
  height: 125px;
}

body[data-mode="cpu"] .character-special.is-description-multiline p {
  font-size: 0.9rem;
  line-height: 1;
}

body[data-mode="cpu"] .fighter-stat-panel {
  display: grid;
  gap: 11px;
  padding: 16px;
  border: 1px solid rgba(255, 214, 139, 0.28);
  background: rgba(4, 5, 10, 0.46);
}

body[data-mode="cpu"] .fighter-stat-row {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 13px;
  align-items: center;
}

body[data-mode="cpu"] .fighter-stat-row span {
  color: #ffd27a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 0 10px rgba(255, 159, 46, 0.48);
}

body[data-mode="cpu"] .fighter-stat-track {
  position: relative;
  height: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 248, 232, 0.18);
  background: rgba(255, 248, 232, 0.12);
  box-shadow:
    inset 0 0 8px rgba(0, 0, 0, 0.48),
    0 0 10px rgba(185, 77, 255, 0.16);
}

body[data-mode="cpu"] .fighter-stat-track i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: block;
  background:
    linear-gradient(90deg, #ff7a35, #ffd27a);
  box-shadow: 0 0 12px rgba(255, 159, 46, 0.48);
}

body[data-mode="cpu"] .fighter-stat-row:nth-child(2) .fighter-stat-track i {
  background:
    linear-gradient(90deg, #8d75ff, #8fe7ff);
  box-shadow: 0 0 12px rgba(143, 231, 255, 0.4);
}

body[data-mode="cpu"] .character-story {
  align-self: start;
  padding-top: 2px;
  color: rgba(255, 248, 232, 0.82);
  font-size: 1.04rem;
}

body[data-mode="cpu"] .character-select-info button {
  width: 230px;
  min-height: 54px;
  margin-top: 0;
  border-radius: 0;
  font-family: var(--fighter-serif);
  font-size: 1.1rem;
  letter-spacing: 0;
}

body[data-mode="cpu"] .character-icon-row {
  display: grid;
  grid-template-columns: repeat(3, 132px);
  justify-content: center;
  gap: 18px;
  min-height: 0;
}

body[data-mode="cpu"] .character-icon-row button {
  display: grid;
  grid-template-rows: 62px auto;
  place-items: center;
  gap: 5px;
  height: 92px;
  padding: 7px 8px 8px;
  border: 1px solid rgba(255, 214, 139, 0.34);
  border-radius: 0;
  background: rgba(4, 5, 10, 0.7);
  color: rgba(255, 248, 232, 0.82);
}

body[data-mode="cpu"] .character-icon-row img {
  width: 62px;
  height: 62px;
  border: 1px solid rgba(255, 214, 139, 0.42);
  border-radius: 0;
}

body[data-mode="cpu"] .character-icon-row button span {
  font-family: var(--fighter-serif);
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

body[data-mode="cpu"] .character-icon-row button.active,
body[data-mode="cpu"] .character-icon-row button:hover {
  border-color: rgba(255, 214, 139, 0.9);
  background:
    linear-gradient(180deg, rgba(255, 210, 122, 0.2), rgba(182, 76, 255, 0.14)),
    rgba(4, 5, 10, 0.82);
  box-shadow:
    0 0 20px rgba(255, 159, 46, 0.38),
    inset 0 0 18px rgba(255, 210, 122, 0.08);
}

/* Full-screen fighter select art pass. */
body[data-mode="cpu"] .fighter-character-select.reference-select {
  --select-side-padding: 56px;
  --select-info-width: 520px;
  --select-column-gap: 32px;
  position: relative;
  width: 100%;
  height: 100%;
  padding: 8px 64px 10px;
  overflow: hidden;
  grid-template-rows: 78px minmax(0, 1fr) 112px 60px;
  gap: 8px;
}

body[data-mode="cpu"] .fighter-character-select .fighter-screen-head,
body[data-mode="cpu"] .character-select-info,
body[data-mode="cpu"] .character-select-lower,
body[data-mode="cpu"] .character-icon-row,
body[data-mode="cpu"] .fighter-flow-actions {
  position: relative;
  z-index: 3;
}

body[data-mode="cpu"] .fighter-character-select .fighter-screen-head h2 {
  font-size: 5.5rem;
  transform: translateY(-8px);
}

body[data-mode="cpu"] .character-select-stage {
  position: static;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--select-info-width);
  gap: var(--select-column-gap);
  align-items: center;
  height: auto;
  min-height: 0;
  padding: 0 var(--select-side-padding);
}

body[data-mode="cpu"] .character-full-art {
  position: absolute;
  inset: -18px -64px -18px;
  z-index: 0;
  height: auto;
  min-height: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
  backdrop-filter: none;
}

body[data-mode="cpu"] .character-full-art::before {
  display: none;
}

body[data-mode="cpu"] .character-full-art::after {
  height: 44%;
  background:
    linear-gradient(180deg, transparent 0%, rgba(4, 5, 10, 0.28) 44%, rgba(4, 5, 10, 0.86) 100%);
}

body[data-mode="cpu"] .character-full-art img {
  left: 34%;
  bottom: 0;
  width: 650px;
  transform: translate(-50%, 226px);
  filter:
    drop-shadow(0 0 24px rgba(255, 210, 122, 0.34))
    drop-shadow(28px 20px 28px rgba(0, 0, 0, 0.5));
}

body[data-mode="cpu"] .character-art-name {
  display: none;
}

body[data-mode="cpu"] .character-select-info {
  grid-column: 2;
  justify-self: stretch;
  height: 390px;
  width: 100%;
  padding: 26px 30px;
  transform: none;
  background:
    linear-gradient(135deg, rgba(255, 214, 139, 0.1), transparent 35%),
    linear-gradient(180deg, rgba(9, 12, 24, 0.86), rgba(4, 5, 10, 0.76));
}

body[data-mode="cpu"] .character-select-info h3 {
  display: flex;
  align-items: flex-end;
  gap: 18px;
}

body[data-mode="cpu"] .character-name-ja {
  flex: 0 0 auto;
}

body[data-mode="cpu"] .character-name-en {
  flex: 0 1 auto;
  color: #ffd27a;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 1.28rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.7),
    0 0 14px rgba(255, 159, 46, 0.5);
}

body[data-mode="cpu"] .fighter-stat-heading {
  display: block;
  margin-bottom: 1px;
}

body[data-mode="cpu"] .fighter-stat-heading span {
  color: #ffd27a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.34rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 0 10px rgba(255, 159, 46, 0.48);
}

body[data-mode="cpu"] .fighter-stat-panel {
  gap: 10px;
  padding: 14px 16px 15px;
}

body[data-mode="cpu"] .character-difficulty-panel {
  display: grid;
  gap: 8px;
  padding: 12px 16px 14px;
  border: 1px solid rgba(255, 214, 139, 0.28);
  background: rgba(4, 5, 10, 0.46);
}

body[data-mode="cpu"] .character-difficulty-label {
  color: #ffd27a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.34rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 10px rgba(255, 159, 46, 0.48);
}

body[data-mode="cpu"] .character-difficulty-panel .difficulty-select {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body[data-mode="cpu"] .character-difficulty-panel .difficulty-select button {
  display: grid;
  width: auto;
  min-width: 0;
  min-height: 40px;
  padding: 6px 8px;
  place-items: center;
  border-radius: 0;
}

body[data-mode="cpu"] .character-difficulty-panel .difficulty-select strong {
  font-size: 1.18rem;
  line-height: 1;
}

body[data-mode="cpu"] .fighter-stat-row {
  grid-template-columns: 54px 1fr;
}

body[data-mode="cpu"] .character-select-info button {
  width: 278px;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.48rem;
  line-height: 1;
}

body[data-mode="cpu"] .character-icon-row {
  grid-template-columns: repeat(auto-fit, 78px);
  justify-content: center;
  gap: 12px;
  min-width: 0;
  margin: 0;
  transform: none;
}

body[data-mode="cpu"] .character-select-lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--select-info-width);
  gap: var(--select-column-gap);
  align-items: stretch;
  width: 100%;
  padding: 0 var(--select-side-padding);
}

body[data-mode="cpu"] .character-roster-panel,
body[data-mode="cpu"] .character-select-lower .character-difficulty-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
  min-width: 0;
  padding: 9px 12px 10px;
  border: 1px solid rgba(255, 214, 139, 0.28);
  background: rgba(4, 5, 10, 0.46);
}

body[data-mode="cpu"] .character-roster-label,
body[data-mode="cpu"] .character-select-lower .character-difficulty-label {
  color: #ffd27a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 10px rgba(255, 159, 46, 0.48);
}

body[data-mode="cpu"] .character-select-lower .character-difficulty-panel {
  align-self: auto;
}

body[data-mode="cpu"] .character-select-lower .difficulty-select button {
  min-height: 34px;
  padding: 4px 6px;
}

body[data-mode="cpu"] .character-icon-row button {
  grid-template-rows: 1fr;
  width: 78px;
  height: 70px;
  padding: 6px;
}

body[data-mode="cpu"] .character-icon-row img {
  width: 56px;
  height: 56px;
}

body[data-mode="cpu"] .character-select-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--select-info-width);
  align-items: stretch;
  align-self: end;
  gap: var(--select-column-gap);
  width: 100%;
  margin: 0;
  padding: 0 var(--select-side-padding);
}

body[data-mode="cpu"] .character-select-actions button {
  width: 100%;
  min-width: 180px;
  min-height: 54px;
}

body[data-mode="cpu"] .character-select-actions [data-fighter-back] {
  width: 180px;
  justify-self: start;
}

body[data-mode="cpu"] .character-select-actions [data-confirm-player] {
  min-width: 0;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.45rem;
  line-height: 1;
}

body[data-mode="cpu"] .vs-art-actions {
  display: none !important;
}

body[data-mode="cpu"].fighter-selecting .fighter-story {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  align-content: normal;
}

body[data-mode="cpu"].fighter-selecting .fighter-character-select.reference-select {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  margin: 0;
  opacity: 1;
  filter: none;
  transform: scale(1);
  transition:
    opacity 1.35s ease,
    filter 1.35s ease,
    transform 1.35s ease;
  will-change: opacity, filter, transform;
}

body[data-mode="cpu"].fighter-selecting .fighter-character-select.reference-select.is-exiting-to-vs {
  opacity: 0;
  filter: blur(8px) brightness(0.42);
  transform: scale(1.018);
  pointer-events: none;
}

/* Ending scene: full art, lower-third story window, then credits. */
body[data-mode="cpu"].fighter-ending .topbar,
body[data-mode="cpu"].fighter-ending .credits {
  display: none;
}

body[data-mode="cpu"].fighter-opening .game-shell {
  padding: 0;
  background: #090807;
}

body[data-mode="cpu"].fighter-opening .game-shell::before {
  inset: 10px;
  z-index: 9;
  border-color: rgba(255, 210, 122, 0.3);
  pointer-events: none;
}

body[data-mode="cpu"].fighter-opening .game-shell::after {
  display: none;
}

body[data-mode="cpu"].fighter-opening .fighter-story {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  align-content: normal;
}

body[data-mode="cpu"] .fighter-opening-screen {
  position: absolute;
  inset: 0;
  isolation: isolate;
  overflow: hidden;
  background: #090807;
  cursor: pointer;
  animation: none;
}

body[data-mode="cpu"] .fighter-opening-screen.opening-scene-character {
  animation: openingSceneReveal 420ms ease both;
}

body[data-mode="cpu"] .fighter-opening-screen.is-finishing {
  pointer-events: none;
}

body[data-mode="cpu"] .fighter-opening-screen.is-leaving {
  animation: openingSceneLeave 720ms ease both;
}

body[data-mode="cpu"] .opening-full-art {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  animation: none;
}

body[data-mode="cpu"] .opening-scene-character .opening-full-art {
  animation: openingArtReveal 7s ease-out both;
}

body[data-mode="cpu"] .fighter-opening-screen::before {
  content: "";
  display: none;
}

body[data-mode="cpu"] .fighter-opening-screen::after {
  content: "";
  position: absolute;
  inset: 14px;
  z-index: 6;
  border: 1px solid rgba(255, 221, 143, 0.34);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 0 42px rgba(255, 182, 68, 0.08);
  pointer-events: none;
}

body[data-mode="cpu"] .opening-skip-button {
  position: absolute;
  top: 24px;
  right: 34px;
  z-index: 8;
  min-width: 116px;
  min-height: 42px;
  padding: 8px 18px;
  border: 1px solid rgba(255, 225, 164, 0.66);
  border-radius: 0;
  background: rgba(7, 8, 14, 0.7);
  color: #fff1cf;
  cursor: pointer;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.16rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  box-shadow: inset 0 0 18px rgba(255, 192, 90, 0.08), 0 4px 18px rgba(0, 0, 0, 0.34);
}

body[data-mode="cpu"] .opening-skip-button:hover,
body[data-mode="cpu"] .opening-skip-button:focus-visible {
  border-color: rgba(255, 225, 164, 0.94);
  background: rgba(68, 43, 16, 0.82);
  box-shadow: inset 0 0 22px rgba(255, 192, 90, 0.16), 0 0 18px rgba(255, 177, 61, 0.24);
}

body[data-mode="cpu"] .opening-message-window {
  position: absolute;
  right: 48px;
  bottom: 30px;
  left: 48px;
  z-index: 5;
  display: grid;
  min-height: 226px;
  padding: 22px 34px 24px;
  border: 1px solid rgba(255, 226, 159, 0.58);
  background:
    linear-gradient(180deg, rgba(8, 9, 16, 0.56), rgba(8, 8, 14, 0.76)),
    radial-gradient(circle at 50% 0%, rgba(255, 184, 75, 0.08), transparent 58%);
  box-shadow:
    0 12px 42px rgba(0, 0, 0, 0.48),
    0 0 30px rgba(255, 176, 64, 0.13),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 0 44px rgba(52, 75, 126, 0.12);
  pointer-events: none;
}

body[data-mode="cpu"] .opening-message-text {
  display: grid;
  align-content: center;
  justify-items: stretch;
  gap: 2px;
  min-width: 0;
}

body[data-mode="cpu"] .opening-message-text p {
  margin: 0;
  color: #f9f7f2;
  font-family: var(--fighter-serif);
  font-size: 1.24rem;
  font-weight: 750;
  line-height: 1.43;
  letter-spacing: 0.01em;
  text-shadow:
    0 2px 7px rgba(0, 0, 0, 0.94),
    0 0 12px rgba(255, 255, 255, 0.22);
}

body[data-mode="cpu"] .opening-message-text p.is-emphasis {
  margin-top: 7px;
  color: #fff0bd;
  font-size: 1.52rem;
  font-weight: 900;
  letter-spacing: 0.025em;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.94),
    0 0 12px rgba(255, 255, 255, 0.32),
    0 0 24px rgba(255, 177, 61, 0.42);
}

body[data-mode="cpu"] .opening-scene-2 .opening-message-text {
  justify-items: center;
  text-align: center;
}

body[data-mode="cpu"] .opening-scene-2 .opening-message-text p.is-emphasis {
  margin-top: 12px;
  font-size: 2.35rem;
  letter-spacing: 0.08em;
}

body[data-mode="cpu"] .opening-scene-character .opening-message-text p {
  font-size: 1.13rem;
  line-height: 1.42;
}

body[data-mode="cpu"] .opening-continue-caret {
  display: block;
  justify-self: center;
  width: 0;
  height: 0;
  margin-top: 7px;
  border-top: 13px solid #fff3d2;
  border-right: 10px solid transparent;
  border-left: 10px solid transparent;
  filter: drop-shadow(0 0 7px rgba(255, 184, 72, 0.72));
  animation: endingCaretBlink 1.05s ease-in-out infinite;
}

@keyframes openingSceneReveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes openingSceneLeave {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes openingArtReveal {
  from { transform: scale(1.018); }
  to { transform: scale(1); }
}

body[data-mode="cpu"].fighter-ending .game-shell {
  padding: 0;
  background: #05070e;
}

body[data-mode="cpu"].fighter-ending .game-shell::before {
  inset: 10px;
  z-index: 4;
  border-color: rgba(255, 210, 122, 0.34);
}

body[data-mode="cpu"].fighter-ending .game-shell::after {
  display: none;
}

body[data-mode="cpu"].fighter-ending .fighter-story {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  align-content: normal;
}

body[data-mode="cpu"] .fighter-ending-screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #05070e;
}

body[data-mode="cpu"] .ending-full-art {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

body[data-mode="cpu"] .fighter-ending-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(5, 7, 14, 0.12) 0%, transparent 42%, rgba(5, 7, 14, 0.42) 100%),
    linear-gradient(90deg, rgba(5, 7, 14, 0.28), transparent 28%, transparent 72%, rgba(5, 7, 14, 0.28));
  pointer-events: none;
}

body[data-mode="cpu"] .ending-message-window {
  position: absolute;
  left: 58px;
  right: 58px;
  bottom: 34px;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  height: 244px;
  padding: 24px 28px 26px 34px;
  border: 1px solid rgba(255, 230, 157, 0.54);
  background:
    linear-gradient(180deg, rgba(5, 7, 14, 0.78), rgba(5, 7, 14, 0.88));
  box-shadow:
    0 0 30px rgba(82, 151, 255, 0.24),
    inset 0 0 0 1px rgba(255, 248, 232, 0.1),
    inset 0 0 44px rgba(47, 82, 146, 0.18);
  cursor: pointer;
}

body[data-mode="cpu"] .ending-message-text {
  display: grid;
  gap: 4px;
  align-content: center;
  justify-items: stretch;
  width: 100%;
  min-height: 0;
}

body[data-mode="cpu"] .ending-message-text p {
  margin: 0;
  color: #f7fbff;
  font-family: var(--fighter-serif);
  font-size: 1.38rem;
  font-weight: 800;
  line-height: 1.48;
  letter-spacing: 0;
  text-shadow:
    0 2px 7px rgba(0, 0, 0, 0.9),
    0 0 11px rgba(255, 255, 255, 0.58),
    0 0 24px rgba(85, 162, 255, 0.46);
}

body[data-mode="cpu"] .ending-continue-caret {
  display: block;
  width: 0;
  height: 0;
  justify-self: center;
  margin-top: 6px;
  border-right: 13px solid transparent;
  border-left: 13px solid transparent;
  border-top: 18px solid #f7fbff;
  filter:
    drop-shadow(0 0 6px rgba(255, 255, 255, 0.72))
    drop-shadow(0 0 12px rgba(85, 162, 255, 0.58));
  animation: endingCaretBlink 1.05s ease-in-out infinite;
}

body[data-mode="cpu"] .ending-message-window button,
body[data-mode="cpu"] .ending-credit-screen > button {
  min-width: 150px;
  min-height: 52px;
  border: 1px solid rgba(255, 230, 157, 0.72);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 230, 157, 0.94), rgba(255, 156, 45, 0.92) 52%, rgba(114, 48, 5, 0.96));
  color: #1b1307;
  cursor: pointer;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow:
    0 0 24px rgba(255, 153, 38, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

body[data-mode="cpu"] .ending-message-window button:hover,
body[data-mode="cpu"] .ending-credit-screen > button:hover {
  transform: translateY(-1px);
}

body[data-mode="cpu"] .ending-credit-screen {
  display: block;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(5, 7, 14, 0.1), rgba(5, 7, 14, 0.78)),
    url("image/ancient-library-bg.png") center / cover no-repeat,
    #05070e;
}

body[data-mode="cpu"] .ending-credit-screen::after {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 210, 122, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(5, 7, 14, 0.42), rgba(5, 7, 14, 0.9));
}

body[data-mode="cpu"] .ending-credit-viewport {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
}

body[data-mode="cpu"] .ending-credit-roll {
  position: absolute;
  left: 50%;
  bottom: 0;
  display: grid;
  justify-items: center;
  gap: 30px;
  width: 760px;
  padding: 0 54px 80px;
  border: 0;
  background: transparent;
  color: #fff8e8;
  text-align: center;
  box-shadow: none;
  transform: translate(-50%, 820px);
  animation: endingCreditRoll 30s linear forwards;
}

body[data-mode="cpu"] .ending-credit-roll span,
body[data-mode="cpu"] .ending-credit-roll p,
body[data-mode="cpu"] .ending-credit-final p {
  margin: 0;
  color: #ffd27a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.26rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 0 12px rgba(255, 159, 46, 0.42);
}

body[data-mode="cpu"] .ending-credit-roll h2 {
  margin: 0 0 12px;
  color: #fffaf0;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 5rem;
  line-height: 0.9;
  letter-spacing: 0;
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.82),
    0 0 24px rgba(255, 159, 46, 0.58);
}

body[data-mode="cpu"] .ending-credit-entry {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 0;
}

body[data-mode="cpu"] .ending-credit-entry strong + strong {
  margin-top: 2px;
}

body[data-mode="cpu"] .ending-credit-roll strong,
body[data-mode="cpu"] .ending-credit-roll em,
body[data-mode="cpu"] .ending-credit-final strong,
body[data-mode="cpu"] .ending-credit-final em {
  color: #f7fbff;
  font-family: var(--fighter-serif);
  font-size: 1.38rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1.3;
  text-shadow:
    0 2px 7px rgba(0, 0, 0, 0.9),
    0 0 12px rgba(255, 255, 255, 0.5);
}

body[data-mode="cpu"] .ending-credit-final {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 6;
  display: grid;
  justify-items: center;
  gap: 48px;
  width: 880px;
  color: #fff8e8;
  text-align: center;
  transform: translate(-50%, 520px);
  animation: endingCreditFinalHold 42s linear forwards;
}

body[data-mode="cpu"] .ending-credit-final p {
  font-size: 1.58rem;
}

body[data-mode="cpu"] .ending-credit-final strong {
  font-size: 1.7rem;
}

body[data-mode="cpu"] .ending-credit-final em {
  margin-top: 0;
  color: #ffd27a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 3.1rem;
}

body[data-mode="cpu"] .ending-credit-screen > button {
  position: absolute;
  right: 46px;
  bottom: 36px;
  z-index: 6;
}

@keyframes endingCaretBlink {
  0%, 100% {
    opacity: 0.28;
    transform: translateY(-2px);
  }
  50% {
    opacity: 1;
    transform: translateY(4px);
  }
}

@keyframes endingCreditRoll {
  from {
    transform: translate(-50%, 820px);
  }
  to {
    transform: translate(-50%, -820px);
  }
}

@keyframes endingCreditFinalHold {
  0%, 65% {
    transform: translate(-50%, 520px);
  }
  84%, 100% {
    transform: translate(-50%, -50%);
  }
}

/* Final battle affordance pass: quieter card hover, clear skill readiness, and stronger reveal cues. */
body[data-mode="cpu"].fighter-playing .card {
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, filter 0.14s ease;
}

body[data-mode="cpu"].fighter-playing .card:hover {
  transform: none !important;
  opacity: 1;
  border-color: rgba(255, 210, 122, 0.68);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(246, 241, 225, 0.97));
  box-shadow:
    0 7px 0 rgba(0, 0, 0, 0.18),
    0 0 12px rgba(255, 210, 122, 0.16);
  filter: brightness(1.025);
}

body[data-mode="cpu"].fighter-playing .skill-meter.is-ready .fighter-label strong {
  color: #ffe28a;
  text-shadow:
    0 0 8px rgba(255, 226, 138, 0.72),
    0 0 18px rgba(255, 168, 54, 0.38);
}

body[data-mode="cpu"].fighter-playing .skill-meter.is-active .fighter-label em {
  color: #ffe28a;
  text-shadow: 0 0 10px rgba(255, 179, 63, 0.72);
}

body[data-mode="cpu"].fighter-playing .skill-meter.is-active .gauge-track {
  border-color: rgba(255, 179, 63, 0.7);
  box-shadow:
    0 0 10px rgba(255, 179, 63, 0.34),
    inset 0 0 12px rgba(255, 179, 63, 0.12);
}

body[data-mode="cpu"].fighter-playing .skill-meter.is-ready .gauge-track {
  border-color: rgba(255, 226, 138, 0.88);
  box-shadow:
    0 0 10px rgba(255, 226, 138, 0.45),
    0 0 24px rgba(255, 168, 54, 0.28),
    inset 0 0 12px rgba(255, 255, 255, 0.08);
  animation: skillGaugeReady 0.92s ease-in-out infinite alternate;
}

body[data-mode="cpu"].fighter-playing .skill-meter.is-ready .gauge-track span {
  background:
    linear-gradient(90deg, #fff3a8, #ffb33f 55%, #fff3a8);
  box-shadow: 0 0 18px rgba(255, 226, 138, 0.72);
}

body[data-mode="cpu"].fighter-playing .skill-meter.enemy.is-ready .gauge-track span {
  background:
    linear-gradient(270deg, #ffd2ec, #ff5fa8 55%, #ffd2ec);
  box-shadow: 0 0 18px rgba(255, 95, 168, 0.7);
}

body[data-mode="cpu"].fighter-playing #fighterSkillButton:not(:disabled) {
  border-color: rgba(255, 226, 138, 0.88);
  color: #211204;
  background:
    linear-gradient(180deg, #fff3a8, #ffb33f);
  box-shadow:
    0 0 16px rgba(255, 226, 138, 0.55),
    0 8px 0 rgba(0, 0, 0, 0.24);
}

body[data-mode="cpu"].fighter-playing .skill-revealed {
  z-index: 8;
  transform: translateY(-3px) scale(1.035) !important;
  border-color: rgba(255, 245, 166, 1) !important;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.96), rgba(255, 238, 150, 0.76) 42%, rgba(98, 43, 8, 0.92) 100%) !important;
  color: #1d1304 !important;
  box-shadow:
    0 0 0 3px rgba(255, 245, 166, 0.68),
    0 0 24px rgba(255, 245, 166, 0.72),
    0 0 54px rgba(255, 147, 38, 0.52),
    0 12px 0 rgba(0, 0, 0, 0.18) !important;
  animation: correctCardBeacon 0.76s ease-in-out infinite alternate;
}

body[data-mode="cpu"].fighter-playing .skill-revealed::before {
  content: "CORRECT";
  position: absolute;
  top: -13px;
  left: 50%;
  z-index: 2;
  padding: 3px 10px;
  border: 1px solid rgba(255, 245, 166, 0.9);
  background: rgba(10, 7, 2, 0.88);
  color: #fff4a6;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1rem;
  line-height: 1;
  text-shadow: 0 0 10px rgba(255, 245, 166, 0.78);
  transform: translateX(-50%);
}

body[data-mode="cpu"].fighter-playing .skill-candidate {
  z-index: 8;
  transform: translateY(-3px) scale(1.035) !important;
  border-color: rgba(142, 238, 255, 1) !important;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.96), rgba(143, 227, 255, 0.72) 42%, rgba(13, 39, 75, 0.94) 100%) !important;
  color: #06182b !important;
  box-shadow:
    0 0 0 3px rgba(142, 238, 255, 0.65),
    0 0 24px rgba(81, 219, 255, 0.74),
    0 0 54px rgba(84, 120, 255, 0.5),
    0 12px 0 rgba(0, 0, 0, 0.18) !important;
  animation: correctCardBeacon 0.76s ease-in-out infinite alternate;
}

body[data-mode="cpu"].fighter-playing .skill-candidate::before {
  content: "CANDIDATE";
  position: absolute;
  top: -13px;
  left: 50%;
  z-index: 2;
  padding: 3px 10px;
  border: 1px solid rgba(142, 238, 255, 0.9);
  background: rgba(3, 12, 28, 0.9);
  color: #9befff;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1rem;
  line-height: 1;
  text-shadow: 0 0 10px rgba(81, 219, 255, 0.85);
  transform: translateX(-50%);
}

body[data-mode="cpu"].fighter-playing .skill-added,
body[data-mode="cpu"].fighter-playing .skill-glitched {
  animation: fieldCardMaterialize 0.48s ease-out both;
}

body[data-mode="cpu"].fighter-playing .card:nth-child(12) {
  grid-column: 4 / span 2;
}

body[data-mode="cpu"].fighter-playing .card:nth-child(13) {
  grid-column: 6 / span 2;
}

body[data-mode="cpu"].fighter-playing .card:nth-child(14) {
  grid-column: 8 / span 2;
}

body.fighter-reversed[data-mode="cpu"].fighter-playing #reading .digit {
  border-color: rgba(255, 95, 168, 0.42);
  box-shadow:
    0 0 16px rgba(255, 95, 168, 0.2),
    inset 0 0 18px rgba(255, 255, 255, 0.06);
}

@keyframes skillGaugeReady {
  from { filter: brightness(1); }
  to { filter: brightness(1.22); }
}

@keyframes correctCardBeacon {
  from { filter: brightness(1.02); }
  to { filter: brightness(1.2); }
}

@keyframes fieldCardMaterialize {
  from {
    opacity: 0;
    filter: blur(5px) brightness(1.4);
  }
  to {
    opacity: 1;
    filter: blur(0) brightness(1);
  }
}

@keyframes roundWinFade {
  0% { opacity: 0; }
  12% { opacity: 1; }
  82% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes roundWinImageIn {
  from {
    opacity: 0;
    transform: translateY(calc(var(--round-win-image-y, 0px) + 18px)) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(var(--round-win-image-y, 0px)) scale(1);
  }
}

/* Title screen: cinematic lockup and structured main menu. */
body[data-mode="cpu"].fighter-title #karuta {
  display: grid;
  grid-template-columns: minmax(0, 690px) 346px;
  grid-template-rows: minmax(0, 1fr);
  align-content: center;
  align-items: center;
  justify-content: start;
  gap: 34px;
  padding: 64px 80px 70px 138px;
}

body[data-mode="cpu"].fighter-title .fighter-story {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  align-content: center;
  justify-items: start;
}

body[data-mode="cpu"].fighter-title .reference-title {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-height: 0;
  margin: 0;
  place-items: center start;
  text-align: left;
}

body[data-mode="cpu"].fighter-title .reference-title::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 36%;
  z-index: 0;
  width: 680px;
  height: 430px;
  background:
    radial-gradient(ellipse at center, rgba(255, 176, 66, 0.16), transparent 58%),
    linear-gradient(90deg, rgba(5, 6, 12, 0.7), transparent 82%);
  filter: blur(1px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

body[data-mode="cpu"].fighter-title .title-crest {
  position: absolute;
  top: 50%;
  left: 43%;
  z-index: 0;
  display: grid;
  width: 324px;
  height: 324px;
  place-content: center;
  border: 1px solid rgba(255, 210, 122, 0.12);
  border-radius: 50%;
  color: rgba(255, 236, 194, 0.065);
  text-align: center;
  transform: translate(-50%, -50%);
  box-shadow:
    inset 0 0 0 12px rgba(255, 210, 122, 0.018),
    inset 0 0 42px rgba(255, 159, 46, 0.05),
    0 0 70px rgba(183, 74, 255, 0.06);
}

body[data-mode="cpu"].fighter-title .title-crest::before,
body[data-mode="cpu"].fighter-title .title-crest::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 210, 122, 0.08);
  border-radius: 50%;
}

body[data-mode="cpu"].fighter-title .title-crest::before { inset: 18px; }
body[data-mode="cpu"].fighter-title .title-crest::after { inset: 48px; }

body[data-mode="cpu"].fighter-title .title-crest span {
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 6.6rem;
  font-style: normal;
  line-height: 0.78;
  letter-spacing: 0.03em;
}

body[data-mode="cpu"].fighter-title .title-crest i {
  margin-top: 16px;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.3rem;
  font-style: normal;
  letter-spacing: 0.28em;
}

body[data-mode="cpu"].fighter-title .title-lockup {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: start;
  width: min(100%, 690px);
  animation: title-lockup-arrive 0.72s cubic-bezier(0.2, 0.78, 0.22, 1) both;
}

body[data-mode="cpu"].fighter-title .title-kicker {
  margin: 0 0 15px 4px;
  color: #ffd27a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-shadow: 0 0 16px rgba(255, 159, 46, 0.62);
}

body[data-mode="cpu"].fighter-title .fighter-title-main {
  position: relative;
  z-index: 1;
  margin: 0;
  display: grid;
  justify-items: start;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-weight: 900;
  line-height: 0.78;
  letter-spacing: 0.015em;
  transform: none;
}

body[data-mode="cpu"].fighter-title .fighter-title-main span {
  color: #fff7e4;
  font-size: 5.5rem;
  text-shadow:
    0 2px 0 rgba(52, 19, 3, 0.95),
    0 0 22px rgba(255, 159, 46, 0.48);
  -webkit-text-stroke: 1px rgba(255, 210, 122, 0.24);
}

body[data-mode="cpu"].fighter-title .fighter-title-main strong {
  color: transparent;
  font-size: 9.6rem;
  line-height: 0.84;
  letter-spacing: 0.015em;
  background: linear-gradient(180deg, #fffaf0 4%, #ead8b6 40%, #c59b5d 74%, #82613b 100%);
  background-clip: text;
  -webkit-background-clip: text;
  filter: drop-shadow(0 3px 0 rgba(39, 24, 12, 0.9)) drop-shadow(0 0 16px rgba(219, 181, 112, 0.22));
  -webkit-text-stroke: 1px rgba(255, 244, 218, 0.28);
}

body[data-mode="cpu"].fighter-title .title-classification-rule {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: min(100%, 610px);
  margin-top: 22px;
  color: rgba(255, 226, 166, 0.68);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 0.94rem;
  letter-spacing: 0.12em;
}

body[data-mode="cpu"].fighter-title .title-classification-rule i {
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 210, 122, 0.72), rgba(183, 74, 255, 0.38));
  box-shadow: 0 0 10px rgba(255, 159, 46, 0.25);
}

body[data-mode="cpu"].fighter-title .difficulty-select {
  display: grid;
  grid-template-columns: repeat(3, 168px);
  justify-content: center;
  width: auto;
  margin: 0;
  gap: 14px;
}

body[data-mode="cpu"].fighter-title .difficulty-select button {
  display: grid;
  min-width: 168px;
  width: 168px;
  min-height: 70px;
  height: 70px;
  align-content: center;
  justify-items: center;
  gap: 3px;
  padding: 8px 12px;
}

body[data-mode="cpu"].fighter-title .difficulty-select strong {
  font-size: 1.6rem;
  line-height: 1;
}

body[data-mode="cpu"].fighter-title .difficulty-select span {
  font-size: 0.82rem;
  line-height: 1;
}

body[data-mode="cpu"].fighter-title .credits {
  position: absolute;
  right: 0;
  bottom: 16px;
  left: 0;
  z-index: 4;
  display: block;
  margin: 0;
  color: rgba(255, 248, 232, 0.68);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.9);
}

body[data-mode="cpu"].fighter-title .credits p {
  margin: 0;
}

body[data-mode="cpu"].fighter-title .action-row {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 56px 24px 24px;
  border: 1px solid rgba(255, 210, 122, 0.26);
  background:
    linear-gradient(135deg, rgba(255, 210, 122, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(7, 8, 17, 0.88), rgba(4, 5, 11, 0.74));
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.34),
    inset 0 0 34px rgba(177, 73, 255, 0.05);
  backdrop-filter: blur(6px);
  animation: title-menu-arrive 0.68s 0.12s cubic-bezier(0.2, 0.78, 0.22, 1) both;
}

body[data-mode="cpu"].fighter-title .action-row::before {
  content: "MAIN MENU";
  position: absolute;
  top: 19px;
  left: 24px;
  color: #ffd27a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-shadow: 0 0 14px rgba(255, 159, 46, 0.46);
}

body[data-mode="cpu"].fighter-title .action-row::after {
  content: "SELECT MODE";
  position: absolute;
  top: 22px;
  right: 24px;
  color: rgba(255, 248, 232, 0.38);
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
}

body[data-mode="cpu"].fighter-title .action-row #continueButton,
body[data-mode="cpu"].fighter-title .action-row #startButton,
body[data-mode="cpu"].fighter-title .action-row #twoPlayerButton,
body[data-mode="cpu"].fighter-title .action-row #galleryButton,
body[data-mode="cpu"].fighter-title .action-row #patchNoteButton,
body[data-mode="cpu"].fighter-title .action-row #howToButton {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: center;
  justify-items: start;
  width: 100%;
  min-width: 0;
  height: 58px;
  min-height: 58px;
  padding: 0 16px;
  border: 1px solid rgba(255, 224, 148, 0.74);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 230, 157, 0.95), rgba(255, 156, 45, 0.9) 52%, rgba(114, 48, 5, 0.94));
  color: #160907;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.36rem;
  line-height: 1;
  letter-spacing: 0;
  box-shadow:
    0 0 18px rgba(255, 153, 38, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.36);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

body[data-mode="cpu"].fighter-title .action-row #continueButton::after,
body[data-mode="cpu"].fighter-title .action-row #startButton::after,
body[data-mode="cpu"].fighter-title .action-row #twoPlayerButton::after,
body[data-mode="cpu"].fighter-title .action-row #galleryButton::after,
body[data-mode="cpu"].fighter-title .action-row #patchNoteButton::after,
body[data-mode="cpu"].fighter-title .action-row #howToButton::after {
  content: "›";
  justify-self: end;
  font-size: 1.5rem;
}

body[data-mode="cpu"].fighter-title .action-row #continueButton:hover,
body[data-mode="cpu"].fighter-title .action-row #startButton:hover,
body[data-mode="cpu"].fighter-title .action-row #twoPlayerButton:hover,
body[data-mode="cpu"].fighter-title .action-row #galleryButton:hover,
body[data-mode="cpu"].fighter-title .action-row #patchNoteButton:hover,
body[data-mode="cpu"].fighter-title .action-row #howToButton:hover {
  transform: translateX(5px);
}

body[data-mode="cpu"].fighter-title .action-row #continueButton[hidden] {
  display: none !important;
}

body[data-mode="cpu"].fighter-title .action-row #continueButton {
  border-color: rgba(255, 245, 190, 0.96);
  box-shadow:
    0 0 24px rgba(255, 174, 55, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-mode="cpu"].fighter-title .action-row #continueButton > span {
  display: grid;
  justify-items: start;
  gap: 3px;
}

body[data-mode="cpu"].fighter-title .action-row #continueButton small {
  overflow: hidden;
  max-width: 100%;
  color: rgba(34, 12, 7, 0.76);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-mode="cpu"].fighter-title .action-row #galleryButton,
body[data-mode="cpu"].fighter-title .action-row #patchNoteButton,
body[data-mode="cpu"].fighter-title .action-row #howToButton {
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(30, 22, 37, 0.92), rgba(9, 10, 20, 0.92));
  color: #fff8e8;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.82);
}

body[data-mode="cpu"].fighter-title #message,
body[data-mode="cpu"].fighter-title .option-panel,
body[data-mode="cpu"].fighter-title .cpu-level-panel,
body[data-mode="cpu"].fighter-title .reader-panel {
  display: none !important;
}

/* 2P battle mode. */
body[data-mode="cpu"].fighter-title .action-row #twoPlayerButton {
  display: grid !important;
  width: 100%;
  min-width: 0;
  height: 58px;
  min-height: 58px;
  padding: 0 16px;
  border: 1px solid rgba(255, 224, 148, 0.74);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 230, 157, 0.95), rgba(255, 156, 45, 0.9) 52%, rgba(114, 48, 5, 0.94));
  color: #160907;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  box-shadow:
    0 0 18px rgba(255, 153, 38, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.36);
}

@keyframes title-lockup-arrive {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes title-menu-arrive {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

body[data-mode="cpu"].fighter-title .action-row #twoPlayerButton:disabled {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(10, 12, 22, 0.76);
  color: rgba(255, 248, 232, 0.4);
  cursor: not-allowed;
  box-shadow: none;
}

/* How to play. A field manual for the classification arena. */
body[data-mode="cpu"].fighter-how-to .game-shell {
  background:
    radial-gradient(circle at 78% 22%, rgba(177, 73, 255, 0.18), transparent 31%),
    linear-gradient(135deg, rgba(255, 156, 45, 0.17), transparent 43%),
    linear-gradient(180deg, rgba(4, 5, 10, 0.32), rgba(4, 5, 10, 0.92)),
    url("image/ancient-library-bg.png") center / cover no-repeat;
}

body[data-mode="cpu"].fighter-how-to .fighter-story {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.how-to-screen {
  display: grid;
  grid-template-rows: 78px minmax(0, 1fr) 44px;
  gap: 12px;
  width: 100%;
  height: 100%;
  padding: 24px 42px 20px;
  color: #fff8e8;
}

.how-to-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 214, 139, 0.38);
}

.how-to-header div {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.how-to-header span,
.how-to-header p {
  margin: 0 0 9px;
  color: #ffd27a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.how-to-header h2 {
  margin: 0;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 4.35rem;
  line-height: 0.88;
  letter-spacing: 0.02em;
  text-shadow: 0 3px 0 rgba(47, 12, 4, 0.95), 0 0 20px rgba(255, 168, 50, 0.5);
}

.how-to-content {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 3px;
  scrollbar-color: rgba(255, 210, 122, 0.56) rgba(4, 5, 10, 0.4);
}

.how-to-prologue {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 22px;
  align-items: center;
  padding: 14px 22px;
  border: 1px solid rgba(255, 214, 139, 0.24);
  background:
    linear-gradient(90deg, rgba(255, 159, 46, 0.12), transparent 46%),
    rgba(4, 5, 10, 0.69);
  box-shadow: inset 4px 0 0 rgba(255, 166, 49, 0.75);
}

.how-to-prologue > div:first-child > span,
.how-to-step small,
.how-to-flow small {
  color: #ffd27a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.how-to-prologue h3 {
  margin: 2px 0 4px;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 1.23rem;
  line-height: 1.35;
}

.how-to-prologue p {
  margin: 0;
  color: rgba(255, 248, 232, 0.78);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.65;
}

.how-to-crest {
  display: grid;
  place-content: center;
  min-height: 72px;
  border-left: 1px solid rgba(255, 214, 139, 0.28);
  text-align: center;
}

.how-to-crest strong {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.6rem;
  line-height: 0.9;
  letter-spacing: 0.08em;
  text-shadow: 0 0 18px rgba(255, 159, 46, 0.48);
}

.how-to-crest span {
  margin-top: 7px;
  color: #c997ff;
  font-family: "Bebas Neue", sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.18em;
}

.how-to-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.how-to-step {
  position: relative;
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr);
  gap: 8px 10px;
  min-width: 0;
  padding: 14px 14px 13px;
  border: 1px solid rgba(255, 214, 139, 0.25);
  background:
    linear-gradient(145deg, rgba(177, 73, 255, 0.08), transparent 50%),
    rgba(6, 8, 17, 0.83);
}

.how-to-step::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 36px;
  height: 1px;
  background: #c681ff;
  box-shadow: 0 0 10px rgba(177, 73, 255, 0.72);
}

.how-to-step-number {
  grid-row: 1 / span 2;
  color: rgba(255, 210, 122, 0.35);
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.45rem;
  line-height: 1;
}

.how-to-step small {
  display: block;
  font-size: 0.67rem;
  line-height: 1;
}

.how-to-step h3 {
  margin: 3px 0 0;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 1rem;
  line-height: 1.2;
}

.how-to-step p {
  grid-column: 1 / -1;
  margin: 0;
  color: rgba(255, 248, 232, 0.73);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 1.55;
}

.how-to-battle-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 10px;
}

.how-to-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr) 20px) minmax(0, 1fr);
  align-items: center;
  padding: 12px 16px;
  border: 1px solid rgba(255, 214, 139, 0.22);
  background: rgba(4, 5, 10, 0.69);
}

.how-to-flow > div {
  display: grid;
  text-align: center;
}

.how-to-flow small {
  font-size: 0.68rem;
}

.how-to-flow strong {
  margin-top: 2px;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.18rem;
  letter-spacing: 0.04em;
}

.how-to-flow span {
  color: rgba(255, 248, 232, 0.56);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
}

.how-to-flow i {
  color: #c997ff;
  font-family: serif;
  font-size: 2rem;
  font-style: normal;
  text-align: center;
}

.how-to-special {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid rgba(255, 179, 68, 0.42);
  background:
    linear-gradient(120deg, rgba(255, 154, 38, 0.2), transparent 58%),
    rgba(8, 7, 14, 0.84);
  box-shadow: inset 3px 0 0 #ff9e2c;
}

.how-to-special > span {
  color: #ffd27a;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  text-shadow: 0 0 12px rgba(255, 159, 46, 0.48);
}

.how-to-special strong,
.how-to-special p {
  display: block;
  margin: 0;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.72rem;
  line-height: 1.55;
}

.how-to-special p {
  color: rgba(255, 248, 232, 0.62);
}

.how-to-analytics {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 210px;
  gap: 16px;
  align-items: center;
  padding: 13px 16px;
  border: 1px solid rgba(150, 211, 255, 0.24);
  background:
    linear-gradient(120deg, rgba(82, 151, 214, 0.12), transparent 48%),
    rgba(4, 7, 15, 0.76);
  box-shadow: inset 3px 0 0 rgba(150, 211, 255, 0.62);
}

.how-to-analytics > span {
  color: #a8d8ff;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.24rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-shadow: 0 0 12px rgba(85, 162, 255, 0.45);
}

.how-to-analytics h3,
.how-to-analytics p {
  margin: 0;
  font-family: "Noto Sans JP", sans-serif;
}

.how-to-analytics h3 {
  margin-bottom: 4px;
  color: #fff8e8;
  font-size: 0.88rem;
}

.how-to-analytics p {
  color: rgba(255, 248, 232, 0.66);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.6;
}

.how-to-analytics p + p {
  margin-top: 3px;
}

.how-to-analytics nav {
  display: grid;
  gap: 7px;
}

.how-to-analytics a {
  display: grid;
  min-height: 30px;
  padding: 5px 8px;
  place-items: center;
  border: 1px solid rgba(150, 211, 255, 0.26);
  color: #c8e8ff;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
}

.how-to-analytics a:hover,
.how-to-analytics a:focus-visible {
  border-color: rgba(168, 216, 255, 0.82);
  background: rgba(85, 162, 255, 0.12);
  box-shadow: 0 0 12px rgba(85, 162, 255, 0.22);
}

.how-to-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.how-to-actions p {
  margin: 0;
  color: rgba(255, 248, 232, 0.65);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

.how-to-actions p span {
  margin-right: 8px;
  color: #ffd27a;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.how-to-action-buttons {
  display: flex;
  gap: 10px;
}

.how-to-actions button {
  min-width: 210px;
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid rgba(255, 214, 139, 0.34);
  border-radius: 0;
  background: rgba(4, 5, 10, 0.82);
  color: #fff8e8;
  cursor: pointer;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.18rem;
  font-weight: 900;
}

.how-to-actions button:hover {
  border-color: rgba(255, 214, 139, 0.9);
  background: linear-gradient(180deg, rgba(255, 210, 122, 0.24), rgba(182, 76, 255, 0.16)), rgba(4, 5, 10, 0.86);
  box-shadow: 0 0 16px rgba(255, 159, 46, 0.3);
}

/* Patch notes. History data lives in fighters_config.js. */
body[data-mode="cpu"].fighter-patch-notes .game-shell {
  background:
    linear-gradient(135deg, rgba(255, 156, 45, 0.16), transparent 42%, rgba(177, 73, 255, 0.2)),
    linear-gradient(180deg, rgba(4, 5, 10, 0.28), rgba(4, 5, 10, 0.9)),
    url("image/ancient-library-bg.png") center / cover no-repeat;
}

body[data-mode="cpu"].fighter-patch-notes .fighter-story {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.patch-note-screen {
  display: grid;
  grid-template-rows: 92px minmax(0, 1fr) 48px;
  gap: 14px;
  width: 100%;
  height: 100%;
  padding: 30px 48px 24px;
  color: #fff8e8;
}

.patch-note-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 214, 139, 0.38);
}

.patch-note-header div {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.patch-note-header span,
.patch-note-header p {
  margin: 0 0 11px;
  color: #ffd27a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.patch-note-header h2 {
  margin: 0;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 4.8rem;
  line-height: 0.9;
  text-shadow: 0 3px 0 rgba(47, 12, 4, 0.95), 0 0 20px rgba(255, 168, 50, 0.5);
}

.patch-note-content {
  min-height: 0;
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(255, 214, 139, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 210, 122, 0.06), transparent 48%),
    rgba(4, 5, 10, 0.62);
  scrollbar-color: rgba(255, 210, 122, 0.56) rgba(4, 5, 10, 0.4);
}

.patch-note-list {
  display: grid;
  gap: 14px;
  width: min(100%, 920px);
  margin: 0 auto;
}

.patch-note-entry {
  position: relative;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  padding: 28px 30px;
  border: 1px solid rgba(255, 214, 139, 0.32);
  background:
    linear-gradient(90deg, rgba(255, 159, 46, 0.1), transparent 32%),
    rgba(7, 9, 18, 0.82);
  box-shadow: inset 4px 0 0 rgba(255, 166, 49, 0.72), 0 12px 34px rgba(0, 0, 0, 0.24);
}

.patch-note-entry time {
  color: #ffd27a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-shadow: 0 0 14px rgba(255, 159, 46, 0.4);
}

.patch-note-entry ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.patch-note-entry li {
  position: relative;
  padding-left: 22px;
  color: rgba(255, 248, 232, 0.94);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.7;
}

.patch-note-entry li::before {
  content: "◆";
  position: absolute;
  top: 0.08em;
  left: 0;
  color: #c681ff;
  font-size: 0.72em;
  text-shadow: 0 0 10px rgba(177, 73, 255, 0.66);
}

.patch-note-empty {
  margin: 0;
  color: rgba(255, 248, 232, 0.62);
  text-align: center;
}

.patch-note-actions {
  display: flex;
  justify-content: flex-start;
}

.patch-note-actions button {
  min-width: 210px;
  padding: 0 20px;
  border: 1px solid rgba(255, 214, 139, 0.34);
  border-radius: 0;
  background: rgba(4, 5, 10, 0.82);
  color: #fff8e8;
  cursor: pointer;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.18rem;
  font-weight: 900;
}

.patch-note-actions button:hover {
  border-color: rgba(255, 214, 139, 0.9);
  background: linear-gradient(180deg, rgba(255, 210, 122, 0.24), rgba(182, 76, 255, 0.16)), rgba(4, 5, 10, 0.86);
  box-shadow: 0 0 16px rgba(255, 159, 46, 0.3);
}

/* Gallery and sound test. */
body[data-mode="cpu"].fighter-gallery .game-shell {
  background:
    linear-gradient(135deg, rgba(255, 156, 45, 0.14), transparent 38%, rgba(177, 73, 255, 0.2)),
    linear-gradient(180deg, rgba(4, 5, 10, 0.3), rgba(4, 5, 10, 0.9)),
    url("image/ancient-library-bg.png") center / cover no-repeat;
}

body[data-mode="cpu"].fighter-gallery .fighter-story {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.fighter-gallery-screen {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 76px 48px minmax(0, 1fr) 48px;
  gap: 10px;
  padding: 24px 42px 22px;
  color: #fff8e8;
}

.gallery-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 214, 139, 0.38);
}

.gallery-header div {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.gallery-header span,
.gallery-header p {
  margin: 0 0 10px;
  color: #ffd27a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.gallery-header h2 {
  margin: 0;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 4.6rem;
  line-height: 0.92;
  text-shadow: 0 3px 0 rgba(47, 12, 4, 0.95), 0 0 20px rgba(255, 168, 50, 0.6);
}

.gallery-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.gallery-tabs button,
.gallery-actions button,
.gallery-sound-buttons button,
.gallery-sound-footer button,
.gallery-viewer-bar button {
  border: 1px solid rgba(255, 214, 139, 0.34);
  border-radius: 0;
  background: rgba(4, 5, 10, 0.76);
  color: #fff8e8;
  cursor: pointer;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.18rem;
  font-weight: 900;
}

.gallery-tabs button.active,
.gallery-tabs button:hover,
.gallery-sound-buttons button:hover,
.gallery-actions button:hover,
.gallery-sound-footer button:hover,
.gallery-viewer-bar button:hover {
  border-color: rgba(255, 214, 139, 0.9);
  background: linear-gradient(180deg, rgba(255, 210, 122, 0.24), rgba(182, 76, 255, 0.16)), rgba(4, 5, 10, 0.86);
  box-shadow: 0 0 16px rgba(255, 159, 46, 0.3);
}

.gallery-content {
  min-height: 0;
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(255, 214, 139, 0.24);
  background: rgba(4, 5, 10, 0.52);
  scrollbar-color: rgba(255, 210, 122, 0.56) rgba(4, 5, 10, 0.4);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.gallery-card {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 214, 139, 0.28);
  border-radius: 0;
  background: rgba(7, 9, 18, 0.84);
  color: #fff8e8;
  font: inherit;
}

.gallery-card.is-unlocked {
  cursor: pointer;
}

.gallery-card.is-unlocked:hover {
  border-color: rgba(255, 214, 139, 0.9);
  box-shadow: 0 0 18px rgba(255, 159, 46, 0.28);
  transform: translateY(-1px);
}

.gallery-card.is-locked {
  color: rgba(255, 248, 232, 0.38);
}

.gallery-card-visual {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 210, 122, 0.06), rgba(177, 73, 255, 0.08)), #070912;
}

.gallery-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-lock {
  color: rgba(255, 248, 232, 0.2);
  font-family: "Bebas Neue", sans-serif;
  font-size: 4.2rem;
  text-shadow: 0 0 18px rgba(177, 73, 255, 0.28);
}

.gallery-card > strong {
  display: block;
  overflow: hidden;
  margin-top: 7px;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.86rem;
  line-height: 1.3;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-actions {
  display: flex;
  justify-content: flex-start;
}

.gallery-actions button {
  min-width: 210px;
  padding: 0 20px;
}

.gallery-sound-test {
  display: grid;
  gap: 14px;
}

.gallery-sound-group {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(255, 214, 139, 0.2);
  background: rgba(4, 5, 10, 0.46);
}

.gallery-sound-group h3 {
  margin: 8px 0 0;
  color: #ffd27a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.45rem;
}

.gallery-sound-buttons {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.gallery-sound-buttons button {
  min-height: 38px;
  padding: 5px 7px;
  font-size: 0.98rem;
}

.gallery-sound-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 214, 139, 0.28);
  background: rgba(4, 5, 10, 0.92);
}

.gallery-sound-footer p {
  margin: 0;
  color: #ffd27a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.18rem;
}

.gallery-sound-now-playing {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.gallery-equalizer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 82px;
  height: 28px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease;
}

.gallery-equalizer.is-playing {
  opacity: 1;
  visibility: visible;
}

.gallery-equalizer i {
  width: 4px;
  height: 24px;
  display: block;
  background: linear-gradient(180deg, #fff4bd 0%, #ffbd4f 48%, #b64dff 100%);
  box-shadow: 0 0 7px rgba(255, 173, 58, 0.6);
  transform: scaleY(var(--eq-level, 0.08));
  transform-origin: center;
  transition: transform 45ms linear;
  will-change: transform;
}

.gallery-sound-footer button {
  min-width: 120px;
  min-height: 36px;
}

.gallery-viewer {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 64px;
  padding: 20px 28px;
  background: rgba(2, 3, 8, 0.96);
}

.gallery-viewer-art {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.gallery-viewer-art > img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.gallery-ending-message {
  position: absolute;
  right: 4%;
  bottom: 4%;
  left: 4%;
  max-height: 34%;
  overflow: auto;
  padding: 16px 22px;
  border: 1px solid rgba(255, 214, 139, 0.48);
  background: rgba(4, 5, 10, 0.86);
  color: #fff8e8;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.65;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.72);
}

.gallery-ending-message p {
  margin: 0;
}

.gallery-viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid rgba(255, 214, 139, 0.32);
  color: #fff8e8;
}

.gallery-viewer-bar strong {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 1.1rem;
}

.gallery-viewer-bar button {
  min-width: 210px;
  min-height: 42px;
}

body[data-mode="cpu"].fighter-two-player-setup .game-shell {
  background:
    linear-gradient(90deg, rgba(255, 156, 45, 0.18), transparent 34%, transparent 66%, rgba(177, 73, 255, 0.24)),
    linear-gradient(180deg, rgba(4, 5, 10, 0.14), rgba(4, 5, 10, 0.86)),
    url("image/ancient-library-bg.png") center / cover no-repeat;
}

body[data-mode="cpu"].fighter-two-player-setup .fighter-story {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
}

body[data-mode="cpu"] .two-player-setup-screen {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 82px 112px 1fr 62px;
  gap: 10px;
  padding: 18px 48px 16px;
  color: #fff8e8;
}

body[data-mode="cpu"] .two-player-setup-screen .fighter-screen-head h2 {
  font-size: 4.7rem;
  transform: translateY(-8px);
}

body[data-mode="cpu"] .two-player-fixed-fighters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 0;
}

body[data-mode="cpu"] .two-player-fighter-card {
  display: grid;
  grid-template-columns: 68px minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 210, 122, 0.38);
  background:
    linear-gradient(90deg, rgba(255, 210, 122, 0.12), transparent),
    rgba(5, 7, 14, 0.68);
  box-shadow: inset 0 0 0 1px rgba(255, 248, 232, 0.06);
}

body[data-mode="cpu"] .two-player-fighter-card.p2 {
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) 68px;
  border-color: rgba(190, 98, 255, 0.46);
  background:
    linear-gradient(270deg, rgba(190, 98, 255, 0.14), transparent),
    rgba(5, 7, 14, 0.68);
  text-align: right;
}

body[data-mode="cpu"] .two-player-fighter-card span {
  display: inline-grid;
  place-items: center;
  min-width: 54px;
  min-height: 34px;
  border: 1px solid rgba(255, 210, 122, 0.5);
  background: rgba(255, 210, 122, 0.12);
  color: #ffd27a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.5rem;
  line-height: 1;
}

body[data-mode="cpu"] .two-player-fighter-card.p2 span {
  grid-column: 3;
  grid-row: 1;
  border-color: rgba(190, 98, 255, 0.58);
  background: rgba(190, 98, 255, 0.14);
  color: #e9c2ff;
}

body[data-mode="cpu"] .two-player-fighter-card img {
  width: 68px;
  height: 68px;
  border: 1px solid rgba(255, 248, 232, 0.5);
  background: #fff8e8;
  object-fit: cover;
  object-position: center;
}

body[data-mode="cpu"] .two-player-fighter-card.p2 img {
  grid-column: 2;
  grid-row: 1;
}

body[data-mode="cpu"] .two-player-fighter-card strong {
  min-width: 0;
  color: #fff8e8;
  font-size: 1.55rem;
  text-shadow: 0 0 14px rgba(255, 159, 46, 0.42);
  white-space: nowrap;
}

body[data-mode="cpu"] .two-player-vs-mark {
  display: grid;
  place-items: center;
  color: #fff2bd;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 4rem;
  line-height: 1;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.86),
    0 0 22px rgba(255, 159, 46, 0.72);
}

body[data-mode="cpu"] .two-player-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
}

body[data-mode="cpu"] .two-player-control-panel {
  display: grid;
  grid-template-rows: 42px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

body[data-mode="cpu"] .two-player-control-panel h3 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  color: #fff8e8;
  font-size: 1.45rem;
  line-height: 1;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.84);
}

body[data-mode="cpu"] .two-player-control-panel h3 span {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 28px;
  border: 1px solid rgba(255, 210, 122, 0.56);
  color: #ffd27a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
}

body[data-mode="cpu"] .two-player-control-panel.is-p2 h3 span {
  border-color: rgba(190, 98, 255, 0.62);
  color: #e9c2ff;
}

body[data-mode="cpu"] .two-player-control-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-height: 0;
}

body[data-mode="cpu"] .two-player-control-option {
  display: grid;
  grid-template-rows: 46px 98px 1fr;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  padding: 10px;
  border: 1px solid rgba(255, 210, 122, 0.3);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 210, 122, 0.08), transparent 42%),
    rgba(5, 7, 14, 0.7);
  color: #fff8e8;
  cursor: pointer;
  font: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 248, 232, 0.05);
}

body[data-mode="cpu"] .two-player-control-option:hover,
body[data-mode="cpu"] .two-player-control-option.is-active {
  border-color: rgba(255, 210, 122, 0.82);
  background:
    linear-gradient(180deg, rgba(255, 210, 122, 0.18), rgba(190, 98, 255, 0.08)),
    rgba(5, 7, 14, 0.78);
  box-shadow:
    0 0 18px rgba(255, 159, 46, 0.24),
    inset 0 0 0 1px rgba(255, 248, 232, 0.08);
}

body[data-mode="cpu"] .two-player-control-option:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

body[data-mode="cpu"] .control-option-head {
  display: grid;
  gap: 3px;
  justify-items: center;
  line-height: 1;
}

body[data-mode="cpu"] .control-option-head strong {
  font-size: 1rem;
  white-space: nowrap;
}

body[data-mode="cpu"] .control-option-head em {
  color: #ffd27a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 0.98rem;
  font-style: normal;
}

body[data-mode="cpu"] .control-line-art {
  align-self: center;
  justify-self: center;
  color: rgba(255, 248, 232, 0.88);
}

body[data-mode="cpu"] .mouse-art {
  position: relative;
  width: 74px;
  height: 94px;
}

body[data-mode="cpu"] .mouse-body {
  position: absolute;
  left: 50%;
  top: 17px;
  width: 48px;
  height: 66px;
  border: 3px solid currentColor;
  border-radius: 24px;
  transform: translateX(-50%);
}

body[data-mode="cpu"] .mouse-body::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: currentColor;
  opacity: 0.7;
}

body[data-mode="cpu"] .mouse-body i {
  position: absolute;
  left: 50%;
  top: 12px;
  width: 6px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 8px;
  transform: translateX(-50%);
}

body[data-mode="cpu"] .mouse-cord {
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 20px;
  background: currentColor;
}

body[data-mode="cpu"] .keyboard-art {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  width: 174px;
  height: 94px;
}

body[data-mode="cpu"] .keyboard-row,
body[data-mode="cpu"] .control-map-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  width: 100%;
}

body[data-mode="cpu"] .keyboard-row.is-offset,
body[data-mode="cpu"] .control-map-row.is-offset {
  grid-template-columns: repeat(5, 1fr);
  width: calc(100% - 26px);
}

body[data-mode="cpu"] .keyboard-row i {
  display: grid;
  place-items: center;
  height: 28px;
  border: 2px solid currentColor;
  font-style: normal;
  font-size: 0.72rem;
  line-height: 1;
}

body[data-mode="cpu"] .control-key-map {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
}

body[data-mode="cpu"] .control-map-key {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 38px;
  border: 1px solid rgba(255, 248, 232, 0.24);
  background: rgba(255, 255, 255, 0.06);
  line-height: 1;
}

body[data-mode="cpu"] .control-map-key b {
  color: #fff8e8;
  font-size: 0.82rem;
}

body[data-mode="cpu"] .control-map-key small {
  color: rgba(255, 210, 122, 0.72);
  font-size: 0.58rem;
}

body[data-mode="cpu"] .control-map-note {
  display: grid;
  place-items: center;
  min-height: 74px;
  margin: 0;
  border: 1px solid rgba(255, 248, 232, 0.18);
  color: rgba(255, 248, 232, 0.82);
  font-weight: 900;
}

body[data-mode="cpu"] .two-player-setup-actions {
  align-self: end;
  gap: 16px;
}

body[data-mode="cpu"] .two-player-setup-actions button {
  min-width: 190px;
  min-height: 54px;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.45rem;
  line-height: 1;
}

body[data-mode="cpu"].fighter-two-player.fighter-playing .fighter-skill-strip {
  display: none !important;
}

body[data-mode="cpu"].fighter-two-player.fighter-playing .card {
  padding-top: 30px;
}

body[data-mode="cpu"] .card-subject {
  display: block;
  width: 100%;
}

body[data-mode="cpu"] .card-key-badges {
  position: absolute;
  top: 5px;
  right: 6px;
  left: 6px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
}

body[data-mode="cpu"] .card-key-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 2px 5px;
  border: 1px solid rgba(17, 24, 39, 0.2);
  background: rgba(255, 232, 154, 0.92);
  color: #17120a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 0.82rem;
  line-height: 1;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}

body[data-mode="cpu"] .card-key-badge b {
  font-size: 0.64rem;
}

body[data-mode="cpu"] .card-key-badge.p2 {
  margin-left: auto;
  background: rgba(225, 190, 255, 0.92);
}

body[data-mode="cpu"].fighter-two-player.fighter-playing .skill-cutin.enemy .skill-cutin-frame img,
body[data-mode="cpu"].fighter-two-player.fighter-playing .round-win-screen.enemy img {
  scale: -1 1;
}

/* Smartphone portrait stage: keep desktop fixed-stage UI intact. */
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage {
  --mobile-edge: max(6px, env(safe-area-inset-left));
  --mobile-bottom: max(6px, env(safe-area-inset-bottom));
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .arena {
  position: fixed;
  inset: 0;
  left: 0;
  top: 0;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) var(--mobile-bottom) var(--mobile-edge);
  aspect-ratio: auto;
  overflow: hidden;
  transform: none;
  transform-origin: center;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .game-shell,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-selecting .game-shell,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .game-shell,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-result .game-shell,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-vs-ready .game-shell,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-ending .game-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 8px;
  border-color: rgba(255, 210, 122, 0.38);
  overflow: hidden;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage #karuta,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .fighter-story {
  width: 100%;
  height: 100%;
  min-height: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .game-shell::before {
  inset: 6px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .game-modal {
  width: calc(100vw - 16px);
  max-width: none;
  max-height: calc(100dvh - 16px);
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .modal-frame {
  padding: 16px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .rules-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .rules-grid section {
  padding: 12px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title #karuta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: stretch;
  justify-items: center;
  gap: 12px;
  padding: 18px 0 34px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title .fighter-story {
  align-content: center;
  justify-items: center;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title .reference-title {
  place-items: center;
  text-align: center;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title .title-lockup {
  justify-items: center;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title .title-crest {
  left: 50%;
  width: 250px;
  height: 250px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title .title-kicker {
  max-width: 300px;
  margin-bottom: 10px;
  font-size: 0.7rem;
  line-height: 1.35;
  text-align: center;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title .fighter-title-main {
  justify-items: center;
  transform: none;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title .fighter-title-main span {
  font-size: clamp(2.6rem, 14vw, 4rem);
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title .fighter-title-main strong {
  font-size: clamp(4.7rem, 25vw, 7rem);
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title .title-classification-rule {
  width: min(100%, 300px);
  margin-top: 12px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title .difficulty-select {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 336px);
  gap: 8px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title .difficulty-select button {
  width: auto;
  min-width: 0;
  height: 56px;
  min-height: 56px;
  padding: 7px 6px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title .difficulty-select strong {
  font-size: clamp(1.08rem, 5.1vw, 1.42rem);
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title .action-row {
  gap: 9px;
  width: min(100%, 296px);
  padding: 44px 16px 16px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title .action-row #continueButton,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title .action-row #startButton,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title .action-row #twoPlayerButton,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title .action-row #galleryButton,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title .action-row #patchNoteButton,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title .action-row #howToButton {
  width: min(100%, 264px);
  min-width: 0;
  height: 50px;
  min-height: 50px;
  font-size: 1.28rem;
}

@media (prefers-reduced-motion: reduce) {
  body[data-mode="cpu"].fighter-title .title-lockup,
  body[data-mode="cpu"].fighter-title .action-row {
    animation: none;
  }
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title .action-row #twoPlayerButton:disabled {
  font-size: 1.05rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-title .credits {
  bottom: 10px;
  padding: 0 10px;
  font-size: 0.64rem;
  line-height: 1.35;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-selecting .game-shell {
  padding: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .fighter-character-select.reference-select {
  grid-template-rows: 48px minmax(0, 1fr) auto 52px;
  gap: 6px;
  padding: 8px 9px max(8px, env(safe-area-inset-bottom));
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .fighter-character-select .fighter-screen-head h2 {
  font-size: clamp(2.45rem, 12vw, 3.35rem);
  transform: none;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-select-stage {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  height: auto;
  min-height: 0;
  padding: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-full-art {
  position: relative;
  inset: auto;
  grid-column: 1;
  grid-row: 1;
  overflow: hidden;
  clip-path: inset(0);
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid rgba(255, 214, 139, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 210, 122, 0.08), rgba(4, 5, 10, 0.76)),
    rgba(4, 5, 10, 0.46);
  box-shadow:
    inset 0 0 0 1px rgba(255, 248, 232, 0.06),
    0 0 18px rgba(255, 159, 46, 0.16);
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-full-art::after {
  height: 42%;
  background:
    linear-gradient(180deg, transparent 0%, rgba(4, 5, 10, 0.32) 48%, rgba(4, 5, 10, 0.82) 100%);
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-full-art img {
  left: 50%;
  bottom: -48px;
  width: min(84vw, 315px);
  /* 縦の短い端末でも頭上に最低14pxのセーフエリアを残す。 */
  max-height: calc(100% + 34px);
  transform: translateX(-50%);
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-select-info {
  grid-column: 2;
  grid-row: 1;
  justify-self: stretch;
  align-self: stretch;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 9px;
  gap: 7px;
  transform: none;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-select-info h3 {
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 4px 8px;
  font-size: clamp(1.32rem, 6.7vw, 1.82rem);
  line-height: 1;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-name-en {
  font-size: 0.62rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-special {
  gap: 3px;
  padding: 7px 8px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-special span,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .fighter-stat-heading span {
  font-size: 0.78rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-special strong {
  font-size: 0.9rem;
  line-height: 1.12;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-special p {
  font-size: 0.66rem;
  line-height: 1.28;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-special.is-description-multiline {
  height: 78px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-special.is-description-multiline p {
  font-size: 0.53rem;
  line-height: 1.08;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .fighter-stat-panel {
  align-self: stretch;
  align-content: center;
  gap: 6px;
  padding: 7px 8px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .fighter-stat-row {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 7px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .fighter-stat-row span {
  font-size: 0.82rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .fighter-stat-track {
  height: 11px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-difficulty-panel {
  gap: 4px;
  padding: 6px 7px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-difficulty-label {
  font-size: 0.76rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-difficulty-panel .difficulty-select {
  gap: 4px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-difficulty-panel .difficulty-select button {
  min-height: 28px;
  padding: 3px 2px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-difficulty-panel .difficulty-select strong {
  font-size: 0.68rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-icon-row {
  grid-template-columns: none;
  grid-auto-columns: 58px;
  grid-auto-flow: column;
  justify-content: safe center;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  align-self: center;
  margin: 0;
  padding: 1px 0 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 210, 122, 0.46) transparent;
  -webkit-overflow-scrolling: touch;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-select-lower {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 6px;
  align-items: stretch;
  padding: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-roster-panel {
  gap: 4px;
  padding: 6px 7px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-roster-label {
  font-size: 0.76rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-icon-row button {
  width: 58px;
  height: 54px;
  padding: 4px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-icon-row img {
  width: 44px;
  height: 44px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-select-actions {
  display: grid;
  grid-template-columns: minmax(92px, 0.72fr) minmax(0, 1.65fr);
  justify-items: stretch;
  align-items: stretch;
  gap: 7px;
  margin: 0;
  padding: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-select-actions button,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-select-actions [data-confirm-player] {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  font-size: 1.02rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-select-actions [data-confirm-player] {
  order: 2;
  background:
    linear-gradient(180deg, rgba(255, 230, 157, 0.95), rgba(255, 156, 45, 0.9) 52%, rgba(114, 48, 5, 0.94));
  color: #160907;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .character-select-actions [data-fighter-back] {
  order: 1;
  width: 100%;
  min-height: 48px;
  font-size: 0.9rem;
  background:
    linear-gradient(180deg, rgba(30, 22, 37, 0.92), rgba(9, 10, 20, 0.92));
  color: #fff8e8;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-how-to .game-shell {
  padding: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-screen {
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px 10px max(9px, env(safe-area-inset-bottom));
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-header {
  min-height: 52px;
  align-items: center;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-header div {
  display: grid;
  gap: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-header span,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-header p {
  margin: 0 0 5px;
  font-size: 0.62rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-header h2 {
  font-size: 2.65rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-content {
  gap: 8px;
  padding-right: 1px;
  -webkit-overflow-scrolling: touch;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-prologue {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 13px 14px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-prologue h3 {
  font-size: 1rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-prologue p {
  font-size: 0.72rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-crest {
  grid-template-columns: auto auto;
  place-content: center;
  align-items: baseline;
  gap: 10px;
  min-height: 42px;
  border-top: 1px solid rgba(255, 214, 139, 0.2);
  border-left: 0;
  padding-top: 8px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-crest strong {
  font-size: 1.85rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-steps {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-step {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 7px;
  padding: 11px 10px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-step-number {
  font-size: 2rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-step small {
  font-size: 0.55rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-step h3 {
  font-size: 0.86rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-step p {
  font-size: 0.64rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-battle-guide {
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-flow {
  padding: 10px 7px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-flow small {
  font-size: 0.52rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-flow strong {
  font-size: 0.83rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-flow span {
  font-size: 0.56rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-special {
  grid-template-columns: 70px minmax(0, 1fr);
  padding: 10px 12px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-special > span {
  font-size: 1.1rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-special strong,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-special p {
  font-size: 0.64rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-analytics {
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 11px 12px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-analytics > span {
  font-size: 0.92rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-analytics h3 {
  font-size: 0.78rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-analytics p {
  font-size: 0.59rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-analytics nav {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-actions {
  display: grid;
  gap: 6px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-action-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-actions p {
  font-size: 0.64rem;
  text-align: center;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .how-to-actions button {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 4px 12px;
  font-size: 1rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .battle-tutorial-overlay {
  padding: 10px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .battle-tutorial-panel {
  gap: 9px;
  padding: 20px 17px 17px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .battle-tutorial-kicker {
  font-size: 0.72rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .battle-tutorial-step {
  top: 20px;
  right: 17px;
  font-size: 0.68rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .battle-tutorial-panel h2 {
  font-size: 1.28rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .battle-tutorial-panel > p {
  font-size: 0.76rem;
  line-height: 1.65;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .battle-tutorial-example {
  gap: 6px;
  padding: 8px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .battle-tutorial-example span {
  width: 36px;
  height: 42px;
  font-size: 1.9rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .battle-tutorial-example strong {
  font-size: 0.82rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .battle-tutorial-special {
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  padding: 9px 10px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .battle-tutorial-special p {
  font-size: 0.66rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .battle-tutorial-actions {
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 7px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .battle-tutorial-actions.single {
  grid-template-columns: minmax(0, 1fr);
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .battle-tutorial-actions button {
  min-height: 42px;
  font-size: 1rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .battle-tutorial-coach {
  top: 118px;
  right: 9px;
  left: 9px;
  width: auto;
  padding: 10px 68px 10px 11px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .battle-tutorial-coach strong {
  font-size: 0.78rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .battle-tutorial-coach p {
  font-size: 0.61rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .skill-tutorial-toast {
  right: 9px;
  bottom: 72px;
  left: 9px;
  width: auto;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-patch-notes .game-shell {
  padding: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .patch-note-screen {
  grid-template-rows: auto minmax(0, 1fr) 42px;
  gap: 8px;
  padding: 12px 10px max(9px, env(safe-area-inset-bottom));
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .patch-note-header {
  min-height: 52px;
  align-items: center;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .patch-note-header div {
  display: grid;
  gap: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .patch-note-header span,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .patch-note-header p {
  margin: 0 0 5px;
  font-size: 0.68rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .patch-note-header h2 {
  font-size: 2.8rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .patch-note-content {
  padding: 8px;
  -webkit-overflow-scrolling: touch;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .patch-note-list {
  gap: 8px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .patch-note-entry {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 18px 16px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .patch-note-entry time {
  font-size: 1.35rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .patch-note-entry li {
  padding-left: 18px;
  font-size: 0.88rem;
  line-height: 1.65;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .patch-note-actions button {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 4px 12px;
  font-size: 1rem;
}

/* Smartphone gallery: compact header, touch-friendly tabs and internal scrolling. */
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-gallery .game-shell {
  padding: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .fighter-gallery-screen {
  grid-template-rows: auto auto minmax(0, 1fr) 42px;
  gap: 7px;
  padding: 12px 10px max(9px, env(safe-area-inset-bottom));
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-header {
  min-height: 48px;
  align-items: center;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-header div {
  align-items: end;
  gap: 8px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-header span,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-header p {
  margin: 0 0 5px;
  font-size: 0.7rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-header p {
  max-width: 42%;
  line-height: 1.2;
  text-align: right;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-header h2 {
  font-size: 2.8rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-tabs button {
  min-height: 36px;
  padding: 4px 6px;
  font-size: 0.9rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-content {
  padding: 6px;
  -webkit-overflow-scrolling: touch;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-card {
  padding: 5px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-card > strong {
  margin-top: 4px;
  font-size: 0.68rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-lock {
  font-size: 2.8rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-actions button {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 4px 12px;
  font-size: 1rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-sound-test {
  gap: 8px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-sound-group {
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  padding: 8px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-sound-group h3 {
  margin: 0;
  font-size: 1.1rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-sound-buttons {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-sound-buttons button {
  min-height: 42px;
  padding: 5px;
  font-size: 0.88rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-sound-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-sound-now-playing {
  gap: 8px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-sound-footer p {
  overflow: hidden;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-equalizer {
  flex: 0 0 56px;
  gap: 2px;
  width: 56px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-equalizer i {
  width: 3px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-sound-footer button {
  min-width: 72px;
  min-height: 38px;
  font-size: 0.88rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-viewer {
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px 9px max(9px, env(safe-area-inset-bottom));
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-ending-message {
  right: 2%;
  bottom: 2%;
  left: 2%;
  max-height: 42%;
  padding: 10px 12px;
  font-size: 0.78rem;
  line-height: 1.5;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-viewer-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  padding-top: 7px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-viewer-bar strong {
  overflow: hidden;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .gallery-viewer-bar button {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  font-size: 0.96rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-vs-ready .game-shell,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-ending .game-shell {
  padding: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-ending .arena {
  padding: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-ending .game-shell {
  border: 0;
  background: #05070e;
  box-shadow: none;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-ending .fighter-battle-hud,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-ending .fighter-skill-strip,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-ending .reader-panel,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-ending #cardGrid {
  display: none !important;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .reference-vs-screen.vs-art-screen {
  inset: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .vs-full-art,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .victory-full-art,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .ending-full-art {
  object-fit: contain;
  background: #05070e;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .vs-screen-meta {
  top: max(12px, env(safe-area-inset-top));
  font-size: 0.82rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .game-shell {
  padding: 6px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing #karuta {
  --battle-message-height: 30px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto var(--battle-message-height);
  gap: 5px;
  overflow: hidden;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .fighter-battle-hud {
  grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
  gap: 5px;
  margin: 0;
  padding: 5px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .fighter-combatant {
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 5px;
  padding: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .fighter-combatant.enemy {
  grid-template-columns: minmax(0, 1fr) 38px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .fighter-face {
  width: 38px;
  height: 38px;
  border-width: 1px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .round-markers {
  width: 38px;
  min-height: 6px;
  gap: 3px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .round-markers span {
  width: 6px;
  height: 6px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .fighter-label {
  gap: 3px;
  margin-bottom: 4px;
  font-size: 0.62rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .fighter-label span {
  min-width: 24px;
  padding: 2px 3px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .fighter-label strong {
  font-size: 0.72rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .fighter-label em {
  display: none;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .hp-track {
  height: 16px;
  border-width: 1px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .fight-clock {
  gap: 1px;
  padding: 4px 3px;
  border-width: 1px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .fight-clock span {
  font-size: 0.58rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .fight-clock strong {
  font-size: 0.72rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .fight-clock em {
  width: 48px;
  min-height: 24px;
  font-size: 1.42rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .reader-panel {
  --reader-stage-height: 62px;
  height: calc(var(--reader-stage-height) + 10px);
  min-height: 0;
  max-height: calc(var(--reader-stage-height) + 10px);
  margin: 0;
  padding: 5px 4px;
  overflow: hidden;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing #reading {
  height: var(--reader-stage-height);
  gap: 8px;
  margin: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing #reading .digit {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 3px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing #reading .digit .num {
  font-size: 3.55rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .countdown-display.round-call {
  top: 5px;
  right: 5px;
  left: 5px;
  height: 62px;
  padding: 0 8px;
  font-size: 1.34rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .countdown-display.round-call-fight {
  font-size: 3.55rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .countdown-display.ko-call,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .countdown-display.time-up-call,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .countdown-display.perfect-call {
  font-size: clamp(4.4rem, 22vw, 6.2rem);
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing #message {
  width: 100%;
  height: var(--battle-message-height);
  min-height: var(--battle-message-height);
  max-height: var(--battle-message-height);
  margin: 0;
  padding: 3px 8px;
  overflow: hidden;
  font-size: 0.72rem;
  line-height: 1.18;
  white-space: normal;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing #message .msg-main {
  font-size: 0.88rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing #message .msg-main + .msg-sub {
  margin-left: 0.35em;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing #message .msg-sub {
  font-size: 0.68rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .grid {
  --mobile-card-gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  align-content: stretch;
  gap: var(--mobile-card-gap);
  min-height: 0;
  margin: 0;
  padding: 6px;
  overflow: hidden;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .card,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .card:nth-child(n) {
  grid-column: auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 5px 6px;
  border-bottom-width: 2px;
  font-size: clamp(0.68rem, 3.1vw, 0.82rem);
  line-height: 1.16;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  justify-self: center;
  width: calc((100% - var(--mobile-card-gap)) / 2);
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .card-subject {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .fighter-skill-strip {
  position: relative;
  right: auto;
  bottom: auto;
  left: auto;
  grid-template-columns: minmax(0, 1fr) 78px minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  margin: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .skill-meter {
  justify-self: stretch;
  width: 100%;
  min-width: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .skill-meter.enemy {
  justify-self: stretch;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .skill-meter.enemy .fighter-label {
  justify-content: flex-end;
  text-align: right;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .fighter-skill-strip .fighter-label {
  margin-bottom: 3px;
  font-size: 0.56rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .fighter-skill-strip .fighter-label strong {
  display: none;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .gauge-track {
  width: 100%;
  height: 10px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing #fighterSkillButton {
  min-height: 34px;
  padding: 4px 5px;
  font-size: 0.88rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .combo-cutin {
  top: 110px;
  height: 72px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .combo-cutin-panel {
  width: 246px;
  padding: 12px 24px 13px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .combo-cutin-panel strong {
  font-size: 3rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .skill-cutin-frame {
  width: calc(100% - 14px);
  max-width: 100%;
  height: auto;
  max-height: min(34vh, 250px);
  aspect-ratio: 1672 / 941;
  margin: 0 auto;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .skill-cutin.player,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .skill-cutin.enemy {
  justify-content: center;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .skill-cutin.player .skill-cutin-frame,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .skill-cutin.enemy .skill-cutin-frame {
  margin-left: 0;
  margin-right: 0;
  clip-path: inset(0);
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .skill-cutin-frame img {
  object-fit: contain;
  object-position: center;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .round-win-screen {
  --round-win-image-y: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .round-win-screen img {
  width: auto;
  height: auto;
  max-width: 104%;
  max-height: 86%;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .round-win-copy {
  top: auto;
  bottom: max(42px, calc(env(safe-area-inset-bottom) + 34px));
  width: calc(100% - 20px);
  padding: 0 10px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .round-win-copy span {
  font-size: 1.05rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage.fighter-playing .round-win-copy strong {
  max-width: 100%;
  font-size: clamp(2.1rem, 10vw, 2.62rem);
  white-space: normal;
  overflow-wrap: anywhere;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .result-modal {
  width: 100%;
  height: 100%;
  max-height: none;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .result-modal .modal-frame,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .result-modal .modal-frame:has(.victory-art-screen) {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .victory-message-window {
  left: 10px;
  right: 10px;
  bottom: max(70px, calc(env(safe-area-inset-bottom) + 62px));
  min-height: 0;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(5, 7, 14, 0), rgba(5, 7, 14, 0.52));
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .victory-message-window p {
  max-width: 100%;
  font-size: clamp(0.88rem, 4vw, 1.14rem);
  line-height: 1.45;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .result-modal .result-actions,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .result-modal .modal-frame:has(.victory-art-screen) .result-actions {
  right: 0;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 0;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .result-modal .result-actions button,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .result-modal .modal-frame:has(.victory-art-screen) .result-actions button {
  flex: 1 1 0;
  min-width: 0;
  max-width: 168px;
  min-height: 44px;
  font-size: 1rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .result-modal .result-actions #fighterContinueButton,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .result-modal .result-actions #resultTopButton {
  min-width: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .fighter-opening-screen {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .fighter-opening-screen::after {
  inset: 8px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .opening-full-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .opening-skip-button {
  top: 14px;
  right: 16px;
  min-width: 76px;
  min-height: 34px;
  padding: 5px 10px;
  font-size: 0.86rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .opening-message-window {
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 12px;
  min-height: 0;
  max-height: min(46%, 330px);
  padding: 14px 14px max(16px, calc(env(safe-area-inset-bottom) + 10px));
  overflow: hidden;
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(8, 9, 16, 0.56), rgba(8, 8, 14, 0.76)),
    radial-gradient(circle at 50% 0%, rgba(255, 184, 75, 0.06), transparent 60%);
  backdrop-filter: blur(4px);
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .opening-message-text {
  gap: 1px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .opening-message-text p,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .opening-scene-character .opening-message-text p {
  font-size: clamp(0.8rem, 3.45vw, 0.96rem);
  line-height: 1.42;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .opening-message-text p.is-emphasis {
  margin-top: 4px;
  font-size: clamp(0.88rem, 3.85vw, 1.04rem);
  line-height: 1.4;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .opening-scene-2 .opening-message-text p.is-emphasis {
  margin-top: 8px;
  font-size: clamp(1.12rem, 5vw, 1.38rem);
  letter-spacing: 0.035em;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .opening-continue-caret {
  margin-top: 4px;
  border-top-width: 10px;
  border-right-width: 8px;
  border-left-width: 8px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .fighter-ending-screen:not(.ending-credit-screen) {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .fighter-ending-screen:not(.ending-credit-screen)::after {
  background:
    linear-gradient(180deg, rgba(5, 7, 14, 0.04) 0%, transparent 44%, rgba(5, 7, 14, 0.28) 68%, rgba(5, 7, 14, 0.78) 100%);
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .fighter-ending-screen:not(.ending-credit-screen) .ending-full-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .ending-message-window {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 5;
  width: auto;
  height: auto;
  min-height: 0;
  max-height: min(42%, 280px);
  padding: 16px 16px max(16px, calc(env(safe-area-inset-bottom) + 10px));
  overflow: hidden;
  border-width: 1px;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(5, 7, 14, 0.58), rgba(5, 7, 14, 0.74));
  backdrop-filter: blur(5px);
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .ending-message-text p {
  font-size: clamp(0.86rem, 3.7vw, 1rem);
  line-height: 1.48;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .ending-continue-caret {
  margin-top: 4px;
  border-right-width: 10px;
  border-left-width: 10px;
  border-top-width: 14px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .ending-credit-roll,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .ending-credit-final {
  width: min(100%, 330px);
  padding-right: 18px;
  padding-left: 18px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .ending-credit-roll h2 {
  font-size: 3rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .ending-credit-roll strong,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .ending-credit-roll em,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .ending-credit-final strong,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .ending-credit-final em {
  font-size: 1rem;
}

/* URL-only debug preview: ?debug=1 */
body[data-mode="cpu"].fighter-debug .game-shell {
  padding: 0;
  background:
    linear-gradient(135deg, rgba(255, 156, 45, 0.12), transparent 38%, rgba(102, 103, 255, 0.18)),
    linear-gradient(180deg, rgba(3, 5, 11, 0.36), rgba(3, 5, 11, 0.94)),
    url("image/ancient-library-bg.png") center / cover no-repeat;
}

body[data-mode="cpu"].fighter-debug .fighter-story {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.fighter-debug-screen {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 68px minmax(0, 1fr) 44px;
  gap: 10px;
  padding: 20px 28px 18px;
  color: #fff8e8;
}

.debug-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 214, 139, 0.38);
}

.debug-header > div {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.debug-header span,
.debug-preview-heading span,
.debug-controls h3 {
  color: #ffd27a;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.debug-header span {
  margin-bottom: 9px;
  font-size: 1rem;
}

.debug-header h2 {
  margin: 0;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 3.9rem;
  line-height: 0.92;
  text-shadow: 0 3px 0 rgba(47, 12, 4, 0.95), 0 0 20px rgba(255, 168, 50, 0.54);
}

.debug-header code {
  margin-bottom: 10px;
  padding: 5px 10px;
  border: 1px solid rgba(129, 225, 255, 0.42);
  background: rgba(4, 15, 28, 0.72);
  color: #94e9ff;
  font-size: 0.84rem;
}

.debug-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 12px;
}

.debug-controls,
.debug-preview {
  min-height: 0;
  border: 1px solid rgba(255, 214, 139, 0.24);
  background: rgba(4, 5, 10, 0.72);
}

.debug-controls {
  overflow-y: auto;
  padding: 12px;
  scrollbar-color: rgba(255, 210, 122, 0.56) rgba(4, 5, 10, 0.4);
}

.debug-controls section + section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 214, 139, 0.18);
}

.debug-controls h3 {
  margin: 0 0 7px;
  font-size: 0.92rem;
}

.debug-character-list,
.debug-opponent-list {
  display: grid;
  gap: 6px;
}

.debug-character-list button,
.debug-opponent-list button,
.debug-screen-tabs button,
.debug-sub-options button,
.debug-actions button {
  border: 1px solid rgba(255, 214, 139, 0.3);
  border-radius: 0;
  background: rgba(7, 9, 18, 0.88);
  color: #fff8e8;
  cursor: pointer;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-weight: 900;
}

.debug-character-list button {
  min-height: 50px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 4px 8px;
  text-align: left;
}

.debug-character-list img {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 214, 139, 0.34);
  object-fit: cover;
}

.debug-character-list span {
  min-width: 0;
  display: grid;
}

.debug-character-list strong {
  font-size: 1rem;
}

.debug-character-list small {
  overflow: hidden;
  color: rgba(255, 248, 232, 0.6);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.debug-screen-tabs,
.debug-sub-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.debug-sub-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.debug-screen-tabs button,
.debug-sub-options button,
.debug-opponent-list button {
  min-height: 34px;
  padding: 5px 6px;
  font-size: 0.88rem;
}

.debug-opponent-list button {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.debug-opponent-list span {
  color: #ffd27a;
  font-size: 0.68rem;
}

.debug-character-list button.active,
.debug-character-list button:hover,
.debug-opponent-list button.active,
.debug-opponent-list button:hover,
.debug-screen-tabs button.active,
.debug-screen-tabs button:hover,
.debug-sub-options button.active,
.debug-sub-options button:hover,
.debug-actions button:hover {
  border-color: rgba(255, 214, 139, 0.94);
  background: linear-gradient(180deg, rgba(255, 210, 122, 0.24), rgba(129, 73, 255, 0.16)), rgba(4, 5, 10, 0.9);
  box-shadow: 0 0 14px rgba(255, 159, 46, 0.24);
}

.debug-preview {
  display: grid;
  grid-template-rows: 38px minmax(0, 1fr) 40px 24px;
  padding: 10px;
}

.debug-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 214, 139, 0.2);
}

.debug-preview-heading span {
  font-size: 0.82rem;
}

.debug-preview-heading strong {
  overflow: hidden;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.05rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.debug-preview-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #020307;
}

.debug-preview-stage > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.debug-preview-message {
  position: absolute;
  right: 3%;
  bottom: 3%;
  left: 3%;
  max-height: 34%;
  overflow-y: auto;
  padding: 12px 16px;
  border: 1px solid rgba(255, 224, 163, 0.72);
  background: rgba(5, 5, 11, 0.88);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  color: #fff9e9;
}

.debug-preview-message p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  text-shadow: 0 2px 4px #000;
}

.debug-preview-message p + p {
  margin-top: 4px;
}

.debug-asset-path {
  overflow: hidden;
  margin: 6px 0 0;
  color: rgba(148, 233, 255, 0.72);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.debug-open-screen {
  margin-top: 6px;
  border: 1px solid rgba(255, 222, 151, 0.92);
  border-radius: 0;
  background: linear-gradient(180deg, #ffd27a, #ef8d22);
  box-shadow: 0 0 18px rgba(255, 159, 46, 0.28), inset 0 1px rgba(255, 255, 255, 0.54);
  color: #1b0c02;
  cursor: pointer;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.debug-open-screen:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 26px rgba(255, 174, 51, 0.54), inset 0 1px rgba(255, 255, 255, 0.64);
}

.debug-live-back {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 20;
  min-width: 176px;
  min-height: 42px;
  padding: 7px 16px;
  border: 1px solid rgba(255, 222, 151, 0.9);
  border-radius: 0;
  background: rgba(5, 6, 12, 0.88);
  box-shadow: 0 0 16px rgba(255, 159, 46, 0.28);
  color: #fff8e8;
  cursor: pointer;
  font-family: "Bebas Neue", "Noto Sans JP", sans-serif;
  font-size: 1rem;
  font-weight: 900;
}

.debug-live-back:hover {
  border-color: #ffd27a;
  background: rgba(47, 24, 12, 0.92);
}

body[data-mode="cpu"].fighter-debug-live .result-modal .modal-close,
body[data-mode="cpu"].fighter-debug-live .result-modal #resultTopButton {
  display: none !important;
}

.debug-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.debug-actions p {
  margin: 0;
  color: rgba(255, 248, 232, 0.56);
  font-size: 0.72rem;
}

.debug-actions button {
  min-width: 180px;
  height: 40px;
  padding: 5px 18px;
  font-size: 1rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .fighter-debug-screen {
  grid-template-rows: 54px minmax(0, 1fr) 42px;
  gap: 7px;
  padding: 10px 9px max(8px, env(safe-area-inset-bottom));
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-header > div {
  display: grid;
  gap: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-header h2 {
  font-size: 2.55rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-header span,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-header code {
  margin-bottom: 4px;
  font-size: 0.64rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-workspace {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 7px;
  max-height: 205px;
  padding: 7px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-controls section + section {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-controls section:nth-child(n + 3) {
  grid-column: 1 / -1;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-character-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-character-list button {
  min-height: 38px;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 5px;
  padding: 3px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-character-list img {
  width: 30px;
  height: 30px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-character-list strong {
  font-size: 0.72rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-character-list small {
  font-size: 0.48rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-screen-tabs {
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-screen-tabs button,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-sub-options button,
body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-opponent-list button {
  min-height: 29px;
  font-size: 0.7rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-opponent-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-preview {
  grid-template-rows: 32px minmax(0, 1fr) 36px 20px;
  padding: 6px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-preview-heading strong {
  max-width: 70%;
  font-size: 0.74rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-preview-message {
  max-height: 38%;
  padding: 8px 10px;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-preview-message p {
  font-size: 0.68rem;
  line-height: 1.35;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-actions p {
  display: none;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-actions button {
  width: 100%;
  min-width: 0;
  height: 38px;
  font-size: 0.9rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-open-screen {
  font-size: 0.86rem;
}

body[data-mode="cpu"].fighter-smartphone.fighter-portrait-stage .debug-live-back {
  top: 10px;
  right: 10px;
  min-width: 138px;
  min-height: 36px;
  padding: 5px 10px;
  font-size: 0.78rem;
}
