:root {
  color-scheme: dark;
  --ink: #f1f5ff;
  --muted: #94a5c0;
  --gold: #ffd983;
  --enemy: #97dcce;
  font-family:
    ui-rounded, "SF Pro Rounded", "PingFang SC", system-ui, sans-serif;
  background: #10162c;
  color: var(--ink);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(ellipse at 20% 15%, #233d59 0, transparent 55%),
    radial-gradient(ellipse at 90% 80%, #342445 0, transparent 45%), #10162c;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #fff0ae;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
a {
  color: inherit;
  text-decoration: none;
}
.topbar {
  height: 66px;
  max-width: 1090px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
}
.topbar > a {
  font-size: 24px;
  width: 32px;
}
.brand {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 1px;
}
.brand small {
  font-size: 10px;
  display: block;
  letter-spacing: 2px;
  color: #9babcc;
  margin-top: 2px;
}
.top-actions {
  margin-left: auto;
  display: flex;
  gap: 9px;
}
.top-actions button {
  border: 1px solid #bddaff25;
  border-radius: 12px;
  background: #18263b;
  padding: 8px 12px;
  min-height: 40px;
  font-size: 12px;
}
#pause-button {
  font-size: 18px;
  min-width: 40px;
}
.expedition {
  max-width: 1050px;
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 28px;
  margin: 10px auto 30px;
  padding: 0 18px;
  align-items: center;
}
.arena {
  height: 650px;
  position: relative;
  border: 1px solid #bdc5ff27;
  border-radius: 26px;
  overflow: hidden;
  isolation: isolate;
  background: #15233a;
}
.ruins-art {
  position: absolute;
  inset: 0;
  background: url("./art/rift-citadel-v1.png") center/cover;
  z-index: -3;
  opacity: 0.75;
}
.arena:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(#12203722 20%, #0c142aee 90%);
  z-index: -1;
  pointer-events: none;
}
.rift-glow {
  position: absolute;
  width: 100%;
  height: 70%;
  background: radial-gradient(ellipse, #80fbd71a, transparent 65%);
  z-index: -2;
}
.arena-heading {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.arena-heading button {
  font-size: 13px;
  background: #152338ab;
  border: 1px solid #b4d5e638;
  border-radius: 30px;
  padding: 8px 13px;
  letter-spacing: 1px;
}
.arena-heading span {
  background: #ed645f;
  color: #fff3e7;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
}
.enemy {
  width: 94%;
  height: 380px;
  position: relative;
  margin: 90px auto 0;
  display: flex;
  justify-content: center;
  align-items: center;
  filter: drop-shadow(0 14px 10px #0b1429);
}
.enemy-aura {
  position: absolute;
  width: 68%;
  height: 50%;
  border: 1px solid #b8f4ed33;
  border-radius: 50%;
  box-shadow: 0 0 55px #71d2c22a;
  transform: rotateX(45deg);
}
.enemy-status {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 94px;
}
.enemy-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}
.enemy-title h1 {
  font-size: 23px;
  margin: 0;
  font-weight: 750;
}
.enemy-title > span {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: #ffe4d3;
}
.boss-health {
  height: 16px;
  position: relative;
  border: 2px solid #382636;
  background: #190f24;
  border-radius: 20px;
  box-shadow:
    0 1px 0 #d0c9f349,
    inset 0 2px 4px #0005;
  overflow: hidden;
}
.boss-health i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  border-radius: 20px;
  background: #ffdca0;
  transition: width 0.5s 0.15s;
}
#boss-fill {
  background: linear-gradient(#ffb2a2, #f16c6e 40%, #bd354a);
  transition: width 0.16s;
  box-shadow: 0 0 15px #ff627c55;
}
.boss-health.hit {
  animation: health-hit 0.26s;
}
.battle-callout {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 36px;
  min-height: 28px;
  text-align: center;
  font-size: 20px;
  font-weight: 850;
  color: #fff0b8;
  opacity: 0;
  transform: translateY(8px);
  transition: 0.18s;
}
.battle-callout.show {
  opacity: 1;
  transform: none;
}
.arena[data-phase="2"] {
  box-shadow: inset 0 0 45px #df4b5335;
}
.arena[data-phase="2"] .guardian {
  filter: drop-shadow(0 0 13px #ef654d55);
}
.enemy.defeated .guardian {
  animation: guardian-fall 0.7s forwards;
}
.spell-desk {
  min-width: 0;
}
.battle-bar {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}
.player-vitals {
  display: flex;
  align-items: center;
}
#health {
  display: flex;
  gap: 3px;
}
#health svg {
  width: 21px;
  height: 23px;
  fill: #f37986;
  filter: drop-shadow(0 2px 0 #703948);
}
#health .empty {
  fill: #36445e;
  filter: none;
}
.move-counter {
  display: flex;
  gap: 4px;
  align-items: baseline;
}
.move-counter strong {
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  color: #fff0bd;
}
.move-counter span {
  font-size: 12px;
  color: #b6bed1;
}
.move-counter.low strong {
  color: #ff8890;
}
.intent {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #421f36a6;
  padding: 7px 9px;
  border: 1px solid #fa81786b;
  border-radius: 12px;
}
.intent-icon svg {
  width: 19px;
  height: 19px;
  color: #ff8c7d;
  display: block;
}
.windup {
  display: flex;
  gap: 3px;
}
.windup i {
  width: 9px;
  height: 19px;
  border-radius: 3px;
  transform: skew(-12deg);
  background: #352638;
  border: 1px solid #d17b784d;
}
.windup i.lit {
  background: #ff8b72;
  box-shadow: 0 0 6px #ff8b7244;
}
.intent b {
  font-size: 11px;
  color: #ffcfbf;
  white-space: nowrap;
}
.intent.imminent {
  animation: warning-pulse 0.8s infinite alternate;
}
.board-wrap {
  position: relative;
  padding: 9px;
  border-radius: 20px;
  background: linear-gradient(
    135deg,
    #6f8aab,
    #293958 26%,
    #17213a 70%,
    #5d688b
  );
  box-shadow:
    0 16px 40px #03091955,
    inset 0 1px 0 #d1f2ff6b;
  border: 1px solid #a7c5df53;
}
.board {
  position: relative;
  aspect-ratio: 1;
  touch-action: none;
  border-radius: 12px;
  background: #111f35;
  box-shadow: inset 0 2px 12px #020b21aa;
  isolation: isolate;
  overflow: hidden;
}
.board-floor,
.pieces,
.threat-layer,
.gesture-guide {
  position: absolute;
  inset: 0;
}
.board-floor {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
}
.well {
  margin: 1px;
  background: #27385166;
  border: 1px solid #52718b16;
  border-radius: 7px;
}
.well:nth-child(16n + 1),
.well:nth-child(16n + 3),
.well:nth-child(16n + 5),
.well:nth-child(16n + 7),
.well:nth-child(16n + 10),
.well:nth-child(16n + 12),
.well:nth-child(16n + 14),
.well:nth-child(16n + 16) {
  background: #16263e80;
}
.piece {
  position: absolute;
  left: 0;
  top: 0;
  width: 12.5%;
  height: 12.5%;
  border: 0;
  background: transparent;
  padding: 4px;
  transition:
    transform 0.23s cubic-bezier(0.2, 0.75, 0.25, 1),
    opacity 0.15s;
  will-change: transform;
  display: grid;
  place-items: center;
}
.tile-face {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  pointer-events: none;
  position: relative;
}
.tile-face svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.piece.selected:before,
.piece.hinted:before,
.piece.match-preview:before {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: -1;
  border: 2px solid #fff2b7;
  border-radius: 9px;
  box-shadow:
    0 0 12px #ffeca355,
    inset 0 0 8px #fff0af33;
}
.piece.hinted .tile-face {
  animation: gem-hint 1s infinite alternate;
}
.piece.clearing .tile-face {
  animation: gem-clear 0.24s forwards;
}
.piece.invalid {
  animation: invalid 0.25s;
}
.piece.new-special .tile-face {
  animation: special-birth 0.75s;
}
.pieces {
  z-index: 1;
}
.threat-layer {
  z-index: 3;
  pointer-events: none;
}
.threat-mark {
  position: absolute;
  width: 12.5%;
  height: 12.5%;
  padding: 2px;
}
.threat-mark:before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 2px solid #ff6d71;
  border-radius: 50%;
  box-shadow:
    0 0 9px #ff726767,
    inset 0 0 7px #ff726755;
}
.threat-mark svg {
  position: absolute;
  width: 16px;
  height: 16px;
  right: -1px;
  top: -1px;
  background: #6a1c36;
  border-radius: 50%;
  color: #ffe8dd;
  padding: 1px;
}
.threat-mark.urgent:before {
  animation: warning-pulse 0.7s infinite alternate;
}
.threat-mark.broken:before {
  border-color: #affad5;
  animation: mark-break 0.42s forwards;
}
.threat-mark.broken svg {
  opacity: 0;
}
.gesture-guide {
  z-index: 4;
  pointer-events: none;
}
.gesture-guide .guide-arrow {
  position: absolute;
  width: 12.5%;
  height: 12.5%;
  display: grid;
  place-items: center;
  font-size: 30px;
  color: #fff3be;
  text-shadow:
    0 2px 5px #04132d,
    0 0 8px #04132d;
  font-weight: 900;
  animation: swipe-guide 1.3s infinite;
}
.combo {
  position: absolute;
  top: 44%;
  left: 0;
  right: 0;
  z-index: 8;
  text-align: center;
  pointer-events: none;
  color: #fff0aa;
  text-shadow:
    0 2px 0 #5b3445,
    0 5px 12px #0c153f;
  font-size: 34px;
  font-weight: 900;
  opacity: 0;
}
.combo.show {
  animation: combo 0.8s;
}
.cast-confirm {
  position: absolute;
  z-index: 9;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  border: 2px solid #fff1bd;
  background: linear-gradient(#ffe1a0, #f2b957);
  color: #412b26;
  border-radius: 24px;
  font-size: 17px;
  font-weight: 800;
  padding: 10px 27px;
  box-shadow: 0 5px 20px #0c152aaa;
}
.below-board {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 37px;
  margin: 5px 0;
}
.feedback {
  font-size: 13px;
  color: #d0dce8;
  margin: 0;
  line-height: 1.4;
  flex: 1;
  text-align: center;
  min-height: 18px;
}
.feedback.important {
  color: #ffe3a4;
  font-weight: 700;
}
.icon-button {
  border: 1px solid #b5d6ec30;
  border-radius: 11px;
  background: #233148;
  font-size: 22px;
  min-width: 36px;
  min-height: 34px;
}
.spell-toolbar {
  display: flex;
  gap: 10px;
}
.spell-button {
  position: relative;
  overflow: hidden;
  flex: 1;
  display: grid;
  grid-template-columns: 43px 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 66px;
  padding: 9px 13px 13px;
  text-align: left;
  border: 1px solid #a4c1e83d;
  border-radius: 15px;
  background: linear-gradient(135deg, #30445e, #1c2942);
  box-shadow: inset 0 1px #d4e7ff14;
}
.spell-button:disabled {
  color: #b2c4da;
  opacity: 0.84;
}
.skill-icon svg {
  width: 40px;
  height: 40px;
  display: block;
}
.skill-info b {
  display: block;
  font-size: 16px;
}
.skill-info small {
  display: block;
  font-size: 11px;
  color: #a4b7d0;
  margin-top: 4px;
}
.skill-value {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.skill-charge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: #101a33;
}
.skill-charge i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6aa8ff, #acb7ff);
  width: 0;
  transition: width 0.25s;
}
.spell-button.ready {
  background: linear-gradient(135deg, #565071, #31335a);
  border-color: #f7d698a3;
  box-shadow:
    0 0 0 1px #f7d69822,
    inset 0 1px #ffe7ae4d;
  animation: skill-ready 1.8s infinite alternate;
}
.spell-button.ready .skill-charge i {
  background: #ffe3a3;
}
.spell-button.ready .skill-caption {
  color: #ffe8ad;
}
.spell-button.armed {
  border-color: #fff1b5;
  box-shadow: 0 0 16px #ffc45b33;
}
.cancel-aim {
  border: 1px solid #9fafce55;
  border-radius: 13px;
  background: #24304a;
  padding: 8px 12px;
}
.board-footer {
  display: flex;
  justify-content: space-between;
  color: #798aa7;
  font-size: 10px;
  margin-top: 10px;
  padding: 0 4px;
}
.board-footer button {
  font-size: 11px;
  background: none;
  border: 0;
  color: #98acc9;
  padding: 2px;
}
.board-footer button:hover {
  color: white;
}
.match-preview .tile-face {
  filter: brightness(1.23);
}
.match-clear-impact {
  animation: board-impact 0.22s;
}
.match-hit-player {
  animation: player-hit 0.35s;
}
.match-hit-enemy {
  filter: drop-shadow(0 0 15px #f5d589);
}
#fx-canvas {
  position: fixed;
  pointer-events: none;
  inset: 0;
  z-index: 80;
}
dialog {
  color: var(--ink);
  width: min(420px, calc(100% - 32px));
  max-height: 88svh;
  overflow: auto;
  padding: 28px;
  border: 1px solid #9cb9dc66;
  border-radius: 24px;
  background: linear-gradient(135deg, #25344e, #19213d);
  box-shadow: 0 20px 100px #030b29aa;
}
dialog::backdrop {
  background: #070d1dc9;
  backdrop-filter: blur(5px);
}
dialog h2 {
  font-size: 27px;
  margin: 0 32px 22px 0;
}
#modal-close {
  position: absolute;
  right: 13px;
  top: 12px;
  width: 36px;
  height: 36px;
  font-size: 24px;
  border: 0;
  background: none;
  color: #becde0;
}
#modal-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 24px;
}
#modal-actions button {
  border: 1px solid #90aacc55;
  border-radius: 13px;
  background: #243650;
  padding: 12px 17px;
  font-size: 14px;
  flex: 1;
  min-width: 120px;
}
#modal-actions .primary {
  background: linear-gradient(#ffe3a4, #e9b86e);
  color: #372c28;
  font-weight: 800;
  border-color: #fff1c3;
}
.result-emblem {
  text-align: center;
  font-size: 60px;
  color: #ffe4a0;
  margin: 8px;
}
.result-stars {
  text-align: center;
  letter-spacing: 9px;
  color: #ffd985;
  font-size: 34px;
}
.result-stats {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  justify-content: center;
}
.result-stats > div {
  text-align: center;
  flex: 1;
  background: #14203980;
  border-radius: 14px;
  padding: 15px 7px;
}
.result-stats b {
  display: block;
  font-size: 23px;
  color: #e4f0ff;
}
.result-stats span {
  font-size: 11px;
  color: #a9bad0;
}
.result-note {
  text-align: center;
  font-size: 14px;
  color: #b9c9df;
}
.boss-map {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.boss-map button {
  position: relative;
  border: 1px solid #889dc644;
  border-radius: 15px;
  padding: 16px 8px;
  background: #152540;
  display: grid;
  gap: 9px;
}
.boss-map button:disabled {
  opacity: 0.4;
}
.boss-map strong {
  font-size: 16px;
}
.boss-map span {
  font-size: 12px;
  color: #adbed7;
}
.boss-map small {
  color: #ffd685;
  font-size: 15px;
}
.help-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 60px;
  padding: 10px 0;
  border-bottom: 1px solid #8597b62b;
}
.help-row svg {
  width: 34px;
  height: 34px;
}
.help-row .help-gems {
  display: flex;
  gap: 0;
}
.help-row b {
  font-size: 14px;
}
.help-row .help-arrow {
  color: #ffdd92;
  font-size: 25px;
}
.help-heart {
  font-size: 25px;
  color: #ff8991;
}
.help-foot {
  font-size: 12px;
  color: #abbeda;
  line-height: 1.6;
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@keyframes guardian-float {
  50% {
    transform: translateY(-8px);
  }
}
@keyframes core-beat {
  to {
    opacity: 0.65;
  }
}
@keyframes wing-left {
  50% {
    transform: rotate(-3deg);
  }
}
@keyframes wing-right {
  50% {
    transform: rotate(3deg);
  }
}
@keyframes guardian-fall {
  to {
    transform: translateY(35px) scale(0.7);
    opacity: 0;
  }
}
@keyframes health-hit {
  50% {
    filter: brightness(1.8);
  }
}
@keyframes warning-pulse {
  to {
    filter: brightness(1.55);
    box-shadow: 0 0 12px #fd62615c;
  }
}
@keyframes gem-hint {
  to {
    transform: translateY(-3px);
    filter: brightness(1.22);
  }
}
@keyframes gem-clear {
  50% {
    transform: scale(1.16);
    filter: brightness(1.6);
  }
  to {
    transform: scale(0.3);
    opacity: 0;
  }
}
@keyframes special-birth {
  25% {
    transform: scale(1.25);
    filter: brightness(1.8);
  }
  70% {
    transform: scale(0.93);
  }
}
@keyframes invalid {
  30% {
    translate: -4px;
  }
  65% {
    translate: 4px;
  }
}
@keyframes swipe-guide {
  0%,
  15% {
    translate: -6px;
    opacity: 0.45;
  }
  65% {
    translate: 7px;
    opacity: 1;
  }
  100% {
    translate: 7px;
    opacity: 0;
  }
}
@keyframes mark-break {
  to {
    transform: scale(1.7);
    opacity: 0;
  }
}
@keyframes combo {
  0% {
    opacity: 0;
    transform: scale(0.75);
  }
  20%,
  65% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-12px);
  }
}
@keyframes skill-ready {
  to {
    box-shadow:
      0 0 18px #bca2ff33,
      inset 0 1px #ffe7ae4d;
  }
}
@keyframes board-impact {
  35% {
    translate: 0 2px;
  }
  70% {
    translate: 0 -1px;
  }
}
@keyframes player-hit {
  30% {
    filter: brightness(2);
    transform: translateX(4px);
  }
  65% {
    transform: translateX(-3px);
  }
}
@media (max-width: 900px) {
  .expedition {
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 auto 18px;
    padding: 0 12px;
  }
  .arena {
    width: 100%;
    height: 174px;
    border-radius: 18px;
  }
  .spell-desk {
    width: 100%;
  }
  .topbar {
    max-width: 520px;
    height: 52px;
    padding: 0 14px;
    gap: 8px;
  }
  .brand {
    font-size: 15px;
  }
  .brand small {
    display: none;
  }
  .topbar > a {
    font-size: 21px;
    width: 23px;
  }
  .top-actions {
    gap: 5px;
  }
  .top-actions button {
    min-height: 34px;
    font-size: 10px;
    padding: 5px 9px;
  }
  #pause-button {
    font-size: 15px;
    min-width: 34px;
  }
  .arena-heading {
    top: 10px;
    left: 11px;
    right: 11px;
  }
  .arena-heading button {
    font-size: 10px;
    padding: 5px 9px;
  }
  .arena-heading span {
    font-size: 10px;
    padding: 4px 8px;
  }
  .enemy {
    position: absolute;
    width: 57%;
    height: 145px;
    right: 0;
    top: -5px;
    margin: 0;
  }
  .enemy-status {
    left: 15px;
    right: 15px;
    bottom: 16px;
  }
  .enemy-title {
    margin-bottom: 7px;
  }
  .enemy-title h1 {
    font-size: 17px;
  }
  .enemy-title > span {
    font-size: 12px;
  }
  .boss-health {
    height: 12px;
  }
  .battle-callout {
    left: 15px;
    right: auto;
    bottom: 62px;
    max-width: 48%;
    font-size: 17px;
    text-align: left;
  }
  .ruins-art {
    background-position: center 52%;
    opacity: 0.57;
  }
  .arena:after {
    background:
      linear-gradient(0deg, #101e34f7, transparent 65%),
      linear-gradient(90deg, #111d3199, transparent);
  }
  .battle-bar {
    min-height: 34px;
    margin-bottom: 7px;
    gap: 6px;
  }
  #health {
    gap: 2px;
  }
  #health svg {
    width: 17px;
    height: 20px;
  }
  .move-counter strong {
    font-size: 24px;
  }
  .move-counter span {
    font-size: 11px;
  }
  .intent {
    gap: 4px;
    padding: 5px 6px;
    border-radius: 9px;
  }
  .intent b {
    font-size: 10px;
  }
  .intent-icon svg {
    width: 16px;
    height: 16px;
  }
  .windup i {
    width: 7px;
    height: 15px;
  }
  .board-wrap {
    padding: 6px;
    border-radius: 15px;
  }
  .board {
    border-radius: 9px;
  }
  .piece {
    padding: 3px;
  }
  .below-board {
    min-height: 30px;
    margin: 3px 0;
  }
  .feedback {
    font-size: 12px;
  }
  .icon-button {
    min-width: 31px;
    min-height: 29px;
    font-size: 19px;
  }
  .spell-toolbar {
    gap: 7px;
  }
  .spell-button {
    grid-template-columns: 34px 1fr auto;
    gap: 5px;
    min-height: 58px;
    padding: 7px 9px 10px;
    border-radius: 12px;
  }
  .skill-icon svg {
    width: 33px;
    height: 33px;
  }
  .skill-info b {
    font-size: 14px;
  }
  .skill-info small {
    font-size: 10px;
    margin-top: 3px;
  }
  .skill-value {
    font-size: 11px;
  }
  .board-footer {
    margin-top: 7px;
    font-size: 9px;
  }
  .combo {
    font-size: 28px;
  }
  .cast-confirm {
    padding: 9px 23px;
    font-size: 15px;
    bottom: 16px;
  }
  .threat-mark svg {
    width: 14px;
    height: 14px;
  }
  .threat-mark:before {
    inset: 1px;
    border-width: 2px;
  }
}
@media (max-width: 430px) and (max-height: 760px) {
  .topbar {
    height: 42px;
  }
  .arena {
    height: 119px;
  }
  .enemy {
    height: 108px;
    width: 50%;
    top: -10px;
  }
  .arena-heading {
    top: 7px;
    left: 10px;
  }
  .arena-heading button {
    padding: 3px 8px;
  }
  .enemy-status {
    bottom: 10px;
    left: 12px;
    right: 12px;
  }
  .enemy-title h1 {
    font-size: 15px;
  }
  .enemy-title {
    margin-bottom: 5px;
  }
  .boss-health {
    height: 10px;
  }
  .battle-callout {
    bottom: 47px;
    font-size: 15px;
  }
  .expedition {
    gap: 5px;
  }
  .battle-bar {
    min-height: 28px;
    margin-bottom: 5px;
  }
  .spell-button {
    min-height: 53px;
  }
  .board-footer {
    margin-top: 5px;
  }
  .spell-toolbar .skill-caption {
    font-size: 9px;
  }
  .feedback {
    font-size: 11px;
  }
  .below-board {
    min-height: 26px;
  }
  .icon-button {
    min-height: 26px;
  }
  .skill-value {
    font-size: 10px;
  }
  #health svg {
    width: 15px;
  }
  .intent {
    padding: 4px;
  }
  .move-counter strong {
    font-size: 21px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
  .piece.clearing {
    opacity: 0;
  }
  .combo.show {
    opacity: 1;
  }
  .enemy.defeated {
    opacity: 0.2;
  }
  .gesture-guide .guide-arrow {
    opacity: 1;
  }
}

.cast-confirm {
  position: static;
  transform: none;
  flex-shrink: 0;
  font-size: 13px;
  padding: 5px 15px;
  min-height: 32px;
  order: 2;
  box-shadow: 0 3px 10px #10172b55;
}
.spell-toolbar {
  flex-wrap: wrap;
}
.shared-energy {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #c8d9ee;
}
.shared-energy > div {
  height: 4px;
  border-radius: 8px;
  background: #192642;
  flex: 1;
  overflow: hidden;
}
.shared-energy i {
  display: block;
  height: 100%;
  background: #a9b7ff;
  transition: width 0.18s;
}
.shared-energy small {
  font-size: 10px;
  color: #9faeca;
}
.spell-toolbar.dual .skill-charge {
  display: none;
}
.special-range {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.special-range i {
  position: absolute;
  width: 12.5%;
  height: 12.5%;
  border: 1px dashed #fff6b2;
  background: #ffea9122;
  animation: range-flash 0.9s forwards;
}
@keyframes range-flash {
  0%,
  70% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
  }
}
@media (min-width: 901px) and (max-height: 800px) {
  .expedition {
    max-width: 1000px;
    grid-template-columns: 1fr 438px;
    gap: 24px;
    margin-top: 0;
  }
  .arena {
    height: 592px;
  }
  .enemy {
    height: 350px;
    margin-top: 70px;
  }
  .enemy-status {
    bottom: 77px;
  }
  .topbar {
    height: 58px;
  }
  .board-footer {
    margin-top: 6px;
  }
  .spell-button {
    min-height: 59px;
  }
}

@media (max-width: 430px) and (max-height: 760px) {
  .arena {
    height: 108px;
  }
  .enemy {
    height: 98px;
    top: -1px;
  }
  .shared-energy {
    font-size: 11px;
    line-height: 13px;
  }
}
