/* Home */
.home-screen {
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(8, 10, 16, 0.99) 0%, rgba(12, 14, 23, 0.92) 39%, rgba(13, 15, 24, 0.22) 74%),
    radial-gradient(circle at 77% 34%, rgba(181, 37, 55, 0.22), transparent 28%),
    linear-gradient(135deg, #111522 0%, #1c1c29 55%, #090b12 100%);
}

.home-scenery {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0.74;
}

.home-scenery::before,
.home-scenery::after {
  content: "";
  position: absolute;
  right: -4vw;
  bottom: -16vh;
  width: 72vw;
  height: 45vh;
  border-radius: 50% 50% 0 0;
  background: #07090e;
  transform: rotate(-5deg);
}

.home-scenery::after {
  right: 23vw;
  bottom: -28vh;
  width: 66vw;
  height: 56vh;
  background: #0c0f17;
  transform: rotate(8deg);
}

.sun-disc {
  position: absolute;
  top: 9%;
  right: 12%;
  width: min(27vw, 390px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 222, 166, 0.25);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 219, 163, 0.14), rgba(181, 37, 55, 0.08) 46%, transparent 70%);
  box-shadow: 0 0 100px rgba(181, 37, 55, 0.13);
}

.torii {
  position: absolute;
  right: 5%;
  bottom: 6%;
  width: 46vw;
  height: 72vh;
  opacity: 0.19;
  filter: drop-shadow(0 0 20px rgba(181, 37, 55, 0.3));
}

.torii i {
  position: absolute;
  display: block;
  background: var(--crimson);
}

.torii-top {
  top: 4%;
  left: 0;
  width: 100%;
  height: 5.5%;
  transform: perspective(250px) rotateX(-12deg);
}

.torii-cross {
  top: 12%;
  left: 8%;
  width: 84%;
  height: 6%;
}

.torii-left,
.torii-right {
  top: 9%;
  width: 7%;
  height: 91%;
}

.torii-left {
  left: 16%;
  transform: skewX(-3deg);
}

.torii-right {
  right: 16%;
  transform: skewX(3deg);
}

.mist {
  position: absolute;
  left: 42%;
  width: 70%;
  height: 13%;
  border-radius: 50%;
  background: rgba(205, 215, 223, 0.05);
  filter: blur(26px);
}

.mist-one {
  bottom: 18%;
}

.mist-two {
  bottom: 5%;
  transform: translateX(10%);
}

.home-copy {
  position: relative;
  z-index: 12;
  width: min(47vw, 660px);
  margin: clamp(34px, 7vh, 82px) 0 0 clamp(28px, 7vw, 118px);
}

.home-copy h1 {
  position: relative;
  margin: 10px 0 14px;
  font-family: var(--display);
  font-weight: 500;
  line-height: 0.9;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.home-copy h1 span {
  display: block;
  color: #fff7e9;
  font-size: clamp(58px, 7vw, 108px);
  letter-spacing: 0.14em;
}

.home-copy h1 em {
  display: block;
  margin: -2px 0 0 1.8em;
  color: var(--gold);
  font-size: clamp(24px, 3vw, 46px);
  font-style: normal;
  letter-spacing: 0.32em;
}

.home-lead {
  width: min(100%, 580px);
  padding-left: 16px;
  border-left: 2px solid var(--crimson);
  color: var(--paper-dim);
  font: 400 clamp(12px, 1.05vw, 15px)/1.8 var(--serif);
  letter-spacing: 0.08em;
}

.main-menu {
  display: grid;
  gap: 7px;
  width: min(100%, 510px);
  margin-top: clamp(24px, 4vh, 42px);
}

.menu-command {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr 22px;
  align-items: center;
  min-height: 60px;
  padding: 8px 15px;
  overflow: hidden;
  border: 1px solid rgba(216, 182, 106, 0.15);
  background: linear-gradient(90deg, rgba(24, 27, 40, 0.94), rgba(21, 24, 35, 0.58));
  text-align: left;
  cursor: pointer;
  transition: 180ms ease;
}

.menu-command::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--crimson);
  transform: scaleY(0);
  transition: 180ms ease;
}

.menu-command:hover,
.menu-command:focus-visible {
  border-color: rgba(216, 182, 106, 0.56);
  background: linear-gradient(90deg, rgba(75, 25, 35, 0.92), rgba(25, 27, 39, 0.64));
  transform: translateX(7px);
}

.menu-command:hover::before {
  transform: scaleY(1);
}

.menu-command.primary {
  border-color: rgba(216, 182, 106, 0.42);
}

.command-index {
  color: var(--gold);
  font: 500 12px/1 var(--serif);
}

.menu-command > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-command b {
  font: 500 16px/1.25 var(--serif);
  letter-spacing: 0.13em;
}

.menu-command small {
  color: var(--paper-dim);
  font-size: 8px;
  letter-spacing: 0.2em;
}

.menu-command > i {
  color: var(--gold);
  font: 300 28px/1 var(--serif);
}

.home-record {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  color: var(--paper-dim);
}

.home-record span {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.home-record small {
  font-size: 9px;
  letter-spacing: 0.12em;
}

.home-record b {
  color: var(--paper);
  font: 500 15px/1 var(--serif);
}

.home-record > i {
  width: 1px;
  height: 14px;
  background: var(--line);
}

.home-character {
  position: absolute;
  z-index: 8;
  right: clamp(10px, 3vw, 60px);
  bottom: clamp(15px, 3vh, 40px);
  width: min(48vw, 720px);
  height: 88%;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.home-character img {
  position: relative;
  z-index: 2;
  width: auto;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(-18px 22px 30px rgba(0, 0, 0, 0.56));
}

.character-halo {
  position: absolute;
  z-index: 1;
  top: 17%;
  left: 28%;
  width: 48%;
  aspect-ratio: 1;
  border: 1px solid rgba(216, 182, 106, 0.22);
  border-radius: 50%;
  box-shadow: 0 0 70px rgba(181, 37, 55, 0.14), inset 0 0 70px rgba(181, 37, 55, 0.08);
}

.character-seal {
  position: absolute;
  z-index: 3;
  right: 15%;
  top: 21%;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 2px solid rgba(255, 240, 213, 0.82);
  background: rgba(181, 37, 55, 0.84);
  color: #fff6e7;
  font: 600 13px/1.35 var(--serif);
  text-align: center;
  transform: rotate(8deg);
}

.home-dialogue {
  position: absolute;
  z-index: 14;
  right: 4.5%;
  bottom: 4%;
  width: min(34vw, 460px);
  padding: 15px 20px 16px 62px;
  border: 1px solid rgba(216, 182, 106, 0.42);
  background: rgba(11, 13, 20, 0.84);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
}

.home-dialogue span {
  position: absolute;
  left: -12px;
  top: -14px;
  padding: 7px 16px;
  background: var(--crimson);
  font: 600 13px/1 var(--serif);
  letter-spacing: 0.2em;
}

.home-dialogue p {
  color: var(--paper-soft);
  font: 400 13px/1.7 var(--serif);
  letter-spacing: 0.05em;
}

.reset-button {
  font-size: 11px;
  opacity: 0.7;
}

/* Stage select */
.stage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 1260px;
  margin: 0 auto;
}

.stage-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: min(48vh, 430px);
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(20, 23, 34, 0.58), rgba(8, 10, 16, 0.94)),
    radial-gradient(circle at 50% 24%, rgba(181, 37, 55, 0.16), transparent 34%);
  text-align: left;
  cursor: pointer;
  transition: 220ms ease;
}

.stage-card::before {
  content: attr(data-kanji);
  position: absolute;
  right: -10px;
  top: 30px;
  color: rgba(255, 255, 255, 0.035);
  font: 700 130px/1 var(--serif);
}

.stage-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: var(--crimson);
  transform: scaleX(0);
  transform-origin: left;
  transition: 220ms ease;
}

.stage-card:not(:disabled):hover {
  border-color: var(--gold);
  background:
    linear-gradient(180deg, rgba(49, 31, 38, 0.72), rgba(8, 10, 16, 0.94)),
    radial-gradient(circle at 50% 24%, rgba(181, 37, 55, 0.26), transparent 38%);
  transform: translateY(-7px);
}

.stage-card:not(:disabled):hover::after {
  transform: scaleX(1);
}

.stage-card:disabled {
  cursor: not-allowed;
  filter: grayscale(0.75);
  opacity: 0.52;
}

.stage-card.is-cleared .stage-status {
  color: var(--gold-bright);
}

.stage-card.is-final {
  background:
    linear-gradient(180deg, rgba(28, 31, 46, 0.66), rgba(8, 10, 16, 0.96)),
    radial-gradient(circle at 50% 24%, rgba(47, 127, 197, 0.2), transparent 38%);
}

.stage-chapter {
  color: var(--gold);
  font: 600 10px/1 var(--sans);
  letter-spacing: 0.24em;
}

.stage-card h3 {
  position: relative;
  margin: 28px 0 10px;
  font: 500 23px/1.35 var(--serif);
  letter-spacing: 0.1em;
}

.stage-card p {
  position: relative;
  min-height: 48px;
  color: var(--paper-dim);
  font: 400 12px/1.75 var(--serif);
}

.stage-rule {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: auto;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stage-rule span {
  color: var(--paper-dim);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.stage-rule b {
  font: 500 18px/1 var(--serif);
}

.stage-status {
  margin-top: 16px;
  color: var(--paper-soft);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.stage-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 3vw, 40px);
  max-width: 900px;
  margin: 28px auto 0;
  color: var(--paper-dim);
  font-size: 10px;
  letter-spacing: 0.13em;
}

.stage-tip b {
  color: var(--gold);
}

/* Shop */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.shop-card {
  position: relative;
  display: grid;
  grid-template-columns: 122px 1fr;
  gap: 22px;
  min-height: 224px;
  padding: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(29, 33, 48, 0.86), rgba(10, 12, 19, 0.92));
}

.shop-card::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.035);
  pointer-events: none;
}

.item-orb {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  margin: auto;
  border: 1px solid var(--line);
  transform: rotate(45deg);
}

.item-orb i {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50% 50% 47% 53%;
  font: 700 35px/1 var(--serif);
  transform: rotate(-45deg);
}

.item-orb.crimson i {
  background: radial-gradient(circle at 38% 30%, #ff8993, #a51629 54%, #3c0710);
  box-shadow: 0 0 32px rgba(239, 83, 101, 0.34), inset 0 0 12px rgba(255, 255, 255, 0.28);
}

.item-orb.azure i {
  background: radial-gradient(circle at 38% 30%, #8de3ff, #236fb4 54%, #09264a);
  box-shadow: 0 0 32px rgba(105, 200, 238, 0.32), inset 0 0 12px rgba(255, 255, 255, 0.28);
}

.shop-info {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.shop-info small {
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.shop-info h3 {
  margin: 5px 0 9px;
  font: 500 23px/1.2 var(--serif);
  letter-spacing: 0.1em;
}

.shop-info p {
  color: var(--paper-dim);
  font-size: 12px;
  line-height: 1.7;
}

.shop-buy-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.shop-owned {
  color: var(--paper-dim);
  font-size: 10px;
}

.shop-owned b {
  display: block;
  margin-top: 3px;
  color: var(--paper);
  font: 500 19px/1 var(--serif);
}

.shop-buy {
  min-height: 42px;
  padding: 0 18px;
}

.shopkeeper-note {
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: 790px;
  margin: 32px auto 0;
  color: var(--paper-dim);
  font: 400 12px/1.8 var(--serif);
}

.note-seal {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border: 2px solid rgba(255, 239, 213, 0.74);
  background: var(--crimson-dark);
  color: var(--paper);
  text-align: center;
  transform: rotate(-5deg);
}

/* Growth */
.growth-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto;
}

.growth-card {
  position: relative;
  min-height: 270px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(29, 33, 48, 0.82), rgba(9, 11, 17, 0.9));
}

.growth-card::before {
  content: attr(data-glyph);
  position: absolute;
  right: -8px;
  top: -20px;
  color: rgba(255, 255, 255, 0.035);
  font: 700 150px/1 var(--serif);
}

.growth-card > small {
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.2em;
}

.growth-card h3 {
  margin: 7px 0 18px;
  font: 500 25px/1 var(--serif);
  letter-spacing: 0.12em;
}

.stat-value {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-value b {
  font: 500 48px/1 var(--serif);
}

.stat-value span {
  color: var(--paper-dim);
  font-size: 10px;
}

.growth-card p {
  min-height: 48px;
  margin: 14px 0 22px;
  color: var(--paper-dim);
  font-size: 12px;
  line-height: 1.75;
}

.growth-card button {
  width: 100%;
}

.level-progress-card {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 18px;
  max-width: 850px;
  margin: 30px auto 0;
  padding: 18px 24px;
  border: 1px solid var(--line);
  background: rgba(8, 10, 16, 0.66);
}

.sub-tab-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  max-width: 420px;
  margin: 0 auto 24px;
}

.sub-tab-btn {
  flex: 1;
  padding: 10px 18px;
  border: 1px solid var(--line);
  background: rgba(16, 19, 29, 0.85);
  color: var(--paper-dim);
  font: 500 14px/1 var(--serif);
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: 160ms ease;
}

.sub-tab-btn:hover {
  border-color: var(--gold);
  color: var(--paper);
}

.sub-tab-btn.is-active {
  border-color: var(--gold-bright);
  background: linear-gradient(90deg, rgba(181, 37, 55, 0.92), rgba(123, 9, 25, 0.85));
  color: #fff;
  box-shadow: 0 0 16px rgba(181, 37, 55, 0.35);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto;
}

.skills-grid[hidden] {
  display: none !important;
}

/* Gallery */
.gallery-container {
  max-width: 960px;
  margin: 0 auto;
}

.gallery-stage {
  display: grid;
  grid-template-columns: minmax(280px, 440px) 1fr;
  gap: 32px;
  align-items: center;
  padding: 32px;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(20, 24, 36, 0.94), rgba(8, 10, 16, 0.96)),
    radial-gradient(circle at 30% 40%, rgba(181, 37, 55, 0.15), transparent 40%);
}

.gallery-art-frame {
  position: relative;
  width: 100%;
  height: min(54vh, 480px);
  overflow: hidden;
  border: 1px solid rgba(216, 182, 106, 0.35);
  background: radial-gradient(circle at 50% 35%, rgba(216, 182, 106, 0.08), rgba(6, 8, 13, 0.96));
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-art-frame img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.65));
  transition: filter 300ms ease, opacity 300ms ease;
}

.gallery-art-frame.is-locked img {
  filter: brightness(0) contrast(2) blur(1px);
  opacity: 0.94;
}

.gallery-lock-overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(5px);
  text-align: center;
  padding: 24px;
  gap: 10px;
}

.gallery-art-frame.is-locked .gallery-lock-overlay {
  display: flex;
}

.gallery-lock-icon {
  font-size: 42px;
}

.gallery-lock-overlay b {
  color: var(--crimson-bright);
  font: 500 20px/1 var(--serif);
  letter-spacing: 0.16em;
}

.gallery-lock-overlay small {
  color: var(--paper-dim);
  font: 400 12px/1.6 var(--serif);
  max-width: 240px;
}

.gallery-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.gallery-variant-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gallery-variant-btn {
  padding: 9px 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper-dim);
  font: 500 13px/1 var(--serif);
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: 160ms ease;
}

.gallery-variant-btn:hover {
  border-color: var(--gold);
  color: var(--paper);
}

.gallery-variant-btn.is-active {
  border-color: var(--gold-bright);
  background: var(--crimson);
  color: #fff;
  box-shadow: 0 0 14px rgba(181, 37, 55, 0.4);
}

.gallery-details h3 {
  font: 500 24px/1.2 var(--serif);
  color: var(--gold-bright);
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}

.gallery-details p {
  font: 400 13px/1.8 var(--serif);
  color: var(--paper-dim);
  letter-spacing: 0.06em;
}

.level-progress-card > div:first-child {
  display: flex;
  flex-direction: column;
}

.level-progress-card span {
  color: var(--paper-dim);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.level-progress-card b {
  font: 500 21px/1.4 var(--serif);
}

/* Guide */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 1260px;
  margin: 0 auto;
}

.guide-card {
  position: relative;
  min-height: 350px;
  padding: 52px 24px 24px;
  border: 1px solid var(--line);
  background: rgba(15, 18, 28, 0.82);
}

.guide-number {
  position: absolute;
  left: 22px;
  top: -14px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--gold);
  background: var(--crimson-dark);
  font: 500 21px/1 var(--serif);
  transform: rotate(45deg);
}

.guide-number::first-letter {
  transform: rotate(-45deg);
}

.guide-card h3 {
  margin: 12px 0 14px;
  font: 500 22px/1.2 var(--serif);
  letter-spacing: 0.12em;
}

.guide-card p {
  min-height: 105px;
  color: var(--paper-dim);
  font-size: 12px;
  line-height: 1.8;
}

.guide-hands {
  display: flex;
  justify-content: space-around;
  margin-top: 26px;
  font-size: 29px;
}

.guide-hands i {
  font-style: normal;
  filter: grayscale(0.2);
}

.guide-skill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  color: var(--azure-bright);
  font-size: 25px;
}

.guide-skill b {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--azure-bright);
  transform: rotate(45deg);
}

.guide-skill small {
  color: var(--paper-dim);
  font-size: 9px;
}

.guide-arrows {
  margin-top: 11px;
  color: var(--gold-bright);
  font: 500 25px/1.3 var(--serif);
  letter-spacing: 0.2em;
  text-align: center;
}

.guide-reward {
  margin-top: 30px;
  color: var(--gold-bright);
  font: 500 17px/1 var(--serif);
  text-align: center;
}

/* Battle */
.battle-screen {
  overflow: hidden;
}

.battle-arena {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #11151f;
}

.battle-backdrop {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(16, 20, 33, 0.12), rgba(6, 8, 13, 0.82)),
    radial-gradient(circle at 68% 24%, rgba(222, 188, 130, 0.12), transparent 29%),
    linear-gradient(135deg, #1e2637 0%, #1b1c29 42%, #141019 100%);
}

.battle-backdrop::before {
  content: "";
  position: absolute;
  inset: auto -5% -20% 20%;
  height: 65%;
  background: #0b0d14;
  clip-path: polygon(0 45%, 13% 23%, 23% 39%, 33% 8%, 45% 39%, 58% 18%, 72% 42%, 82% 27%, 100% 52%, 100% 100%, 0 100%);
  opacity: 0.8;
}

.battle-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 11.8%, rgba(255, 255, 255, 0.012) 12%),
    linear-gradient(90deg, rgba(7, 9, 14, 0.84), transparent 36%, transparent 72%, rgba(7, 9, 14, 0.34));
}

.battle-moon {
  position: absolute;
  top: 10%;
  right: 16%;
  width: min(25vw, 330px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 237, 200, 0.2), rgba(216, 182, 106, 0.07) 52%, transparent 70%);
  box-shadow: 0 0 80px rgba(216, 182, 106, 0.08);
}

.distant-shrine {
  position: absolute;
  right: 9%;
  bottom: 14%;
  width: 35%;
  height: 45%;
  opacity: 0.2;
  background:
    linear-gradient(90deg, transparent 16%, var(--crimson-dark) 16% 21%, transparent 21% 79%, var(--crimson-dark) 79% 84%, transparent 84%),
    linear-gradient(180deg, transparent 14%, var(--crimson-dark) 14% 20%, transparent 20% 29%, var(--crimson-dark) 29% 35%, transparent 35%);
}

.battle-mist {
  position: absolute;
  right: -8%;
  bottom: 5%;
  width: 76%;
  height: 18%;
  border-radius: 50%;
  background: rgba(214, 222, 232, 0.055);
  filter: blur(28px);
}

.chapter-tag {
  position: absolute;
  z-index: 14;
  left: 28px;
  top: 20px;
  display: flex;
  flex-direction: column;
  padding-left: 13px;
  border-left: 2px solid var(--crimson);
}

.chapter-tag small {
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.2em;
}

.chapter-tag b {
  margin-top: 4px;
  font: 500 15px/1 var(--serif);
  letter-spacing: 0.12em;
}

.battle-exit {
  position: absolute;
  z-index: 40;
  right: 24px;
  top: 22px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(7, 9, 14, 0.5);
  color: var(--paper-dim);
  font-size: 10px;
  cursor: pointer;
}

.combatant-hud {
  position: absolute;
  z-index: 20;
}

.enemy-hud {
  top: 22px;
  left: 50%;
  width: min(56vw, 700px);
  transform: translateX(-50%);
}

.enemy-hud-single,
.enemy-hud-dual {
  width: 100%;
}

.dual-enemy-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dual-enemy-card {
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: rgba(10, 13, 20, 0.88);
  cursor: pointer;
  transition: 160ms ease;
  text-align: left;
}

.dual-enemy-card:hover {
  border-color: var(--gold);
}

.dual-enemy-card.is-selected {
  border-color: var(--crimson-bright);
  background: linear-gradient(135deg, rgba(80, 15, 26, 0.72), rgba(18, 22, 34, 0.88));
  box-shadow: 0 0 16px rgba(181, 37, 55, 0.45);
}

.dual-enemy-card.is-dead {
  opacity: 0.38;
  filter: grayscale(0.85);
  cursor: not-allowed;
}

.hud-name {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  margin-bottom: 7px;
}

.hud-name > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--gold);
  background: rgba(80, 15, 26, 0.82);
  font: 600 17px/1 var(--serif);
  transform: rotate(45deg);
}

.hud-name > span::first-letter {
  transform: rotate(-45deg);
}

.hud-name > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.hud-name small {
  color: var(--gold);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.hud-name b {
  font: 500 18px/1 var(--serif);
  letter-spacing: 0.18em;
}

.hud-name em {
  color: var(--paper-soft);
  font: normal 500 12px/1 var(--serif);
}

/* 畫面中央小樂獲勝巨型 Emoji 警告 */
.round-warning-emoji {
  position: absolute;
  z-index: 45;
  left: 50%;
  top: 40%;
  display: grid;
  place-items: center;
  font-size: clamp(80px, 14vw, 160px);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 35px rgba(239, 83, 101, 0.85)) drop-shadow(0 10px 20px rgba(0, 0, 0, 0.8));
  transition: transform 180ms cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 180ms ease;
}

.round-warning-emoji.is-active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  animation: warning-emoji-pulse 500ms ease-in-out infinite alternate;
}

.battle-character-wrap {
  position: absolute;
  z-index: 5;
  left: 54%;
  bottom: 50px;
  width: min(52vw, 760px);
  height: 90%;
  pointer-events: none;
  transform: translateX(-50%);
  transition: transform 240ms ease, opacity 240ms ease;
}

.battle-character-wrap.is-dual-stage {
  left: 50%;
  width: min(85vw, 1100px);
}

.character-single-slot {
  position: absolute;
  inset: 0;
}

.character-single-slot[hidden] {
  display: none !important;
}

.character-single-slot img {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(-10px 19px 27px rgba(0, 0, 0, 0.58));
}

.characters-dual-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}

.characters-dual-wrap[hidden] {
  display: none !important;
}

.character-dual-slot {
  position: relative;
  width: 48%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.character-dual-slot.is-left {
  transform: scaleX(-1);
}

.character-dual-slot img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(-10px 19px 27px rgba(0, 0, 0, 0.58));
  transition: opacity 200ms ease, filter 200ms ease;
  transform: none;
}

.character-dual-slot.is-right img {
  transform: none;
}

.character-dual-slot.is-dead img {
  opacity: 0.35;
  filter: grayscale(0.9) brightness(0.6);
}

.battle-character-aura {
  position: absolute;
  z-index: 1;
  left: 25%;
  top: 17%;
  width: 55%;
  aspect-ratio: 1;
  border: 1px solid rgba(216, 182, 106, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 90px rgba(181, 37, 55, 0.12);
}

.hand-selector-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.dual-hand-sub-column {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dual-hand-sub-column .hand-button {
  grid-template-columns: 30px 1fr 22px;
  padding: 3px 6px;
  min-height: 38px;
}

.dual-hand-sub-column .hand-button span {
  font-size: 12px;
}

.dual-hand-sub-column .hand-button i {
  font-size: 18px;
}

.damage-number {
  position: absolute;
  z-index: 4;
  left: 52%;
  top: 32%;
  color: #fff3db;
  font: 700 34px/1 var(--serif);
  text-shadow: 0 2px 0 var(--crimson-dark), 0 0 18px var(--crimson);
  opacity: 0;
}

.round-oracle {
  position: absolute;
  z-index: 28;
  left: 50%;
  top: clamp(80px, 14vh, 130px);
  width: min(88vw, 470px);
  padding: 16px 20px 20px;
  border: 1px solid rgba(216, 182, 106, 0.4);
  background: linear-gradient(135deg, rgba(11, 13, 21, 0.94), rgba(25, 28, 41, 0.88));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
  transform: translateX(-50%);
}

.round-label {
  display: block;
  margin-bottom: 11px;
  color: var(--paper-dim);
  font-size: 8px;
  letter-spacing: 0.26em;
}

.round-label b {
  color: var(--gold);
  font-size: 11px;
}

.hand-versus {
  display: grid;
  grid-template-columns: 1fr 44px 1fr;
  align-items: center;
  text-align: center;
}

.hand-versus > div {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0 10px;
}

.hand-versus > div[hidden],
.dual-hand-wrap[hidden] {
  display: none !important;
}

.hand-versus small {
  grid-column: 1 / -1;
  color: var(--paper-dim);
  font-size: 7px;
  letter-spacing: 0.17em;
}

.hand-versus strong {
  grid-row: 2 / 4;
  font-size: 35px;
  filter: drop-shadow(0 5px 6px rgba(0, 0, 0, 0.4));
}

.hand-versus b {
  text-align: left;
  font: 500 13px/1 var(--serif);
}

.hand-versus > span {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  margin: auto;
  border: 1px solid var(--gold);
  color: var(--gold);
  font: 500 15px/1 var(--serif);
  transform: rotate(45deg);
}

.round-countdown {
  position: absolute;
  right: -32px;
  top: 50%;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(9, 11, 17, 0.95);
  box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgba(0, 0, 0, 0.45);
  transform: translateY(-50%);
}

.round-countdown i {
  position: absolute;
  inset: 5px;
  border: 3px solid var(--crimson);
  border-right-color: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.round-countdown b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 500 24px/1 var(--serif);
}

.round-countdown small {
  position: absolute;
  left: 50%;
  bottom: -17px;
  width: 80px;
  color: var(--paper-dim);
  font-size: 7px;
  letter-spacing: 0.12em;
  text-align: center;
  transform: translateX(-50%);
}

/* 左側區域集合 */
.battle-left-cluster {
  position: absolute;
  z-index: 24;
  left: clamp(20px, 3.5vw, 54px);
  bottom: 140px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(32vw, 340px);
}

.player-hud {
  position: static;
  width: 100%;
}

.player-name > span {
  background: rgba(23, 64, 101, 0.82);
}

.resource-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
}

.resource-row > span {
  color: var(--azure-bright);
  font-size: 9px;
}

.resource-row em {
  color: var(--paper-soft);
  font: normal 500 10px/1 var(--serif);
}

.hand-selector {
  position: static;
  display: grid;
  width: 100%;
  gap: 6px;
}

.hand-selector-group {
  display: grid;
  gap: 6px;
  width: 100%;
}

.hand-selector-dual {
  display: flex;
  gap: 8px;
  width: 100%;
}

.hand-selector-dual[hidden],
.hand-selector-group[hidden] {
  display: none !important;
}

.dual-hand-sub-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.panel-kicker {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 3px;
  color: var(--gold);
  font-size: 8px;
  letter-spacing: 0.22em;
}

.panel-kicker small,
.quick-label small {
  color: var(--paper-dim);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.hand-button {
  display: grid;
  grid-template-columns: 45px 1fr 28px;
  align-items: center;
  min-height: 44px;
  padding: 4px 12px;
  border: 1px solid rgba(216, 182, 106, 0.13);
  background: linear-gradient(90deg, rgba(16, 19, 29, 0.88), rgba(16, 19, 29, 0.36));
  text-align: left;
  cursor: pointer;
  transition: 160ms ease;
}

.hand-button i {
  font-size: 24px;
  font-style: normal;
}

.hand-button span {
  font: 500 14px/1 var(--serif);
  letter-spacing: 0.14em;
}

.hand-button kbd {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border: 1px solid rgba(216, 182, 106, 0.45);
  border-radius: 3px;
  background: rgba(10, 12, 18, 0.9);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  color: var(--gold-bright);
  font: 700 10px/1 var(--sans);
}

.hand-button:hover,
.hand-button.is-selected {
  border-color: rgba(216, 182, 106, 0.68);
  background: linear-gradient(90deg, rgba(94, 24, 36, 0.94), rgba(21, 24, 35, 0.58));
  transform: translateX(5px);
}

.hand-button:disabled {
  cursor: default;
  opacity: 0.46;
}

.quick-slots {
  position: static;
}

.quick-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--paper-dim);
  font-size: 7px;
  letter-spacing: 0.18em;
}

.slot-grid {
  position: relative;
  display: grid;
  grid-template: repeat(3, 52px) / repeat(3, 52px);
}

.soul-slot {
  position: relative;
  z-index: 2;
  width: 48px;
  height: 48px;
  margin: 2px;
  border: 1px solid rgba(216, 182, 106, 0.45);
  background: rgba(10, 12, 18, 0.9);
  cursor: pointer;
  transform: rotate(45deg);
  transition: 160ms ease;
}

.soul-slot:hover:not(:disabled) {
  border-color: var(--gold-bright);
  background: rgba(67, 34, 39, 0.94);
  transform: rotate(45deg) scale(1.07);
}

.soul-slot:disabled {
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.38;
}

.slot-content {
  position: absolute;
  inset: -9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(-45deg);
}

.slot-kbd {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  min-width: 14px;
  height: 14px;
  padding: 0 2px;
  border: 1px solid rgba(216, 182, 106, 0.65);
  border-radius: 2px;
  background: rgba(10, 12, 19, 0.92);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  color: var(--gold-bright);
  font: 700 8px/1 var(--sans);
  text-transform: uppercase;
}

.slot-content i {
  font: normal 700 18px/1 var(--serif);
}

.slot-content small {
  margin-top: 2px;
  font-size: 7px;
}

.slot-content b {
  margin-top: 1px;
  color: var(--gold-bright);
  font-size: 8px;
}

.hp-slot {
  grid-area: 1 / 2;
}

.hp-slot i {
  color: var(--crimson-bright);
  text-shadow: 0 0 8px var(--crimson);
}

.morph-slot {
  grid-area: 2 / 3;
}

.morph-slot i {
  color: var(--azure-bright);
  text-shadow: 0 0 8px var(--azure);
}

.morph-slot.is-ready {
  border-color: var(--azure-bright);
  box-shadow: 0 0 22px rgba(105, 200, 238, 0.36);
  animation: skill-ready 600ms ease-in-out infinite alternate;
}

.mp-slot {
  grid-area: 3 / 2;
}

.mp-slot i {
  color: var(--azure-bright);
  text-shadow: 0 0 8px var(--azure);
}

.slot-core {
  grid-area: 2 / 2;
  display: grid;
  place-items: center;
  color: rgba(216, 182, 106, 0.2);
  font-size: 22px;
}

.avg-dialogue {
  position: absolute;
  z-index: 70;
  left: 50%;
  bottom: 16px;
  width: min(calc(100% - 48px), 1080px);
  min-height: 112px;
  padding: 31px 54px 24px 72px;
  border: 1px solid rgba(216, 182, 106, 0.53);
  background:
    linear-gradient(100deg, rgba(10, 12, 19, 0.97), rgba(24, 27, 39, 0.9)),
    var(--ink-900);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.53), inset 0 0 0 3px rgba(255, 255, 255, 0.025);
  transform: translateX(-50%);
}

.avg-dialogue::before,
.avg-dialogue::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--gold);
}

.avg-dialogue::before {
  left: 8px;
  top: 8px;
  border-left: 1px solid;
  border-top: 1px solid;
}

.avg-dialogue::after {
  right: 8px;
  bottom: 8px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.avg-dialogue > span {
  position: absolute;
  left: 38px;
  top: -15px;
  min-width: 120px;
  padding: 8px 20px;
  background: linear-gradient(90deg, var(--crimson), var(--crimson-dark));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  font: 600 13px/1 var(--serif);
  letter-spacing: 0.2em;
}

.avg-dialogue p {
  color: #f5ead8;
  font: 400 clamp(13px, 1.2vw, 16px)/1.75 var(--serif);
  letter-spacing: 0.07em;
}

.dialogue-next {
  position: absolute;
  right: 24px;
  bottom: 16px;
  color: var(--gold);
  font-size: 9px;
  animation: dialogue-caret 800ms ease-in-out infinite;
}

.qte-overlay {
  position: absolute;
  z-index: 70;
  inset: 0;
  display: grid;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 160ms ease;
}

.qte-overlay.is-active {
  visibility: visible;
  opacity: 1;
}

.qte-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(24, 27, 39, 0.54), rgba(4, 5, 8, 0.94)),
    rgba(5, 6, 9, 0.78);
  backdrop-filter: blur(5px);
}

.qte-panel {
  position: relative;
  z-index: 2;
  width: min(92vw, 720px);
  padding: 28px 32px 22px;
  border: 1px solid rgba(216, 182, 106, 0.62);
  background: rgba(12, 14, 22, 0.93);
  box-shadow: 0 0 80px rgba(181, 37, 55, 0.24);
  text-align: center;
}

.qte-panel h2 {
  margin: 5px 0 3px;
  font: 500 clamp(25px, 3vw, 39px)/1.2 var(--serif);
  letter-spacing: 0.15em;
}

.qte-panel > p:not(.eyebrow) {
  color: var(--paper-dim);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.qte-sequence {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 22px 0 16px;
}

.qte-arrow {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(48px, 7vw, 68px);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--paper);
  font-size: clamp(25px, 3.6vw, 38px);
  transition: 120ms ease;
}

.qte-arrow-key-hint {
  position: absolute;
  right: 2px;
  bottom: 2px;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  font-family: var(--sans);
  color: var(--gold-bright);
  background: rgba(0, 0, 0, 0.82);
  padding: 2px 4px;
  border-radius: 2px;
  border: 1px solid rgba(216, 182, 106, 0.5);
  letter-spacing: 0.04em;
  pointer-events: none;
}

.qte-arrow.is-current {
  border-color: var(--gold-bright);
  background: rgba(181, 37, 55, 0.28);
  box-shadow: 0 0 24px rgba(216, 182, 106, 0.2);
  transform: scale(1.08);
}

.qte-arrow.is-done {
  border-color: var(--green);
  background: rgba(97, 169, 133, 0.13);
  color: var(--green);
  transform: scale(0.88);
}

.qte-sequence.is-wrong {
  animation: qte-wrong 220ms ease;
}

.qte-input-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 28px;
  margin: -7px 0 11px;
  color: var(--paper-dim);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.qte-input-hint b {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(216, 182, 106, 0.42);
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper);
  font: 600 17px/1 var(--serif);
}

.qte-input-hint.is-chord {
  color: var(--gold-bright);
}

.qte-input-hint.is-chord b {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(216, 182, 106, 0.13);
}

.qte-input-hint i {
  color: var(--gold);
  font-style: normal;
}

.qte-timer {
  width: min(100%, 490px);
  height: 7px;
  margin: 0 auto 5px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.qte-timer i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--crimson), var(--gold-bright));
  transform-origin: left;
}

.qte-panel > b {
  color: var(--gold-bright);
  font: 500 15px/1 var(--serif);
}

.qte-pad {
  display: none;
  grid-template: repeat(3, 38px) / repeat(3, 38px);
  justify-content: center;
  gap: 4px;
  margin-top: 12px;
}

.qte-pad button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  font-size: 19px;
}

.dual-hand-wrap {
  display: flex;
  gap: 14px;
  align-items: center;
}

.dual-hand-side {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dual-hand-side small {
  color: var(--paper-dim);
  font-size: 7px;
  letter-spacing: 0.17em;
}

.dual-hand-side strong {
  font-size: 28px;
  filter: drop-shadow(0 5px 6px rgba(0, 0, 0, 0.4));
}

.dual-hand-side b {
  font: 500 11px/1 var(--serif);
}

.qte-pad button.is-held {
  border-color: var(--gold-bright);
  background: rgba(181, 37, 55, 0.42);
  box-shadow: 0 0 14px rgba(216, 182, 106, 0.28);
  transform: scale(0.92);
}

.qte-panel > small {
  display: block;
  margin-top: 13px;
  color: var(--paper-dim);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.qte-panel-dual {
  width: min(96vw, 920px);
  padding: 24px 28px 20px;
}

.dual-qte-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0 14px;
}

.dual-qte-slot {
  padding: 16px 14px 12px;
  border: 1px solid rgba(216, 182, 106, 0.35);
  background: rgba(8, 10, 16, 0.85);
  border-radius: 4px;
  transition: 160ms ease;
  position: relative;
}

.dual-qte-slot.is-completed {
  border-color: var(--green);
  background: rgba(97, 169, 133, 0.12);
}

.dual-qte-slot.is-failed {
  border-color: var(--crimson);
  background: rgba(181, 37, 55, 0.12);
  opacity: 0.65;
}

.slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.slot-badge {
  padding: 3px 8px;
  border-radius: 3px;
  font: 600 10px/1 var(--sans);
  letter-spacing: 0.06em;
}

.slot-badge.wasd-badge {
  background: rgba(105, 200, 238, 0.22);
  border: 1px solid var(--azure-bright);
  color: var(--azure-bright);
}

.slot-badge.arrow-badge {
  background: rgba(216, 182, 106, 0.22);
  border: 1px solid var(--gold-bright);
  color: var(--gold-bright);
}

.slot-target-name {
  font: 500 13px/1 var(--serif);
  color: var(--paper);
}

.slot-status-indicator {
  font-size: 10px;
  color: var(--paper-dim);
}

.dual-qte-touch-controls {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}

.dual-touch-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dual-touch-col small {
  color: var(--gold);
  font-size: 10px;
  margin-bottom: 6px;
}

.is-dual-touch-pad {
  display: grid !important;
}

.dual-qte-footer-hint {
  display: block;
  margin-top: 10px;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.08em;
}


.result-overlay {
  position: absolute;
  z-index: 65;
  inset: 0;
  display: grid;
  align-items: center;
  visibility: hidden;
  padding-left: clamp(24px, 7vw, 110px);
  background: transparent;
  pointer-events: none;
  opacity: 0;
  transition: opacity 350ms ease, visibility 350ms ease;
}

.result-overlay.is-active {
  visibility: visible;
  opacity: 1;
}

.result-card {
  position: relative;
  z-index: 3;
  width: min(48vw, 600px);
  padding: 34px;
  border-left: 3px solid var(--crimson);
  background: linear-gradient(90deg, rgba(13, 15, 24, 0.96), rgba(19, 22, 33, 0.82));
  box-shadow: 22px 25px 70px rgba(0, 0, 0, 0.43);
  pointer-events: auto;
}

/* 結算畫面過渡：隱藏對局中的 HUD，並確保小樂立繪鮮明呈現不被半透明遮罩遮蔽 */
.battle-arena.is-settlement .chapter-tag,
.battle-arena.is-settlement .battle-exit,
.battle-arena.is-settlement .combatant-hud,
.battle-arena.is-settlement .round-oracle,
.battle-arena.is-settlement .battle-left-cluster,
.battle-arena.is-settlement .auto-battle-hud-banner,
.battle-arena.is-settlement .frozen-hand-badge,
.battle-arena.is-settlement .round-warning-emoji,
.battle-arena:has(.result-overlay.is-active) .chapter-tag,
.battle-arena:has(.result-overlay.is-active) .battle-exit,
.battle-arena:has(.result-overlay.is-active) .combatant-hud,
.battle-arena:has(.result-overlay.is-active) .round-oracle,
.battle-arena:has(.result-overlay.is-active) .battle-left-cluster,
.battle-arena:has(.result-overlay.is-active) .auto-battle-hud-banner,
.battle-arena:has(.result-overlay.is-active) .frozen-hand-badge,
.battle-arena:has(.result-overlay.is-active) .round-warning-emoji {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 240ms ease, visibility 240ms ease;
}

.battle-arena.is-settlement .battle-character-wrap,
.battle-arena:has(.result-overlay.is-active) .battle-character-wrap {
  z-index: 50;
  opacity: 1 !important;
}

.battle-arena.is-settlement .battle-character-wrap::after,
.battle-arena:has(.result-overlay.is-active) .battle-character-wrap::after {
  display: none !important;
}

.result-card h2 {
  margin: 8px 0 12px;
  font: 500 clamp(35px, 5vw, 66px)/1 var(--serif);
  letter-spacing: 0.15em;
}

.result-card > p:not(.eyebrow) {
  color: var(--paper-dim);
  font: 400 13px/1.75 var(--serif);
}

.reward-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 24px 0;
  background: var(--line);
  border: 1px solid var(--line);
}

.reward-row span {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  background: var(--ink-900);
}

.reward-row small {
  color: var(--paper-dim);
  font-size: 8px;
  letter-spacing: 0.13em;
}

.reward-row b {
  margin-top: 4px;
  color: var(--gold-bright);
  font: 500 20px/1 var(--serif);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.watermelon-game {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid rgba(97, 169, 133, 0.6);
  background: linear-gradient(135deg, rgba(30, 78, 55, 0.3), rgba(8, 12, 15, 0.66));
}

.watermelon-game[hidden] {
  display: none;
}

.watermelon-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--gold-bright);
  font: 500 13px/1 var(--serif);
  letter-spacing: 0.1em;
}

.watermelon-game > p {
  color: var(--paper-soft);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-align: center;
}

.timing-track {
  position: relative;
  height: 36px;
  margin-bottom: 4px;
  overflow: hidden;
  border: 1px solid rgba(216, 182, 106, 0.5);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.08) 0 1px, transparent 1px 10%),
    rgba(0, 0, 0, 0.58);
}

.timing-track i {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 50%;
  width: 26%;
  border: 1px solid rgba(162, 238, 171, 0.86);
  background: rgba(97, 169, 133, 0.63);
  box-shadow: 0 0 20px rgba(97, 169, 133, 0.54), inset 0 0 13px rgba(202, 255, 209, 0.24);
  transform: translateX(-50%);
}

.timing-track b {
  position: absolute;
  z-index: 2;
  top: -4px;
  bottom: -4px;
  left: 0;
  width: 5px;
  border-radius: 4px;
  background: #fffdf2;
  box-shadow: 0 0 15px #fff, 0 0 6px var(--gold);
  transform: translateX(-50%);
  will-change: left;
}

.watermelon-game .button-primary {
  width: 100%;
}

.watermelon-game kbd {
  margin-left: 9px;
}

.watermelon-status {
  margin-top: 14px;
  padding: 11px 14px;
  border-left: 2px solid var(--green);
  background: rgba(97, 169, 133, 0.1);
  color: var(--paper-soft);
  font: 400 12px/1.6 var(--serif);
  letter-spacing: 0.06em;
}

/* Home Admin Actions & Footer */
.home-admin-actions {
  position: absolute;
  z-index: 30;
  left: 24px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: fit-content;
  max-width: fit-content;
  gap: 4px;
}

.reset-button {
  display: inline-block;
  width: fit-content;
  font-size: 11px;
  opacity: 0.6;
  padding: 0;
  cursor: pointer;
  border-bottom: 1px solid currentColor;
  transition: opacity 160ms ease, color 160ms ease;
}

.reset-button:hover {
  opacity: 1;
  color: var(--paper-soft);
}

.home-footer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  width: fit-content;
}

.footer-plain-link {
  display: inline-block;
  width: fit-content;
  color: var(--paper-dim);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  opacity: 0.55;
  transition: all 160ms ease;
}

.footer-plain-link:hover {
  color: var(--paper-soft);
  border-bottom-color: currentColor;
  opacity: 0.95;
}

.footer-plain-sep {
  color: var(--paper-dim);
  font-size: 9px;
  opacity: 0.3;
  user-select: none;
}

.cheat-button {
  color: var(--gold);
  border-color: rgba(216, 182, 106, 0.3);
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 6px 14px;
  background: rgba(216, 182, 106, 0.05);
  transition: all 0.2s ease;
}

.cheat-button:hover {
  background: rgba(216, 182, 106, 0.15);
  border-color: var(--gold);
  color: var(--gold-bright);
}

/* Cheat Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(8, 7, 12, 0.82);
  backdrop-filter: blur(8px);
  display: grid;
  place-content: center;
  padding: 20px;
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal-card {
  background: var(--bg-card, #17131b);
  border: 1px solid var(--line-bright, #d8b66a);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(216, 182, 106, 0.15);
  width: min(92vw, 620px);
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 4px;
  color: var(--paper);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
}

.modal-header h3 {
  margin: 0;
  font: 600 16px var(--serif);
  color: var(--gold-bright);
  letter-spacing: 0.08em;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--paper-dim);
  font-size: 22px;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--paper);
}

.cheat-content {
  padding: 20px;
}

.cheat-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.cheat-quick-btn {
  padding: 10px 12px;
  font-size: 12px;
  white-space: nowrap;
}

.cheat-quick-actions > .cheat-quick-btn:last-child {
  grid-column: span 2;
}

.cheat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.cheat-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cheat-field span {
  font-size: 11px;
  color: var(--paper-dim);
  letter-spacing: 0.05em;
}

.cheat-field input {
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  color: var(--paper);
  font-family: inherit;
  font-size: 14px;
  border-radius: 2px;
}

.cheat-field input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(0, 0, 0, 0.6);
}

.cheat-actions {
  grid-column: span 2;
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.cheat-actions button {
  width: 100%;
}

/* Equipment Screen Layout */
.page-backdrop-equipment {
  background:
    radial-gradient(ellipse at 80% 20%, rgba(138, 43, 226, 0.12), transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(216, 182, 106, 0.1), transparent 60%);
}

.equipment-layout {
  display: grid;
  grid-template-columns: minmax(320px, 440px) 1fr;
  gap: 24px;
  margin-top: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .equipment-layout {
    grid-template-columns: 1fr;
  }
}

.paperdoll-card {
  background: rgba(18, 15, 23, 0.7);
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: 4px;
  position: relative;
}

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

.paperdoll-title {
  font: 600 15px var(--serif);
  color: var(--gold);
  letter-spacing: 0.1em;
}

.paperdoll-stats-summary {
  display: flex;
  gap: 10px;
  font-size: 12px;
}

.paperdoll-stats-summary span {
  color: var(--paper-dim);
}

.paperdoll-stats-summary b {
  color: var(--gold-bright);
  margin-left: 3px;
}

.paperdoll-stage {
  position: relative;
  min-height: 480px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.paperdoll-silhouette {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  opacity: 0.28;
  pointer-events: none;
}

.paperdoll-silhouette img {
  max-height: 440px;
  object-fit: contain;
  filter: grayscale(0.6) brightness(0.7);
}

.paperdoll-slots-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 16px;
  width: 100%;
  max-width: 380px;
}

.equip-slot-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(12, 10, 16, 0.75);
  border: 1px solid rgba(216, 182, 106, 0.35);
  border-radius: 4px;
  padding: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 80px;
}

.equip-slot-btn:hover {
  background: rgba(216, 182, 106, 0.1);
  border-color: var(--gold-bright);
  transform: translateY(-2px);
}

.equip-slot-btn.is-two-handed-locked {
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(0.8);
}

.slot-tag {
  font-size: 10px;
  color: var(--paper-dim);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.slot-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1;
}

.slot-placeholder {
  font-size: 24px;
  opacity: 0.3;
}

.slot-item-icon {
  font-size: 22px;
  line-height: 1;
  margin-bottom: 4px;
}

.slot-item-name {
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Bag Card */
.bag-card {
  background: rgba(18, 15, 23, 0.7);
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: 4px;
}

.bag-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 8px;
}

.bag-header h3 {
  margin: 0;
  font: 600 15px var(--serif);
  color: var(--gold);
}

.bag-count-badge {
  font-size: 12px;
  color: var(--paper-dim);
}

.bag-hint {
  font-size: 11px;
  color: var(--paper-dim);
  margin-bottom: 14px;
}

.equipment-bag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  min-height: 260px;
}

.bag-item-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.bag-item-card:hover {
  border-color: var(--gold);
  background: rgba(216, 182, 106, 0.08);
  transform: translateY(-2px);
}

.bag-item-icon {
  font-size: 26px;
  line-height: 1;
}

.bag-item-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bag-item-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--paper);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bag-item-type {
  font-size: 10px;
  color: var(--paper-dim);
}

/* Rarity Colors */
.rarity-common {
  border-color: #7b7885 !important;
  color: #cfcbdb !important;
}
.rarity-rare {
  border-color: #3b82f6 !important;
  color: #93c5fd !important;
}
.rarity-epic {
  border-color: #a855f7 !important;
  color: #d8b4fe !important;
}
.rarity-legendary {
  border-color: #f59e0b !important;
  color: #fde68a !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

/* Tooltip floating card */
.equip-tooltip {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  background: #15111b;
  border: 1px solid var(--gold);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(216, 182, 106, 0.2);
  padding: 14px;
  border-radius: 4px;
  width: 250px;
  font-family: var(--serif);
  color: var(--paper);
}

.equip-tooltip[hidden] {
  display: none !important;
}

.tooltip-header {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.tooltip-icon {
  font-size: 22px;
}

.tooltip-title {
  font-size: 14px;
  font-weight: 700;
}

.tooltip-stats {
  font-size: 12px;
  margin-bottom: 8px;
  line-height: 1.5;
  color: var(--gold-bright);
}

.tooltip-effect {
  font-size: 11px;
  color: #86efac;
  background: rgba(134, 239, 172, 0.08);
  padding: 6px;
  border-left: 2px solid #86efac;
  margin-bottom: 8px;
}

.tooltip-desc {
  font-size: 11px;
  color: var(--paper-dim);
  line-height: 1.5;
}

/* Equipment Shop Cards */
.equipment-shop-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.shop-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.shop-section-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0 6px;
  border-bottom: 1px solid var(--line);
  margin-top: 10px;
}

.shop-section-heading span {
  font: 600 14px var(--serif);
  color: var(--gold-bright);
  letter-spacing: 0.1em;
}

.shop-equip-card {
  background: rgba(18, 15, 23, 0.7);
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 4px;
  display: flex;
  gap: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.shop-equip-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.shop-card-potion .item-orb {
  width: 54px;
  height: 54px;
  margin: 0;
}

.shop-card-potion .item-orb i {
  width: 36px;
  height: 36px;
  font-size: 18px;
}

.shop-equip-icon {
  font-size: 32px;
  display: grid;
  place-content: center;
  width: 54px;
  height: 54px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.shop-equip-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.shop-equip-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.shop-slot-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--gold);
  background: rgba(216, 182, 106, 0.12);
  border: 1px solid rgba(216, 182, 106, 0.25);
  border-radius: 2px;
  padding: 1px 5px;
  letter-spacing: 0.05em;
}

.shop-slot-badge.is-potion {
  color: var(--azure-bright);
  background: rgba(105, 200, 238, 0.12);
  border-color: rgba(105, 200, 238, 0.25);
}

.shop-equip-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--paper);
}

.shop-equip-stats {
  font-size: 11px;
  color: var(--gold-bright);
  margin-bottom: 4px;
}

.shop-equip-desc {
  font-size: 11px;
  color: var(--paper-dim);
  line-height: 1.4;
  margin-bottom: 10px;
}

.shop-equip-action {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.shop-status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: 0.05em;
}

.shop-status-badge.is-equipped {
  color: #86efac;
  background: rgba(134, 239, 172, 0.14);
  border: 1px solid rgba(134, 239, 172, 0.4);
}

.shop-status-badge.is-owned {
  color: var(--azure-bright);
  background: rgba(105, 200, 238, 0.12);
  border: 1px solid rgba(105, 200, 238, 0.3);
}

.button-primary.shop-btn-equip {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.8), rgba(21, 128, 61, 0.9));
  border: 1px solid #86efac;
  color: #fff;
}

.button-secondary.shop-btn-unequip {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

/* Shop Paperdoll Layout */
.shop-paperdoll-details {
  background: rgba(18, 15, 23, 0.6);
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 20px;
  overflow: hidden;
}

.shop-paperdoll-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(12, 10, 16, 0.85);
  cursor: pointer;
  font: 600 13px var(--serif);
  color: var(--gold-bright);
  letter-spacing: 0.08em;
  user-select: none;
}

.shop-paperdoll-summary:hover {
  background: rgba(216, 182, 106, 0.08);
}

.shop-paperdoll-card {
  border: none;
  background: transparent;
  padding: 14px 16px;
}

.shop-paperdoll-slots-grid {
  grid-template-columns: repeat(6, 1fr);
  max-width: 100%;
  gap: 8px 10px;
}

.shop-paperdoll-slots-grid .equip-slot-btn {
  min-height: 64px;
  padding: 4px;
}

.shop-paperdoll-slots-grid .slot-box {
  width: 32px;
  height: 32px;
  font-size: 16px;
}

@media (max-width: 768px) {
  .shop-paperdoll-slots-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Consumables Bar in Equipment Screen */
.equipment-consumables-card {
  margin-top: 18px;
  padding: 14px 16px;
  background: rgba(18, 15, 23, 0.7);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.consumables-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.consumables-header h4 {
  font: 600 13px var(--serif);
  color: var(--gold);
  margin: 0;
}

.consumables-header small {
  font-size: 10px;
  color: var(--paper-dim);
}

.consumables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.consumable-item-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(12, 10, 16, 0.7);
  border: 1px solid rgba(216, 182, 106, 0.2);
  padding: 8px 12px;
  border-radius: 4px;
}

.consumable-item-badge .item-orb {
  width: 38px;
  height: 38px;
  margin: 0;
  flex-shrink: 0;
}

.consumable-item-badge .item-orb i {
  width: 24px;
  height: 24px;
  font-size: 13px;
}

.consumable-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.consumable-item-info strong {
  font-size: 12px;
  color: var(--paper);
}

.consumable-item-info p {
  font-size: 10px;
  color: var(--paper-dim);
  margin: 0;
}

.consumable-item-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-bright);
  font-family: var(--serif);
}

/* Pause Modal */
.pause-modal-card {
  max-width: 380px;
  text-align: center;
}

.pause-content {
  padding: 10px 0;
}

.pause-message {
  font-size: 12px;
  color: var(--paper-soft);
  line-height: 1.6;
  margin-bottom: 20px;
}

.pause-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pause-action-btn {
  width: 100%;
  padding: 10px 16px;
  font-size: 13px;
}

/* Stage Actions Row with Auto-Battle */
.stage-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

.stage-btn-auto {
  padding: 5px 10px;
  font-size: 11px;
  font-family: var(--serif);
  color: #fff;
  background: linear-gradient(135deg, rgba(235, 120, 20, 0.85), rgba(181, 37, 55, 0.9));
  border: 1px solid var(--gold);
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.stage-btn-auto:hover {
  background: linear-gradient(135deg, rgba(255, 140, 40, 1), rgba(210, 45, 65, 1));
  box-shadow: 0 0 10px rgba(255, 150, 50, 0.5);
  transform: translateY(-1px);
}

/* Auto-Battle HUD Banner (Bottom-Right Corner) */
.auto-battle-hud-banner {
  position: absolute;
  right: clamp(20px, 3.5vw, 54px);
  bottom: 140px;
  left: auto;
  transform: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  background: rgba(18, 12, 28, 0.94);
  border: 1px solid var(--gold-bright);
  border-radius: 24px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), 0 0 16px rgba(230, 160, 40, 0.35);
  z-index: 100;
  font-size: 12px;
  color: var(--paper);
  animation: bannerPulse 2s infinite ease-in-out;
}

@keyframes bannerPulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(230, 160, 40, 0.3); }
  50% { box-shadow: 0 4px 22px rgba(255, 190, 60, 0.6); }
}

.auto-battle-icon {
  font-size: 16px;
  color: var(--gold-bright);
  animation: iconSpin 2s linear infinite;
}

@keyframes iconSpin {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.btn-toggle-autobattle,
.btn-stop-autobattle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(181, 37, 55, 0.9);
  border: 1px solid var(--crimson-bright);
  color: #fff;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: all 0.15s cubic-bezier(0.2, 0.8, 0.25, 1);
  user-select: none;
}

.btn-toggle-autobattle:hover,
.btn-stop-autobattle:hover {
  background: rgba(220, 45, 65, 1);
  box-shadow: 0 0 10px rgba(220, 45, 65, 0.7);
  transform: translateY(-1px);
}

.btn-toggle-autobattle:active,
.btn-stop-autobattle:active {
  transform: scale(0.92) translateY(1px);
  filter: brightness(1.25);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.btn-toggle-autobattle.is-paused {
  background: linear-gradient(135deg, rgba(230, 160, 40, 0.95), rgba(190, 120, 20, 0.95));
  border-color: var(--gold-bright);
  color: #10131f;
  box-shadow: 0 0 10px rgba(230, 160, 40, 0.5);
  animation: pauseBtnPulse 1.5s infinite ease-in-out;
}

.btn-toggle-autobattle.is-paused:hover {
  background: linear-gradient(135deg, rgba(255, 185, 60, 1), rgba(220, 140, 30, 1));
  box-shadow: 0 0 14px rgba(255, 185, 60, 0.8);
}

@keyframes pauseBtnPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.btn-toggle-autobattle .toggle-icon {
  font-size: 13px;
  line-height: 1;
  display: inline-block;
}

/* Frozen Kohaku Hand Badge */
.frozen-hand-badge {
  position: absolute;
  top: 118px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 14px;
  background: rgba(15, 30, 60, 0.9);
  border: 1px solid #64b5f6;
  border-radius: 14px;
  box-shadow: 0 0 12px rgba(100, 181, 246, 0.5);
  color: #bbdefb;
  font-size: 12px;
  font-family: var(--serif);
  z-index: 95;
  animation: freezeGlow 1.5s infinite alternate ease-in-out;
}

@keyframes freezeGlow {
  0% { box-shadow: 0 0 8px rgba(100, 181, 246, 0.3); }
  100% { box-shadow: 0 0 18px rgba(144, 202, 249, 0.8); }
}

.frozen-hand-badge b {
  color: #fff;
  text-decoration: line-through;
  font-weight: 700;
  margin: 0 2px;
}

/* Auto-Battle Modal */
.auto-battle-card {
  max-width: 420px;
}

.auto-battle-modal-content {
  padding: 12px 0;
}

.auto-battle-stage-title {
  font-size: 16px;
  color: var(--gold-bright);
  font-family: var(--serif);
  margin-bottom: 8px;
}

.auto-battle-desc {
  font-size: 12px;
  color: var(--paper-dim);
  line-height: 1.6;
  margin-bottom: 16px;
}

.auto-battle-count-select {
  margin-bottom: 20px;
}

.auto-battle-count-select label {
  display: block;
  font-size: 12px;
  color: var(--paper-soft);
  margin-bottom: 8px;
}

.auto-battle-count-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.auto-battle-count-buttons .count-btn {
  flex: 1;
  min-width: 50px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--paper-dim);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-family: var(--serif);
  transition: all 0.15s ease;
}

.auto-battle-count-buttons .count-btn:hover {
  border-color: var(--gold);
  color: var(--paper);
}

.auto-battle-count-buttons .count-btn.is-active {
  background: linear-gradient(135deg, rgba(235, 120, 20, 0.7), rgba(181, 37, 55, 0.8));
  border-color: var(--gold-bright);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(255, 150, 50, 0.4);
}

.auto-battle-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Home Records & Resource Dashboard */
.home-records-dashboard {
  margin-top: 24px;
  padding: 16px 20px;
  background: linear-gradient(145deg, rgba(20, 24, 38, 0.92), rgba(12, 14, 24, 0.96));
  border: 1px solid rgba(216, 182, 106, 0.25);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.home-records-header {
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(216, 182, 106, 0.15);
  padding-bottom: 8px;
}

.home-records-header h3 {
  font: 600 16px/1.2 var(--serif);
  color: var(--gold-bright);
  letter-spacing: 0.08em;
  margin: 0 0 4px;
}

.home-records-header p {
  font-size: 11px;
  color: var(--paper-dim);
  line-height: 1.5;
  margin: 0;
}

.home-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  transition: all 180ms ease;
}

.stat-card:hover {
  background: rgba(216, 182, 106, 0.06);
  border-color: rgba(216, 182, 106, 0.3);
}

.stat-card-wide {
  grid-column: 1 / -1;
}

.stat-card-icon {
  font-size: 20px;
}

.stat-card-data {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-card-data small {
  font-size: 10px;
  color: var(--paper-dim);
  letter-spacing: 0.05em;
}

.stat-card-data b {
  font: 600 14px/1.2 var(--serif);
  color: var(--paper);
}

.home-stage-breakdown-wrap {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
}

.home-stage-breakdown-wrap h4 {
  font: 600 13px/1.2 var(--serif);
  color: var(--gold);
  letter-spacing: 0.08em;
  margin: 0 0 10px;
}

.home-stage-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.home-stage-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  font-size: 11px;
  border-left: 3px solid var(--crimson);
}

.home-stage-stat-name {
  color: var(--paper-soft);
  font-weight: 500;
}

.home-stage-stat-detail {
  display: flex;
  gap: 8px;
  color: var(--paper-dim);
}

.home-stage-stat-detail b {
  color: var(--gold-bright);
}

/* Stage Card Metrics Row */
.stage-metrics-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0 10px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(216, 182, 106, 0.15);
  border-radius: 4px;
  font-size: 11px;
}

.stage-metric-attempts {
  color: var(--gold-bright);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}

.stage-metric-breakdown {
  color: var(--paper-dim);
  font-size: 10px;
  letter-spacing: 0.04em;
}

/* Records Page Layout */
.records-page-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: linear-gradient(145deg, rgba(20, 24, 38, 0.92), rgba(12, 14, 24, 0.96));
  border: 1px solid rgba(216, 182, 106, 0.25);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.page-backdrop-records {
  background: radial-gradient(circle at 50% 20%, rgba(181, 37, 55, 0.12), transparent 70%),
              radial-gradient(circle at 80% 80%, rgba(216, 182, 106, 0.08), transparent 60%);
}

.records-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .records-top-grid {
    grid-template-columns: 1fr;
  }
}

.records-profile-card,
.records-consumables-card {
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(216, 182, 106, 0.2);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.records-profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.records-profile-header h4,
.records-consumables-card h4,
.records-section-header h4 {
  margin: 0;
  font-size: 15px;
  color: var(--gold-bright);
  letter-spacing: 0.05em;
}

.records-level-tag {
  background: var(--crimson-900);
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: bold;
}

.records-xp-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--paper-dim);
}

.records-dps-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(216, 182, 106, 0.1);
  border: 1px solid rgba(216, 182, 106, 0.35);
  border-radius: 6px;
}

.records-dps-icon {
  font-size: 22px;
}

.records-dps-badge small {
  display: block;
  font-size: 11px;
  color: var(--paper-dim);
}

.records-dps-badge b {
  font-size: 18px;
  color: var(--gold-bright);
  font-family: var(--font-cinzel), monospace;
}

.records-consumables-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.records-consumable-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 13px;
}

.records-consumable-pill.wide {
  grid-column: 1 / -1;
}

.records-consumable-pill strong {
  color: var(--gold-bright);
  font-size: 14px;
}

/* Section Card */
.records-section-card {
  padding: 20px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(216, 182, 106, 0.2);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.records-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid rgba(216, 182, 106, 0.15);
  padding-bottom: 10px;
}

/* Read-Only Paperdoll Grid */
.records-paperdoll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.records-paperdoll-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(216, 182, 106, 0.15);
  border-radius: 4px;
  cursor: help;
  transition: all 0.2s ease;
}

.records-paperdoll-item:hover {
  background: rgba(216, 182, 106, 0.08);
  border-color: var(--gold);
}

.records-paperdoll-item-icon {
  font-size: 20px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.records-paperdoll-item-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.records-paperdoll-slot-tag {
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.records-paperdoll-item-name {
  font-size: 12px;
  color: var(--paper);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  font-weight: 500;
}

/* Tables in Records Page */
.records-table-wrap {
  overflow-x: auto;
}

.records-stats-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.records-stats-table th {
  padding: 10px 14px;
  background: rgba(216, 182, 106, 0.12);
  color: var(--gold-bright);
  font-weight: 600;
  border-bottom: 1px solid rgba(216, 182, 106, 0.3);
  white-space: nowrap;
}

.records-stats-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--paper);
}

.records-stats-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.records-stats-table tr.total-row td {
  font-weight: bold;
  background: rgba(216, 182, 106, 0.06);
  border-top: 1px solid rgba(216, 182, 106, 0.25);
  color: var(--gold-bright);
}

.rate-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 12px;
}

.rate-high {
  background: rgba(82, 196, 26, 0.2);
  color: #73d13d;
  border: 1px solid rgba(82, 196, 26, 0.4);
}

.rate-mid {
  background: rgba(250, 173, 20, 0.2);
  color: #ffc53d;
  border: 1px solid rgba(250, 173, 20, 0.4);
}

.rate-low {
  background: rgba(245, 34, 45, 0.2);
  color: #ff7875;
  border: 1px solid rgba(245, 34, 45, 0.4);
}

/* Recent Battles List */
.records-recent-battles-wrap {
  max-height: 380px;
  overflow-y: auto;
  padding-right: 6px;
}

.records-recent-battles-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recent-battle-card {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  font-size: 12px;
  transition: background 0.15s ease;
}

.recent-battle-card:hover {
  background: rgba(216, 182, 106, 0.05);
}

.recent-battle-result {
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.recent-battle-result.win {
  background: rgba(82, 196, 26, 0.25);
  color: #95de64;
  border: 1px solid rgba(82, 196, 26, 0.5);
}

.recent-battle-result.loss {
  background: rgba(245, 34, 45, 0.25);
  color: #ff7875;
  border: 1px solid rgba(245, 34, 45, 0.5);
}

.recent-battle-stage {
  color: var(--paper);
  font-weight: 500;
}

.recent-battle-mode {
  color: var(--paper-dim);
  font-size: 11px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.recent-battle-dps {
  color: var(--gold-bright);
  font-weight: 600;
  font-family: var(--font-cinzel), monospace;
}

.recent-battle-damage {
  color: var(--paper-dim);
}

.recent-battle-damage b {
  color: var(--paper);
}

/* Settlement Overlay Combat Stats */
.settlement-combat-stats-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 16px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(216, 182, 106, 0.2);
  border-radius: 4px;
  font-size: 12px;
}

.settlement-combat-stats-row span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.settlement-combat-stats-row small {
  color: var(--paper-dim);
  font-size: 11px;
}

.settlement-combat-stats-row b {
  color: var(--gold-bright);
  font-family: var(--font-cinzel), monospace;
}




