:root {
  color-scheme: dark;
  --ink: #0d1420;
  --panel: #151d2b;
  --panel-2: #1b273a;
  --paper: #f5efe3;
  --muted: #b3bdcb;
  --dull: #8d9db4;
  --line: rgba(242,216,160,.24);
  --gold: #e7c990;
  --red: #d45851;
  --rose: #eb9a78;
  --blue: #97cce9;
  --display: "Hiragino Mincho ProN","Yu Mincho",YuMincho,Georgia,serif;
  --body: "Hiragino Sans","Yu Gothic",Meiryo,sans-serif;
}

*,*::before,*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  line-height: 1.6;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: .46;
}

button:focus-visible {
  outline: 2px solid #fadd9c;
  outline-offset: 3px;
}

button:not(:disabled),.clickable {
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

figure,p,h1,h2,h3 {
  margin: 0;
}

h1,h2,h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.2;
}

button[hidden],header[hidden],section[hidden] {
  display: none!important;
}

#shell {
  min-height: 100dvh;
}

#game {
  margin: 0 auto;
  min-height: calc(100dvh - 56px);
}

.frame {
  width: min(1320px,calc(100% - 56px));
  margin-inline: auto;
}

#chrome {
  height: 55px;
  border-bottom: 1px solid #b8905928;
  background: #0e1723;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: clamp(18px,4vw,65px);
  gap: 12px;
  position: relative;
  z-index: 5;
}

.wordmark {
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: .16em;
  color: #f2d49f;
  font-weight: 700;
}

.chrome-actions {
  display: flex;
  gap: 8px;
}

.quiet-button {
  border: 1px solid #a7b4cb38;
  border-radius: 4px;
  padding: 5px 12px;
  background: #f0f4ff08;
  color: #e1e6ef;
  font-size: 13px;
}

.quiet-button:not(:disabled):hover {
  background: #e4eef420;
}

.eyebrow,.subhead {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: .17em;
  font-weight: 700;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow::before {
  content: "";
  width: 21px;
  height: 1px;
  background: currentColor;
}

.primary {
  border: 1px solid #c48962;
  border-radius: 5px;
  padding: 10px 18px;
  min-height: 46px;
  background: linear-gradient(110deg,#9a393b,#722b35);
  color: #fff3e5;
  text-align: left;
  font-weight: 750;
  letter-spacing: .06em;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: inset 0 0 0 1px #f7ceb51a,0 4px 15px #07080d24;
}

.primary:not(:disabled):hover {
  background: linear-gradient(115deg,#b84d48,#8d3640);
  border-color: #f5c896;
}

:is(.campaign-depart,.battle,.party-battle,.cycle-start,.bad-ending) .primary {
  border-color: #b49b73;
  background: #2b4059;
  color: #fff0d9;
  box-shadow: inset 0 1px #dbe9ff16, 0 2px 6px #07080d33;
}

:is(.campaign-depart,.battle,.party-battle,.cycle-start,.bad-ending) .primary:not(:disabled):hover {
  border-color: var(--gold);
  background: #38516d;
}

.party-battle .primary:disabled {
  border-color: #627186;
  background: #1b2637;
  color: #b4c0d2;
  opacity: 1;
  box-shadow: none;
}

.primary b,.secondary b {
  font-family: Georgia,serif;
  font-size: 1.1rem;
  font-weight: 400;
}

.secondary {
  border: 1px solid #a6b0c347;
  border-radius: 5px;
  padding: 9px 14px;
  min-height: 42px;
  background: #151f2e;
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}

.secondary:not(:disabled):hover {
  background: #26354a;
  border-color: #e7c99085;
}

.title-screen {
  position: relative;
  min-height: 100dvh;
  display: grid;
  align-items: center;
  isolation: isolate;
  overflow: hidden;
  background: #162f55;
}

/* Layers, back to front: illustration, small far petals, the heroine and terrace cut out
   of the same illustration, the menu shade, then the larger near petals. */
.title-background,
.title-front {
  position: absolute;
  inset: 0;
  z-index: -5;
  margin: 0;
}

.title-front {
  z-index: -3;
  pointer-events: none;
}

.title-background img,
.title-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 61% center;
}

.title-petals {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.title-petals-back {
  z-index: -4;
}

.title-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(90deg,#071221f2 0%,#0a1727ce 27%,#10203b43 51%,transparent 74%),linear-gradient(0deg,#080e1ad9,transparent 23%);
}

.title-inner {
  width: min(1280px,calc(100% - 104px));
  margin: auto;
  padding: 50px 0 90px;
}

.title-brand small {
  font-weight: 700;
  color: #ecd5a3;
  letter-spacing: .39em;
  font-size: 13px;
  text-shadow: 0 1px 12px #080c13;
}

.title-brand h1 {
  font-size: clamp(47px,6.75vw,107px);
  letter-spacing: -.075em;
  white-space: nowrap;
  color: #fff1cd;
  text-shadow: 0 4px 0 #511e26,0 13px 25px #061022a8;
  -webkit-text-stroke: .6px #f6d195;
  margin: 9px 0 0;
}

.title-rule {
  width: min(350px,75%);
  height: 1px;
  background: linear-gradient(90deg,#f0cb7b,transparent);
  margin: 24px 0 12px;
}

.title-brand p {
  font-family: var(--display);
  font-size: clamp(18px,2.15vw,31px);
  color: #fff1da;
  letter-spacing: .095em;
  text-shadow: 0 2px 8px #0a1421;
}

.title-actions {
  margin-top: 41px;
  display: grid;
  gap: 9px;
  width: min(318px,100%);
}

.title-actions button {
  position: relative;
  min-height: 50px;
  padding-inline: 19px;
}

.title-actions button::after {
  content: "";
  position: absolute;
  inset-inline-end: 12px;
  inset-block-start: 50%;
  width: 48px;
  height: 48px;
  transform: translateY(-50%);
  background: url("characters/hikari-menu-running.png") center / contain no-repeat;
  image-rendering: pixelated;
  opacity: 0;
  pointer-events: none;
}

.title-actions button[data-do="new"]::after {
  background-image: url("characters/hikari-menu-run-b.png");
}

.title-actions button[data-do="album"]::after {
  background-image: url("characters/hikari-menu-run-c.png");
}

.title-actions button[data-do="soundSettings"]::after {
  background-image: url("characters/hikari-menu-run-d.png");
}

.title-actions button:focus-visible::after {
  opacity: 1;
}

.title-actions button:focus-visible > b {
  visibility: hidden;
}

@media (hover: hover) {
  .title-actions button:hover::after {
    opacity: 1;
  }

  .title-actions button:hover > b {
    visibility: hidden;
  }

  .title-actions:has(button:hover) button:focus-visible:not(:hover)::after {
    opacity: 0;
  }

  .title-actions:has(button:hover) button:focus-visible:not(:hover) > b {
    visibility: visible;
  }
}

.title-footer {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  justify-content: space-between;
  padding: 15px clamp(22px,4vw,78px);
  color: #e0e9f4aa;
  font-size: 12px;
}

.title-studio {
  letter-spacing: .22em;
}

a.title-studio {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: .28em;
}

a.title-studio:hover {
  color: #fff2d3;
}

a.title-studio:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 2px;
}

.title-version {
  letter-spacing: .08em;
}

.scene-page {
  position: relative;
  isolation: isolate;
  min-height: max(445px,calc(100dvh - 55px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 16px clamp(16px,4vw,64px) 17px;
}

.scene-heading {
  grid-row: 1;
  text-shadow: 0 2px 9px #020710;
}

.scene-heading h1 {
  margin-top: 4px;
  font-size: clamp(21px,3.0vw,39px);
  letter-spacing: .06em;
}


.skip-toggle:disabled {
  opacity: .38;
  cursor: default;
}

.skip-toggle[aria-pressed="true"] {
  border-color: var(--gold);
  color: #1a1206;
  background: var(--gold);
}

.scene-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: #102237;
  overflow: hidden;
}

.scene-art .shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 46%;
}

.scene-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg,#060b16b8,transparent 28%),
    linear-gradient(0deg,#080f1dd9,transparent 42%);
}

.scene-page[data-staging="raid"] .shot {
  object-position: center 25%;
}

.scene-entering[data-staging="raid"] .shot {
  animation: scene-cut .56s ease-out both;
}

@keyframes scene-cut {
  from { filter: brightness(.45); transform: scale(1.018); }
  to { filter: brightness(1); transform: none; }
}

.scene-page[data-staging="fall"][data-beat="1"] .shot {
  filter: brightness(.74);
}

.scene-page[data-staging="fall"][data-beat="2"] .shot {
  filter: brightness(.53);
}

.scene-page[data-staging="fall"][data-beat="3"] .shot {
  animation: lights-recede .62s ease-out both;
}

.scene-page[data-staging="fall"]:is([data-beat="4"], [data-beat="5"]) .shot {
  filter: brightness(.30);
}

.scene-page[data-staging="sink"], .scene-page[data-staging="echo"] {
  background: #05070c;
}

.scene-page[data-staging="sink"] .scene-art,
.scene-page[data-staging="echo"] .scene-art {
  background-color: #05070c;
}

.scene-entering[data-staging="sink"] .shot {
  animation: reach-dark 1.16s ease-out both;
}

.scene-page[data-staging="sink"]:is([data-beat="2"], [data-beat="3"]) .shot {
  filter: brightness(.57) saturate(.72);
}

.scene-low-point .shot {
  animation: reach-bottom .8s ease-in both;
}

.scene-page[data-staging="echo"] .shot {
  filter: brightness(.16) saturate(.42);
}

.scene-waiting :is(.scene-heading,.dialogue-body,.dialogue-foot) {
  visibility: hidden;
}

.scene-page[data-staging="sink"] .dialogue,
.scene-page[data-staging="echo"] .dialogue {
  background: linear-gradient(115deg,#090e18ee,#080d17f2);
  border-color: #bdc1d235;
}

.scene-art .memory-figures {
  position: absolute;
  top: 6%;
  left: 50%;
  width: min(71%,820px);
  height: 60%;
  object-fit: contain;
  object-position: center top;
  z-index: 1;
  opacity: .96;
  transform: translateX(-50%);
  filter: drop-shadow(0 0 16px #fac69550) drop-shadow(0 0 38px #ffd4a32c);
  mask-image: linear-gradient(180deg,#000 0%,#000 46%,#000d 64%,transparent 100%);
}

.scene-entering[data-staging="echo"] .memory-figures {
  animation: memory-arrives .34s var(--memory-delay) cubic-bezier(.19,.74,.35,1) both;
}

.scene-page[data-staging="rise"]:is([data-beat="0"], [data-beat="1"], [data-beat="2"]) .shot {
  filter: brightness(.69) saturate(.8);
}

.scene-page[data-staging="rise"] .shot[src="art/rise-dawn.webp"] {
  object-position: center top;
}

.scene-page[data-staging="rise"][data-beat="3"] .shot {
  animation: rise-morning 1.16s cubic-bezier(.21,.72,.31,1) both;
}

.scene-waiting[data-staging="rise"] .dialogue {
  visibility: hidden;
}

.scene-page[data-staging="rise"][data-beat="3"] .scene-art::after {
  transition: opacity .3s ease-out;
}

.scene-waiting[data-staging="rise"] .scene-art::after {
  opacity: .45;
}

.scene-page[data-staging="rise"][data-beat="3"] .scene-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse at 5% 20%,#fff1b6 0%,#ffcc7b8f 22%,#ffca7430 48%,transparent 72%);
  mix-blend-mode: screen;
  animation: sunrise-bloom 1.3s ease-out both;
}

.power-up {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #000;
}

.power-up-message:not(:empty) {
  width: min(100%, 414px);
  padding: 20px;
  border: 1px solid #a77f55;
  border-radius: 8px;
  background: radial-gradient(ellipse at 50% 118%, #5b3a28, #342621 70%, #292120);
  color: #fff0d0;
  text-align: center;
  text-wrap: balance;
  font: 600 clamp(17px, 2.75vw, 22px)/1.55 var(--display);
  letter-spacing: .04em;
}

.power-up-advance {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 0 24px max(24px,5vh);
  border: 0;
  color: #c8bda9;
  font-size: 13px;
}

.power-up-advance:disabled {
  visibility: hidden;
}

.power-up-advance:focus-visible {
  outline-offset: -4px;
}

@media (prefers-reduced-motion: no-preference) {
  .power-up-message:not(:empty) {
    animation: power-up-arrives .24s ease-out both;
  }
}

@keyframes power-up-arrives {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

.scene-entering[data-staging="opening"] .shot {
  animation: daylight-returns 1.05s ease-out both;
}

@keyframes lights-recede {
  from { filter: brightness(.53); }
  to { filter: brightness(.30); }
}

@keyframes reach-dark {
  from { opacity: .08; transform: translateY(-16px) scale(1.055); }
  to { opacity: 1; transform: none; }
}

@keyframes reach-bottom {
  from { filter: brightness(.57) saturate(.72); }
  to { filter: brightness(.16) saturate(.42); }
}

@keyframes memory-arrives {
  0% { visibility: hidden; opacity: 0; transform: translateX(-50%) scale(.96); }
  45% { visibility: visible; opacity: .96; transform: translateX(-50%) scale(1.012); }
  100% { visibility: visible; opacity: .96; transform: translateX(-50%) scale(1); }
}

@keyframes rise-morning {
  from { filter: brightness(.42) saturate(.65); transform: translateY(19px) scale(1.07); }
  63% { filter: brightness(1.06) saturate(1.07); }
  to { filter: none; transform: none; }
}

@keyframes sunrise-bloom {
  0% { opacity: 0; transform: scale(.88); transform-origin: left top; }
  45% { opacity: .65; }
  100% { opacity: 0; transform: scale(1.16); transform-origin: left top; }
}

@keyframes daylight-returns {
  from { filter: brightness(.32); }
  to { filter: brightness(1); }
}

.scene-controls {
  grid-row: 3;
  position: relative;
  width: min(1080px,100%);
  margin: 0 auto;
}

.dialogue {
  --dialogue-line-height: clamp(41px,4vw,44px);
  --dialogue-name-height: 27px;
  --dialogue-line-padding: 7px;
  position: relative;
  display: grid;
  grid-template-rows: minmax(0,1fr) 26px;
  gap: 1px;
  height: 202px;
  padding: 3px clamp(14px,2.3vw,28px) 4px;
  background: linear-gradient(115deg,#172538f7,#111b2bf5 76%);
  border: 1px solid #e4c58d68;
  border-radius: 20px;
  box-shadow: 0 12px 32px #04071080;
}

.dialogue-body {
  display: grid;
  grid-template-columns: clamp(66px,9.6vw,112px) minmax(0,1fr);
  align-items: start;
  gap: clamp(10px,2vw,22px);
  min-height: 0;
}

.dialogue-face {
  position: relative;
  grid-area: 1 / 1;
  align-self: center;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #e4c58d72;
  border-radius: 14px;
  background: radial-gradient(ellipse at center,#54434b,#1b2435);
}

.dialogue-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dialogue-copy {
  grid-area: 1 / 2;
  display: grid;
  grid-template-rows: var(--dialogue-name-height) auto;
  min-width: 0;
}

ruby {
  ruby-position: over;
}

rt {
  font-size: .52em;
  line-height: 1;
  letter-spacing: 0;
}

.speaker {
  grid-row: 1;
  align-self: start;
  font-weight: 800;
  letter-spacing: .11em;
  font-size: 13px;
  line-height: 16px;
  color: var(--gold);
}

.speaker[data-element="hikari"] {
  color: #ffab93;
}

.speaker[data-element="shion"] {
  color: #a3deff;
}

.speaker[data-element="yura"] {
  color: #b7df9a;
}

.speaker[data-element="towa"] {
  color: #f2d694;
}

.line {
  grid-row: 2;
  height: calc(3 * var(--dialogue-line-height) + var(--dialogue-line-padding));
  padding-top: 2px;
  overflow: hidden;
  font: 500 clamp(20px,2vw,26px)/var(--dialogue-line-height) var(--display);
  letter-spacing: .035em;
  line-break: strict;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.dialogue .line ruby {
  ruby-align: start;
}

/* Reserve the same space above the first line even when it has no reading. */
.first-line-ruby-space rt::before {
  content: "\200b";
  visibility: hidden;
}

.dialogue-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dialogue-advance {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
}

.key-hint {
  font-size: 11px;
  color: #a6b7cc;
  letter-spacing: .06em;
}

.notice {
  color: #f9dba1;
  font-size: 13px;
  letter-spacing: .035em;
}

.choice-list {
  position: absolute;
  z-index: 1;
  inset-inline: 0;
  bottom: calc(100% + 9px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 9px;
  background: #121c2cef;
  border: 1px solid #e4c58d68;
  border-radius: 15px;
}

.choice-list[hidden],.dialogue-foot[hidden] {
  display: none;
}

.choice-list .secondary {
  min-height: 45px;
}

.choice-list kbd,.combat-command kbd {
  font-family: inherit;
  color: #eac98a;
  font-size: 12px;
  font-weight: 750;
  border: 1px solid #d4b87a40;
  border-radius: 3px;
  padding: 2px 5px;
  min-width: 22px;
  text-align: center;
}

.hub {
  display: grid;
  grid-template-columns: minmax(0,1.62fr) minmax(285px,1fr);
  gap: 22px;
  padding-block: 22px 28px;
}

.main-card,.aside-card {
  border: 1px solid #bf9b683f;
  border-radius: 8px;
  background: linear-gradient(145deg,#1d2a3d,#131c2a);
  overflow: hidden;
}

.training-board {
  padding: 21px clamp(16px,2.3vw,33px) 23px;
}

.training-board h1,.end-copy h1 {
  font-size: clamp(29px,3.3vw,51px);
  letter-spacing: .055em;
  margin: 6px 0 12px;
}

.training-board .intro {
  font-size: 14px;
  color: #cad3df;
  margin-bottom: 18px;
}

.exercise-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.exercise {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  text-align: left;
  border: 1px solid #c1cfe329;
  border-radius: 5px;
  background: #0c162551;
  min-height: 86px;
  padding: 10px 9px;
}

.exercise:not(:disabled):hover {
  border-color: #eac78991;
  background: #29354a;
}

.exercise strong {
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.25;
  display: block;
}

.exercise .exercise-upgrade {
  display: block;
  margin-top: 3px;
  color: #b3ded2;
  font-size: 11px;
  line-height: 1.3;
}

.exercise p {
  font-size: 11px;
  color: #bac8d8;
  margin: 3px 0;
  line-height: 1.4;
}

.exercise .deltas {
  font-size: 11px;
  color: #f7d69a;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
  display: block;
}

.glyph {
  display: grid;
  place-items: center;
  border: 1px solid #e3c88b47;
  background: #6d45313f;
  color: #ecdaa9;
  border-radius: 6px;
  font: 700 17px var(--display);
  width: 31px;
  height: 34px;
}

.exercise[data-id="tide"] .glyph {
  background: #245e754d;
  color: #b3e9ff;
}

.hub-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.hub-actions .primary {
  min-width: 183px;
}

.campaign-goal {
  margin-top: 13px;
  color: #dfcba5;
  font-size: 13px;
}

.campaign-depart {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #bd9c6855;
  border-radius: 6px;
  background: #172235;
}

.campaign-depart h3 {
  font-size: 17px;
  color: var(--gold);
}

.campaign-depart p {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.campaign-depart .primary {
  min-height: 40px;
}

.campaign-friends {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.campaign-friends h3 {
  color: var(--gold);
  font-size: 15px;
  line-height: 1.6;
}

.campaign-friends-hint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.campaign-friends ul {
  display: grid;
  gap: 4px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.campaign-friends li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 8px;
  font-size: 12px;
}

.campaign-friends li strong {
  color: #c6d7e9;
  font-weight: 650;
}

.training-board .notice {
  display: block;
  margin-top: 12px;
}

.week-report {
  display: grid;
  gap: 7px;
  padding: 9px 11px;
  margin-top: 14px;
  border-left: 2px solid var(--gold);
  background: #101a2a;
  color: #e8d3ab;
  font-size: 12px;
}

.week-deltas {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.week-deltas li {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 7px;
  border: 1px solid #8293ad4d;
  border-radius: 4px;
  color: #edf3fc;
  font-size: 13px;
}

.training-date {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
}

.training-days {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.training-days li {
  width: clamp(30px,5vw,42px);
  min-height: 45px;
  display: grid;
  align-content: center;
  justify-items: center;
  line-height: 1.15;
  border: 1px solid #7584a04d;
  border-radius: 5px;
  background: #0f1928;
  color: var(--muted);
  font-size: 10px;
}

.training-days li[aria-current="step"] {
  border-color: #f0c88f;
  background: #322a2b;
  color: var(--gold);
}

.training-days b {
  color: var(--grade-color, #738399);
  font-size: 19px;
  line-height: 1.2;
}

.practice {
  max-width: 1000px;
  margin-block: 17px 24px;
  border: 1px solid #bf9b6866;
  border-radius: 8px;
  overflow: hidden;
  background: #152033;
}

.practice-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 10px clamp(12px,3vw,30px);
  gap: 9px;
}

.practice-heading h1 { font-size: clamp(21px,3vw,32px); }

.practice-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: clamp(192px,43vh,400px);
  background: url("art/practice-yard.webp") center 57% / cover;
}

.practice-stage > img,.practice-hikari {
  position: absolute;
  width: min(44%, 540px);
  height: 63%;
  bottom: 11%;
}

.practice-stage img {
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(2px 5px 3px #45281669);
}

.practice-hikari {
  /* All poses use the same 440 × 296 canvas fitted to the bottom of this box. */
  --pose-width: min(100cqw, calc(100cqh * 440 / 296));
  --pose-height: min(100cqh, calc(100cqw * 296 / 440));
  left: 15%;
  z-index: 2;
  container-type: size;
}
.practice-hikari img { width: 100%; height: 100%; }
.practice-coach { right: 8%; z-index: 1; }
.practice-partner { right: 22%; z-index: 1; }
.practice-stage[data-exercise="tide"] .practice-coach {
  right: 0;
  scale: 1.15;
  transform-origin: 50% 95%;
}
.practice-stage[data-exercise="tide"] .practice-hikari { left: 6%; }

.practice-stage[data-exercise="track"] {
  --hurdle-finish: 14%;
}
.practice-stage[data-exercise="track"] .practice-hikari { left: 34%; }
.practice-stage[data-exercise="track"] .practice-coach { right: auto; left: 82%; translate: -50% 0; }
.practice-stage[data-exercise="blade"] .practice-hikari { transition: transform .12s ease-out; }
.practice-stage[data-exercise="blade"][data-pose="strike"] .practice-hikari { transform: translateX(13%); }
.practice-stage[data-exercise="track"].is-playing .practice-hikari {
  animation: hurdle-run .79s linear both;
}

.practice-stage[data-exercise="track"]:is([data-pose="guard"],[data-pose="rest"],[data-pose="cheer"],[data-pose="disappointed"]) .practice-hikari {
  transform: translateX(var(--hurdle-finish));
}

@keyframes hurdle-run {
  0% { transform: translateX(-68%); }
  31% { transform: translateX(-39%); }
  43% { transform: translate(-17%,-16%); }
  58% { transform: translate(-3%,-21%); }
  74% { transform: translate(11%,0); }
  100% { transform: translateX(var(--hurdle-finish)); }
}

.practice-prop,.practice-motion { position: absolute; }

.practice-prop {
  bottom: 13%;
  left: 57%;
  display: none;
}

.practice-stage[data-exercise="blade"] .practice-prop {
  display: block;
  left: 50%;
  width: 4%;
  height: 34%;
  border-radius: 12px 12px 3px 3px;
  border: 2px solid #4e301c;
  background: repeating-linear-gradient(0deg,#785135 0 3px,#c2a576 3px 9px,#b28958 9px 12px);
  box-shadow: 3px 4px 0 #63402854;
  transform-origin: center bottom;
}

.practice-stage[data-exercise="track"] .practice-prop {
  display: block;
  left: 46%;
  width: 10%;
  height: 18%;
  border: solid #65432b;
  border-width: 8px 6px 0;
  border-radius: 3px 3px 0 0;
  box-shadow: inset 0 3px #e9bb82, 3px 0 #62452e52;
}

.practice-stage[data-pose="strike"] .practice-prop { animation: target-recoil .2s ease-out; }
@keyframes target-recoil {
  45% { transform: rotate(8deg); }
  100% { transform: rotate(0); }
}

.practice-motion {
  z-index: 3;
  left: 39%;
  bottom: 23%;
  width: 18%;
  height: 28%;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  border: solid transparent;
  border-width: 0 0 5px 5px;
  border-left-color: #ffbf6e;
  border-bottom-color: #fff3c2;
}

.practice-stage[data-exercise="tide"] .practice-motion {
  border-left-color: #36abf0;
  border-bottom-color: #d1fbff;
  left: 33%;
  width: 37%;
}

.practice-stage.is-playing[data-exercise="tide"][data-exchange="signal"] .practice-motion {
  animation: practice-water-cue .34s ease-out;
}

@keyframes practice-water-cue {
  0% { opacity: 0; transform: translateX(24%) rotate(-11deg) scale(.6); }
  30% { opacity: .85; }
  100% { opacity: 0; transform: translateX(-17%) rotate(-9deg) scale(1); }
}

.practice-stage[data-exercise="blade"] .practice-motion {
  border-left-color: #ff7e44;
  border-bottom-color: #ffd18a;
  filter: drop-shadow(0 0 6px #f75b328a);
}

.practice-stage[data-exercise="blade"] .practice-motion::after {
  content: "";
  position: absolute;
  left: 70%;
  top: 62%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffe39e;
  box-shadow: 9px -10px 0 -1px #ff934a, -7px -8px 0 -1px #ffc773;
}

.practice-stage.is-playing[data-pose="strike"] .practice-motion {
  animation: practice-swipe .2s ease-out;
}

.practice-stage[data-exercise="blade"][data-pose="strike"] .practice-motion {
  animation-duration: .17s;
}

@keyframes practice-swipe {
  0% { opacity: .8; transform: rotate(-24deg) scale(.65); }
  42% { opacity: 1; }
  100% { opacity: 0; transform: rotate(-9deg) scale(1.15); }
}

.practice-grade-float {
  --head-x: -.015;
  --head-from-bottom: .79;
  position: absolute;
  z-index: 3;
  left: calc(50% + var(--pose-width) * var(--head-x));
  bottom: calc(var(--pose-height) * var(--head-from-bottom));
  translate: -50% 22%;
  transform-origin: center bottom;
  color: var(--grade-color);
  font-size: clamp(30px,4vw,48px);
  line-height: 1;
  text-shadow: 0 1px 3px #221823, 0 0 12px #221823b0;
  pointer-events: none;
  animation: practice-grade-rise .72s ease-out both;
}

.practice-stage[data-pose="rest"] .practice-grade-float {
  --head-x: .045;
  --head-from-bottom: .68;
}

.practice-cheer-air {
  position: absolute;
  inset: 0;
  opacity: 0;
}

@media(prefers-reduced-motion:no-preference) {
  .practice-stage[data-result="jump"] .practice-hikari {
    --cheer-duration: .54s;
    transform-origin: center bottom;
    animation: practice-cheer-jump var(--cheer-duration) linear both;
  }
  .practice-stage[data-result="jump"] .practice-hikari img:first-child {
    animation: practice-cheer-ground var(--cheer-duration) step-end both;
  }
  .practice-stage[data-result="jump"] .practice-cheer-air {
    animation: practice-cheer-air var(--cheer-duration) step-end both;
  }
}

@keyframes practice-cheer-jump {
  0%, 100% { translate: 0 0; scale: 1; }
  16% { translate: 0 2px; scale: 1 .96; animation-timing-function: cubic-bezier(.13,.64,.42,1); }
  49% { translate: 0 -28px; scale: 1; animation-timing-function: cubic-bezier(.58,0,.82,.38); }
  84% { translate: 0 0; scale: 1; }
  91% { translate: 0 1px; scale: 1 .97; }
}

@keyframes practice-cheer-ground {
  0%, 84%, 100% { opacity: 1; }
  16% { opacity: 0; }
}

@keyframes practice-cheer-air {
  0%, 84%, 100% { opacity: 0; }
  16% { opacity: 1; }
}

.practice-stage[data-result="aura"] .practice-hikari img {
  position: relative;
  z-index: 1;
}

.practice-aura {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: var(--pose-width);
  height: calc(var(--pose-height) * 370 / 296);
  translate: -50% 0;
  pointer-events: none;
}

.practice-aura-back { z-index: 0; }
.practice-aura-front { z-index: 2; }

@keyframes practice-grade-rise {
  0% { opacity: 0; transform: translateY(3px) scale(.78); }
  17% { opacity: 1; transform: translateY(-7px) scale(1); }
  73% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-24px) scale(1); }
}

@media(prefers-reduced-motion:reduce) {
  .practice-grade-float { animation: none; }
}

.practice-footer {
  min-height: 107px;
  padding: 9px clamp(12px,3vw,25px);
  border-top: 1px solid #a4814366;
  display: grid;
  align-items: center;
}

.practice-wait { color: var(--muted); text-align: center; }
.practice-wait[hidden] { display: none; }

.practice-result {
  --grade-color: #f5d797;
  display: grid;
  grid-template-columns: minmax(82px, .52fr) minmax(114px, 1.18fr) minmax(90px, .45fr);
  gap: clamp(8px,2vw,22px);
  align-items: center;
  animation: practice-reveal .24s ease-out both;
}

:is(.practice-result,.practice-grade-float,.training-days li)[data-grade="0"] { --grade-color: #ffa8a2; }
:is(.practice-result,.practice-grade-float,.training-days li)[data-grade="1"] { --grade-color: #d7d8c7; }
:is(.practice-result,.practice-grade-float,.training-days li)[data-grade="2"] { --grade-color: #96e4d4; }
:is(.practice-result,.practice-grade-float,.training-days li)[data-grade="3"] { --grade-color: #adccff; }
:is(.practice-result,.practice-grade-float,.training-days li)[data-grade="4"] { --grade-color: #f5d797; }

.practice-grade {
  display: grid;
  gap: 4px;
  justify-items: center;
  color: var(--grade-color);
  font-size: 14px;
  line-height: 1.2;
}

.practice-grade b {
  font-size: clamp(29px,4vw,38px);
  line-height: 1;
}

.practice-changes > p {
  margin: 0 0 5px;
  color: #b6c7db;
  font-size: 12px;
}

.practice-deltas {
  display: grid;
  gap: 3px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: clamp(13px,1.65vw,17px);
  font-variant-numeric: tabular-nums;
}

.practice-deltas li {
  display: grid;
  grid-template-columns: 1fr auto 3.8ch;
  column-gap: clamp(3px,1vw,9px);
  align-items: center;
  padding: 1px 6px;
  border-left: 2px solid #9ee7ca85;
  background: #cfdefa0a;
}

.practice-deltas .decrease { border-left-color: #ffafa485; }

.practice-deltas li > span:first-child {
  color: #f0f3fa;
  font-weight: 700;
}

.practice-values {
  display: flex;
  align-items: baseline;
  gap: 0.45em;
  white-space: nowrap;
  color: #c7d3e1;
}

.practice-values i { color: #adc1d9; font-style: normal; }
.practice-values strong { color: #ffffff; }
:is(.practice-deltas,.week-deltas) b { text-align: right; color: #9ee7ca; font-variant-numeric: tabular-nums; }
:is(.practice-deltas,.week-deltas) .decrease b { color: #ffafa4; }
.practice-result .secondary { min-width: 0; }

@keyframes practice-reveal {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media(max-width:500px) {
  .practice-stage > img,.practice-hikari { height: 58%; width: 47%; }
  .practice-stage[data-exercise="tide"] .practice-coach { right: -3%; }
  .practice-result { column-gap: 7px; grid-template-columns: minmax(60px,.6fr) 1fr; }
  .practice-result .secondary { grid-column: 1 / -1; }
}

.portrait-area {
  height: clamp(192px,33vh,285px);
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 62% 37%,#773a4455,transparent 66%),linear-gradient(130deg,#41262e,#1d283b 56%,#22314a);
  border-bottom: 1px solid #ba915f43;
}

.portrait-area::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg,#151d2d99,transparent 65%),linear-gradient(0deg,#121a29,transparent 52%);
}

.portrait-area img {
  position: absolute;
  height: auto;
  width: min(70%,292px);
  right: 3%;
  top: 3%;
  object-fit: contain;
  object-position: center top;
  filter: drop-shadow(0 7px 18px #090b1680);
}

.portrait-caption {
  position: absolute;
  z-index: 1;
  bottom: 12px;
  left: 18px;
}

.portrait-caption h2 {
  font-size: clamp(22px,2.7vw,36px);
  letter-spacing: .075em;
}

.portrait-caption p {
  margin: 5px 0 2px;
  color: #edcc94;
  font-size: 12px;
  letter-spacing: .08em;
}

.sheet {
  padding: 12px 17px 15px;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 15px;
}

.stat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1px 5px;
  font-size: 13px;
  align-items: center;
}

.stat span {
  color: #d0d9e6;
}

.stat strong {
  color: #f7f1e2;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.meter {
  height: 4px;
  background: #ffffff19;
  border-radius: 100px;
  overflow: hidden;
  grid-column: 1/-1;
}

.meter i {
  display: block;
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg,#a44953,#e9ab72);
}

.meter.is-cool i {
  background: linear-gradient(90deg,#4f82b7,#94d6f2);
}

.meter.is-warm i {
  background: linear-gradient(90deg,#a27b60,#f1ce84);
}

.weekly-stat-heading {
  margin: 0 0 9px;
  color: #edcc94;
  font-size: 12px;
  font-weight: 700;
}

.weekly-stat {
  --change-color: #9ee7ca;
}

.stats:has(.weekly-stat) .stat {
  grid-template-rows: auto 1fr auto;
  row-gap: 3px;
}

.stats:has(.weekly-stat) .meter {
  grid-row: 3;
  height: 6px;
}

.weekly-stat.decrease {
  --change-color: #ffafa4;
}

.weekly-stat-delta {
  color: var(--change-color);
  font-variant-numeric: tabular-nums;
}

.stat .weekly-stat-values {
  grid-column: 1/-1;
  color: #bac6d7;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.weekly-stat-values i {
  font-style: normal;
}

.weekly-stat-values strong {
  font-size: 17px;
  line-height: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .weekly-stat.is-counting .meter i {
    position: relative;
    overflow: hidden;
    animation: weekly-stat-fill var(--weekly-duration) cubic-bezier(.25,.5,.55,1) var(--weekly-delay) backwards;
  }

  .weekly-stat.is-counting .meter i::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg,transparent 22%,#fff9 50%,transparent 78%);
    animation: weekly-stat-glint var(--weekly-duration) ease-out var(--weekly-delay) both;
  }

  .weekly-stat.is-counting .weekly-stat-delta {
    transform-origin: right center;
    animation: weekly-stat-delta .36s ease-out calc(var(--weekly-delay) + var(--weekly-duration) - .18s) backwards;
  }

  @keyframes weekly-stat-fill {
    from { width: var(--previous-width); }
  }

  @keyframes weekly-stat-glint {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
  }

  @keyframes weekly-stat-delta {
    0% { opacity: 0; transform: translateY(6px) scale(.86); }
    60% { opacity: 1; transform: translateY(-2px) scale(1.14); }
    100% { transform: none; }
  }
}

.bond-row {
  border-top: 1px solid #efd4a728;
  margin-top: 13px;
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bond-row span {
  font-size: 12px;
  color: #cfd9e6;
}

.bond-row strong {
  font-size: 13px;
  color: #b0e1ff;
}

.battle-supply {
  margin-top: 14px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: #c7d1dc;
}

.battle-supply h3 { font-size: 14px; color: var(--gold); }

.battle-supply ul {
  margin: 5px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  line-height: 1.65;
}

.battle-supply ul.is-scrollable {
  max-block-size: 141px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-inline: 2px 7px;
  scrollbar-gutter: stable;
}

.battle-supply li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding-block: 3px;
  border-bottom: 1px solid #f4e0bf17;
}

.battle-supply li strong {
  color: var(--gold);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.list {
  list-style: none;
  margin: 16px 0;
  padding: 0;
}

.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #f4e0bf27;
  min-height: 49px;
  font-size: 14px;
}

.list li span:last-child {
  color: #f2d29b;
  font-size: 13px;
  text-align: right;
}

.battle {
  padding: 19px 0 25px;
  display: grid;
  grid-template-columns: minmax(0,1.5fr) minmax(310px,1fr);
  gap: 18px;
}

.enemy-stage {
  height: clamp(390px,calc(100dvh - 99px),660px);
  align-self: start;
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
  overflow: hidden;
  border: 1px solid #beaa7e83;
  border-radius: 8px;
  color: #172336;
}

.enemy-stage, .party-enemy-art {
  background: radial-gradient(ellipse at 50% 32%,#fbf4e4 1%,#ebebed 30%,#b5c9dd 70%,#6685a8);
}

.enemy-art {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.enemy-art::before {
  content: "";
  width: min(73%,450px);
  aspect-ratio: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  border: 1px solid #47668149;
  box-shadow: 0 0 0 5px #ffffff34,0 0 0 6px #53809f44,0 0 0 24px #ffffff21;
  border-radius: 50%;
  z-index: -1;
}

.enemy-art img {
  height: 100%;
  width: 100%;
  padding: 8px 12px 11px;
  object-fit: contain;
  position: absolute;
  inset: 0;
  filter: drop-shadow(0 12px 15px #25334e31);
}

.enemy-team .enemy-top h1 {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  column-gap: .8em;
  font-size: clamp(15px,1.8vw,23px);
  line-height: 1.18;
}

.enemy-team .enemy-top h1 span { white-space: nowrap; }
.enemy-team .enemy-top .hp-label, .enemy-team .enemy-top .meter { grid-column: 1 / -1; }
.enemy-team .enemy-top .hp-label { margin-top: 3px; }

.enemy-pair-art {
  display: grid;
  grid-template-columns: minmax(0,1.2fr) minmax(0,.8fr);
  padding-inline: 7px;
}

.enemy-fighter { position: relative; }

.enemy-fighter img {
  padding-inline: 4px;
  object-position: center bottom;
}

.enemy-fighter-rabbit img { top: auto; height: 90%; }

.enemy-dialogue { min-height: 48px; }

.enemy-exchange {
  display: grid;
  gap: 4px;
  margin: 0 11px 9px;
  padding: 5px 7px;
  border-radius: 5px;
  background: #142238;
  color: #f1f3fb;
  font-size: clamp(11px,1.15vw,13px);
  line-height: 1.45;
}

.enemy-exchange > div {
  display: grid;
  grid-template-columns: 29px minmax(0,1fr);
  gap: 7px;
  align-items: center;
}

.enemy-exchange img { width: 29px; aspect-ratio: 1; border-radius: 3px; }
.enemy-exchange strong { color: #ffd7a1; }

.enemy-top {
  position: relative;
  margin: 12px 13px 0;
  background: #111d2fe8;
  color: #fff3d8;
  border-radius: 5px;
  padding: 10px 15px;
  box-shadow: 0 8px 25px #17253826;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(103px,42%);
  gap: 0 12px;
}

.enemy-top .eyebrow {
  font-size: 10px;
  grid-column: 1 / -1;
}

.enemy-top h1 {
  font-size: clamp(17px,2.1vw,26px);
  margin-block: 3px 2px;
}

.enemy-top .hp-label {
  align-self: end;
}

.hp-label {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 10px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.hp-label strong {
  font-size: 16px;
  white-space: nowrap;
}

.enemy-top .meter {
  grid-column: 2;
  margin-top: 2px;
  height: 6px;
}

.commands-panel {
  padding: 16px 17px 18px;
  border: 1px solid #d2b87748;
  border-radius: 8px;
  background: linear-gradient(145deg,#1d2a3c,#111927);
}

.battle-hikari h2 {
  font-size: 25px;
  margin: 2px 0 6px;
}

.battle-hikari .meter {
  height: 7px;
  margin-top: 5px;
}

.intent {
  border-radius: 5px;
  background: #18324b;
  border: 1px solid #8dc2e762;
  margin: 13px 0 10px;
  padding: 8px 11px;
}

.intent span {
  font-size: 11px;
  color: #abd6ec;
  letter-spacing: .08em;
}

.intent strong {
  display: block;
  color: #e7f4ff;
  font-size: 16px;
}

.intent p {
  font-size: 12px;
  color: #d3e7f4;
}

.intent[data-kind="charge"] {
  background: #252f44;
  border-color: #ac9267;
}

.intent[data-kind="charge"] span {
  color: #f1cf94;
}

.command-list {
  display: grid;
  gap: 6px;
}

.command-list.is-scrollable {
  max-block-size: clamp(154px, 38dvh, 306px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 3px 5px 3px 3px;
}

.combat-scroll-hint {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.combat-command {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 3px 9px;
  align-items: center;
  border: 1px solid #dbdceb37;
  border-radius: 5px;
  background: #10192a9e;
  text-align: left;
  padding: 6px 9px;
  min-height: 47px;
}

.combat-command:not(:disabled):hover {
  background: #314058;
  border-color: #edc78e;
}

.combat-command strong {
  font-size: 14px;
  line-height: 1.15;
}

.sword-rainbow-label {
  display: inline-block;
  justify-self: start;
  color: #ffedb8;
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
  .sword-rainbow-label {
    background-image: repeating-linear-gradient(90deg, #ffaaaa 0%, #ffcb8f 7%, #fff098 14%,
      #b8efac 21%, #a3e8fb 28%, #b4c6ff 35%, #e1b7ff 42%, #ffaaaa 50%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  @media (prefers-reduced-motion: no-preference) {
    .sword-rainbow-label { animation: sword-rainbow-flow 5.6s linear infinite; }
  }
}

@keyframes sword-rainbow-flow {
  to { background-position: 100% 0; }
}

@media (forced-colors: active) {
  .sword-rainbow-label {
    background: none;
    color: ButtonText;
    animation: none;
  }
}

.combat-command small {
  font-size: 11px;
  color: #bacbdd;
  grid-column: 2/-1;
  line-height: 1.3;
}

.combat-command.no-shortcut { grid-template-columns: minmax(0, 1fr) auto; }
.combat-command.no-shortcut small { grid-column: 1 / -1; }

.combat-command .uses {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: #efce94;
}

.combat-log {
  color: #d8e2f0;
  line-height: 1.5;
  font-size: 12px;
  word-break: keep-all;
  overflow-wrap: anywhere;
  min-height: 35px;
  margin-top: 12px;
}

.combat-log small {
  color: #a8b7ca;
}

.result-card {
  --result-surface: #263647;
  --result-border: #7691a7;
  --result-accent: #c7def0;
  margin-top: 16px;
  padding: 12px 14px 14px;
  border: 1px solid var(--result-border);
  border-radius: 6px;
  background: linear-gradient(145deg,var(--result-surface),#151f2d);
}

.result-card[data-result="win"] {
  --result-surface: #3e3024;
  --result-border: #ad885a;
  --result-accent: #f4d8a4;
}

.result-card h3 {
  margin: 0 0 8px;
  font-size: 26px;
  color: var(--result-accent);
}

.result-card .primary {
  width: 100%;
}

.effect {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: screen;
}

.effect.spark::before,.effect.fight::before {
  content: "";
  position: absolute;
  left: -15%;
  top: 43%;
  width: 130%;
  height: 7px;
  background: #fff5c2;
  box-shadow: 0 0 9px 4px #ffd05a,0 0 30px 15px #ed491a;
  transform: rotate(-23deg);
  animation: slash .56s ease-out both;
}

.effect.fight::before {
  box-shadow: 0 0 9px 3px #fff1bf,0 0 23px 9px #a5d6ee;
}

.effect.is-parried::before {
  background: #e4fbff;
  box-shadow: 0 0 7px 5px #c2f2ff,0 0 26px 13px #247add;
  transform: rotate(20deg);
}

.effect.is-interrupt::after,.effect.is-strong::after {
  content: "";
  position: absolute;
  inset: 8% 6%;
  background: radial-gradient(ellipse,#fff8c5 1%,#e69a2e 16%,transparent 60%);
  animation: aura .44s .12s ease-out both;
}

.battle-hikari.is-hit .meter {
  animation: status-flash .25s .31s ease-out both;
  --status-glow: #ec5f45;
}

.battle-hikari.is-healing .meter {
  animation: status-flash .45s ease-out both;
  --status-glow: #7af3ce;
}

@keyframes status-flash {
  40% { box-shadow: 0 0 13px 3px var(--status-glow); }
}

.effect.heal,.effect.read {
  background: radial-gradient(ellipse,#e8fbff 1%,#3bc4f1 22%,transparent 65%);
  animation: aura .58s ease-out both;
}

.damage-number {
  position: absolute;
  top: 32%;
  left: 51%;
  z-index: 4;
  color: #fff3a4;
  -webkit-text-stroke: 1px #76411e;
  font: bold 47px Georgia,serif;
  text-shadow: 0 3px 8px #19192d;
  pointer-events: none;
  animation: damage .63s ease-out both;
}

.damage-number.ally-damage {
  left: 61%;
  color: #ffcefa;
  -webkit-text-stroke-color: #77447b;
  font-size: clamp(30px,4vw,42px);
}

.misfire-beam {
  position: absolute;
  z-index: 3;
  top: 44%;
  left: 31%;
  right: 24%;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(90deg,#fff6ff,#e3a0ff 64%,transparent);
  box-shadow: 0 0 10px #ca74ff;
  pointer-events: none;
  transform-origin: right;
  animation: misfire-flash .32s .08s ease-out both;
}

@keyframes misfire-flash {
  0% { opacity: 0; transform: rotate(4deg) scaleX(.1); }
  42% { opacity: 1; transform: rotate(4deg) scaleX(1); }
  100% { opacity: 0; transform: rotate(4deg) scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .misfire-beam { animation: none; }
}

.battle.is-animating .combat-command {
  pointer-events: none;
}

.battle.is-animating .result-card .primary {
  pointer-events: none;
}

.sound-settings {
  display: grid;
  gap: 18px;
  max-width: 38rem;
}

.sound-setting {
  display: grid;
  grid-template-columns: minmax(8em, auto) minmax(4rem, 1fr) 3.5em;
  gap: 12px;
  align-items: center;
}

.sound-setting input {
  width: 100%;
  accent-color: #e8af66;
}

.sound-setting output {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.end {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding-block: 28px;
}

.end-art {
  overflow: hidden;
  min-height: 375px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #16304a;
}

.end-art img {
  height: 100%;
  object-fit: cover;
  object-position: 44% center;
}

.campaign-ending {
  align-items: center;
  grid-template-columns: minmax(0,1.55fr) minmax(244px,1fr);
}

.campaign-ending .end-art {
  min-height: 0;
  aspect-ratio: 16 / 9;
  background: #111b28;
}

.campaign-ending .end-art img,
.scene-page[data-staging="ending"] .shot {
  object-fit: contain;
  object-position: center;
}

.campaign-ending .end-copy h1 {
  font-size: clamp(22px,3vw,35px);
}

@media (max-width: 830px) {
  .campaign-ending .end-copy {
    padding-inline: 16px;
  }
}

.end-copy {
  padding: 26px 29px 23px;
  background: #1b2638;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.bad-ending .end-art {
  border-color: #827c745c;
}

.bad-ending {
  min-height: 100dvh;
}

.bad-ending .end-art img {
  filter: saturate(.72) brightness(.8);
}

.bad-ending .end-copy {
  background: #171e29;
}

.bad-ending {
  position: relative;
  grid-template-columns: minmax(0,1fr);
}

.bad-end-veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 16px;
  border: 0;
  border-radius: 0;
  background: #05080dad;
  color: inherit;
  font: inherit;
  cursor: pointer;
  animation: bad-end-in .9s ease-out both;
}

.bad-end-window {
  display: grid;
  gap: 14px;
  justify-items: center;
  width: min(460px, 100%);
  padding: 34px 28px 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #171e29f2;
  box-shadow: 0 18px 50px #000a;
  text-align: center;
}

.bad-end-title {
  font-family: var(--display);
  font-size: clamp(1.7rem, 5vw, 2.3rem);
  font-weight: 700;
  color: #f1e6d2;
}

.bad-end-message {
  color: #d9e2ed;
  line-height: 1.8;
}

.bad-end-grit {
  color: var(--gold);
  font-size: 1.15rem;
}

.bad-end-grit b {
  font-size: 1.6rem;
  margin-inline-start: .3em;
}

.bad-end-hint {
  margin-top: 6px;
  color: #a9b3c0;
  font-size: .9rem;
  animation: bad-end-blink 2.4s ease-in-out infinite;
}

.bad-end-veil:hover .bad-end-window,
.bad-end-veil:focus-visible .bad-end-window {
  border-color: var(--gold);
}

@keyframes bad-end-in {
  from { opacity: 0; }
}

@keyframes bad-end-blink {
  50% { opacity: .45; }
}

@media (prefers-reduced-motion: reduce) {
  .bad-end-veil, .bad-end-hint { animation: none; }
}

.training-deadline {
  display: inline-block;
  margin-inline-start: .8em;
  color: #d5ba8f;
}

.end-copy>p {
  color: #d9e2ed;
  line-height: 1.8;
  margin-bottom: 16px;
}

.end-actions {
  display: grid;
  gap: 8px;
  margin-top: 21px;
}

dialog {
  width: min(830px,calc(100% - 32px));
  max-height: calc(100dvh - 85px);
  overflow: auto;
  margin: auto;
  color: var(--paper);
  border: 1px solid #cba96ba1;
  background: #162235;
  border-radius: 8px;
  box-shadow: 0 25px 65px #0009;
  padding: 0;
}

dialog::backdrop {
  background: #060b14c8;
  backdrop-filter: blur(5px);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #1b2b42;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 4;
}

.dialog-head h2 {
  font-size: 22px;
}

.dialog-body {
  padding: 16px 18px 21px;
}

dialog.technique-reward {
  width: min(350px,calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 22px clamp(16px,4vw,25px) 20px;
  border-color: #64758d;
  background: #182336;
}

.technique-reward h2 {
  color: #c6d4e7;
  font-size: 16px;
  line-height: 1.55;
}

.technique-reward-list {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  border-block: 1px solid #90a5bf42;
}

.technique-reward-list li {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: baseline;
  gap: 3px 12px;
  padding: 10px 0;
  font-size: 18px;
  font-weight: 750;
}

.technique-reward-list li + li {
  border-top: 1px solid #90a5bf42;
}

.technique-reward-uses {
  color: #c6d4e7;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.technique-reward-info {
  grid-column: 1/-1;
  color: #c6d4e7;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
}

.technique-reward-close {
  min-width: 93px;
  min-height: 36px;
  padding: 4px 14px;
  border: 1px solid #62738b;
  border-radius: 4px;
  background: #29384c;
  color: #e8eef6;
  font-size: 14px;
}

.technique-reward-close:hover {
  background: #354962;
  border-color: #94aac7;
}

.technique-reward-close:focus-visible {
  outline: 1px solid #a7bedc;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  dialog.technique-reward[open] {
    animation: practice-reveal .18s ease-out;
  }
}

.memory-collection {
  padding: 10px 12px 12px;
  margin-bottom: 14px;
  background: #111a28;
  border: 1px solid #a08d6c52;
  border-radius: 6px;
}

.memory-collection-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding-bottom: 8px;
}

.memory-collection-heading h3 { font-size: 16px; color: #f0dec0; }
.memory-collection-heading p { font-size: 12px; color: #d2bfa0; font-variant-numeric: tabular-nums; }
.memory-collection-heading strong { font-size: 15px; color: #f5dfb9; }

.memory-slot-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.memory-slot-grid li {
  aspect-ratio: 16 / 9;
  border: 1px solid #ab967b67;
  border-radius: 3px;
  background: #192335;
}

.memory-slot-grid button {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 2px;
}

.memory-slot-grid img { width: 100%; height: 100%; object-fit: cover; }
.memory-slot-grid li:has(button:hover) { border-color: var(--gold); }

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

.album-button {
  padding: 0;
  border: 1px solid #cebe944f;
  border-radius: 5px;
  overflow: hidden;
  background: #101b2c;
  font-size: 12px;
  text-align: left;
}

.album-button:hover {
  border-color: #f2d290;
}

.album-button img {
  aspect-ratio: 16/9;
  object-fit: cover;
}

.album-button span {
  display: block;
  padding: 6px 8px;
}

.album-large {
  max-height: calc(100dvh - 162px);
  object-fit: contain;
  border-radius: 4px;
}

dialog.art-viewer {
  width: min(1410px,calc(100% - 28px));
  max-height: calc(100dvh - 30px);
}

.history {
  list-style: none;
  margin: 0;
  padding: 0;
}

.history li {
  margin-bottom: 8px;
  border-bottom: 1px solid #dfe5f921;
  padding-bottom: 7px;
  font-size: 14px;
  white-space: pre-line;
}

.history strong {
  font-size: 12px;
  color: var(--gold);
  display: block;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 16px;
}

.cycle-start-actions {
  flex-wrap: wrap;
  margin-top: 0;
}

@keyframes slash {
  0% {
    opacity: 0;
    transform: rotate(-23deg) scaleX(.35);
  }
  25% {
    opacity: 1;
    transform: rotate(-23deg) scaleX(1);
  }
  100% {
    opacity: 0;
    transform: rotate(-23deg) scaleX(1.07);
  }
}

@keyframes aura {
  0% {
    opacity: 0;
    transform: scale(.45);
  }
  30% {
    opacity: .94;
  }
  100% {
    opacity: 0;
    transform: scale(1.20);
  }
}

@keyframes damage {
  0% {
    opacity: 0;
    transform: translateY(5px);
  }
  21% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-38px);
  }
}

@media(max-width:960px) {
  .title-inner {
    width: calc(100% - 66px);
  }
  .frame {
    width: calc(100% - 32px);
  }
  .hub {
    grid-template-columns: minmax(0,1.52fr) minmax(245px,1fr);
    gap: 12px;
  }
  .training-board {
    padding: 15px;
  }
  .exercise {
    min-height: 92px;
  }
  .exercise strong {
    font-size: 15px;
  }
  .scene-page {
    padding-inline: 16px;
  }
  .scene-art .shot[src="art/invasion-street.webp"] {
    object-position: left 46%;
  }
  .battle {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
  }
  .enemy-top {
    grid-template-columns: minmax(0,1fr) max-content;
  }
}

@media(min-width:681px) and (max-height:740px) {
  .hub {
    padding-block: 14px 18px;
  }
  .training-board {
    padding-block: 14px 16px;
  }
  .training-board h1 {
    font-size: clamp(27px,3.2vw,42px);
    margin: 4px 0 7px;
  }
  .training-board .intro {
    margin-bottom: 11px;
  }
  .exercise-grid {
    gap: 6px;
  }
  .exercise {
    min-height: 64px;
    padding: 6px 8px;
    gap: 6px;
  }
  .exercise strong {
    font-size: 15px;
  }
  .exercise p {
    margin-block: 2px;
  }
  .week-report {
    margin-top: 9px;
    padding-block: 5px;
    gap: 5px;
  }
  .week-deltas { gap: 5px 6px; }
  .week-deltas li { padding: 3px 6px; }
  .hub-actions {
    margin-top: 10px;
  }
  .hub-actions .primary,.hub-actions .secondary {
    min-height: 40px;
    padding-block: 6px;
  }
  .battle {
    padding-block: 12px 14px;
  }
  .enemy-stage {
    height: clamp(390px,calc(100dvh - 81px),660px);
  }
  .commands-panel {
    padding: 12px 13px 14px;
  }
  .battle-hikari h2 {
    font-size: clamp(20px,2.4vw,22px);
    margin-bottom: 4px;
  }
  .battle-hikari {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    column-gap: 8px;
  }
  .battle-hikari .eyebrow,.battle-hikari .meter {
    grid-column: 1/-1;
  }
  .intent {
    display: grid;
    grid-template-columns: auto minmax(0,1fr);
    align-items: baseline;
    gap: 2px 7px;
    margin-block: 9px 8px;
    padding: 6px 9px;
  }
  .intent p {
    grid-column: 1/-1;
  }
  .command-list {
    gap: 4px;
  }
  .combat-command {
    min-height: 42px;
    gap: 2px 7px;
    padding: 4px 8px;
  }
  .combat-command small {
    grid-column: 1/-1;
  }
  .combat-log {
    margin-top: 8px;
  }
  .end {
    padding-block: 16px;
  }
  .end-copy {
    padding-block: 18px;
  }
  .end-copy h1 {
    margin-bottom: 8px;
  }
  .end-copy .list {
    margin-block: 9px;
  }
  .end-copy .list li {
    min-height: 39px;
  }
  .end-actions {
    margin-top: 12px;
  }
}

@media(max-width:680px) {
  #chrome {
    padding-inline: 10px;
  }
  .wordmark {
    font-size: 11px;
  }
  .quiet-button {
    padding-inline: 7px;
    font-size: 12px;
  }
  .chrome-actions {
    gap: 4px;
  }
  .title-inner {
    width: calc(100% - 34px);
  }
  .title-background img,
  .title-front img {
    object-position: 60% center;
  }
  .title-screen::before {
    background: linear-gradient(90deg,#071221e6,#0a172788 65%,transparent),linear-gradient(0deg,#080e1aec,transparent 45%);
  }
  .title-brand h1 {
    font-size: clamp(30px,9.3vw,60px);
  }
  .hub,.battle,.end {
    grid-template-columns: 1fr;
  }
  .scene-page {
    padding: 13px 10px;
  }
  .dialogue {
    --dialogue-line-height: 35px;
    --dialogue-name-height: 25px;
    --dialogue-line-padding: 6px;
    height: 172px;
    border-radius: 17px;
  }
  .choice-list {
    grid-template-columns: 1fr;
  }
  .line {
    font-size: 18px;
  }
  .battle .enemy-stage {
    height: clamp(310px,56dvh,450px);
  }
  .end-art {
    min-height: 200px;
  }
  .album-grid {
    grid-template-columns: 1fr 1fr;
  }
  .title-footer {
    gap: 8px;
  }
  .title-studio {
    letter-spacing: .08em;
  }
}

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

.opening {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  cursor: none;
  transition: opacity .55s ease;
}

.opening video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.opening-petals {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.opening-skip {
  position: absolute;
  pointer-events: none;
  right: 24px;
  bottom: 18px;
  font-size: 13px;
  letter-spacing: .12em;
  color: #fff1dacc;
  text-shadow: 0 1px 6px #000;
  opacity: 0;
  animation: opening-hint 1s ease 1.5s forwards;
}

.opening-out {
  opacity: 0;
}

@keyframes opening-hint {
  to { opacity: .7; }
}
