:root {
  --bg: #070c1d;
  --panel: #131c32;
  --panel-2: #223357;
  --line: #3f5178;
  --text: #e2ecff;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --accent: #60a5fa;
  --accent-2: #a78bfa;
  --shadow: 0 8px 18px rgba(5, 8, 22, .24);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #050813;
  color: var(--text);
  font-family: "Microsoft YaHei", system-ui, sans-serif;
}

#app {
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: -229px;
  margin-top: -506px;
  width: 458px;
  height: 1012px;
  transform-origin: center center;
  padding: 10px 8px 10px;
  overflow-x: hidden;
  overflow-y: hidden;
  background:
    radial-gradient(920px 420px at -8% -12%, rgba(78, 126, 221, .24) 0%, rgba(26, 37, 82, 0) 58%),
    radial-gradient(760px 390px at 112% 4%, rgba(68, 112, 193, .2) 0%, rgba(16, 41, 71, 0) 56%),
    linear-gradient(168deg, #0b1230 0%, #0a132a 46%, #091126 100%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .48);
  border: 1px solid rgba(111, 151, 234, .24);
  border-radius: 16px;
}

#app::before,
#app::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
  filter: blur(20px);
}

#app::before {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  left: -80px;
  top: 24%;
  background: rgba(80, 171, 255, .14);
}

#app::after {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  right: -70px;
  bottom: 16%;
  background: rgba(167, 139, 250, .14);
}

#app::-webkit-scrollbar {
  display: none;
}

.topbar {
  position: relative;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(112, 146, 219, .28);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(23, 37, 72, .86), rgba(16, 27, 53, .82));
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.brand {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 1px;
  text-shadow: 0 0 20px rgba(96, 165, 250, .25);
}

.top-right {
  display: flex;
  gap: 8px;
  font-size: 12px;
  align-items: center;
}

.top-right .top-chip {
  padding: 4px 8px;
  border: 1px solid rgba(106, 131, 190, .4);
  border-radius: 999px;
  background: rgba(8, 14, 30, .5);
  color: #d5e6ff;
}

.top-cache-btn {
  cursor: pointer;
  transition: filter .18s ease, transform .15s ease;
}

.top-cache-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.top-cache-btn:active {
  transform: translateY(0);
}

#screenRoot {
  padding: 8px 6px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: calc(100% - 66px);
  overflow: hidden;
  align-content: start;
}

.panel.fill {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.fill-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.panel-footer {
  margin-top: 8px;
}

.equip-grid {
  flex: 1;
  align-content: start;
}

.equip-section {
  margin-bottom: 10px;
}

.equip-fill-body {
  position: relative;
  padding-bottom: 52px;
  gap: 8px;
  overflow: hidden;
}

.equip-fixed-back {
  position: absolute;
  left: 0;
  bottom: 0;
}

.equip-section-head {
  margin-bottom: 6px;
}

.equip-mounted-window,
.equip-list-window {
  border: 1px solid rgba(103, 134, 204, .32);
  border-radius: 10px;
  padding: 8px;
  background: rgba(9, 16, 31, .28);
}

.equip-list-window {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.equip-scroll {
  max-height: 150px;
  overflow-y: auto;
}

.equip-list-window.locked-window {
  flex: 1;
  min-height: 220px;
}

.equip-list-window.locked-window .equip-scroll {
  max-height: none;
  flex: 1;
}

.equip-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.panel {
  background:
    linear-gradient(160deg, rgba(26, 40, 73, .84), rgba(20, 31, 58, .82)),
    var(--panel);
  border: 1px solid rgba(103, 134, 204, .32);
  border-radius: 12px;
  padding: 10px;
  box-shadow: var(--shadow);
}

.title {
  margin: 0 0 8px;
  font-size: 16px;
  color: #eff6ff;
  letter-spacing: 1px;
}

.small {
  font-size: 12px;
  color: #cbd5e1;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.prepare-actions {
  flex-wrap: wrap;
}

.prepare-actions .btn {
  flex: 1 1 calc(50% - 6px);
}

.prepare-actions .expand-only {
  display: none;
}

.expanded-mode .prepare-actions .normal-only {
  display: none;
}

.expanded-mode .prepare-actions .expand-only {
  display: inline-flex;
}

.grid {
  display: grid;
  gap: 8px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.btn {
  border: 1px solid rgba(116, 150, 222, .38);
  background: linear-gradient(180deg, #3b5a96 0%, #2c4576 100%);
  color: #f1f7ff;
  border-radius: 9px;
  padding: 7px 9px;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(9, 14, 30, .28);
  transition: transform .15s ease, filter .18s ease, box-shadow .18s ease;
}

.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(9, 14, 30, .34);
}

.btn:active {
  transform: translateY(0);
  filter: brightness(.97);
}

.btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.btn.primary {
  background: linear-gradient(180deg, #3b82f6 0%, #1e40af 100%);
}

.btn.success {
  background: linear-gradient(180deg, #22c55e 0%, #166534 100%);
}

.btn.warn {
  background: linear-gradient(180deg, #f59e0b 0%, #92400e 100%);
}

.btn.danger {
  background: linear-gradient(180deg, #ef4444 0%, #991b1b 100%);
}

.item-card,
.hero-card,
.equip-card,
.feature-card {
  background: linear-gradient(160deg, rgba(13, 21, 39, .96), rgba(17, 26, 48, .96));
  border: 1px solid rgba(102, 126, 178, .5);
  border-radius: 10px;
  padding: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03);
}

.equip-card {
  transition: transform .15s ease, filter .18s ease, border-color .18s ease;
  padding: 6px;
  border-radius: 8px;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

.equip-card:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.equip-card-locked {
  opacity: .6;
  filter: grayscale(.25);
}

.equip-card-active {
  border-color: rgba(59, 130, 246, .75);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, .26);
}

.equip-card-actions {
  margin-top: 6px;
  align-items: center;
}

.equip-card .btn {
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 12px;
  width: 100%;
}

.equip-lock-text {
  color: #94a3b8;
}

.equip-card-name {
  font-size: 11px;
  font-weight: 700;
  color: #e2ecff;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.equip-slot-placeholder {
  border-style: dashed;
  border-color: rgba(148, 163, 184, .45);
  background: rgba(120, 136, 165, .14);
  opacity: .7;
  pointer-events: none;
  min-height: 112px;
}

.adventure-screen {
  background:
    radial-gradient(1000px 400px at 50% -30%, rgba(96, 165, 250, .35), rgba(96, 165, 250, 0) 54%),
    linear-gradient(180deg, #e8f8ff 0%, #d2efff 56%, #cae9ff 100%);
  color: #0d1832;
  border-color: rgba(80, 132, 204, .5);
}

.adventure-content {
  flex: 1;
  min-height: 0;
  gap: 8px;
}

.adventure-title {
  text-align: center;
  border: 1px solid rgba(104, 141, 202, .7);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #e8f2ff 100%);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #1f3b75;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .9), 0 4px 14px rgba(85, 123, 201, .25);
}

.adventure-sub .btn,
.bottom-tabs .btn {
  background: linear-gradient(180deg, #ffffff, #f0f7ff);
  color: #112549;
  border-color: rgba(120, 150, 205, .65);
}

.adventure-top-actions {
  margin-top: 6px;
}

.adventure-top-actions .btn {
  flex: 1;
}

.adventure-meta {
  margin: 10px 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-card {
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(102, 131, 185, .65);
  border-radius: 9px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #1f3b75;
  box-shadow: 0 6px 14px rgba(84, 121, 182, .14);
}

.scene-wrap {
  position: relative;
  width: 100%;
  min-height: 200px;
  border: 2px solid rgba(20, 39, 71, .85);
  border-radius: 14px;
  overflow: hidden;
  background-size: cover;
  background-position: top center;
  margin: 6px 0;
  box-shadow: 0 16px 28px rgba(10, 20, 40, .2);
}

.main-scene {
  min-height: 0;
  flex: 1;
}

.scene-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 56px;
  border-radius: 10px;
  border: 1px solid rgba(220, 236, 255, .8);
  background: rgba(13, 26, 49, .62);
  color: #e3efff;
  font-size: 20px;
  z-index: 4;
}

.scene-arrow.left {
  left: 10px;
}

.scene-arrow.right {
  right: 10px;
}

.scene-wrap-sm {
  min-height: 140px;
}

.scene-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5, 10, 22, .52), rgba(5, 10, 22, .06));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 12px;
}

.boss-avatar {
  width: 72px;
  height: 72px;
  background: center/contain no-repeat;
  filter: drop-shadow(0 6px 12px rgba(11, 22, 46, .4));
}

.boss-name {
  margin-top: 4px;
  color: #f9fbff;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}

.chapter-story {
  background: linear-gradient(180deg, rgba(20,28,44,0.85) 0%, rgba(11,16,28,0.95) 100%);
  border: 1px solid #3d4f6c;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0;
  box-shadow: inset 0 0 20px rgba(100,160,255,0.05), 0 4px 12px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
}

.chapter-story::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(100,160,255,0.3), transparent);
}

.story-content {
  font-size: 13px;
  line-height: 1.6;
  color: #d1dceb;
  text-align: justify;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.bottom-tabs {
  margin-top: auto;
}

.bottom-tabs .btn {
  flex: 1 1 0;
  min-width: 0;
}

.start-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  gap: 2px;
  line-height: 1.1;
}

.start-btn.locked {
  opacity: 1;
}

.start-main {
  font-weight: 700;
}

.start-lock {
  font-size: 10px;
  color: #f43f5e;
  font-weight: 700;
}

.chapter-actions .btn {
  flex: 1 1 0;
}

.chapter-reward-body {
  gap: 6px;
}

.chapter-reward-grid {
  align-content: start;
}

.battle-hud-top {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 8px;
}

.hud-wave,
.hud-gold {
  text-align: center;
  border: 1px solid rgba(112, 150, 224, .55);
  border-radius: 10px;
  padding: 6px 8px;
  background: rgba(12, 21, 40, .62);
  color: #d5e4ff;
}

.bag-grid {
  display: grid;
  gap: 3px;
  align-items: start;
}

.bag-grid.board {
  position: relative;
  width: max-content;
  margin: 0 auto;
}

.expanded-mode .bag-cell.layout-source {
  cursor: grab;
}

.expanded-mode .bag-cell.layout-source.is-dragging {
  cursor: grabbing;
}

.bag-cell {
  min-height: 42px;
  border: 1px solid rgba(98, 123, 177, .5);
  border-radius: 8px;
  background: #0b1220 center/cover no-repeat;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(173, 198, 255, .08);
  z-index: 1;
}

.bag-cell.occupied {
  opacity: .95;
}

.bag-grid.board:not(.expanded) .bag-cell.inactive {
  visibility: hidden;
  border-color: transparent;
  box-shadow: none;
  background: none;
  pointer-events: none;
}

.bag-grid.board.expanded .bag-cell.inactive {
  visibility: visible;
  border-style: dashed;
  border-color: rgba(248, 113, 113, .55);
  background-color: rgba(248, 113, 113, .12);
  opacity: .58;
}

.bag-cell.enabled-cell {
  border-color: rgba(96, 165, 250, .62);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .18), inset 0 1px 0 rgba(173, 198, 255, .12);
}

.bag-cell.drop-ok {
  outline: 2px solid #22c55e;
}

.bag-cell.drop-bad {
  outline: 2px solid #ef4444;
}

.drag-equip {
  border: 1px solid rgba(145, 170, 218, .6);
  border-radius: 8px;
  min-height: 42px;
  background: linear-gradient(180deg, #1e2f52 0%, #162442 100%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  color: #f8fafc;
  font-size: 11px;
  padding: 3px;
  cursor: grab;
  box-shadow: 0 6px 14px rgba(7, 12, 26, .32);
  transition: transform .15s ease;
  z-index: 3;
}

.drag-equip.grid-shape-item {
  border-color: transparent;
  box-shadow: none;
  background: none;
  padding: 0;
}

.grid-shape-cell {
  position: absolute;
  min-height: 0;
  width: 42px;
  height: 42px;
  pointer-events: none;
}

.board-items {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;
}

.board-item {
  position: absolute;
  pointer-events: auto;
}

.expanded-mode .board-item-wrap.normal-item .board-item {
  pointer-events: none;
}

.expanded-mode .shop-item-wrap.normal-item .drag-equip,
.expanded-mode .board-item-wrap.normal-item .drag-equip {
  opacity: .38;
  filter: saturate(.25) brightness(.85);
  cursor: not-allowed;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .35), 0 4px 10px rgba(2, 6, 23, .35);
  pointer-events: none;
}

.expanded-mode .shop-item-wrap.normal-item .item-label {
  opacity: .45;
}

.bag-grid.board.dragging .board-item {
  pointer-events: none;
}

.bag-grid.board.dragging .board-item.is-dragging {
  pointer-events: auto;
}

.bag-grid.board.dragging .board-items {
  pointer-events: none;
}

.drag-equip:hover {
  transform: translateY(-2px);
}

.drag-equip.shop {
  min-height: 0;
}


.sprite {
  width: 44px;
  height: 44px;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  margin: 5px auto;
}

.icon-equip {
  width: 38px;
  height: 38px;
}

.shop-rack {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px;
  min-height: 84px;
}

.shop-rack-fill {
  flex: 1;
  align-content: flex-start;
}

.shop-item-wrap {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.shop-item-wrap.drop-ok .drag-equip {
  outline: 2px solid #22c55e;
}

.shop-item-wrap.drop-bad .drag-equip {
  outline: 2px solid #ef4444;
}

.bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #141d31;
  border: 1px solid rgba(95, 125, 186, .42);
}

.bar>span {
  display: block;
  height: 100%;
}

.hp>span {
  background: #dc2626;
}

.exp>span {
  background: #2563eb;
}

.battle-stage {
  position: relative;
  margin-top: 10px;
  flex: 1;
  height: auto;
  aspect-ratio: 900 / 1560;
  border: 1px solid rgba(109, 138, 198, .62);
  border-radius: 12px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05), 0 14px 26px rgba(7, 14, 30, .33);
}

.battle-speed-btn {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 8;
  min-width: 52px;
  padding: 6px 10px;
  background: rgba(29, 54, 103, 0.88);
  border-color: rgba(126, 167, 255, 0.58);
  box-shadow: 0 8px 18px rgba(6, 12, 28, 0.34);
}

.battle-panel-body {
  gap: 6px;
}

.battle-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(160px 90px at 50% 80%, rgba(98, 128, 186, .3), rgba(15, 26, 50, 0)), rgba(2, 6, 23, .24);
  pointer-events: none;
}

.hero-hp-bar {
  position: absolute;
  left: 50%;
  top: calc(82% + 40px);
  width: 148px;
  transform: translateX(-50%);
  z-index: 4;
}

.unit {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.unit.monster.dying {
  pointer-events: none;
}

.unit-icon {
  width: 48px;
  height: 48px;
  background: center/contain no-repeat;
  filter: drop-shadow(0 5px 12px rgba(4, 8, 20, .4));
}

.unit.monster.t0 .unit-icon {
  width: 48px;
  height: 48px;
}

.unit.monster.t1 .unit-icon {
  width: 64px;
  height: 64px;
}

.unit.monster.t2 .unit-icon {
  width: 90px;
  height: 90px;
}

.unit.hero .unit-icon {
  width: 56px;
  height: 56px;
  animation: pulse 1.2s infinite;
  filter: drop-shadow(0 0 8px rgba(96, 165, 250, .4)) drop-shadow(0 8px 18px rgba(5, 10, 22, .45));
}

.unit-hp {
  width: 36px;
  height: 4px;
  background: #111827;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.unit-hp span {
  display: block;
  height: 100%;
  background: #ef4444;
}

.projectile {
  position: absolute;
  width: 14px;
  height: 14px;
  z-index: 3;
  background: center/contain no-repeat;
  filter: drop-shadow(0 0 5px rgba(167, 139, 250, .8));
}

.projectile.effect-none {
  display: none;
}

.hit-text {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 5;
  color: #ffd2d2;
  font-weight: 700;
  font-size: 14px;
  text-shadow: 0 0 8px rgba(239, 68, 68, .8);
  pointer-events: none;
  transition: transform 0.2s ease-out;
}

.hit-text.crit {
  color: #fbbf24;
  font-size: 20px;
  text-shadow: 0 0 12px rgba(245, 158, 11, .9);
  z-index: 6;
  transform: translate(-50%, -80%) scale(1.2);
}

.hit-text.heal {
  color: #4ade80;
  text-shadow: 0 0 8px rgba(34, 197, 94, .8);
}

.hit-text.shield {
  color: #60a5fa;
  text-shadow: 0 0 8px rgba(37, 99, 235, .8);
}

.hit-text.burn {
  color: #f97316;
  font-size: 12px;
  text-shadow: 0 0 6px rgba(234, 88, 12, .7);
}

.unit-icon.frozen {
  filter: drop-shadow(0 0 8px #60a5fa) brightness(1.2) saturate(0.5);
  background-color: rgba(96, 165, 250, 0.3) !important;
}

.unit-icon.burning::after {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M20 80 Q 50 20 80 80 Q 65 60 50 80 Q 35 60 20 80' fill='%23f97316' opacity='0.6'/%3E%3C/svg%3E") center/contain no-repeat;
  animation: pulse 0.5s infinite;
}

@keyframes monsterHitFlash {
  0% { filter: brightness(2.1) saturate(0); }
  100% { filter: brightness(1) saturate(1); }
}

.unit-icon.hit-flash {
  animation: monsterHitFlash 0.12s linear;
}

.battle-range-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.battle-range-overlay svg {
  width: 100%;
  height: 100%;
}

.battle-range-ring {
  fill: none;
  stroke: rgba(239, 68, 68, 0.9);
  stroke-width: 0.35;
  stroke-dasharray: 1.2 0.9;
}

.battle-range-ring.monster-range-ring {
  stroke: rgba(96, 165, 250, 0.9);
}

.battle-hitbox {
  position: absolute;
  pointer-events: none;
  z-index: 4;
  box-sizing: border-box;
}

.battle-hitbox.target-hurtbox {
  border: 1px solid rgba(96, 165, 250, 0.9);
  background: rgba(96, 165, 250, 0.12);
  border-radius: 999px;
}

.battle-hitbox.projectile-hitbox.circle {
  border: 1px solid rgba(248, 113, 113, 0.95);
  background: rgba(248, 113, 113, 0.14);
  border-radius: 999px;
}

.battle-hitbox.projectile-hitbox.rect {
  border: 1px solid rgba(248, 113, 113, 0.95);
  background: rgba(248, 113, 113, 0.14);
  border-radius: 4px;
}

.battle-effect.aoe-blast {
  width: 80px;
  height: 80px;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='40' fill='none' stroke='%23ef4444' stroke-width='4' opacity='0.6'%3E%3Canimate attributeName='r' from='10' to='45' dur='0.3s' repeatCount='1'/%3E%3Canimate attributeName='opacity' from='0.8' to='0' dur='0.3s' repeatCount='1'/%3E%3C/circle%3E%3C/svg%3E");
}

.battle-effect {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  background: center/contain no-repeat;
}

.battle-effect.melee {
  width: 40px;
  height: 40px;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M10 90 Q 50 10 90 10 Q 50 40 10 90 Z' fill='%23e2e8f0' opacity='0.9'/%3E%3Cpath d='M15 85 Q 50 15 85 15 Q 50 35 15 85 Z' fill='%23f8fafc'/%3E%3C/svg%3E");
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, .6));
}

.equip-bar {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.equip-slot {
  position: relative;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(116, 147, 206, .3);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6) center/contain no-repeat;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(163, 192, 255, .1);
}

.equip-slot.active {
  border-color: rgba(248, 113, 113, 0.95);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.8), inset 0 1px 0 rgba(163, 192, 255, .1);
}

.cd-mask {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, .48);
}

.feature-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 8px;
}

.feature-icon {
  border: 1px solid rgba(112, 146, 213, .62);
  border-radius: 10px;
  min-height: 68px;
  background-color: rgba(15, 23, 42, .45);
  background-size: 78% 78%;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
}

.feature-content {
  display: grid;
  gap: 6px;
}

.modal-root {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, .72);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  z-index: 50;
  backdrop-filter: blur(5px);
}

.modal-root.hidden {
  display: none;
}

.modal {
  width: min(680px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: linear-gradient(165deg, rgba(28, 42, 75, .98), rgba(15, 24, 46, .98));
  border: 1px solid rgba(117, 146, 208, .5);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 18px 40px rgba(3, 7, 18, .58);
}

.pause-modal {
  width: min(340px, 100%);
  padding: 16px;
}

.settle-modal {
  width: min(388px, 100%);
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background:
    radial-gradient(220px 140px at 50% -8%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 72%),
    linear-gradient(180deg, rgba(18, 30, 58, 0.98), rgba(11, 20, 42, 0.98));
}

.settle-modal::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  height: 4px;
  border-radius: 0 0 999px 999px;
}

.settle-modal::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  left: 50%;
  top: -132px;
  transform: translateX(-50%);
  border-radius: 50%;
  pointer-events: none;
  filter: blur(28px);
  opacity: 0.9;
}

.settle-modal.is-win {
  border-color: rgba(74, 222, 128, 0.46);
  box-shadow: 0 24px 50px rgba(3, 8, 20, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.settle-modal.is-win::before {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.9), rgba(96, 165, 250, 0.95));
}

.settle-modal.is-win::after {
  background: radial-gradient(circle, rgba(34, 197, 94, 0.22) 0%, rgba(96, 165, 250, 0.12) 38%, rgba(0, 0, 0, 0) 72%);
}

.settle-modal.is-fail {
  border-color: rgba(248, 113, 113, 0.42);
  box-shadow: 0 24px 50px rgba(3, 8, 20, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.settle-modal.is-fail::before {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.92), rgba(239, 68, 68, 0.96));
}

.settle-modal.is-fail::after {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.18) 0%, rgba(239, 68, 68, 0.16) 42%, rgba(0, 0, 0, 0) 72%);
}

.settle-header,
.settle-stats,
.settle-actions {
  position: relative;
  z-index: 1;
}

.settle-header {
  text-align: center;
  display: grid;
  gap: 6px;
}

.settle-kicker {
  justify-self: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.42);
  color: #c7d8ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.settle-title {
  margin: 2px 0 0;
  font-size: 30px;
  letter-spacing: 0.04em;
  text-shadow: 0 8px 26px rgba(96, 165, 250, 0.18);
}

.settle-subtitle {
  color: #dbeafe;
  font-size: 13px;
  font-weight: 600;
}

.settle-message {
  margin: 2px auto 0;
  max-width: 286px;
  color: #b9c9ea;
  font-size: 12px;
  line-height: 1.55;
}

.settle-stats {
  margin: 18px 0 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.settle-stat {
  padding: 12px 10px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(27, 42, 77, 0.82), rgba(14, 24, 49, 0.88));
  border: 1px solid rgba(112, 146, 213, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.settle-label {
  color: #8fb0e8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.settle-value {
  margin-top: 8px;
  color: #f8fbff;
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
}

.settle-value.positive {
  color: #86efac;
}

.settle-value.negative {
  color: #fca5a5;
}

.settle-actions {
  display: grid;
  gap: 10px;
}

.settle-actions .btn {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pause-section {
  margin-top: 16px;
}

.pause-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  position: relative;
}

.pause-divider::before,
.pause-divider::after {
  content: "";
  height: 1px;
  background: rgba(148, 163, 184, 0.3);
  flex: 1;
}

.pause-divider::before {
  margin-right: 12px;
}

.pause-divider::after {
  margin-left: 12px;
}

.pause-divider span {
  font-size: 14px;
  font-weight: bold;
  color: #cbd5e1;
}

.pause-feature-box {
  background: #1e40af;
  border: 1px solid #3b82f6;
  border-radius: 12px;
  padding: 12px;
  min-height: 100px;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.1), 0 4px 6px rgba(0, 0, 0, 0.3);
}

.pause-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pause-feature-icon {
  width: 48px;
  height: 48px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(0, 0, 0, 0.2);
}

.feature-empty {
  color: #93c5fd;
  font-size: 14px;
  text-align: center;
  line-height: 76px;
}

/* Tooltip styles */
.tooltip-wrap {
  position: relative;
}

.tooltip-wrap .tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: bold;
  white-space: pre-wrap;
  width: max-content;
  max-width: 200px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 100;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
}

.tooltip-wrap .tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.95) transparent transparent transparent;
}

.tooltip-wrap:hover .tooltip,
.tooltip-wrap:active .tooltip {
  visibility: visible;
  opacity: 1;
}

.state-fail {
  color: var(--danger);
}

.projectile.melee-weapon {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
  }
}

/* Toast Notifications */
#toastRoot {
  position: absolute;
  bottom: 40%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  width: 100%;
}

.toast-item {
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(117, 146, 208, 0.3);
  opacity: 1;
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  animation: toast-enter 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast-item.fade-out {
  opacity: 0;
  transform: translateY(-20px);
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
