/* ============================================================
   死神 VS 火影 · 墨火
   Ink & Flame — a duel painted on washi.
   ============================================================ */

:root {
  --paper: #ece4d2;
  --paper-dim: #cfc4ad;
  --paper-deep: #b3a68c;
  --ink: #0d0e0f;
  --ink-2: #151719;
  --ink-3: #222528;
  --sumi: #353b3e;
  --red: #c53b2c;
  --red-deep: #8e241b;
  --amber: #e3843a;
  --teal: #6fb3b8;
  --violet: #9a86c8;
  --gold: #b08d57;

  --f-display: "KaiTi", "STKaiti", "Kaiti SC", "Songti SC", "SimSun", serif;
  --f-sans: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", sans-serif;
  --f-cond: "Bahnschrift Condensed", "Bahnschrift", "Arial Narrow", "Microsoft YaHei", sans-serif;

  --ease-ink: cubic-bezier(.19, 1, .22, 1);
  --ease-snap: cubic-bezier(.6, 0, .2, 1);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: #070808;
  color: var(--paper);
  font-family: var(--f-sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(120% 90% at 50% 45%, #151719 0%, #0a0b0c 62%, #050606 100%);
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.world {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}

.frame {
  position: relative;
  width: min(100vw, 177.7778vh);
  height: min(56.25vw, 100vh);
  overflow: hidden;
  background: var(--ink);
  box-shadow: 0 0 0 1px rgba(236, 228, 210, .06), 0 40px 120px rgba(0, 0, 0, .75);
  container-type: size;
  isolation: isolate;
}

#scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* The full-screen grain overlay was a compositor tax on low-end GPUs.
   Paper texture now lives inside the painted canvas instead. */
.grain { display: none; }
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background:
    radial-gradient(120% 85% at 50% 45%, transparent 42%, rgba(0, 0, 0, .28) 74%, rgba(0, 0, 0, .62) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .35), transparent 18%, transparent 78%, rgba(0, 0, 0, .45));
}

.ui {
  position: absolute;
  inset: 0;
  z-index: 10;
  overflow: hidden;
}

/* ---------------- shared ---------------- */

.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .42s var(--ease-ink), visibility .42s;
}
.screen.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.screen--modal {
  z-index: 40;
  background: rgba(5, 6, 6, .72);
  backdrop-filter: blur(7px) saturate(.8);
  display: grid;
  place-items: center;
}
.screen--battle { pointer-events: none; }
.screen--battle::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 17%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 5, 6, .62), rgba(4, 5, 6, .2) 58%, transparent);
}
.screen--battle .pause-btn,
.screen--battle .touch-controls { pointer-events: auto; }
.screen--battle.is-cutin .hud,
.screen--battle.is-cutin .battle-hint,
.screen--battle.is-cutin .training-panel,
.screen--battle.is-cutin .combo,
.screen--battle.is-cutin .announce {
  opacity: 0;
  transition: opacity .18s;
}

.eyebrow {
  margin: 0 0 .55em;
  font-family: var(--f-cond);
  font-size: clamp(10px, .85cqw, 15px);
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--paper-dim);
  opacity: .8;
}

kbd {
  display: inline-block;
  min-width: 1.55em;
  padding: .08em .34em .16em;
  margin: 0 .1em;
  border: 1px solid currentColor;
  border-bottom-width: 2px;
  border-radius: 2px;
  font-family: var(--f-cond);
  font-size: .84em;
  line-height: 1.1;
  text-align: center;
  vertical-align: baseline;
  opacity: .92;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
button:disabled { cursor: not-allowed; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .35em 0;
  color: var(--paper-dim);
  font-family: var(--f-sans);
  font-size: clamp(12px, .95cqw, 16px);
  letter-spacing: .12em;
  border-bottom: 1px solid rgba(236, 228, 210, .22);
  transition: color .2s, border-color .2s, transform .2s;
}
.text-btn:hover { color: var(--paper); border-color: var(--red); transform: translateX(3px); }
.text-btn--danger { color: #d98a80; }

.icon-btn {
  width: clamp(30px, 2.4cqw, 42px);
  height: clamp(30px, 2.4cqw, 42px);
  display: grid;
  place-items: center;
  border: 1px solid rgba(236, 228, 210, .28);
  color: var(--paper-dim);
  font-family: var(--f-display);
  font-size: clamp(14px, 1.15cqw, 20px);
  transition: all .2s;
}
.icon-btn:hover { border-color: var(--red); color: var(--paper); background: rgba(197, 59, 44, .18); }

.brush-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2em;
  min-width: 13em;
  padding: .95em 1.3em .9em 1.55em;
  color: var(--ink);
  background: var(--paper);
  clip-path: polygon(0% 10%, 97% 0%, 100% 82%, 3% 100%);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(16px, 1.5cqw, 26px);
  letter-spacing: .16em;
  transition: transform .2s var(--ease-snap), background .2s, color .2s;
}
.brush-btn::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(13, 14, 15, .25);
  clip-path: inherit;
  pointer-events: none;
}
.brush-btn:hover { background: #fff8e9; transform: translate(-2px, -2px); }
.brush-btn:active { transform: translate(1px, 1px); }
.brush-btn:disabled { opacity: .32; filter: grayscale(1); }
.brush-btn i {
  font-family: var(--f-cond);
  font-style: normal;
  font-size: .72em;
  letter-spacing: .1em;
  color: var(--red);
}
.brush-btn--small { min-width: 10em; padding: .8em 1.1em .75em 1.25em; font-size: clamp(14px, 1.15cqw, 20px); }

/* ---------------- title ---------------- */

.screen--title {
  background:
    linear-gradient(90deg, rgba(6, 7, 8, .78) 0%, rgba(6, 7, 8, .18) 32%, transparent 50%, rgba(6, 7, 8, .12) 68%, rgba(6, 7, 8, .72) 100%),
    linear-gradient(180deg, rgba(5, 6, 7, .55) 0%, transparent 34%, transparent 66%, rgba(5, 6, 7, .68) 100%);
}
.title-rail {
  position: absolute;
  top: 5.5%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1em;
  z-index: 2;
  color: rgba(236, 228, 210, .48);
  font-family: var(--f-cond);
  font-size: clamp(9px, .72cqw, 12px);
  letter-spacing: .42em;
}
.title-rail--left { left: 1.7%; }
.title-rail--right { right: 1.7%; align-items: center; }
.rail-line { display: block; width: 1px; height: 11cqh; background: linear-gradient(180deg, transparent, rgba(236, 228, 210, .45)); }
.title-rail--right .rail-line { background: linear-gradient(180deg, rgba(197, 59, 44, .65), transparent); }
.rail-text { writing-mode: vertical-rl; }

.title-lockup {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 4%;
  height: 58%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  pointer-events: none;
  z-index: 2;
}
.title-word {
  display: flex;
  flex-direction: column;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(84px, 12.4cqw, 210px);
  line-height: .8;
  color: var(--paper);
  text-shadow:
    0 2px 0 rgba(0, 0, 0, .22),
    0 20px 70px rgba(0, 0, 0, .55);
  mix-blend-mode: screen;
}
.title-word span { display: block; }
.title-word--left { align-items: flex-start; justify-self: start; transform: rotate(-1.5deg); }
.title-word--right { align-items: flex-end; justify-self: end; transform: rotate(1deg); }
.title-word--left span:last-child { margin-left: .12em; color: #d9d1c1; }
.title-word--right span:last-child { margin-right: .1em; color: #e8d7c2; }
.title-word::after {
  content: "";
  width: 2.5em;
  height: 3px;
  margin-top: .12em;
  background: var(--red);
  opacity: .8;
}
.title-word--left::after { margin-left: .06em; }
.title-word--right::after { margin-right: .06em; }

.title-seal {
  position: relative;
  align-self: center;
  justify-self: center;
  width: clamp(74px, 7.8cqw, 132px);
  aspect-ratio: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 0 .12em;
  border: 2.5px solid rgba(150, 31, 22, .9);
  color: var(--red-deep);
  background: rgba(197, 59, 44, .045);
  box-shadow: inset 0 0 0 3px rgba(197, 59, 44, .12), inset 0 0 30px rgba(197, 59, 44, .12);
  clip-path: polygon(1% 0, 100% 1.5%, 98.5% 100%, 0 98%);
  transform: rotate(-4.5deg);
  mix-blend-mode: multiply;
  font-family: var(--f-cond);
  font-size: clamp(18px, 1.7cqw, 28px);
  font-weight: 700;
  letter-spacing: .06em;
  margin-top: 20%;
}
.title-seal::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(150, 31, 22, .45);
}
.title-seal::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='90' height='90' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
.title-seal i {
  position: absolute;
  bottom: .5em;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--f-display);
  font-style: normal;
  font-size: .34em;
  letter-spacing: .12em;
  color: var(--red-deep);
  opacity: .85;
  white-space: nowrap;
}

.title-sub {
  position: absolute;
  left: 5%;
  bottom: 2.4%;
  z-index: 2;
  margin: 0;
  text-align: left;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 1.1em;
  pointer-events: none;
}
.title-sub span {
  font-family: var(--f-cond);
  font-size: clamp(9px, .76cqw, 12px);
  letter-spacing: .38em;
  color: var(--paper-dim);
  white-space: nowrap;
}
.title-sub em {
  font-family: var(--f-display);
  font-style: normal;
  font-size: clamp(12px, 1cqw, 17px);
  letter-spacing: .14em;
  color: var(--paper);
  opacity: .78;
  white-space: nowrap;
}

.menu {
  position: absolute;
  left: 5%;
  bottom: 9.5%;
  z-index: 5;
  width: min(34cqw, 470px);
  display: flex;
  flex-direction: column;
  gap: .35em;
}
.menu-item {
  display: grid;
  grid-template-columns: 2.4em 1fr 1.1em;
  align-items: center;
  gap: .9em;
  width: 100%;
  padding: .58em .8em .58em .6em;
  color: var(--paper);
  text-align: left;
  border-left: 2px solid transparent;
  background: linear-gradient(90deg, rgba(8, 9, 10, .58), rgba(8, 9, 10, .08));
  transition: background .24s, border-color .24s, transform .24s var(--ease-snap);
}
.menu-item + .menu-item { border-top: 1px solid rgba(236, 228, 210, .1); }
.menu-num {
  font-family: var(--f-display);
  font-size: clamp(13px, 1.1cqw, 19px);
  color: var(--red);
  opacity: .85;
  text-align: center;
}
.menu-copy { display: flex; flex-direction: column; gap: .15em; }
.menu-copy b {
  font-family: var(--f-display);
  font-size: clamp(17px, 1.6cqw, 28px);
  letter-spacing: .18em;
  font-weight: 700;
}
.menu-copy small {
  font-size: clamp(9px, .72cqw, 12px);
  letter-spacing: .18em;
  color: var(--paper-dim);
  opacity: .68;
}
.menu-arrow {
  font-family: var(--f-cond);
  font-size: 1.05em;
  color: var(--red);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .2s, transform .2s;
}
.menu-item:hover, .menu-item:focus-visible {
  background: linear-gradient(90deg, rgba(197, 59, 44, .28), rgba(8, 9, 10, .12));
  border-left-color: var(--red);
  transform: translateX(5px);
  outline: none;
}
.menu-item:hover .menu-arrow, .menu-item:focus-visible .menu-arrow { opacity: 1; transform: none; }
.menu-item--primary {
  background: var(--paper);
  color: var(--ink);
  border-left-color: var(--red);
  clip-path: polygon(0 0, 99% 3%, 100% 94%, 2% 100%);
}
.menu-item--primary .menu-copy small { color: var(--ink-3); opacity: .62; }
.menu-item--primary .menu-num { color: var(--red); }
.menu-item--primary .menu-arrow { color: var(--red); opacity: 1; transform: none; }
.menu-item--primary:hover { background: #fff8e9; }
.menu-item--quiet { background: transparent; }
.menu-item--quiet:hover { background: rgba(197, 59, 44, .14); }

.title-foot {
  position: absolute;
  right: 5%;
  bottom: 4.2%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .65em;
  text-align: right;
}
.disclaimer {
  margin: 0;
  font-size: clamp(8px, .62cqw, 11px);
  line-height: 1.8;
  letter-spacing: .08em;
  color: rgba(236, 228, 210, .4);
}
.record {
  margin: 0;
  font-family: var(--f-cond);
  font-size: clamp(10px, .8cqw, 13px);
  letter-spacing: .22em;
  color: rgba(236, 228, 210, .62);
}
.record b { color: var(--paper); font-size: 1.5em; font-weight: 600; }
.record i { color: #c98c80; font-size: 1.5em; font-style: normal; }

.title-tools {
  position: absolute;
  top: 4%;
  right: 4%;
  z-index: 6;
  display: flex;
  gap: .5em;
}

/* ---------------- select ---------------- */

.screen--select {
  display: flex;
  flex-direction: column;
  padding: 3.2cqh 4.4cqw 2.8cqh;
  background:
    linear-gradient(180deg, rgba(6, 7, 8, .9) 0%, rgba(6, 7, 8, .42) 34%, rgba(6, 7, 8, .52) 66%, rgba(6, 7, 8, .94) 100%);
}
.select-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2em;
  flex: 0 0 auto;
}
.select-title h2 {
  margin: 0;
  font-family: var(--f-display);
  font-size: clamp(28px, 3.1cqw, 52px);
  letter-spacing: .12em;
  line-height: 1;
  font-weight: 700;
}
.select-title h2 span {
  margin-left: .6em;
  font-family: var(--f-sans);
  font-size: .32em;
  letter-spacing: .26em;
  color: var(--red);
  vertical-align: middle;
}
.select-mode {
  margin-left: auto;
  align-self: center;
  padding: .45em 1.2em .5em;
  border: 1px solid rgba(236, 228, 210, .24);
  font-family: var(--f-cond);
  font-size: clamp(10px, .82cqw, 13px);
  letter-spacing: .34em;
  color: var(--paper-dim);
}
.roster {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 1.4cqw;
  padding: 2.2cqh 0 1.4cqh;
}
.roster-side {
  flex: 0 0 4.2cqw;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1em;
  color: rgba(236, 228, 210, .2);
  writing-mode: vertical-rl;
  font-family: var(--f-display);
  font-size: clamp(20px, 2.2cqw, 38px);
  letter-spacing: .18em;
}
.roster-side i {
  writing-mode: vertical-rl;
  font-family: var(--f-cond);
  font-style: normal;
  font-size: .3em;
  letter-spacing: .4em;
  opacity: .7;
}
.roster-side--left { color: rgba(111, 179, 184, .32); }
.roster-side--right { color: rgba(227, 132, 58, .3); }
.roster-grid {
  flex: 1;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: .7cqw;
  max-height: 46cqh;
}
.roster-card {
  position: relative;
  min-width: 0;
  height: 100%;
  padding: 0;
  overflow: hidden;
  text-align: left;
  color: var(--paper);
  border: 1px solid rgba(236, 228, 210, .16);
  background:
    linear-gradient(180deg, rgba(236, 228, 210, .05), rgba(236, 228, 210, .01) 46%, rgba(6, 7, 8, .8) 100%);
  transition: transform .3s var(--ease-ink), border-color .25s, box-shadow .25s;
}
.roster-card:hover, .roster-card:focus-visible {
  transform: translateY(-7px);
  border-color: rgba(236, 228, 210, .48);
  outline: none;
}
.roster-card.is-p1 { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal), 0 12px 40px rgba(0, 0, 0, .45); }
.roster-card.is-p2 { border-color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber), 0 12px 40px rgba(0, 0, 0, .45); }
.roster-card.is-p1.is-p2 { box-shadow: inset 0 0 0 1px var(--teal), inset 0 0 0 3px rgba(227, 132, 58, .7); }
.roster-portrait { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.roster-index {
  position: absolute;
  top: .7em;
  left: .8em;
  z-index: 2;
  font-family: var(--f-display);
  font-size: clamp(12px, .95cqw, 16px);
  color: rgba(236, 228, 210, .65);
  border: 1px solid rgba(236, 228, 210, .22);
  padding: .18em .38em;
}
.roster-tag {
  position: absolute;
  top: .7em;
  z-index: 3;
  padding: .2em .55em .22em;
  font-family: var(--f-cond);
  font-size: clamp(9px, .68cqw, 11px);
  letter-spacing: .16em;
  color: var(--ink);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .2s, transform .2s;
}
.roster-tag--p1 { left: .7em; background: var(--teal); }
.roster-tag--p2 { right: .7em; background: var(--amber); }
.roster-card.is-p1 .roster-tag--p1,
.roster-card.is-p2 .roster-tag--p2 { opacity: 1; transform: none; }
.roster-meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 1.8em .6em .55em;
  background: linear-gradient(180deg, transparent, rgba(5, 6, 7, .9) 52%);
  display: flex;
  flex-direction: column;
  gap: .18em;
}
.roster-name {
  font-family: var(--f-display);
  font-size: clamp(12px, 1.02cqw, 17px);
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.roster-kana {
  font-family: var(--f-cond);
  font-size: clamp(7px, .55cqw, 9px);
  letter-spacing: .1em;
  color: var(--paper-dim);
  opacity: .6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.roster-role {
  margin-top: .15em;
  font-size: clamp(8px, .6cqw, 10px);
  letter-spacing: .06em;
  color: var(--red);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.roster-accent {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  z-index: 3;
  background: var(--accent, var(--red));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease-ink);
}
.roster-card.is-p1 .roster-accent,
.roster-card.is-p2 .roster-accent { transform: scaleX(1); }

.select-foot {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 2cqw;
  padding-top: 1.6cqh;
  border-top: 1px solid rgba(236, 228, 210, .14);
}
.stage-pick .eyebrow { margin-bottom: .5em; }
.stage-list { display: flex; gap: .55em; }
.stage-btn {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .35em;
  min-width: 0;
  width: 8.6em;
  padding: .35em;
  border: 1px solid rgba(236, 228, 210, .2);
  color: var(--paper-dim);
  font-size: clamp(8px, .62cqw, 10px);
  letter-spacing: .06em;
  text-align: left;
  transition: all .2s;
}
.stage-btn > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-btn:hover { border-color: rgba(236, 228, 210, .55); color: var(--paper); }
.stage-btn.is-active { border-color: var(--red); color: var(--paper); background: rgba(197, 59, 44, .14); }
.stage-swatch {
  width: 100%;
  height: 2.1em;
  flex: 0 0 auto;
  display: block;
  background: var(--swatch, linear-gradient(180deg, #1b2b3a, #b9a98b));
  border: 1px solid rgba(236, 228, 210, .25);
}
.stage-btn small { display: block; font-size: .76em; opacity: .55; letter-spacing: .04em; margin-top: .12em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.select-picks {
  display: flex;
  align-items: center;
  gap: 1.1cqw;
}
.pick {
  position: relative;
  display: flex;
  align-items: center;
  gap: .7em;
  opacity: .5;
  transition: opacity .25s;
}
.pick.is-set { opacity: 1; }
.pick-canvas {
  width: clamp(52px, 4.8cqw, 80px);
  height: clamp(65px, 6cqw, 100px);
  background: rgba(236, 228, 210, .045);
  border: 1px solid rgba(236, 228, 210, .16);
}
.pick--p2 .pick-canvas { border-color: rgba(227, 132, 58, .4); }
.pick-side {
  position: absolute;
  top: -.7em;
  left: -.35em;
  z-index: 2;
  padding: .1em .35em;
  background: var(--teal);
  color: var(--ink);
  font-family: var(--f-cond);
  font-size: clamp(8px, .6cqw, 10px);
  letter-spacing: .1em;
}
.pick--p2 .pick-side { background: var(--amber); }
.pick-meta { display: flex; flex-direction: column; gap: .25em; min-width: 5em; }
.pick-meta b { font-family: var(--f-display); font-size: clamp(15px, 1.3cqw, 22px); letter-spacing: .1em; }
.pick-meta small { font-size: clamp(8px, .62cqw, 11px); letter-spacing: .16em; color: var(--paper-dim); opacity: .6; }
.pick-vs {
  font-family: var(--f-display);
  font-size: clamp(18px, 1.8cqw, 30px);
  color: var(--red);
  transform: rotate(-6deg);
}
.select-actions { display: flex; flex-direction: column; align-items: flex-end; gap: .8em; }
.select-hint {
  margin: 0;
  font-size: clamp(9px, .7cqw, 12px);
  letter-spacing: .1em;
  color: var(--paper-dim);
  opacity: .6;
  text-align: right;
}

/* ---------------- battle HUD ---------------- */

.screen--battle { padding: 0; }
.hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 2.2cqw;
  padding: 2.6cqh 3.2cqw 0;
  z-index: 5;
  pointer-events: none;
}
.hud-side { min-width: 0; display: flex; flex-direction: column; gap: .45cqh; }
.hud-side--p2 { align-items: flex-end; }
.hud-id { display: flex; align-items: baseline; gap: .7em; min-width: 0; }
.hud-side--p2 .hud-id { flex-direction: row-reverse; }
.hud-p {
  font-family: var(--f-cond);
  font-size: clamp(9px, .7cqw, 12px);
  letter-spacing: .2em;
  color: var(--teal);
  border: 1px solid currentColor;
  padding: .05em .4em .1em;
}
.hud-side--p2 .hud-p { color: var(--amber); }
.hud-id b {
  font-family: var(--f-display);
  font-size: clamp(18px, 1.7cqw, 28px);
  font-weight: 700;
  letter-spacing: .12em;
  white-space: nowrap;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .7);
}
.hud-title {
  font-size: clamp(8px, .65cqw, 11px);
  letter-spacing: .16em;
  color: var(--paper-dim);
  opacity: .62;
  white-space: nowrap;
}
.hp-shell {
  position: relative;
  width: 100%;
  height: clamp(16px, 1.7cqw, 28px);
  background: rgba(8, 9, 10, .82);
  border: 1px solid rgba(236, 228, 210, .3);
  clip-path: polygon(0 12%, 100% 0, 99.2% 100%, 1% 88%);
  overflow: hidden;
}
.hud-side--p2 .hp-shell { clip-path: polygon(0 0, 100% 12%, 99% 88%, .8% 100%); }
.hp-chip, .hp-ghost, .hp-fill {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 100%;
}
.hud-side--p2 .hp-chip,
.hud-side--p2 .hp-ghost,
.hud-side--p2 .hp-fill { left: auto; right: 0; }
.hp-chip { background: rgba(142, 36, 27, .55); transform-origin: left; }
.hud-side--p2 .hp-chip { transform-origin: right; }
.hp-ghost { background: rgba(236, 228, 210, .72); transform-origin: left; }
.hud-side--p2 .hp-ghost { transform-origin: right; }
.hp-fill {
  background: linear-gradient(180deg, var(--hp-a, #8ed0d2) 0%, var(--hp-b, #4d8f94) 55%, #2b5e63 100%);
  transform-origin: left;
}
.hud-side--p2 .hp-fill {
  background: linear-gradient(180deg, var(--hp-a, #f0b06a) 0%, var(--hp-b, #cf6a2a) 55%, #8a3c14 100%);
  transform-origin: right;
}
.hp-ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(90deg, transparent calc(10% - 1px), rgba(8, 9, 10, .5) 10%, transparent calc(10% + 1px));
  background-size: 10% 100%;
  opacity: .55;
}
.guard-shell {
  position: relative;
  width: 62%;
  height: 4px;
  margin-top: 3px;
  background: rgba(8, 9, 10, .7);
  border: 1px solid rgba(236, 228, 210, .18);
  overflow: hidden;
  transform: skewX(-18deg);
}
.hud-side--p2 .guard-shell { margin-left: auto; }
.guard-shell i {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, #6fb3b8, #bfe6ea);
  transition: background .2s;
}
.hud-side--p2 .guard-shell i { transform-origin: right center; }
.guard-shell.is-low i { background: linear-gradient(90deg, #d98a3a, #f0c07a); }
.guard-shell.is-broken { border-color: rgba(197, 59, 44, .8); }
.guard-shell.is-broken i { background: #c53b2c; }

.stamina-shell {
  position: relative;
  width: 46%;
  height: 3px;
  margin-top: 2px;
  background: rgba(8, 9, 10, .7);
  border: 1px solid rgba(236, 228, 210, .14);
  overflow: hidden;
  transform: skewX(-18deg);
}
.hud-side--p2 .stamina-shell { margin-left: auto; }
.stamina-shell i {
  display: block; width: 100%; height: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, #d9a441, #f5d98a);
}
.hud-side--p2 .stamina-shell i { transform-origin: right center; }

.hp-numbers {
  margin-top: 2px;
  font-family: var(--f-cond);
  font-size: clamp(9px, .72cqw, 12px);
  letter-spacing: .08em;
  color: rgba(236, 228, 210, .66);
  text-align: left;
}
.hud-side--p2 .hp-numbers { text-align: right; }
.hp-numbers.is-low { color: #e8795f; }

.under-row { display: flex; align-items: center; gap: .8em; width: 100%; }
.hud-side--p2 .under-row { flex-direction: row-reverse; }
.meter {
  display: flex;
  align-items: center;
  gap: 3px;
  position: relative;
}
.meter i {
  display: block;
  width: clamp(14px, 1.35cqw, 24px);
  height: clamp(4px, .42cqw, 7px);
  background: rgba(236, 228, 210, .15);
  transform: skewX(-22deg);
  transition: background .15s, box-shadow .15s;
}
.meter i.is-on { background: var(--teal); box-shadow: 0 0 8px rgba(111, 179, 184, .7); }
.hud-side--p2 .meter i.is-on { background: var(--amber); box-shadow: 0 0 8px rgba(227, 132, 58, .7); }
.meter.is-full i { background: #fff3d8; box-shadow: 0 0 12px rgba(255, 220, 150, .95); animation: meterPulse 1.1s ease-in-out infinite; }
.meter-label {
  font-size: clamp(7px, .55cqw, 9px);
  letter-spacing: .18em;
  color: var(--paper-dim);
  opacity: .55;
  margin-left: .25em;
}
.hud-side--p2 .meter-label { margin-left: 0; margin-right: .25em; order: 9; }
.round-pips { display: flex; gap: .35em; margin-left: auto; }
.hud-side--p2 .round-pips { margin-left: 0; margin-right: auto; }
.round-pips i {
  width: clamp(8px, .68cqw, 11px);
  height: clamp(8px, .68cqw, 11px);
  border: 1px solid rgba(236, 228, 210, .45);
  transform: rotate(45deg);
}
.round-pips i.is-won { background: var(--red); border-color: var(--red); box-shadow: 0 0 8px rgba(197, 59, 44, .8); }

.hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35cqh;
  min-width: clamp(80px, 8cqw, 128px);
}
.timer {
  display: flex;
  align-items: baseline;
  gap: .12em;
  color: var(--paper);
  font-family: var(--f-cond);
  line-height: .9;
  text-shadow: 0 4px 24px rgba(0, 0, 0, .8);
  position: relative;
  padding: .25em .45em .18em;
}
.timer::before, .timer::after {
  content: "";
  position: absolute;
  width: .5em; height: .5em;
  border: 1px solid rgba(197, 59, 44, .7);
}
.timer::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.timer::after { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.timer span {
  font-size: clamp(34px, 3.6cqw, 58px);
  font-weight: 700;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.timer em {
  font-style: normal;
  font-size: clamp(9px, .72cqw, 12px);
  letter-spacing: .16em;
  color: var(--paper-dim);
  opacity: .7;
}
.timer.is-low span { color: #f08a78; animation: timerBeat .9s ease-in-out infinite; }
.round-tag {
  font-family: var(--f-display);
  font-size: clamp(10px, .82cqw, 13px);
  letter-spacing: .2em;
  color: var(--paper-dim);
  opacity: .8;
}
.pause-btn {
  width: clamp(24px, 1.9cqw, 32px);
  height: clamp(20px, 1.6cqw, 27px);
  border: 1px solid rgba(236, 228, 210, .25);
  color: rgba(236, 228, 210, .55);
  font-family: var(--f-cond);
  font-size: clamp(9px, .7cqw, 12px);
  line-height: 1;
  transition: all .2s;
}
.pause-btn:hover { border-color: var(--red); color: var(--paper); }

.combo {
  position: absolute;
  top: 27%;
  z-index: 6;
  display: flex;
  align-items: flex-end;
  gap: .2em;
  opacity: 0;
  transform: translateY(10px) rotate(-3deg);
  transition: opacity .18s, transform .25s var(--ease-ink);
  pointer-events: none;
  text-shadow: 0 4px 22px rgba(0, 0, 0, .75);
}
.combo--p1 { left: 4.6cqw; }
.combo--p2 { right: 4.6cqw; transform: translateY(10px) rotate(3deg); }
.combo.is-on { opacity: 1; transform: none; }
.combo b {
  font-family: var(--f-display);
  font-size: clamp(42px, 4.8cqw, 78px);
  line-height: .8;
  font-weight: 700;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}
.combo span {
  font-family: var(--f-display);
  font-size: clamp(13px, 1.15cqw, 19px);
  letter-spacing: .18em;
  color: var(--red);
  writing-mode: vertical-rl;
  line-height: 1;
}
.combo i {
  font-family: var(--f-cond);
  font-style: normal;
  font-size: clamp(7px, .55cqw, 9px);
  letter-spacing: .26em;
  color: var(--paper-dim);
  opacity: .55;
  writing-mode: vertical-rl;
}
.combo.is-big b { color: #ffd9a0; }
.combo.is-big { animation: comboPop .3s var(--ease-snap); }

.announce {
  position: absolute;
  left: 50%;
  top: 34%;
  z-index: 8;
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.announce.is-show { opacity: 1; }
.announce-kanji {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  font-family: var(--f-display);
  font-size: clamp(120px, 18cqw, 300px);
  line-height: 1;
  color: var(--red);
  opacity: .16;
  z-index: -1;
  filter: blur(.4px);
  white-space: nowrap;
}
.announce-text {
  font-family: var(--f-display);
  font-size: clamp(30px, 4.2cqw, 68px);
  font-weight: 700;
  letter-spacing: .28em;
  color: var(--paper);
  text-shadow: 0 4px 30px rgba(0, 0, 0, .8);
  white-space: nowrap;
  padding: .1em .4em .14em .68em;
  background: linear-gradient(90deg, transparent, rgba(8, 9, 10, .55) 12%, rgba(8, 9, 10, .55) 88%, transparent);
}
.announce.is-show .announce-kanji { animation: kanjiStamp .5s var(--ease-ink) both; }
.announce.is-show .announce-text { animation: textWipe .45s var(--ease-ink) both; }
.announce.is-round .announce-text { color: #f6eedc; }
.announce.is-ko .announce-text { color: var(--red); }

.battle-hint {
  position: absolute;
  left: 50%;
  bottom: 3.2%;
  translate: -50% 0;
  z-index: 5;
  display: flex;
  gap: 1.4em;
  padding: .55em 1.1em;
  background: rgba(6, 7, 8, .55);
  border-top: 1px solid rgba(236, 228, 210, .14);
  border-bottom: 1px solid rgba(236, 228, 210, .08);
  font-size: clamp(8px, .64cqw, 11px);
  letter-spacing: .08em;
  color: var(--paper-dim);
  white-space: nowrap;
  transition: opacity .8s;
}
.battle-hint.is-faded { opacity: 0; }
.battle-hint kbd { font-size: .92em; }

.training-panel {
  position: absolute;
  right: 3.2cqw;
  bottom: 3%;
  z-index: 6;
  padding: .8em 1.1em;
  border-left: 2px solid var(--red);
  background: rgba(6, 7, 8, .6);
  max-width: 20em;
}
.training-panel b { font-family: var(--f-display); letter-spacing: .16em; font-size: clamp(13px, 1.05cqw, 17px); }
.training-panel p { margin: .35em 0 0; font-size: clamp(8px, .64cqw, 11px); color: var(--paper-dim); letter-spacing: .06em; }

/* ---------------- pause ---------------- */

.modal {
  position: relative;
  width: min(30cqw, 450px);
  padding: 2.6em 2.4em 2em;
  background:
    linear-gradient(180deg, rgba(236, 228, 210, .055), rgba(236, 228, 210, .02)),
    rgba(10, 11, 12, .95);
  border: 1px solid rgba(236, 228, 210, .2);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .7);
  clip-path: polygon(0 0, 100% 1.2%, 99.3% 98%, 1% 100%);
}
.modal::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(236, 228, 210, .07);
  pointer-events: none;
}
.modal-title {
  margin: 0;
  font-family: var(--f-display);
  font-size: clamp(58px, 5.4cqw, 88px);
  line-height: 1;
  letter-spacing: .1em;
  color: var(--paper);
}
.modal-rule { height: 1px; margin: 1.2em 0 1.4em; background: linear-gradient(90deg, var(--red), rgba(236, 228, 210, .12) 60%, transparent); }
.modal-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 1em; }
.modal-actions .brush-btn { margin-bottom: .5em; }
.modal-note { margin: 1.8em 0 0; font-size: clamp(8px, .64cqw, 11px); color: var(--paper-dim); opacity: .45; letter-spacing: .12em; }

/* ---------------- result ---------------- */

.result {
  position: relative;
  width: min(66cqw, 980px);
  min-height: 40cqh;
  display: grid;
  grid-template-columns: minmax(160px, 21cqw) 1fr;
  gap: 2.4cqw;
  align-items: center;
  padding: 2.8cqw 3.2cqw 2.6cqw;
  color: var(--ink);
  background:
    radial-gradient(120% 130% at 15% 10%, rgba(255, 250, 238, .75), transparent 50%),
    var(--paper);
  clip-path: polygon(0 2%, 97% 0, 100% 16%, 99% 96%, 96.5% 100%, 2% 98%, 0 84%);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .7);
}
.result::after {
  content: "";
  position: absolute;
  inset: 3% 2.4%;
  border: 1px solid rgba(53, 59, 62, .18);
  pointer-events: none;
}
.result-stamp {
  width: clamp(120px, 14cqw, 220px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 3px solid var(--red);
  box-shadow: inset 0 0 0 7px var(--paper), inset 0 0 0 8px rgba(197, 59, 44, .5), inset 0 0 40px rgba(197, 59, 44, .16);
  color: var(--red);
  font-family: var(--f-display);
  font-size: clamp(72px, 8.4cqw, 132px);
  font-weight: 700;
  line-height: 1;
  transform: rotate(-7deg);
  position: relative;
  justify-self: center;
}
.result-stamp.is-loss { color: var(--sumi); border-color: var(--sumi); box-shadow: inset 0 0 0 7px var(--paper), inset 0 0 0 8px rgba(53, 59, 62, .4); }
.result-stamp::after {
  content: "RESULT";
  position: absolute;
  bottom: 15%;
  font-family: var(--f-cond);
  font-size: clamp(7px, .58cqw, 10px);
  letter-spacing: .36em;
  color: currentColor;
  opacity: .65;
  font-weight: 400;
}
.result .eyebrow { color: var(--sumi); opacity: .7; }
.result h2 {
  margin: 0 0 .25em;
  font-family: var(--f-display);
  font-size: clamp(27px, 2.7cqw, 46px);
  letter-spacing: .08em;
  line-height: 1.1;
}
.result-copy > p:not(.eyebrow) {
  margin: 0;
  font-size: clamp(11px, .9cqw, 15px);
  letter-spacing: .04em;
  color: #4a4c4a;
  max-width: 38em;
}
.result-stats {
  display: flex;
  gap: 2.4cqw;
  margin: 1.5em 0 1.6em;
  padding: 1em 0;
  border-top: 1px solid rgba(53, 59, 62, .22);
  border-bottom: 1px solid rgba(53, 59, 62, .16);
}
.result-stats div { display: flex; flex-direction: column-reverse; gap: .2em; }
.result-stats dt { font-size: clamp(8px, .62cqw, 11px); letter-spacing: .18em; color: #6d6a60; }
.result-stats dd { margin: 0; font-family: var(--f-cond); font-size: clamp(22px, 2cqw, 34px); font-weight: 700; line-height: 1; color: var(--ink); }
.result-actions { display: flex; align-items: center; gap: 1.2em; flex-wrap: wrap; }
.result-actions .text-btn { color: #5c5a53; border-color: rgba(53, 59, 62, .28); }
.result-actions .text-btn:hover { color: var(--ink); border-color: var(--red); }
.result-actions .brush-btn { background: var(--ink); color: var(--paper); }
.result-actions .brush-btn:hover { background: #25282a; }
.result-actions .brush-btn i { color: var(--amber); }

/* ---------------- help scroll ---------------- */

.screen--help {
  z-index: 50;
  place-items: stretch;
  padding: 3.2cqh 3.6cqw;
  background: rgba(5, 6, 6, .8);
}
.help {
  position: relative;
  height: 100%;
  overflow: auto;
  padding: 2.6cqw 3cqw 2.4cqw;
  color: var(--ink);
  background:
    radial-gradient(100% 80% at 85% 0%, rgba(255, 251, 240, .9), transparent 45%),
    radial-gradient(120% 100% at 0% 100%, rgba(176, 160, 128, .22), transparent 52%),
    var(--paper);
  clip-path: polygon(0 1%, 99.4% 0, 100% 98.5%, .6% 100%);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .7);
  scrollbar-color: var(--sumi) transparent;
}
.help::before {
  content: "";
  position: absolute;
  inset: 1.4% 1.2%;
  border: 1px solid rgba(53, 59, 62, .16);
  pointer-events: none;
}
.help-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2em;
  padding-bottom: .9cqw;
  border-bottom: 1px solid rgba(53, 59, 62, .25);
}
.help-head h2 {
  margin: 0;
  font-family: var(--f-display);
  font-size: clamp(32px, 3.2cqw, 56px);
  letter-spacing: .12em;
}
.help-head .eyebrow { color: #6d6a60; opacity: .85; font-size: clamp(11px, .95cqw, 16px); }
.help-head .text-btn { color: #5c5a53; border-color: rgba(53, 59, 62, .3); font-size: clamp(14px, 1.1cqw, 19px); }
.help-head .text-btn:hover { color: var(--ink); }
.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4cqw 3cqw;
  padding-top: 1.1cqw;
}
.help-block h3 {
  margin: 0 0 .55em;
  font-family: var(--f-display);
  font-size: clamp(20px, 1.7cqw, 30px);
  letter-spacing: .12em;
  color: var(--ink);
}
.help-block table { width: 100%; border-collapse: collapse; font-size: clamp(14px, 1.05cqw, 18px); }
.help-block th, .help-block td { padding: .44em .4em .44em 0; vertical-align: middle; text-align: left; border-bottom: 1px solid rgba(53, 59, 62, .15); }
.help-block th { width: 34%; font-weight: 500; color: #5f5c54; letter-spacing: .04em; }
.help-block td { color: var(--ink); }
.help-block kbd {
  border-color: rgba(13, 14, 15, .55);
  background: rgba(255, 255, 255, .42);
  font-size: 1em;
  min-width: 1.9em;
  padding: .12em .42em .18em;
}
.help-block--wide { grid-column: 1 / -1; }
.help-tips { display: grid; grid-template-columns: 1fr 1fr; gap: .5em 2.4em; }
.help-tips p { margin: 0; font-size: clamp(13px, .95cqw, 16px); line-height: 1.8; color: #33352f; }
.help-tips b { font-family: var(--f-display); font-size: 1.2em; color: var(--red); margin-right: .35em; }
.help-chars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .8cqw 1cqw; }
.help-char { border-top: 2px solid var(--accent); padding-top: .4em; min-width: 0; }
.help-char b { display: block; font-family: var(--f-display); font-size: clamp(13px, 1.05cqw, 18px); letter-spacing: .04em; }
.help-char span { display: block; margin-top: .2em; font-size: clamp(10px, .78cqw, 13px); color: #5f5c54; letter-spacing: .03em; }
.help-char em { display: block; margin-top: .3em; font-style: normal; font-size: clamp(10px, .8cqw, 13px); color: #33352f; line-height: 1.55; }

/* ---------------- codex ---------------- */
.codex {
  width: 92cqw;
  height: 88cqh;
  display: flex;
  flex-direction: column;
  padding: 2.2cqw 2.6cqw;
  color: var(--ink);
  background:
    radial-gradient(90% 70% at 85% 0%, rgba(255, 251, 240, .95), transparent 50%),
    var(--paper);
  clip-path: polygon(0 1%, 99.5% 0, 100% 98.5%, .5% 100%);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .7);
  overflow: hidden;
}
.codex-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid rgba(53, 59, 62, .25); padding-bottom: .8cqw; }
.codex-head h2 { margin: 0; font-family: var(--f-display); font-size: clamp(26px, 2.5cqw, 42px); letter-spacing: .14em; }
.codex-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 34% 1fr; gap: 2cqw; padding-top: 1.2cqw; }
.codex-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: .55cqw;
  overflow-y: auto;
  padding-right: .3cqw;
}
.codex-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .2em;
  padding: .55em .6em;
  text-align: left;
  border: 1px solid rgba(53, 59, 62, .18);
  border-left: 3px solid var(--accent);
  background: rgba(255, 255, 255, .18);
  color: var(--ink);
  transition: background .2s, transform .2s;
}
.codex-card:hover, .codex-card.is-active { background: rgba(197, 59, 44, .1); transform: translateX(3px); }
.codex-card b { font-family: var(--f-display); font-size: clamp(13px, 1.02cqw, 18px); letter-spacing: .06em; }
.codex-card small { font-size: clamp(9px, .68cqw, 12px); color: #6d6a60; }
.codex-card i { font-style: normal; font-size: clamp(9px, .66cqw, 11px); color: var(--red); }
.codex-detail { overflow-y: auto; padding-right: .4cqw; }
.codex-hero { display: flex; align-items: center; gap: 1.2em; border-bottom: 1px solid rgba(53,59,62,.18); padding-bottom: .9em; }
.codex-seal { width: 2.6em; height: 2.6em; display: grid; place-items: center; font-family: var(--f-display); font-size: 2em; color: var(--accent); border: 2px solid var(--accent); }
.codex-hero h3 { margin: 0; font-family: var(--f-display); font-size: clamp(24px, 2.2cqw, 38px); letter-spacing: .1em; }
.codex-hero p { margin: .2em 0 0; font-family: var(--f-cond); font-size: clamp(10px, .8cqw, 13px); letter-spacing: .12em; color: #6d6a60; }
.codex-hero small { font-size: clamp(10px, .75cqw, 12px); color: var(--red); }
.codex-hp { margin-left: auto; font-family: var(--f-cond); font-size: clamp(11px, .85cqw, 14px); color: var(--ink); }
.codex-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7em 1.2em; margin: 1em 0; }
.codex-stats div { display: flex; align-items: center; gap: .5em; font-size: clamp(10px, .75cqw, 12px); }
.codex-stats span { color: #6d6a60; }
.codex-stats i { flex: 1; height: 5px; background: rgba(53,59,62,.16); position: relative; }
.codex-stats i::after { content: ""; position: absolute; inset: 0; transform: scaleX(var(--v)); transform-origin: left; background: var(--red); }
.codex-stats b { font-family: var(--f-cond); font-weight: 400; color: #4a4a44; }
.codex-block { margin-bottom: 1em; }
.codex-block h4 { margin: 0 0 .35em; font-family: var(--f-display); font-size: clamp(15px, 1.2cqw, 21px); letter-spacing: .08em; }
.codex-block h4 small { font-family: var(--f-cond); font-size: .62em; color: var(--red); margin-left: .5em; }
.codex-block p { margin: 0; font-size: clamp(11px, .86cqw, 14px); line-height: 1.75; color: #33352f; }
.codex-passive { border-left: 3px solid var(--red); padding-left: .8em; }
.codex-combos { margin: .3em 0 .6em; padding-left: 1.1em; }
.codex-combos li { font-size: clamp(11px, .84cqw, 14px); line-height: 1.9; color: #33352f; }
.codex-tip { color: #6d6a60 !important; font-size: clamp(10px, .76cqw, 12px) !important; }

/* ---------------- touch ---------------- */

.touch-controls { display: none; }
body.is-touch .touch-controls { display: flex; }
body.is-touch .battle-hint { display: none; }
body.is-touch .combo--p1 { left: 2.5cqw; }
body.is-touch .combo--p2 { right: 2.5cqw; }

.stick {
  position: absolute;
  left: 4cqw;
  bottom: 6cqh;
  z-index: 12;
  width: 24cqh;
  height: 24cqh;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 4px;
  touch-action: none;
}
.stick-key {
  display: grid;
  place-items: center;
  border: 1px solid rgba(236, 228, 210, .28);
  background: rgba(8, 9, 10, .42);
  color: rgba(236, 228, 210, .78);
  font-family: var(--f-display);
  font-size: clamp(11px, 1cqw, 15px);
  border-radius: 50%;
  touch-action: none;
  user-select: none;
}
.stick-key:active, .stick-key.is-down { background: rgba(197, 59, 44, .5); }
.stick-key--up { grid-area: 1 / 2; }
.stick-key--left { grid-area: 2 / 1; }
.stick-key--right { grid-area: 2 / 3; }
.stick-key--down { grid-area: 3 / 2; }

.touch-btns {
  position: absolute;
  right: 4cqw;
  bottom: 5.5cqh;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1cqh;
  touch-action: none;
}
.touch-btn {
  width: 8.2cqh;
  height: 8.2cqh;
  border-radius: 50%;
  border: 1px solid rgba(236, 228, 210, .3);
  background: rgba(8, 9, 10, .42);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  touch-action: none;
  user-select: none;
}
.touch-btn b { font-family: var(--f-display); font-size: clamp(14px, 1.5cqh, 22px); line-height: 1; }
.touch-btn small { font-family: var(--f-cond); font-size: 8px; opacity: .5; margin-top: 2px; }
.touch-btn:active, .touch-btn.is-down { background: rgba(197, 59, 44, .55); }
.touch-btn--skill { border-color: rgba(111, 179, 184, .55); }
.touch-btn--dodge { border-color: rgba(200, 220, 235, .6); }
.touch-btn--escape { border-color: rgba(190, 140, 240, .65); }
.touch-btn--ult { border-color: rgba(227, 132, 58, .65); }
.touch-btn--ult.is-ready { box-shadow: 0 0 24px rgba(227, 132, 58, .4); }

/* ---------------- rotate ---------------- */

.rotate-hint { display: none; }

/* ---------------- animations ---------------- */

@keyframes meterPulse { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
@keyframes timerBeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes comboPop { 0% { scale: 1; } 40% { scale: 1.14; } 100% { scale: 1; } }
@keyframes kanjiStamp {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.5) rotate(-8deg); filter: blur(6px); }
  60% { opacity: .22; }
  100% { opacity: .16; transform: translate(-50%, -50%) scale(1) rotate(-3deg); filter: blur(.4px); }
}
@keyframes textWipe {
  0% { opacity: 0; clip-path: inset(0 100% 0 0); transform: translateX(-20px); }
  100% { opacity: 1; clip-path: inset(0 0 0 0); transform: none; }
}

/* ---------------- responsive ---------------- */

@media (max-width: 1100px) {
  .roster-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); max-height: 58cqh; }
  .title-word { font-size: clamp(70px, 13.5cqw, 160px); }
  .menu { width: min(46cqw, 430px); }
  .title-sub { display: none; }
  .hud-title { display: none; }
}

@media (max-width: 760px) {
  .title-lockup { top: 7%; left: 4%; right: 4%; }
  .title-word { font-size: 18cqw; }
  .title-seal { width: 15cqw; font-size: 3.4cqw; margin-top: 12%; }
  .title-rail { display: none; }
  .menu { left: 6%; right: 6%; width: auto; bottom: 7%; }
  .menu-copy small { display: none; }
  .title-foot { left: 6%; right: 6%; align-items: flex-start; text-align: left; bottom: 1.6%; }
  .disclaimer { display: none; }
  .title-tools { top: 3.4%; right: 4%; }
  .select-head .eyebrow, .select-mode { display: none; }
  .select-title h2 { font-size: 6cqw; }
  .roster-side { display: none; }
  .roster-grid {
    max-height: none;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-rows: 26cqw;
    overflow-y: auto;
  }
  .roster-name { font-size: 3.2cqw; }
  .roster-kana, .roster-role, .roster-index { display: none; }
  .select-foot { grid-template-columns: 1fr; gap: 1.2cqh; }
  .stage-pick { display: none; }
  .select-picks { justify-content: center; }
  .select-actions { flex-direction: row; align-items: center; justify-content: space-between; }
  .select-hint { text-align: left; max-width: 40%; }
  .select-mode { display: none; }
  .help-grid { grid-template-columns: 1fr; }
  .help-tips { grid-template-columns: 1fr; }
  .help-chars { grid-template-columns: 1fr 1fr; }
  .result { width: 92cqw; grid-template-columns: 1fr; padding: 5cqw; gap: 1.2em; }
  .result-stamp { width: 26cqw; grid-row: 1; }
  .result-stats { gap: 1.2em; }
  .hud { padding: 2cqh 3cqw 0; gap: 1.5cqw; }
  .hud-id b { font-size: 3.2cqw; }
  .hud-id .hud-title { display: none; }
  .hp-shell { height: 2.4cqh; }
  .timer span { font-size: 7cqw; }
  .round-tag { display: none; }
}

@media (orientation: portrait) and (pointer: coarse) {
  .rotate-hint {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: grid;
    place-items: center;
    background: var(--ink);
    color: var(--paper);
    text-align: center;
    padding: 2em;
  }
  .rotate-hint b { display: block; font-family: var(--f-display); font-size: 2em; letter-spacing: .2em; margin-bottom: .4em; }
  .rotate-hint span { font-size: .85em; letter-spacing: .1em; color: var(--paper-dim); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
