.panel,
.card,
.building-card,
.hamster-card,
.zone-card,
.inventory-card,
.quest-card,
.expedition-slot,
.upgrade-card,
.gacha-result-card {
  position: relative;
  border: var(--border);
  border-radius: calc(var(--radius) + 2px);
  background:
    var(--texture-paper-asset),
    radial-gradient(circle at 84% 86%, rgba(255, 244, 214, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(246, 230, 195, 0.76), rgba(207, 159, 98, 0.56)),
    var(--texture-cardboard-asset),
    var(--card);
  background-size: 512px 512px, auto, auto, 460px 460px, auto;
  outline: 1px dashed rgba(75, 42, 22, 0.22);
  outline-offset: -8px;
  box-shadow:
    var(--shadow),
    inset 0 2px 0 rgba(255, 255, 255, 0.34),
    inset 0 -4px 0 rgba(95, 60, 30, 0.12),
    inset 0 -12px 22px rgba(83, 48, 28, 0.05);
}

.panel,
.card {
  padding: 14px;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: var(--border);
  border-radius: 20px;
  background:
    var(--texture-paper-asset),
    radial-gradient(circle at 84% 86%, rgba(255, 244, 214, 0.22), transparent 30%),
    linear-gradient(180deg, rgba(246, 230, 195, 0.8), rgba(207, 159, 98, 0.58)),
    var(--texture-cardboard-asset),
    var(--card);
  background-size: 512px 512px, auto, auto, 460px 460px, auto;
  outline: 1px dashed rgba(90, 60, 36, 0.18);
  outline-offset: -8px;
  box-shadow:
    var(--shadow),
    inset 0 2px 0 rgba(255, 255, 255, 0.32),
    inset 0 -4px 0 rgba(95, 60, 30, 0.12);
  color: var(--text-main);
}

.hero-panel::before,
.home-hero::before,
.guide-card::after,
.zone-card.is-active::before {
  content: "";
  position: absolute;
  width: 58px;
  height: 20px;
  border-right: 1px dashed rgba(120, 95, 50, 0.2);
  border-left: 1px dashed rgba(120, 95, 50, 0.2);
  border-radius: 4px;
  background: var(--texture-tape);
  background-size: cover, auto, auto, auto;
  box-shadow: 0 2px 5px rgba(70, 45, 25, 0.12);
  opacity: 0.72;
  pointer-events: none;
}

.hero-panel::before,
.home-hero::before {
  top: -10px;
  left: 28px;
  transform: rotate(-4deg);
}

.guide-card::after {
  top: -9px;
  right: 28px;
  transform: rotate(3deg);
}

.zone-card.is-active::before {
  top: -9px;
  left: 26px;
  transform: rotate(-3deg);
}

.hero-panel p,
.hero-panel .muted {
  color: var(--text-muted);
}

.hero-panel strong,
.hero-panel h1,
.hero-panel h2 {
  color: var(--text-main);
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: -14px;
  color: rgba(83, 48, 28, 0.08);
  font-size: 5rem;
  font-weight: 900;
}

.home-hero {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: var(--border);
  border-radius: 22px;
  background:
    var(--texture-paper-asset),
    radial-gradient(circle at 82% 18%, rgba(233, 184, 66, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(246, 230, 195, 0.82), rgba(207, 159, 98, 0.56)),
    var(--texture-cardboard-asset),
    var(--card);
  background-size: 512px 512px, auto, auto, 480px 480px, auto;
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -16px 28px rgba(83, 48, 28, 0.07);
}

.home-hero::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -34px;
  width: 120px;
  height: 120px;
  border: 1px dashed rgba(83, 48, 28, 0.14);
  border-radius: 50%;
  background:
    radial-gradient(circle at 42% 46%, rgba(63, 111, 106, 0.14) 0 4px, transparent 5px),
    radial-gradient(circle at 60% 64%, rgba(199, 137, 53, 0.16) 0 5px, transparent 6px);
  pointer-events: none;
}

.home-hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.home-hero h1 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1;
}

.home-kicker {
  margin: 0 0 5px;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-status-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.home-status-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid rgba(83, 48, 28, 0.16);
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.48), transparent 38%),
    var(--texture-paper),
    linear-gradient(180deg, rgba(247, 233, 196, 0.68), rgba(216, 189, 130, 0.32));
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.home-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.home-action-card {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  min-height: 76px;
  padding: 10px;
  overflow: hidden;
  border: 2px solid rgba(83, 48, 28, 0.28);
  border-radius: 18px;
  background:
    var(--texture-paper-asset),
    linear-gradient(180deg, rgba(246, 230, 195, 0.78), rgba(207, 159, 98, 0.56)),
    var(--texture-cardboard-asset),
    var(--card);
  background-size: 512px 512px, auto, 360px 360px, auto;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 6px 12px rgba(83, 48, 28, 0.12);
  transition: transform 120ms ease, filter 120ms ease, border-color 120ms ease;
}

.home-action-card::after {
  content: "";
  position: absolute;
  inset: auto -22px -28px auto;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: rgba(63, 111, 106, 0.08);
  pointer-events: none;
}

.home-action-card.is-primary {
  border-color: rgba(183, 120, 28, 0.64);
  background:
    var(--texture-paper-asset),
    linear-gradient(180deg, rgba(255, 229, 145, 0.44), rgba(56, 108, 97, 0.14)),
    var(--texture-cardboard-asset),
    var(--card);
}

.home-action-card:not(:disabled):active {
  transform: translateY(2px) scale(0.99);
}

.home-action-card:not(:disabled):hover {
  filter: brightness(1.04);
  border-color: rgba(83, 48, 28, 0.42);
}

.home-action-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(83, 48, 28, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(180deg, #EFE4C4, #D5C08F);
  color: var(--accent-2);
  color: var(--accent-2);
}

.home-action-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.home-action-copy strong,
.home-action-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-action-copy strong {
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.05;
}

.home-action-copy small {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.home-action-badge {
  position: absolute;
  top: 7px;
  right: 8px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 6px;
  border: 1px solid rgba(111, 72, 18, 0.36);
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.55), transparent 35%),
    linear-gradient(180deg, #F7C84C, #D8951D);
  color: #3B2410;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 2px 5px rgba(70, 40, 15, 0.25);
}

.home-expedition-section {
  margin-top: 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stat {
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(96, 73, 45, 0.26);
  background:
    var(--texture-paper-asset),
    var(--texture-paper),
    linear-gradient(180deg, rgba(239, 228, 196, 0.78), rgba(216, 189, 130, 0.34));
  background-size: 512px 512px, auto, auto;
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 2px 0 rgba(116, 82, 50, 0.1);
}

.stat span {
  display: block;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.stat strong {
  font-size: 0.92rem;
}

.building-card,
.expedition-slot,
.quest-card,
.upgrade-card,
.gacha-result-card {
  padding: 12px;
}

.expedition-slot {
  position: relative;
  overflow: hidden;
}

.expedition-slot::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 42%;
  background:
    linear-gradient(90deg, transparent, rgba(255, 244, 214, 0.22), transparent),
    radial-gradient(circle at 35% 38%, rgba(63, 111, 106, 0.28) 0 4px, transparent 5px),
    radial-gradient(circle at 68% 62%, rgba(199, 137, 53, 0.24) 0 4px, transparent 5px);
  opacity: 0;
  pointer-events: none;
}

.building-card {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 11px;
  overflow: hidden;
}

.building-card.is-active::after {
  content: "";
  position: absolute;
  inset: auto 12px 0 58px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, var(--accent-2), var(--glow), var(--accent));
  opacity: 0.55;
}

.building-icon,
.hamster-portrait,
.item-icon {
  display: grid;
  place-items: center;
  border: 2px solid rgba(83, 48, 28, 0.5);
  border-radius: 16px;
  background:
    var(--texture-paper-asset),
    linear-gradient(180deg, #EFE4C4, #D5C08F);
  background-size: 512px 512px, auto;
  color: var(--accent-2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 2px 4px rgba(65, 40, 20, 0.12);
  font-weight: 900;
}

.building-icon {
  width: 46px;
  height: 46px;
  color: var(--accent);
}

.building-content {
  min-width: 0;
}

.building-role {
  margin-bottom: 2px;
  color: var(--accent-2);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.building-stat-row {
  margin: 8px 0 10px;
}

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

.building-actions .btn {
  flex: 1 1 150px;
}

.building-actions .select-pill {
  flex: 1 1 126px;
  min-height: 40px;
  text-align: center;
}

.hamster-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 12px;
}

.hamster-portrait {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  font-size: 2rem;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.hamster-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  image-rendering: pixelated;
}

.hamster-portrait-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.character-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: var(--border);
  border-radius: 18px;
  background:
    var(--texture-paper-asset),
    radial-gradient(ellipse at 50% 18%, rgba(244, 197, 66, 0.22), transparent 44%),
    linear-gradient(180deg, rgba(77, 46, 29, 0.28), rgba(246, 230, 195, 0.7) 24%, rgba(207, 159, 98, 0.48)),
    var(--texture-cardboard-asset),
    var(--card);
  background-size: 512px 512px, auto, auto, 460px 460px, auto;
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -14px 24px rgba(83, 48, 28, 0.06);
  overflow: hidden;
}

.character-constellation-panel,
.character-stats-panel,
.character-stage {
  min-width: 0;
  border: 1px solid rgba(83, 48, 28, 0.14);
  border-radius: 16px;
  background:
    var(--texture-paper-asset),
    linear-gradient(180deg, rgba(255, 244, 214, 0.44), rgba(207, 159, 98, 0.2)),
    var(--texture-cardboard-asset),
    rgba(255, 255, 255, 0.16);
  background-size: 512px 512px, auto, 320px 320px, auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.character-constellation-panel {
  grid-area: constellation;
  padding: 8px;
}

.character-stage {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 8px 6px 0;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 32%, rgba(255, 244, 214, 0.5), transparent 58%),
    linear-gradient(180deg, rgba(255, 244, 214, 0.1), rgba(83, 48, 28, 0.06));
  border-color: rgba(83, 48, 28, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.character-stats-panel {
  grid-area: stats;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px;
}

.character-stats-panel > .tag {
  width: 100%;
  justify-content: center;
  border-radius: 12px;
  font-size: 0.56rem;
  line-height: 1.1;
  text-align: center;
  white-space: normal;
  background: rgba(255, 244, 214, 0.34);
}

.panel-label {
  margin: 0 0 6px;
  color: var(--accent-2);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.character-constellation-list,
.character-stat-list {
  display: grid;
  gap: 6px;
}

.character-constellation-nodes {
  gap: 7px;
}

.character-constellation {
  display: grid;
  gap: 2px;
  min-height: 56px;
  padding: 7px;
  border: 1px solid rgba(83, 48, 28, 0.13);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 244, 214, 0.34), rgba(255, 255, 255, 0.12)),
    var(--texture-paper),
    rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
}

.character-constellation-node {
  width: 100%;
  min-height: 42px;
  padding: 7px 6px;
  border-style: solid;
  color: var(--text-muted);
  cursor: help;
  text-align: left;
}

.character-constellation.is-active {
  border-color: rgba(199, 137, 53, 0.55);
  background:
    linear-gradient(180deg, rgba(244, 197, 66, 0.24), rgba(199, 137, 53, 0.12)),
    var(--texture-paper);
  color: var(--text-main);
}

.character-constellation span,
.character-slot span {
  font-size: 0.56rem;
  font-weight: 900;
  color: var(--accent-2);
}

.character-constellation strong {
  overflow: hidden;
  font-size: 0.61rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-constellation small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.53rem;
  line-height: 1.15;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.character-stage-art {
  position: relative;
  display: grid;
  place-items: end center;
  width: 100%;
  min-height: 240px;
  max-height: 340px;
  aspect-ratio: 1 / 0.86;
  overflow: visible;
}

.character-stage-art::before {
  content: "";
  position: absolute;
  inset: 18% 8% 10%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255, 244, 214, 0.72), rgba(244, 197, 66, 0.2) 36%, transparent 68%);
  filter: blur(2px);
  opacity: 0.82;
}

.character-stage-art::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 16px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(45, 25, 16, 0.38), rgba(45, 25, 16, 0.08) 62%, transparent 72%);
}

.character-preview-canvas {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 100%;
  height: auto !important;
  image-rendering: pixelated;
}

.character-preview-img,
.character-preview-fallback {
  position: relative;
  z-index: 1;
  width: min(100%, 220px);
  aspect-ratio: 1;
  border-radius: 18px;
  object-fit: contain;
  object-position: center top;
  image-rendering: pixelated;
}

.character-preview-fallback {
  display: grid;
  place-items: center;
  background: rgba(83, 48, 28, 0.1);
  color: var(--accent-2);
}

.character-stage-meta {
  display: grid;
  gap: 7px;
}

.character-stage-meta h3 {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.15;
}

.character-top-row {
  align-items: flex-start;
}

.character-title-block {
  flex: 1;
  min-width: 0;
}

.character-title-block h2 {
  margin: 0;
  font-size: 1.24rem;
  line-height: 1.05;
}

.character-title-tags {
  gap: 5px;
  margin-top: 6px;
}

.character-constellation-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 7px 8px;
  border: 1px solid rgba(83, 48, 28, 0.12);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 244, 214, 0.44), rgba(255, 255, 255, 0.14)),
    rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  cursor: pointer;
}

.character-constellation-summary .panel-label {
  margin: 0;
}

.character-constellation-summary strong {
  font-size: 0.72rem;
  font-weight: 900;
}

.character-constellation-dots {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  min-width: 0;
}

.character-constellation-dots i {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  max-width: 12px;
  border: 1px solid rgba(83, 48, 28, 0.22);
  border-radius: 999px;
  background: rgba(83, 48, 28, 0.08);
}

.character-constellation-dots i.is-active {
  border-color: rgba(199, 137, 53, 0.8);
  background: linear-gradient(180deg, #F4C542, #C78935);
}

.character-combat-card {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 8px 10px;
  border: 1px solid rgba(83, 48, 28, 0.14);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(62, 35, 21, 0.78), rgba(83, 48, 28, 0.62)),
    var(--texture-leather);
  color: var(--text-on-dark);
  box-shadow: inset 0 1px 0 rgba(255, 244, 214, 0.16);
}

.character-combat-card span {
  color: rgba(255, 244, 214, 0.72);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.character-combat-card strong {
  font-size: 1.46rem;
  line-height: 1;
}

.character-level-card {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid rgba(83, 48, 28, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 244, 214, 0.48), rgba(255, 255, 255, 0.14)),
    rgba(255, 255, 255, 0.13);
}

.character-level-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-main);
  font-size: 0.76rem;
  font-weight: 900;
}

.character-level-track {
  overflow: hidden;
  height: 8px;
  border: 1px solid rgba(83, 48, 28, 0.16);
  border-radius: 999px;
  background: rgba(83, 48, 28, 0.12);
}

.character-level-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #C78935, #F4C542);
}

.character-level-cta {
  min-height: 42px;
}

.tag.is-missing {
  border-color: rgba(164, 59, 45, 0.28);
  background: rgba(164, 59, 45, 0.12);
  color: #8E2F24;
}

.character-weapon-strip {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(83, 48, 28, 0.14);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 244, 214, 0.45), rgba(255, 255, 255, 0.16)),
    var(--texture-paper),
    rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
  text-align: left;
}

.character-weapon-strip.is-equipped {
  border-color: rgba(199, 137, 53, 0.5);
  background:
    linear-gradient(180deg, rgba(244, 197, 66, 0.24), rgba(199, 137, 53, 0.12)),
    var(--texture-paper);
}

.character-weapon-strip.is-empty {
  color: var(--text-muted);
}

.character-weapon-icon,
.character-weapon-empty-icon {
  width: 44px;
  height: 44px;
}

.character-weapon-empty-icon {
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(83, 48, 28, 0.08);
  color: var(--accent-2);
}

.character-weapon-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.character-weapon-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.character-weapon-head > div {
  min-width: 0;
}

.character-weapon-head strong {
  display: block;
  overflow: hidden;
  color: var(--text-main);
  font-size: 0.82rem;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-weapon-body p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.25;
}

.character-weapon-cost {
  gap: 5px;
}

.character-weapon-actions .btn {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  min-height: 36px;
  padding: 7px 8px;
  font-size: 0.7rem;
}

.character-cost-row {
  justify-content: center;
  gap: 6px;
}

.character-stat-chip-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.character-stat-grid-wide {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.character-stat-chip {
  display: grid;
  gap: 1px;
  min-width: 0;
  min-height: 48px;
  align-content: center;
  padding: 6px 5px;
  border: 1px solid rgba(83, 48, 28, 0.12);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 244, 214, 0.44), rgba(255, 255, 255, 0.14)),
    rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.character-stat-chip small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-stat-chip strong {
  color: var(--text-main);
  font-size: 0.98rem;
  font-weight: 900;
}

.character-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 27px;
  padding: 5px 6px;
  border-radius: 10px;
  border: 1px solid rgba(83, 48, 28, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 244, 214, 0.32), rgba(255, 255, 255, 0.12)),
    rgba(255, 255, 255, 0.18);
}

.character-stat-row span {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.56rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-stat-row strong {
  color: var(--text-main);
  font-size: 0.76rem;
  font-weight: 900;
}

.character-slot-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.character-slot {
  display: grid;
  place-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 76px;
  padding: 7px 4px;
  border: 1px solid rgba(83, 48, 28, 0.14);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 244, 214, 0.34), rgba(213, 185, 130, 0.12)),
    var(--texture-paper),
    rgba(255, 255, 255, 0.16);
  color: var(--text-main);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.character-slot:disabled {
  cursor: default;
  opacity: 0.62;
}

.character-slot.is-filled {
  border-color: rgba(199, 137, 53, 0.48);
  background:
    linear-gradient(180deg, rgba(244, 197, 66, 0.22), rgba(199, 137, 53, 0.12)),
    var(--texture-paper);
  cursor: default;
}

.character-slot.is-active {
  border-color: rgba(199, 137, 53, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 0 0 2px rgba(244, 197, 66, 0.18);
}

.character-slot strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-equipment-panel .section-header {
  margin-bottom: 8px;
}

.compact-stack {
  gap: 8px;
}

.character-equipment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: var(--border);
  border-radius: var(--radius);
  background:
    var(--texture-paper-asset),
    linear-gradient(180deg, rgba(246, 230, 195, 0.72), rgba(207, 159, 98, 0.52)),
    var(--texture-cardboard-asset),
    var(--card);
  background-size: 512px 512px, auto, 420px 420px, auto;
}

.character-equipment-row > div {
  min-width: 0;
}

.character-equipment-main {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.character-equipment-icon {
  width: 46px;
  height: 46px;
}

.character-equipment-row strong {
  display: block;
  overflow: hidden;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-equipment-stats {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.character-equipment-main .tag-row,
.character-equipment-cost {
  gap: 5px;
  margin-top: 5px;
}

.equipment-stat-tags {
  gap: 5px;
}

.equipment-stat-tags .tag {
  background: rgba(57, 125, 76, 0.15);
  color: #397D4C;
}

.character-equipment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
}

.character-equipment-actions .select-pill {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 0.72rem;
  line-height: 1.1;
  white-space: normal;
}

.character-equipment-focus {
  display: grid;
  gap: 9px;
}

.character-equipped-card,
.character-equipment-option {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(83, 48, 28, 0.13);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 244, 214, 0.42), rgba(255, 255, 255, 0.14)),
    var(--texture-paper),
    rgba(255, 255, 255, 0.16);
}

.character-equipped-card.is-equipped {
  border-color: rgba(199, 137, 53, 0.44);
  background:
    linear-gradient(180deg, rgba(244, 197, 66, 0.2), rgba(199, 137, 53, 0.08)),
    var(--texture-paper),
    rgba(255, 255, 255, 0.14);
}

.character-equipped-card.is-empty {
  align-items: center;
  color: var(--text-muted);
}

.character-equipped-art,
.character-equipment-option-art,
.character-equipped-empty-icon {
  width: 52px;
  height: 52px;
}

.character-equipped-empty-icon {
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(83, 48, 28, 0.08);
  color: var(--accent-2);
}

.character-equipped-body,
.character-equipment-option-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.character-equipped-head,
.character-equipment-option-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.character-equipped-head > div {
  min-width: 0;
}

.character-equipped-head strong,
.character-equipment-option-head strong {
  display: block;
  overflow: hidden;
  color: var(--text-main);
  font-size: 0.88rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-equipped-card p,
.character-equipment-option p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.character-equipped-actions .btn,
.character-equipment-option .btn {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  min-height: 38px;
  padding: 8px 9px;
  font-size: 0.74rem;
}

.character-equipped-actions,
.inventory-equipment-actions {
  flex-wrap: wrap;
}

.character-equipment-option-grid {
  display: grid;
  gap: 8px;
}

.equipment-delta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.equipment-delta-row span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(83, 48, 28, 0.08);
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 850;
}

.equipment-delta-row .stat-positive {
  background: rgba(57, 125, 76, 0.14);
  color: #397D4C;
}

.equipment-delta-row .stat-negative {
  background: rgba(164, 59, 45, 0.12);
  color: #8E2F24;
}

.equipment-passive {
  margin: 4px 0;
  color: rgba(55, 35, 20, 0.78);
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.25;
}

.constellation-detail-list {
  display: grid;
  gap: 8px;
}

.constellation-detail-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(83, 48, 28, 0.14);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 244, 214, 0.38), rgba(255, 255, 255, 0.14)),
    var(--texture-paper),
    rgba(255, 255, 255, 0.16);
}

.constellation-detail-card.is-active {
  border-color: rgba(199, 137, 53, 0.5);
  background:
    linear-gradient(180deg, rgba(244, 197, 66, 0.2), rgba(199, 137, 53, 0.08)),
    var(--texture-paper),
    rgba(255, 255, 255, 0.14);
}

.constellation-detail-level {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(62, 35, 21, 0.78), rgba(83, 48, 28, 0.62)),
    var(--texture-leather);
  color: var(--text-on-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.constellation-detail-card h3 {
  margin: 0;
  font-size: 0.92rem;
}

.constellation-detail-card p {
  margin: 6px 0;
  font-size: 0.8rem;
  line-height: 1.35;
}

@media (min-width: 680px) {
  .character-equipment-row {
    grid-template-columns: minmax(0, 1.1fr) minmax(170px, 0.9fr);
    align-items: center;
  }

  .character-equipment-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 380px) {
  .character-stat-grid-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.zone-card {
  padding: 14px;
  cursor: pointer;
}

.zone-map-card {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
}

.zone-map-card::after {
  content: "";
  position: absolute;
  inset: 8px 10px auto auto;
  width: 64px;
  height: 44px;
  opacity: 0.14;
  background:
    radial-gradient(circle at 22% 48%, rgba(63, 111, 106, 0.9) 0 3px, transparent 4px),
    radial-gradient(circle at 68% 30%, rgba(199, 137, 53, 0.9) 0 3px, transparent 4px),
    linear-gradient(120deg, transparent 0 26%, rgba(83, 48, 28, 0.9) 27% 30%, transparent 31% 58%, rgba(83, 48, 28, 0.8) 59% 62%, transparent 63%);
  pointer-events: none;
}

.zone-map-icon {
  display: grid;
  width: 52px;
  height: 58px;
  place-items: center;
  align-self: start;
  border: 1.5px solid rgba(96, 73, 45, 0.32);
  border-radius: 16px;
  background:
    var(--texture-paper-asset),
    linear-gradient(180deg, #EFE4C4, #D5C08F);
  background-size: 512px 512px, auto;
  color: var(--accent-2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 2px 4px rgba(65, 40, 20, 0.12);
}

.zone-card-body {
  min-width: 0;
}

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

.zone-stat-grid .tag {
  justify-content: center;
  min-width: 0;
  font-size: 0.69rem;
}

.zone-card.is-active {
  border-color: rgba(183, 120, 28, 0.76);
  background:
    var(--texture-paper-asset),
    radial-gradient(circle at 84% 86%, rgba(255, 255, 255, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(247, 200, 76, 0.28), rgba(79, 117, 84, 0.12)),
    var(--texture-cardboard-asset),
    var(--card);
  background-size: 512px 512px, auto, auto, auto, auto;
}

.inventory-card {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 10px;
  padding: 10px;
}

.inventory-equipment-board {
  display: grid;
  gap: 10px;
}

.inventory-equipment-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: var(--border);
  border-radius: var(--radius);
  background:
    var(--texture-paper-asset),
    linear-gradient(180deg, rgba(246, 230, 195, 0.74), rgba(207, 159, 98, 0.52)),
    var(--texture-cardboard-asset),
    var(--card);
  background-size: 512px 512px, auto, 420px 420px, auto;
}

.inventory-equipment-panel-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.inventory-equipment-panel-head > div {
  min-width: 0;
}

.inventory-equipment-panel-head strong {
  display: block;
  overflow: hidden;
  color: var(--text-main);
  font-size: 0.92rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-equipment-slot-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(83, 48, 28, 0.13);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 244, 214, 0.5), rgba(255, 255, 255, 0.14)),
    rgba(255, 255, 255, 0.14);
  color: var(--accent-2);
}

.inventory-equipment-list {
  display: grid;
  gap: 8px;
}

.inventory-equipment-tile {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  padding: 9px;
  border: 1px solid rgba(83, 48, 28, 0.13);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 244, 214, 0.38), rgba(255, 255, 255, 0.14)),
    var(--texture-paper),
    rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.inventory-equipment-tile.is-equipped {
  border-color: rgba(199, 137, 53, 0.42);
  background:
    linear-gradient(180deg, rgba(244, 197, 66, 0.18), rgba(199, 137, 53, 0.08)),
    var(--texture-paper),
    rgba(255, 255, 255, 0.16);
}

.inventory-equipment-art {
  width: 52px;
  height: 52px;
}

.inventory-equipment-tile-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.inventory-equipment-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.inventory-equipment-title-row h3 {
  margin: 0;
  overflow: hidden;
  color: var(--text-main);
  font-size: 0.88rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-equipment-tile p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.inventory-equipment-cost {
  gap: 5px;
}

.inventory-equipment-actions .btn {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  min-height: 38px;
  padding: 8px 9px;
  font-size: 0.74rem;
}

.inventory-equipment-empty {
  display: grid;
  min-height: 72px;
  place-items: center;
  gap: 4px;
  padding: 10px;
  border: 1px dashed rgba(83, 48, 28, 0.2);
  border-radius: 12px;
  color: var(--text-muted);
  text-align: center;
}

.inventory-equipment-empty span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--accent-2);
  opacity: 0.72;
}

.inventory-equipment-empty p {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 850;
}

/* ── Boss battle ─────────────────────────────────── */
.battle-screen {
  display: block;
}

.battle-boss-list,
.battle-arena,
.battle-setup-panel {
  display: grid;
  gap: 8px;
}

.battle-boss-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(83, 48, 28, 0.1);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 244, 214, 0.28), rgba(255, 255, 255, 0.08)),
    var(--texture-paper),
    rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  text-align: left;
}

.battle-boss-card.is-active {
  border-color: rgba(164, 59, 45, 0.52);
  box-shadow: 0 0 0 2px rgba(164, 59, 45, 0.1);
}

.battle-boss-mark,
.battle-boss-avatar {
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(164, 59, 45, 0.14);
  color: #8E2F24;
}

.battle-boss-mark {
  width: 44px;
  height: 44px;
  overflow: hidden;
}

.battle-boss-thumb {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  object-position: center;
}

.battle-boss-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.battle-boss-copy strong,
.battle-action-panel strong,
.battle-fighter strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-boss-copy small {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.battle-team-grid {
  display: grid;
  gap: 6px;
}

.battle-team-pill {
  min-height: 46px;
  padding: 5px 8px;
  border-width: 1px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 244, 214, 0.3), rgba(255, 255, 255, 0.07)),
    var(--texture-paper),
    rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.battle-field {
  position: relative;
  min-height: min(60dvh, 520px);
  overflow: hidden;
  border: 1px solid rgba(83, 48, 28, 0.045);
  border-radius: 12px;
  background:
    radial-gradient(circle at 78% 36%, rgba(164, 59, 45, 0.055), transparent 22%),
    radial-gradient(circle at 24% 48%, rgba(57, 125, 76, 0.07), transparent 24%),
    linear-gradient(180deg, rgba(255, 244, 214, 0.24), rgba(207, 159, 98, 0.12)),
    var(--texture-paper);
  box-shadow: none;
}

.battle-turn-chip {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 4;
  display: inline-flex;
  max-width: 64%;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid rgba(83, 48, 28, 0.18);
  border-radius: 999px;
  background: rgba(255, 244, 214, 0.86);
  box-shadow: 0 5px 14px rgba(83, 48, 28, 0.12);
  color: var(--text-main);
  transform: translateX(-50%);
}

.battle-turn-chip span,
.battle-turn-chip strong {
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-turn-chip strong {
  color: #8E2F24;
}

.battle-team-lane {
  position: absolute;
  top: 16px;
  bottom: 14px;
  left: 6px;
  z-index: 2;
  display: grid;
  width: min(31%, 118px);
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.battle-boss-unit {
  position: absolute;
  right: 0;
  top: 68px;
  z-index: 1;
  width: 62%;
  height: 58%;
  min-height: 210px;
}

.battle-boss-hp {
  position: absolute;
  top: -34px;
  right: 14px;
  left: 10px;
  z-index: 3;
  display: grid;
  gap: 4px;
}

.battle-boss-hp > strong {
  overflow: hidden;
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-boss-sprite {
  position: absolute;
  right: -8%;
  bottom: 0;
  display: block;
  width: 250px;
  height: 250px;
  max-width: 122%;
  max-height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 12px 12px rgba(55, 35, 20, 0.22));
}

.battle-boss-sprite.boss-frames {
  overflow: visible;
}

.boss-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  object-fit: contain;
  object-position: center bottom;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: opacity;
}

.boss-frame-count-4 .boss-frame {
  animation-duration: 1100ms;
  animation-iteration-count: infinite;
  animation-timing-function: steps(1, end);
  animation-fill-mode: both;
}

.boss-frame-count-4 .boss-frame-1 {
  opacity: 1;
  animation-name: bossFrame4A;
}

.boss-frame-count-4 .boss-frame-2 {
  animation-name: bossFrame4B;
}

.boss-frame-count-4 .boss-frame-3 {
  animation-name: bossFrame4C;
}

.boss-frame-count-4 .boss-frame-4 {
  animation-name: bossFrame4D;
}

.boss-pose-attack .boss-frame {
  animation-duration: 620ms;
  animation-iteration-count: 1;
}

.boss-pose-damage .boss-frame {
  animation-duration: 520ms;
  animation-iteration-count: 1;
}

@keyframes bossFrame4A {
  0%, 24.99% { opacity: 1; }
  25%, 100% { opacity: 0; }
}

@keyframes bossFrame4B {
  0%, 24.99% { opacity: 0; }
  25%, 49.99% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes bossFrame4C {
  0%, 49.99% { opacity: 0; }
  50%, 74.99% { opacity: 1; }
  75%, 100% { opacity: 0; }
}

@keyframes bossFrame4D {
  0%, 74.99% { opacity: 0; }
  75%, 100% { opacity: 1; }
}

.battle-boss-fallback {
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(164, 59, 45, 0.14);
  color: #8E2F24;
}

.battle-boss-stage,
.battle-action-panel,
.battle-result {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: var(--border);
  border-radius: var(--radius);
  background:
    var(--texture-paper-asset),
    linear-gradient(180deg, rgba(246, 230, 195, 0.76), rgba(207, 159, 98, 0.5)),
    var(--texture-cardboard-asset),
    var(--card);
  background-size: 512px 512px, auto, 420px 420px, auto;
}

.battle-boss-stage {
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: center;
}

.battle-boss-avatar {
  width: 66px;
  height: 66px;
}

.battle-boss-avatar svg {
  width: 34px;
  height: 34px;
}

.battle-boss-state {
  min-width: 0;
}

.battle-boss-state h2 {
  margin: 0;
  font-size: 1.1rem;
}

.battle-hp {
  position: relative;
  height: 20px;
  overflow: hidden;
  border: 1px solid rgba(83, 48, 28, 0.24);
  border-radius: 999px;
  background: rgba(83, 48, 28, 0.12);
}

.battle-hp span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #397D4C, #74B66A);
}

.battle-hp-boss span {
  background: linear-gradient(90deg, #8E2F24, #D15A3F);
}

.battle-hp strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #2d1a11;
  font-size: 0.68rem;
  font-weight: 950;
  text-shadow: 0 1px 0 rgba(255, 244, 214, 0.5);
}

.battle-team-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.battle-fighter {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
}

.battle-fighter.is-active {
  border-color: rgba(244, 197, 66, 0.28);
  background: rgba(255, 244, 214, 0.08);
  box-shadow: none;
}

.battle-fighter.is-down {
  opacity: 0.48;
}

.battle-fighter.has-sprite {
  padding-inline: 4px;
}

.battle-fighter strong {
  overflow: hidden;
  font-size: 0.68rem;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-fighter-art {
  display: grid;
  min-height: 0;
  overflow: hidden;
  place-items: center;
}

.battle-fighter-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.battle-fighter-art span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--accent-2);
}

.battle-fighter-art .battle-hamster-sprite {
  position: relative;
  display: block;
  width: min(128px, 132%);
  height: auto;
  max-width: 132%;
  aspect-ratio: var(--sprite-aspect, 1.5);
  filter: drop-shadow(0 7px 7px rgba(55, 35, 20, 0.2));
}

.battle-hamster-sprite-layer {
  position: absolute;
  inset: 0;
  display: block;
  background-position: 0 0;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.battle-hamster-sprite-layer.sprite-frames-4 {
  background-size: 400% 100%;
}

.battle-hamster-sprite-layer.sprite-frames-5 {
  background-size: 500% 100%;
}

.battle-hamster-sprite-layer.sprite-frames-6 {
  background-size: 600% 100%;
}

.battle-hamster-idle.sprite-frames-4 {
  animation: battleSprite4 var(--idle-duration, 570ms) linear infinite;
}

.battle-hamster-attack {
  opacity: 0;
}

.battle-hamster-sprite.is-attacking .battle-hamster-attack.sprite-frames-4 {
  animation:
    battleSprite4 var(--attack-duration, 500ms) linear 1,
    battleSpriteAttackVisibility var(--attack-duration, 500ms) linear 1 forwards;
}

.battle-hamster-sprite.is-attacking .battle-hamster-attack.sprite-frames-5 {
  animation:
    battleSprite5 var(--attack-duration, 500ms) linear 1,
    battleSpriteAttackVisibility var(--attack-duration, 500ms) linear 1 forwards;
}

.battle-hamster-sprite.is-attacking .battle-hamster-attack.sprite-frames-6 {
  animation:
    battleSprite6 var(--attack-duration, 500ms) linear 1,
    battleSpriteAttackVisibility var(--attack-duration, 500ms) linear 1 forwards;
}

@keyframes battleSprite4 {
  0%, 24.99% { background-position-x: 0%; }
  25%, 49.99% { background-position-x: 33.333%; }
  50%, 74.99% { background-position-x: 66.667%; }
  75%, 100% { background-position-x: 100%; }
}

@keyframes battleSprite5 {
  0%, 19.99% { background-position-x: 0%; }
  20%, 39.99% { background-position-x: 25%; }
  40%, 59.99% { background-position-x: 50%; }
  60%, 79.99% { background-position-x: 75%; }
  80%, 100% { background-position-x: 100%; }
}

@keyframes battleSprite6 {
  0%, 16.66% { background-position-x: 0%; }
  16.67%, 33.32% { background-position-x: 20%; }
  33.33%, 49.99% { background-position-x: 40%; }
  50%, 66.65% { background-position-x: 60%; }
  66.66%, 83.32% { background-position-x: 80%; }
  83.33%, 100% { background-position-x: 100%; }
}

@keyframes battleSpriteAttackVisibility {
  0%, 92% { opacity: 1; }
  100% { opacity: 0; }
}

.battle-skill-wheel {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 5;
  width: 126px;
  height: 116px;
}

.battle-skill {
  position: absolute;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 3px solid currentColor;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 26%, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.24) 34%, rgba(255, 255, 255, 0.08)),
    rgba(255, 244, 214, 0.7);
  box-shadow: 0 7px 13px rgba(83, 48, 28, 0.18);
  cursor: pointer;
}

.battle-skill:disabled {
  cursor: default;
  filter: grayscale(0.8);
  opacity: 0.5;
}

.battle-skill.is-ready-action {
  animation: readyActionPulse 1.8s ease-in-out infinite;
}

.battle-skill svg {
  width: 25px;
  height: 25px;
}

.battle-skill-attack {
  left: 0;
  bottom: 14px;
  color: #D8242F;
}

.battle-skill-boss {
  left: 8px;
  top: 0;
  color: #8E2F24;
}

.battle-skill-guard {
  right: 0;
  bottom: 0;
  color: #98D416;
}

.battle-skill-retreat {
  right: 6px;
  top: 0;
  color: #E8D600;
}

.battle-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}

.battle-action-row .btn {
  min-width: 0;
  min-height: 42px;
  padding: 8px 9px;
  font-size: 0.78rem;
}

.battle-log {
  position: absolute;
  right: 148px;
  bottom: 16px;
  left: calc(min(31%, 118px) + 12px);
  z-index: 5;
  display: grid;
  gap: 5px;
}

.battle-log span {
  overflow: hidden;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(83, 48, 28, 0.035);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-result.is-won {
  border-color: rgba(57, 125, 76, 0.34);
}

.battle-result.is-lost {
  border-color: rgba(164, 59, 45, 0.34);
}

.equipment-inline {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 10px;
  padding: 10px 0;
}

.item-icon {
  width: 50px;
  height: 50px;
  color: var(--accent-2);
}

.item-icon .item-sprite {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.character-slot .item-sprite {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
}

.gacha-result-art .item-sprite {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.tag-row,
.duration-row,
.ration-row,
.team-grid,
.constellation-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ration-pill {
  display: grid;
  min-width: min(100%, 172px);
  flex: 1 1 172px;
  gap: 2px;
  align-content: center;
  text-align: left;
}

.ration-pill small {
  overflow: hidden;
  color: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  opacity: 0.78;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-row.zone-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.team-grid {
  align-items: stretch;
}

.team-pill {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 52px;
  min-width: min(100%, 176px);
  flex: 1 1 176px;
  padding: 7px 9px;
  border-radius: 16px;
  text-align: left;
}

.team-pill-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(83, 48, 28, 0.18);
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 244, 214, 0.56), transparent 45%),
    var(--parchment-dark);
}

.team-pill-avatar img,
.team-pill-avatar-fallback {
  width: 100%;
  height: 100%;
}

.team-pill-avatar img {
  display: block;
  object-fit: cover;
  object-position: center top;
  image-rendering: pixelated;
}

.team-pill-avatar-fallback {
  display: grid;
  place-items: center;
  color: var(--accent-2);
}

.team-pill-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.team-pill-copy strong,
.team-pill-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-pill-copy strong {
  color: var(--text-main);
  font-size: 0.78rem;
  line-height: 1.05;
}

.team-pill-copy small {
  color: var(--text-muted);
  font-size: 0.64rem;
  font-weight: 800;
}

.team-pill.is-active .team-pill-copy strong,
.team-pill.is-active .team-pill-copy small {
  color: var(--accent);
}

.constellation-row {
  margin: 8px 0;
  gap: 6px;
}

.constellation-node {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 2px solid rgba(83, 48, 28, 0.25);
  border-radius: 50%;
  background: rgba(83, 48, 28, 0.08);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.constellation-node.is-active {
  border-color: var(--accent);
  background: rgba(199, 137, 53, 0.22);
  color: var(--accent);
}

.upgrade-card {
  display: grid;
  gap: 10px;
}

.gacha-result-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: 8px;
  min-height: 158px;
  padding: 10px;
  overflow: hidden;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(199, 137, 53, 0.18), transparent),
    var(--card);
}

.gacha-result-card.is-prize::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0 36%, rgba(255, 238, 163, 0.26) 48%, transparent 62% 100%);
  pointer-events: none;
}

.gacha-result-art {
  position: relative;
  z-index: 1;
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(83, 48, 28, 0.32);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(63, 111, 106, 0.12)),
    var(--parchment-dark);
  color: var(--accent-2);
}

.gacha-result-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  image-rendering: pixelated;
}

.gacha-result-art span {
  display: grid;
  place-items: center;
}

.gacha-result-info {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
}

.gacha-result-info .card-row {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.gacha-result-info h3 {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.gacha-result-info p {
  display: -webkit-box;
  max-width: 100%;
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(96, 73, 45, 0.24);
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.42), transparent 36%),
    var(--texture-paper),
    linear-gradient(180deg, rgba(247, 233, 196, 0.72), rgba(216, 189, 130, 0.28));
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 1px 2px rgba(70, 40, 15, 0.08);
}

.rarity-common { color: var(--common); }
.rarity-uncommon { color: var(--uncommon); }
.rarity-rare { color: var(--rare); }
.rarity-epic { color: var(--epic); }
.rarity-legendary { color: var(--legendary); }
.rarity-mythic { color: var(--mythic); }

.rarity-frame-common {
  border-color: rgba(184, 155, 115, 0.45);
}

.rarity-frame-uncommon {
  border-color: rgba(128, 185, 90, 0.58);
  background:
    radial-gradient(circle at 18% 22%, rgba(128, 185, 90, 0.1), transparent 28%),
    var(--texture-cardboard),
    var(--card);
}

.rarity-frame-rare {
  border-color: rgba(95, 212, 232, 0.6);
  background:
    radial-gradient(circle at 82% 16%, rgba(95, 212, 232, 0.12), transparent 28%),
    var(--texture-cardboard),
    var(--card);
}

.rarity-frame-epic {
  border-color: rgba(142, 91, 214, 0.72);
  background:
    repeating-linear-gradient(120deg, rgba(142, 91, 214, 0.075) 0 1px, transparent 1px 13px),
    var(--texture-cardboard),
    var(--card);
}

.rarity-frame-legendary {
  border-color: rgba(244, 154, 60, 0.72);
  background:
    linear-gradient(115deg, transparent 0 36%, rgba(255, 224, 135, 0.18) 44%, transparent 56%),
    var(--texture-cardboard),
    var(--card);
}

.rarity-frame-mythic {
  border-color: rgba(240, 107, 201, 0.72);
  background:
    radial-gradient(circle at 18% 18%, rgba(240, 107, 201, 0.14), transparent 28%),
    radial-gradient(circle at 86% 72%, rgba(63, 111, 106, 0.12), transparent 32%),
    var(--texture-cardboard),
    var(--card);
}

.timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(63, 111, 106, 0.24);
  background: rgba(63, 111, 106, 0.12);
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 900;
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, rgba(83, 48, 28, 0.08) 0 2px, transparent 2px 8px),
    rgba(83, 48, 28, 0.22);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 7px),
    linear-gradient(90deg, var(--wood), var(--accent));
}

textarea.save-text {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  border: 2px solid rgba(83, 48, 28, 0.22);
  border-radius: 16px;
  background: rgba(246, 231, 199, 0.72);
  color: var(--text-main);
  padding: 12px;
}

/* ── Empty states ─────────────────────────────── */
.empty-state {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 28px 16px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--card);
  text-align: center;
}

.empty-icon {
  color: var(--wood-dark);
  line-height: 1;
  margin-bottom: 4px;
}

/* ── Hamster status badge variants ─────────────── */
.tag.status-available   { background: linear-gradient(180deg, rgba(158, 173, 117, 0.28), rgba(79, 117, 84, 0.14)); color: var(--success); }
.tag.status-in_expedition { background: linear-gradient(180deg, rgba(143, 194, 188, 0.24), rgba(63, 111, 106, 0.12)); color: var(--accent-2); }
.tag.status-injured     { background: linear-gradient(180deg, rgba(201, 75, 61, 0.2), rgba(164, 59, 45, 0.12)); color: var(--danger); }
.tag.status-resting     { background: linear-gradient(180deg, rgba(247, 200, 76, 0.28), rgba(183, 120, 28, 0.14)); color: var(--accent); }

/* ── Shop placeholder item card ─────────────────── */
.shop-item-card {
  padding: 14px 10px;
  border: var(--border);
  border-radius: 18px;
  background: rgba(83, 48, 28, 0.06);
  text-align: center;
  font-size: 1.6rem;
  line-height: 1.4;
}

/* ── Rarity glow enhancements ───────────────────── */
.rarity-frame-epic      { border-color: rgba(142, 91, 214, 0.72);  box-shadow: var(--shadow), 0 0 10px rgba(142, 91, 214, 0.14); }
.rarity-frame-legendary { border-color: rgba(244, 154, 60, 0.72);  box-shadow: var(--shadow), 0 0 14px rgba(244, 154, 60, 0.2); }
.rarity-frame-mythic    { border-color: rgba(240, 107, 201, 0.72); box-shadow: var(--shadow), 0 0 14px rgba(240, 107, 201, 0.2); }

/* ── Hero panel per-screen decoration ───────────── */
.hero-gacha {
  position: relative;
  overflow: hidden;
  padding: 20px 22px;
  background:
    var(--texture-paper-asset),
    linear-gradient(180deg, rgba(255, 244, 214, 0.9), rgba(234, 216, 180, 0.78)),
    repeating-linear-gradient(120deg, rgba(83, 48, 28, 0.045) 0 1px, transparent 1px 13px),
    linear-gradient(135deg, rgba(199, 137, 53, 0.16), rgba(63, 111, 106, 0.1)),
    var(--parchment);
  background-size: 512px 512px, auto, auto, auto, auto;
}

.hero-gacha .top-row {
  align-items: flex-start;
  margin-bottom: 6px;
}

.featured-card {
  display: inline-flex;
  align-items: center;
  margin-top: 7px;
  padding: 5px 10px;
  border: 1px solid rgba(90, 53, 28, 0.14);
  border-radius: 999px;
  background: rgba(66, 45, 29, 0.12);
  color: #5A351C;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.1;
}

.hero-gacha p,
.hero-gacha .muted {
  color: var(--text-muted);
}

.hero-gacha strong,
.hero-gacha h1,
.hero-gacha h2 {
  color: var(--text-main);
}

.hero-gacha > * {
  position: relative;
  z-index: 1;
}

.hero-gacha::after {
  content: "";
  position: absolute;
  width: 78px;
  height: 56px;
  right: 14px;
  top: 16px;
  border: 2px dashed rgba(83, 48, 28, 0.22);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(199, 137, 53, 0.12)),
    var(--texture-paper);
  transform: rotate(5deg);
  opacity: 0.74;
  pointer-events: none;
}

.gacha-box-stage {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 280px;
  place-items: center;
  margin: 8px 0 16px;
  overflow: hidden;
  perspective: 800px;
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 50% 82%, rgba(70, 39, 20, 0.22), transparent 34%),
    radial-gradient(circle at 50% 50%, rgba(255, 211, 92, 0.28), rgba(255, 211, 92, 0.07) 44%, transparent 72%),
    linear-gradient(180deg, rgba(255, 244, 214, 0.08), rgba(83, 48, 28, 0.03));
}

.gacha-box-stage::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 54%;
  z-index: 0;
  width: 250px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 205, 80, 0.34), rgba(255, 205, 80, 0.09) 48%, transparent 72%);
  filter: blur(9px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.gacha-box-stage::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 0;
  width: 236px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(55, 30, 15, 0.32), rgba(55, 30, 15, 0.08) 66%, transparent 76%);
  filter: blur(2px);
  transform: translateX(-50%);
  pointer-events: none;
}

.gacha-box {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 5;
  width: 226px;
  height: 140px;
  transform: translateX(-50%) translateY(4px);
  transform-style: preserve-3d;
  filter:
    drop-shadow(0 16px 15px rgba(66, 38, 20, 0.32))
    drop-shadow(0 2px 0 rgba(255, 244, 214, 0.25));
  animation: gachaEnvelopeIdle 3.2s ease-in-out infinite;
}

.gacha-box-base,
.gacha-box-lid {
  position: absolute;
  left: 50%;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 34%),
    repeating-linear-gradient(105deg, rgba(92, 58, 31, 0.035) 0 1px, transparent 1px 9px),
    var(--texture-paper-asset),
    linear-gradient(180deg, #FFF0BF 0%, #E5BE72 58%, #C99045 100%);
  background-size: auto, auto, 512px 512px, auto;
  border: 2px solid rgba(95, 58, 27, 0.32);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.58),
    inset 0 -8px 14px rgba(89, 50, 25, 0.13),
    0 8px 16px rgba(83, 48, 28, 0.18);
}

.gacha-box-base {
  bottom: 0;
  display: grid;
  width: 198px;
  height: 102px;
  place-items: center;
  overflow: hidden;
  border-radius: 18px;
  transform: translateX(-50%);
}

.gacha-box-base::before,
.gacha-box-base::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.gacha-box-base::before {
  background:
    linear-gradient(31deg, transparent 49%, rgba(82, 47, 24, 0.22) 50%, transparent 51%),
    linear-gradient(-31deg, transparent 49%, rgba(82, 47, 24, 0.22) 50%, transparent 51%),
    linear-gradient(180deg, transparent 58%, rgba(87, 50, 26, 0.08));
}

.gacha-box-base::after {
  left: 12px;
  right: 12px;
  top: 8px;
  height: 33px;
  border: 1px dashed rgba(83, 48, 28, 0.14);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent);
}

.gacha-box-lid {
  bottom: 54px;
  z-index: 2;
  width: 198px;
  height: 76px;
  border-bottom: 0;
  border-radius: 18px 18px 5px 5px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform: translateX(-50%) rotateX(0deg);
  transform-origin: 50% 100%;
}

.gacha-box-lid::after {
  content: "";
  position: absolute;
  right: 22px;
  left: 22px;
  top: 12px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 250, 220, 0.78), transparent);
  opacity: 0.8;
}

.gacha-box-seal {
  position: relative;
  z-index: 4;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(126, 78, 24, 0.36);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.72), transparent 28%),
    radial-gradient(circle, #FFE486 0%, #E6AD35 52%, #B8781E 100%);
  color: #5B3516;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    inset 0 -4px 8px rgba(86, 47, 18, 0.18),
    0 0 0 7px rgba(244, 197, 66, 0.14),
    0 0 18px rgba(244, 197, 66, 0.38);
}

.gacha-box-seal .svg-icon {
  display: none;
}

.gacha-box-seal::before {
  content: "✦";
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
}

.gacha-box-seal::after {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(255, 219, 102, 0.26), transparent 62%);
  animation: gachaSealPulse 1.9s ease-in-out infinite;
  pointer-events: none;
}

.gacha-stage-glow {
  position: absolute;
  left: 50%;
  bottom: 48px;
  z-index: 2;
  width: 240px;
  height: 152px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 238, 163, 0.82), rgba(244, 197, 66, 0.28) 34%, transparent 66%);
  opacity: 0.28;
  filter: blur(7px);
  transform: translateX(-50%) scale(0.86);
  pointer-events: none;
}

.gacha-burst-light {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 1;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 226, 124, 0.44), rgba(244, 197, 66, 0.16) 38%, transparent 68%);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.65);
  pointer-events: none;
}

.gacha-spark-field {
  position: absolute;
  left: 50%;
  top: 45%;
  z-index: 2;
  width: 230px;
  height: 180px;
  opacity: 0;
  background:
    radial-gradient(circle at 14% 56%, rgba(255, 236, 150, 0.95) 0 3px, transparent 4px),
    radial-gradient(circle at 28% 24%, rgba(255, 244, 214, 0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 50% 12%, rgba(255, 221, 98, 0.95) 0 3px, transparent 4px),
    radial-gradient(circle at 70% 26%, rgba(255, 244, 214, 0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 86% 58%, rgba(255, 236, 150, 0.95) 0 3px, transparent 4px),
    radial-gradient(circle at 42% 78%, rgba(255, 221, 98, 0.9) 0 2px, transparent 3px);
  filter: drop-shadow(0 0 8px rgba(244, 197, 66, 0.55));
  transform: translate(-50%, -50%) scale(0.8);
  pointer-events: none;
}

.gacha-reward-preview {
  position: absolute;
  left: 50%;
  bottom: 102px;
  z-index: 6;
  display: grid;
  width: 132px;
  min-height: 154px;
  justify-items: center;
  gap: 5px;
  padding: 9px 8px 10px;
  border: 2px solid rgba(95, 58, 27, 0.28);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 34%),
    var(--texture-paper-asset),
    linear-gradient(180deg, rgba(255, 242, 197, 0.96), rgba(213, 165, 91, 0.9));
  background-size: auto, 512px 512px, auto;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    inset 0 -7px 14px rgba(83, 48, 28, 0.1),
    0 16px 22px rgba(65, 35, 18, 0.22);
  opacity: 0;
  text-align: center;
  transform: translateX(-50%) translateY(46px) scale(0.74) rotate(-4deg);
  pointer-events: none;
}

.gacha-reward-stars {
  min-height: 20px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(70, 42, 22, 0.14);
  color: #6A3C18;
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
}

.gacha-reward-art {
  display: grid;
  width: 84px;
  height: 84px;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(83, 48, 28, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 244, 214, 0.82), rgba(244, 197, 66, 0.18) 54%, rgba(83, 48, 28, 0.08)),
    rgba(255, 244, 214, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    0 5px 10px rgba(83, 48, 28, 0.16);
}

.gacha-reward-art img,
.gacha-reward-fallback {
  width: 100%;
  height: 100%;
}

.gacha-reward-art img {
  display: block;
  object-fit: contain;
  object-position: center bottom;
  image-rendering: auto;
}

.gacha-reward-art .item-sprite {
  padding: 8px;
}

.gacha-reward-fallback {
  display: grid;
  place-items: center;
  color: #6A3C18;
}

.gacha-reward-name {
  max-width: 100%;
  overflow: hidden;
  color: #3B2312;
  font-size: 0.92rem;
  font-weight: 950;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gacha-reward-type {
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(83, 48, 28, 0.1);
  color: rgba(63, 38, 21, 0.72);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.gacha-reveal-card {
  position: absolute;
  left: 50%;
  bottom: 46px;
  z-index: 3;
  display: grid;
  width: 148px;
  min-height: 142px;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 10px;
  border: 2px solid rgba(83, 48, 28, 0.36);
  border-radius: 16px;
  background:
    var(--texture-paper-asset),
    linear-gradient(180deg, rgba(255, 244, 214, 0.95), rgba(234, 216, 180, 0.82));
  background-size: 512px 512px, auto;
  color: var(--accent);
  box-shadow:
    0 10px 22px rgba(83, 48, 28, 0.2),
    0 0 24px rgba(244, 197, 66, 0.22);
  opacity: 0;
  transform: translateX(-50%) translateY(-72px) scale(0.82) rotate(-6deg);
  pointer-events: none;
  text-align: center;
}

.gacha-drop-placeholder {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: rgba(244, 197, 66, 0.16);
}

.gacha-drop-art {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(83, 48, 28, 0.28);
  border-radius: 16px;
  background:
    radial-gradient(circle at 35% 20%, rgba(255, 244, 214, 0.62), transparent 45%),
    var(--parchment-dark);
  color: var(--accent-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.gacha-drop-art img,
.gacha-drop-fallback {
  width: 100%;
  height: 100%;
}

.gacha-drop-art img {
  display: block;
  object-fit: cover;
  object-position: center top;
  image-rendering: pixelated;
}

.gacha-drop-art .item-sprite {
  object-fit: contain;
  padding: 7px;
}

.gacha-drop-fallback {
  display: grid;
  place-items: center;
}

.gacha-drop-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  width: 100%;
}

.gacha-drop-copy strong,
.gacha-reveal-card > strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gacha-drop-copy small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1.1;
}

.gacha-drop-copy .star-rating {
  flex-shrink: 0;
}

.gacha-box-shadow {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 1;
  width: 205px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(55, 30, 15, 0.2), rgba(55, 30, 15, 0.04) 66%, transparent 76%);
  filter: blur(2px);
  transform: translateX(-50%);
}

.gacha-letter-fx {
  position: absolute;
  left: 50%;
  bottom: 96px;
  z-index: 2;
  width: 74px;
  height: 52px;
  border: 2px solid rgba(93, 55, 27, 0.26);
  border-radius: 9px;
  background:
    linear-gradient(32deg, transparent 49%, rgba(83, 48, 28, 0.14) 50%, transparent 51%),
    linear-gradient(-32deg, transparent 49%, rgba(83, 48, 28, 0.14) 50%, transparent 51%),
    var(--texture-paper-asset),
    linear-gradient(180deg, #FFF3C9, #E8C982);
  background-size: auto, auto, 512px 512px, auto;
  opacity: 0;
  filter: drop-shadow(0 10px 10px rgba(65, 36, 18, 0.22));
  transform: translateX(-50%) translateY(24px) scale(0.72) rotate(-8deg);
  pointer-events: none;
}

.gacha-spark-fx {
  position: absolute;
  left: 50%;
  bottom: 112px;
  z-index: 1;
  width: 180px;
  height: 120px;
  opacity: 0;
  background:
    radial-gradient(circle at 18% 58%, rgba(255, 228, 117, 0.95) 0 3px, transparent 4px),
    radial-gradient(circle at 32% 28%, rgba(255, 244, 214, 0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 50% 18%, rgba(255, 214, 92, 0.9) 0 3px, transparent 4px),
    radial-gradient(circle at 68% 34%, rgba(255, 244, 214, 0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 62%, rgba(255, 228, 117, 0.95) 0 3px, transparent 4px);
  filter: drop-shadow(0 0 7px rgba(244, 197, 66, 0.65));
  transform: translateX(-50%);
  pointer-events: none;
}

.gacha-particles {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.gacha-particles span {
  position: absolute;
  left: 50%;
  bottom: 64px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--glow);
  box-shadow: 0 0 10px rgba(244, 197, 66, 0.75);
  opacity: 0;
}

.gacha-particles span:nth-child(1) { --tx: -76px; --ty: -72px; }
.gacha-particles span:nth-child(2) { --tx: -44px; --ty: -112px; }
.gacha-particles span:nth-child(3) { --tx: -18px; --ty: -86px; }
.gacha-particles span:nth-child(4) { --tx: 18px; --ty: -118px; }
.gacha-particles span:nth-child(5) { --tx: 50px; --ty: -88px; }
.gacha-particles span:nth-child(6) { --tx: 82px; --ty: -60px; }
.gacha-particles span:nth-child(7) { --tx: -96px; --ty: -28px; }
.gacha-particles span:nth-child(8) { --tx: 96px; --ty: -32px; }
.gacha-particles span:nth-child(9) { --tx: -10px; --ty: -138px; }
.gacha-particles span:nth-child(10) { --tx: 10px; --ty: -136px; }

.gacha-box-stage.is-open {
  overflow: visible;
}

.gacha-box-stage.is-open .gacha-box {
  animation: gachaBoxOpenShake 540ms ease both;
}

.gacha-box-stage.is-open .gacha-box-lid {
  animation: gachaLidOpen 780ms cubic-bezier(.2, .9, .2, 1) both;
}

.gacha-box-stage.is-open .gacha-stage-glow {
  animation: gachaGlowBurst 920ms ease-out both;
}

.gacha-box-stage.is-open .gacha-reveal-card {
  animation: gachaRewardDrop 980ms cubic-bezier(.18, .9, .22, 1) 230ms both;
}

.gacha-box-stage.is-open .gacha-particles span {
  animation: gachaParticleBurst 900ms ease-out both;
  animation-delay: var(--delay);
}

.gacha-box-stage.is-opening .gacha-box {
  animation: gachaEnvelopeOpenShake 780ms cubic-bezier(.2, .9, .2, 1) forwards;
}

.gacha-box-stage.is-opening .gacha-box-lid {
  animation: gachaLidOpen 780ms cubic-bezier(.2, .9, .2, 1) forwards;
}

.gacha-box-stage.is-opening .gacha-box-seal {
  animation: gachaSealBurst 780ms ease-out forwards;
}

.gacha-box-stage.has-reward .gacha-reward-preview {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1) rotate(0deg);
  transition:
    opacity 220ms ease,
    transform 420ms cubic-bezier(.18, .9, .24, 1.12);
}

.gacha-box-stage.is-opening .gacha-burst-light {
  animation: gachaBurstLightPulse 720ms ease-out forwards;
}

.gacha-box-stage.is-opening .gacha-spark-field {
  animation: gachaSparkBurstBetter 760ms ease-out 120ms forwards;
}

.gacha-box-stage.is-opening .gacha-reward-preview {
  animation: gachaRewardDrop 820ms cubic-bezier(.16, .9, .24, 1) 240ms forwards;
}

.gacha-box-stage.is-opening .gacha-letter-fx {
  animation: gachaLetterFly 820ms cubic-bezier(.16, .9, .24, 1) 220ms forwards;
}

.gacha-box-stage.is-opening .gacha-spark-fx {
  animation: gachaSparkBurst 740ms ease-out 160ms forwards;
}

.gacha-box-stage.has-prize .gacha-stage-glow {
  background:
    radial-gradient(circle, rgba(255, 238, 163, 0.95), rgba(244, 197, 66, 0.38) 34%, rgba(124, 74, 168, 0.18) 56%, transparent 72%);
}

.gacha-box-stage.has-prize .gacha-reveal-card {
  border-color: rgba(244, 197, 66, 0.64);
  box-shadow:
    0 10px 22px rgba(83, 48, 28, 0.2),
    0 0 34px rgba(244, 197, 66, 0.38);
}

.gacha-reward-preview.rarity-common {
  border-color: rgba(150, 120, 82, 0.46);
}

.gacha-reward-preview.rarity-uncommon {
  border-color: rgba(82, 139, 73, 0.62);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    0 16px 22px rgba(65, 35, 18, 0.22),
    0 0 16px rgba(82, 139, 73, 0.22);
}

.gacha-reward-preview.rarity-rare {
  border-color: rgba(63, 111, 106, 0.72);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    0 16px 22px rgba(65, 35, 18, 0.22),
    0 0 18px rgba(63, 111, 106, 0.28);
}

.gacha-reward-preview.rarity-epic {
  border-color: rgba(142, 91, 214, 0.72);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    0 16px 22px rgba(65, 35, 18, 0.22),
    0 0 22px rgba(142, 91, 214, 0.32);
}

.gacha-reward-preview.rarity-legendary {
  border-color: rgba(244, 154, 60, 0.82);
  background:
    linear-gradient(115deg, transparent 0 34%, rgba(255, 235, 157, 0.32) 46%, transparent 60%),
    var(--texture-paper-asset),
    linear-gradient(180deg, rgba(255, 238, 172, 0.98), rgba(218, 151, 55, 0.92));
  background-size: auto, 512px 512px, auto;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    inset 0 -8px 14px rgba(83, 48, 28, 0.12),
    0 16px 22px rgba(65, 35, 18, 0.24),
    0 0 26px rgba(244, 154, 60, 0.42);
}

.gacha-reward-preview.rarity-mythic {
  border-color: rgba(240, 107, 201, 0.82);
  background:
    radial-gradient(circle at 18% 18%, rgba(240, 107, 201, 0.22), transparent 32%),
    radial-gradient(circle at 84% 72%, rgba(63, 111, 106, 0.2), transparent 36%),
    var(--texture-paper-asset),
    linear-gradient(180deg, rgba(255, 230, 204, 0.98), rgba(210, 126, 176, 0.9));
  background-size: auto, auto, 512px 512px, auto;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    0 16px 22px rgba(65, 35, 18, 0.24),
    0 0 28px rgba(240, 107, 201, 0.44);
}

.gacha-action-row .btn {
  flex: 1 1 0;
}

.pull-buttons {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.pull-btn {
  min-height: 58px;
  height: 58px;
  border: 2px solid rgba(55, 35, 20, 0.65);
  border-radius: 16px;
  font-size: 0.96rem;
  font-weight: 950;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.18),
    inset 0 -5px 0 rgba(0, 0, 0, 0.25),
    0 5px 0 rgba(71, 43, 24, 0.45),
    0 10px 16px rgba(70, 42, 20, 0.14);
}

.pull-btn.primary {
  color: #FFF2C8;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 213, 105, 0.24), transparent 45%),
    var(--texture-button-panel-asset),
    linear-gradient(180deg, #6A4A2D 0%, #332215 100%);
  background-size: auto, 100% 100%, auto;
}

.pull-btn.ten-ready {
  color: #FFF2C8;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 213, 105, 0.3), transparent 45%),
    var(--texture-button-panel-asset),
    linear-gradient(180deg, #775331 0%, #3A2616 100%);
  background-size: auto, 100% 100%, auto;
}

.pull-btn.disabled,
.pull-btn:disabled {
  color: rgba(255, 255, 255, 0.56);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.18)),
    linear-gradient(180deg, #6A6863, #343331);
  filter: grayscale(0.25);
  opacity: 0.76;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.32);
}

.pull-btn.primary:active:not(:disabled),
.pull-btn.ten-ready:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.12),
    inset 0 -3px 0 rgba(0, 0, 0, 0.24),
    0 2px 0 rgba(71, 43, 24, 0.45),
    0 5px 10px rgba(70, 42, 20, 0.12);
}

.gacha-trade-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 11px;
  overflow: hidden;
  border: var(--border);
  border-radius: 18px;
  background:
    var(--texture-paper-asset),
    linear-gradient(180deg, rgba(246, 230, 195, 0.82), rgba(207, 159, 98, 0.54)),
    var(--texture-cardboard-asset),
    var(--card);
  background-size: 512px 512px, auto, 380px 380px, auto;
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.exchange-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: 22px;
  background:
    var(--texture-paper-asset),
    linear-gradient(180deg, rgba(255, 238, 195, 0.92), rgba(209, 163, 96, 0.86)),
    var(--texture-cardboard-asset);
  background-size: 512px 512px, auto, 380px 380px;
  border: 2px solid rgba(116, 77, 34, 0.45);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    0 5px 12px rgba(70, 42, 20, 0.22);
}

.gacha-trade-card::after {
  content: "";
  position: absolute;
  inset: auto -22px -28px auto;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(244, 197, 66, 0.1);
  pointer-events: none;
}

.gacha-trade-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(83, 48, 28, 0.18);
  border-radius: 14px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 244, 214, 0.56), transparent 46%),
    rgba(199, 137, 53, 0.14);
  color: var(--accent);
}

.gacha-trade-copy {
  min-width: 0;
}

.gacha-trade-copy h2 {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.05;
}

.gacha-trade-copy p:last-child {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.gacha-trade-card .select-pill {
  position: relative;
  z-index: 1;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  white-space: nowrap;
}

.gacha-trade-card .exchange-btn {
  min-height: 44px;
  height: 44px;
  padding: 0 16px;
  border: 2px solid rgba(52, 74, 31, 0.5);
  border-radius: 14px;
  background:
    linear-gradient(180deg, #8AA05D 0%, #526D36 100%);
  color: #FFF7D4;
  font-weight: 900;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.22),
    inset 0 -3px 0 rgba(0, 0, 0, 0.22),
    0 3px 0 rgba(64, 48, 27, 0.35);
}

/* ── Shiny (Світяшки) counter ───────────────────── */
.shiny-counter {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(244, 197, 66, 0.18);
  border: 1px solid rgba(244, 197, 66, 0.35);
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.shiny-counter::after {
  content: "";
  position: absolute;
  inset: -35% 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.62), transparent);
  transform: translateX(-130%) skewX(-18deg);
  animation: shinySweep 2.8s ease-in-out infinite;
  pointer-events: none;
}

/* ── Gacha pity progress bar ─────────────────────── */
.gacha-pity-box {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(119, 81, 38, 0.18);
  border-radius: 16px;
  background:
    var(--texture-paper-asset),
    linear-gradient(180deg, rgba(255, 244, 214, 0.64), rgba(231, 197, 141, 0.34));
  background-size: 512px 512px, auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.gacha-pity-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: #5B3A1C;
  font-size: 0.82rem;
  font-weight: 900;
}

.gacha-pity-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(89, 63, 38, 0.45);
  overflow: hidden;
  margin: 0;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.2);
}

.gacha-pity-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #C88724, #F4D56A, #74A05A);
  box-shadow: 0 0 8px rgba(245, 200, 74, 0.7);
  transition: width 400ms ease;
  min-width: 6px;
}

.gacha-pity-hint {
  margin-top: 7px;
  color: rgba(74, 47, 24, 0.75);
  font-size: 0.72rem;
  font-weight: 800;
}

.gacha-pity-note {
  margin: 4px 0 10px;
  color: rgba(74, 47, 24, 0.75);
  font-size: 0.78rem;
}

.gacha-rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.rule-pill {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(117, 82, 39, 0.16);
  border-radius: 999px;
  background: rgba(255, 247, 224, 0.78);
  color: #4C3320;
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.15;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.need-more {
  margin-top: 8px;
  text-align: center;
  color: rgba(74, 47, 24, 0.75);
  font-size: 0.75rem;
  font-weight: 800;
}

.need-more b {
  color: #4A2F18;
  font-weight: 950;
}

/* ── Gacha result grid ───────────────────────────── */
.gacha-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* ── Expedition result banner ────────────────────── */
.result-banner {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border: var(--border);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(106, 143, 78, 0.18), transparent), var(--card);
  box-shadow: var(--shadow), 0 0 12px rgba(106, 143, 78, 0.15);
  margin-bottom: 4px;
  animation: screenEnter 0.25s ease both;
}

.result-banner::after {
  content: "";
  position: absolute;
  inset: -20% 45%;
  background: linear-gradient(90deg, transparent, rgba(244, 197, 66, 0.38), transparent);
  transform: translateX(-130%) skewX(-18deg);
  animation: shinySweep 2.4s ease-out 1;
  pointer-events: none;
}

/* ── Player guidance ───────────────────────────────── */
.guide-card {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding: 12px;
  overflow: hidden;
  border: var(--border);
  border-radius: var(--radius);
  background:
    var(--texture-paper-asset),
    var(--texture-cardboard-asset),
    linear-gradient(135deg, rgba(63, 111, 106, 0.13), rgba(240, 182, 61, 0.12)),
    var(--card);
  background-size: 512px 512px, 420px 420px, auto, auto;
  box-shadow: var(--shadow);
}

.guide-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0 42%, rgba(255, 255, 255, 0.2) 50%, transparent 58% 100%);
  opacity: 0;
  pointer-events: none;
}

.guide-card.is-ready::before {
  animation: guideSweep 2.8s ease-in-out infinite;
}

.guide-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1.5px solid rgba(96, 73, 45, 0.34);
  border-radius: 16px;
  background:
    var(--texture-paper-asset),
    linear-gradient(180deg, rgba(246, 230, 195, 0.88), rgba(207, 159, 98, 0.62)),
    var(--texture-cardboard-asset);
  background-size: 512px 512px, auto, 320px 320px;
  color: var(--accent-2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 2px 4px rgba(65, 40, 20, 0.12);
}

.guide-copy {
  min-width: 0;
}

.guide-kicker {
  margin-bottom: 2px;
  color: var(--accent-2);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guide-copy h2 {
  margin-bottom: 4px;
}

.guide-copy p:last-child {
  margin-bottom: 0;
}

.guide-card > .btn {
  grid-column: 1 / -1;
}

.home-quest-card {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 9px;
  margin-top: 12px;
  padding: 10px;
  border-radius: 18px;
}

.home-quest-card .guide-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.home-quest-card .guide-kicker {
  margin-bottom: 1px;
  font-size: 0.58rem;
}

.home-quest-card .guide-copy h2 {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.05;
}

.home-quest-card .guide-copy p:last-child {
  overflow: hidden;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-quest-card > .btn {
  grid-column: auto;
  width: auto;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.expedition-guide {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0;
}

.step-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 8px;
}

.step-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(83, 48, 28, 0.16);
  background: rgba(83, 48, 28, 0.06);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.step-pill.is-done {
  border-color: rgba(79, 122, 63, 0.28);
  background: rgba(79, 122, 63, 0.14);
  color: var(--success);
}

.step-pill.is-current {
  border-color: rgba(199, 137, 53, 0.38);
  background: rgba(199, 137, 53, 0.18);
  color: var(--accent);
}

.tutorial-target {
  position: relative;
  z-index: 2;
  outline: 3px solid rgba(244, 197, 66, 0.62);
  outline-offset: 3px;
  animation: tutorialTargetPulse 1.35s ease-in-out infinite;
}

.nav-button.tutorial-nav-target {
  background: rgba(244, 197, 66, 0.2);
  color: #FFE3A6;
}

.chance-meter {
  height: 8px;
  overflow: hidden;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(83, 48, 28, 0.18);
}

.chance-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--danger), var(--accent), var(--accent-3));
  transition: width 180ms ease;
}

.chance-meter-labels {
  display: flex;
  justify-content: space-between;
  margin: -6px 1px 10px;
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 900;
  text-transform: uppercase;
}

/* ── Training screen ─────────────────────────────── */
.training-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 6px 0 4px;
}
.training-title-row h2 { margin: 0; font-size: 1.1rem; }

/* Arena */
.training-arena {
  display: flex;
  flex-direction: column;
  padding: 10px 4px 0;
  margin-bottom: 8px;
  overflow: visible;
  gap: 4px;
}

/* Масштабований обгортач — ширина 100%, висота задається JS */
.arena-stage-outer {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 16px;
}

/* Один спільний контейнер — хомяк ліворуч, манекен праворуч, нічого між ними */
.arena-stage {
  position: absolute;
  left: 50%;
  top: 0;
  width: 425px;
  height: 268px;
  transform-origin: top center;
  transform: translateX(-50%) scale(var(--stage-scale, 1));
  overflow: hidden;
  border: 1px solid rgba(83, 48, 28, 0.18);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 25% 89%, rgba(83, 48, 28, 0.22), transparent 20%),
    radial-gradient(ellipse at 82% 88%, rgba(83, 48, 28, 0.2), transparent 18%),
    var(--texture-sawdust-asset),
    radial-gradient(circle at 12% 78%, rgba(138, 90, 50, 0.18) 0 2px, transparent 3px),
    radial-gradient(circle at 46% 86%, rgba(199, 137, 53, 0.16) 0 1.6px, transparent 2.6px),
    radial-gradient(circle at 68% 80%, rgba(83, 48, 28, 0.12) 0 1.2px, transparent 2px),
    repeating-linear-gradient(4deg, rgba(83, 48, 28, 0.04) 0 1px, transparent 1px 10px),
    linear-gradient(180deg, rgba(63, 111, 106, 0.1), rgba(83, 48, 28, 0.08) 62%, rgba(138, 90, 50, 0.16)),
    rgba(234, 216, 180, 0.42);
  background-size: auto, auto, 100% 100%, auto, auto, auto, auto, auto, auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -18px 32px rgba(83, 48, 28, 0.08);
}

.arena-stage::after {
  content: "";
  position: absolute;
  right: 8%;
  bottom: 8px;
  left: 7%;
  height: 24px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(83, 48, 28, 0.2), transparent 48%),
    radial-gradient(ellipse at 82% 50%, rgba(83, 48, 28, 0.18), transparent 44%);
  filter: blur(3px);
  opacity: 0.9;
  pointer-events: none;
}

.arena-hud {
  position: absolute;
  top: 8px;
  right: 8px;
  left: 8px;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.arena-hp-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgba(83, 48, 28, 0.16);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 244, 214, 0.58), rgba(234, 216, 180, 0.36)),
    rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.arena-hp-label,
.arena-hp-value {
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 900;
  white-space: nowrap;
}

.arena-hp-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(83, 48, 28, 0.18);
}

.arena-hp-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #A43B2D, #E05B42, #F4C542);
  transition: width 160ms ease;
}

.arena-status-pill {
  max-width: 108px;
  overflow: hidden;
  padding: 6px 8px;
  border: 1px dashed rgba(83, 48, 28, 0.2);
  border-radius: 999px;
  background: rgba(255, 244, 214, 0.34);
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arena-status-pill.active {
  border-color: rgba(79, 122, 63, 0.38);
  background: rgba(79, 122, 63, 0.14);
  color: var(--success);
}

.arena-canvas-wrap {
  position: absolute;
  z-index: 2;
  left: 8px;
  bottom: 20px;
  display: flex;
  align-items: flex-end;
  overflow: visible;
  /* без рамки та фону */
}

#training-sprite-canvas {
  display: block;
  overflow: visible;
}

.arena-dummy-wrap {
  position: absolute;
  z-index: 2;
  right: 8px;
  bottom: 20px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* Число вилітає поверх сцени — абсолютна позиція по центру */
.arena-center {
  position: absolute;
  left: 50%;
  top: 90px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

/* Підписи нижче */
.arena-labels-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0 6px 4px;
}

.arena-side-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.arena-sprite-wrap {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
}

.arena-sprite {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.arena-empty-wrap {
  /* порожній стан — без рамки */
  opacity: 0.4;
}

.arena-empty-icon { font-size: 1.8rem; }

.arena-label {
  font-size: 0.72rem;
  font-weight: 600;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arena-stat {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.arena-vs {
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  opacity: 0.5;
}

.arena-damage {
  font-size: 1.5rem;
  font-weight: 900;
  color: #e74c3c;
  text-shadow: 0 2px 8px rgba(231,76,60,0.5);
  animation: floatUp 600ms ease forwards;
}

.arena-damage.is-critical {
  color: #F7C84C;
  text-shadow:
    0 2px 8px rgba(231, 76, 60, 0.45),
    0 0 14px rgba(247, 200, 76, 0.72);
  transform-origin: center;
}

.arena-reward {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(244,197,66,0.14);
  padding: 2px 8px;
  border-radius: 999px;
  animation: popIn 180ms ease both;
}

/* Dummy */
.dummy-figure {
  display: block;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(83, 48, 28, 0.22));
}
.dummy-figure.dummy-hit {
  animation: dummyShake 220ms ease both;
}

/* HP bar */
.training-hp-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.training-hp-bar {
  flex: 1;
  height: 10px;
  background: rgba(83, 48, 28, 0.18);
  border-radius: 999px;
  overflow: hidden;
}

.training-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #e74c3c, #c0392b);
  border-radius: 999px;
  transition: width 160ms ease;
}

.training-hp-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Tabs */
.training-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.training-tab-btn {
  flex: 1;
  padding: 8px 4px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid rgba(83, 48, 28, 0.18);
  border-radius: 14px;
  background: rgba(83, 48, 28, 0.06);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}

.training-tab-btn.active {
  background: var(--accent);
  color: #1a1a1a;
  border-color: var(--accent);
}

.training-tab-content > .card {
  margin-bottom: 10px;
}

/* ── Fighter portrait selector ───────────────────── */
.training-fighter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.training-fighter-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px 8px;
  border: 1.5px solid rgba(83, 48, 28, 0.16);
  border-radius: 14px;
  background: rgba(255, 244, 214, 0.18);
  cursor: pointer;
  transition: border-color 120ms, background 120ms, transform 80ms;
}

.training-fighter-card.active {
  border-color: var(--accent);
  background: rgba(244, 197, 66, 0.18);
}

.training-fighter-card:active {
  transform: scale(0.95);
}

.training-fighter-portrait {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(83, 48, 28, 0.06);
  position: relative;
  flex-shrink: 0;
}

.training-fighter-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  image-rendering: pixelated;
}

.training-fighter-portrait .hamster-portrait-fallback {
  width: 100%;
  height: 100%;
}

.training-fighter-name {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70px;
}

.training-fighter-stat {
  font-size: 0.62rem;
  font-weight: 900;
  color: var(--text-muted);
}

.training-fighter-card.active .training-fighter-name {
  color: var(--accent);
}

/* Auto-attack status badge */
.auto-attack-badge {
  text-align: center;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(83, 48, 28, 0.06);
  border: 1px dashed rgba(83, 48, 28, 0.28);
  margin-bottom: 2px;
}
.auto-attack-badge.active {
  color: #7ec850;
  border-color: #7ec85060;
  background: rgba(126, 200, 80, 0.07);
}

/* Hit button */
.hit-btn {
  width: 100%;
  padding: 13px;
  font-size: 1rem;
  margin-bottom: 2px;
}

.hit-btn:active:not(:disabled) {
  transform: scale(0.97);
  transition: transform 60ms ease;
}
