:root {
  color-scheme: dark;
  --bg: #0e1116;
  --bg-2: #151a20;
  --panel: #20262d;
  --panel-2: #28313a;
  --line: #607181;
  --line-soft: rgba(195, 218, 224, 0.18);
  --text: #f3f0e8;
  --muted: #b8c2be;
  --gold: #e5b751;
  --red: #e05a64;
  --green: #66c18a;
  --teal: #58bfc0;
  --violet: #b68adf;
  --card-attack: #722d3a;
  --card-skill: #204f57;
  --card-power: #665229;
  --shadow: 0 22px 56px rgba(0, 0, 0, 0.48);
  font-family:
    "Microsoft YaHei",
    "Segoe UI",
    system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(88, 191, 192, 0.13) 0%, transparent 32%),
    linear-gradient(210deg, rgba(182, 138, 223, 0.1) 0%, transparent 34%),
    repeating-linear-gradient(90deg, rgba(243, 240, 232, 0.025) 0 1px, transparent 1px 42px),
    linear-gradient(135deg, #0e1116 0%, #162126 48%, #171219 100%);
  background-attachment: fixed;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  color: var(--text);
  background: #26313a;
  border-radius: 6px;
  padding: 9px 12px;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease,
    box-shadow 0.12s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--gold);
  background: #33424d;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-shell {
  min-height: 100vh;
}

.boot-screen {
  display: grid;
  min-height: 100vh;
  place-content: center;
  gap: 18px;
  text-align: center;
  color: var(--muted);
}

.boot-mark,
.brand-mark {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 2px solid var(--gold);
  border-radius: 6px;
  margin: 0 auto;
  color: var(--gold);
  font-weight: 900;
  letter-spacing: 0;
  background: rgba(14, 17, 22, 0.82);
  box-shadow: 0 0 24px rgba(229, 183, 81, 0.2);
  animation: sigilPulse 3.6s ease-in-out infinite;
}

.layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 268px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid var(--line-soft);
  background: rgba(14, 17, 22, 0.92);
  padding: 18px;
}

.content {
  min-width: 0;
  padding: 24px;
}

.brand {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  text-align: center;
}

.brand h1 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  letter-spacing: 0;
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.side-section {
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
}

.side-title {
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

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

.stat {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.03);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stat strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
}

.nav-stack {
  display: grid;
  gap: 8px;
}

.nav-stack button {
  width: 100%;
  text-align: left;
}

.screen {
  max-width: 1240px;
  margin: 0 auto;
}

.menu-screen {
  max-width: 1280px;
}

.menu-hero {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  margin-bottom: 18px;
  background:
    radial-gradient(circle at 74% 44%, rgba(88, 191, 192, 0.16), transparent 34%),
    #11161c;
  box-shadow: var(--shadow);
}

.menu-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0.86;
  animation: heroDrift 18s ease-in-out infinite alternate;
}

.menu-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 13, 18, 0.88) 0%, rgba(10, 13, 18, 0.52) 42%, rgba(10, 13, 18, 0.16) 100%),
    linear-gradient(0deg, rgba(10, 13, 18, 0.84) 0%, transparent 48%);
}

.menu-hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: end;
  min-height: 330px;
  max-width: 760px;
  padding: 28px;
  gap: 12px;
}

.menu-hero-copy .screen-copy {
  margin: 0;
  color: rgba(243, 240, 232, 0.88);
}

.menu-hero-copy .primary {
  width: fit-content;
}

.screen-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.screen-title {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
}

.screen-copy {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.menu-grid,
.character-grid,
.reward-grid,
.shop-grid,
.archive-grid,
.deck-grid {
  display: grid;
  gap: 14px;
}

.menu-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
}

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

.panel,
.character-panel,
.event-panel,
.reward-panel,
.shop-panel {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(40, 49, 58, 0.88), rgba(23, 28, 34, 0.92));
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.panel {
  padding: 18px;
}

.character-panel {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

.character-panel img,
.enemy-portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
  background:
    radial-gradient(circle at 50% 50%, rgba(88, 191, 192, 0.12), transparent 42%),
    #1a1714;
}

.character-art {
  min-height: 250px;
}

.character-panel h3,
.panel h3,
.event-panel h3,
.reward-panel h3,
.shop-panel h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.character-panel p,
.event-panel p,
.reward-panel p,
.shop-panel p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.55;
}

.meta-row,
.status-row,
.pile-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.18);
  font-size: 12px;
  white-space: nowrap;
}

.status-tag {
  cursor: help;
  outline: none;
}

.status-tag::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 20;
  width: max-content;
  max-width: min(320px, calc(100vw - 40px));
  border: 1px solid rgba(229, 183, 81, 0.42);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--text);
  background: rgba(12, 15, 19, 0.96);
  box-shadow: var(--shadow);
  line-height: 1.5;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 6px);
  transition:
    opacity 0.14s ease,
    transform 0.14s ease;
}

.status-tag:hover::after,
.status-tag:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.story-preview,
.story-mini,
.event-logline,
.story-focus {
  border: 1px solid rgba(229, 183, 81, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(229, 183, 81, 0.08), rgba(0, 0, 0, 0.18));
}

.story-preview {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 14px;
}

.story-preview strong,
.story-mini strong {
  color: var(--text);
}

.story-preview p,
.story-mini p,
.event-logline p,
.story-focus p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.story-preview button {
  width: fit-content;
}

.story-mini {
  display: grid;
  gap: 6px;
  padding: 10px;
}

.story-mini p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  font-size: 12px;
}

.story-kicker,
.event-logline span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.enemy-codex-panel {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) minmax(260px, 0.8fr);
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 18px;
  background:
    linear-gradient(180deg, rgba(32, 38, 45, 0.82), rgba(14, 17, 22, 0.92));
  box-shadow: var(--shadow);
}

.enemy-codex-panel img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #101419;
}

.enemy-codex-panel h3 {
  margin: 4px 0 8px;
}

.enemy-codex-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.tag.gold {
  color: #ffd17a;
  border-color: rgba(224, 162, 58, 0.55);
}

.tag.danger {
  color: #ffada9;
  border-color: rgba(217, 83, 79, 0.58);
}

.tag.good {
  color: #aee9bf;
  border-color: rgba(99, 184, 125, 0.58);
}

.primary {
  border-color: rgba(224, 162, 58, 0.85);
  color: #1b1308;
  background: linear-gradient(180deg, #f0c766, #d99d2c);
  font-weight: 800;
}

.primary:hover:not(:disabled) {
  color: #17100a;
  background: linear-gradient(180deg, #ffe08e, #e5b751);
}

.danger-button {
  border-color: rgba(217, 83, 79, 0.65);
  background: #512932;
}

.map-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(32, 38, 45, 0.76), rgba(14, 17, 22, 0.92)),
    url("assets/backgrounds/tower.svg");
  background-size: cover;
  box-shadow: var(--shadow);
}

.map {
  position: relative;
  display: grid;
  min-width: 760px;
  gap: 10px;
}

.map-floor {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  min-height: 54px;
}

.map-node {
  width: 48px;
  height: 48px;
  justify-self: center;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  color: var(--muted);
  background: rgba(20, 18, 15, 0.95);
  font-size: 20px;
  line-height: 1;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    opacity 0.18s ease;
}

.map-node.available {
  color: var(--text);
  border-color: var(--gold);
  box-shadow:
    0 0 0 4px rgba(229, 183, 81, 0.13),
    0 0 26px rgba(229, 183, 81, 0.28);
  animation: nodePulse 2.4s ease-in-out infinite;
}

.map-node.available:hover {
  transform: translateY(-3px) scale(1.06);
}

.map-node.visited {
  color: #11100e;
  background: var(--green);
  border-color: #baf0c8;
}

.map-node.locked {
  opacity: 0.32;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.combat-layout {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(260px, auto) auto;
  gap: 14px;
  overflow: hidden;
  max-width: 1280px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(10, 13, 18, 0.58), rgba(10, 13, 18, 0.92)),
    url("assets/generated/source_tower_arena.png");
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
  animation: arenaDrift 22s ease-in-out infinite alternate;
}

.combat-layout::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 62%, rgba(229, 183, 81, 0.16), transparent 28%),
    linear-gradient(90deg, rgba(88, 191, 192, 0.1), transparent 34%, rgba(224, 90, 100, 0.08));
}

.combat-layout > * {
  position: relative;
  z-index: 1;
}

.combat-top {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  gap: 14px;
}

.combatant,
.enemy-zone {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(40, 49, 58, 0.78), rgba(19, 23, 28, 0.9));
  padding: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.enemy-zone {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  animation: panelEnter 0.36s ease both;
}

.enemy-portrait {
  position: relative;
  min-height: 220px;
  perspective: 800px;
}

.enemy-portrait img {
  animation: enemyFloat 4.6s ease-in-out infinite;
  transform-origin: center bottom;
  will-change: transform;
}

.hp-bar {
  height: 15px;
  overflow: hidden;
  border: 1px solid rgba(244, 234, 216, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.26);
  margin: 8px 0;
}

.hp-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a52e36, #e0714e);
  transition: width 0.32s ease;
}

.block-line {
  color: #9be4f2;
  font-weight: 700;
}

.intent {
  border: 1px solid rgba(224, 162, 58, 0.38);
  border-radius: 6px;
  padding: 10px;
  background: rgba(224, 162, 58, 0.08);
  animation: intentGlow 2.8s ease-in-out infinite;
}

.combat-fx {
  position: absolute;
  inset: 12px 12px auto auto;
  z-index: 3;
  display: grid;
  gap: 6px;
  pointer-events: none;
}

.player-fx {
  inset: 12px 12px auto auto;
}

.enemy-fx {
  inset: 16px 16px auto auto;
}

.fx {
  justify-self: end;
  min-width: 58px;
  border: 1px solid rgba(243, 240, 232, 0.24);
  border-radius: 999px;
  padding: 4px 9px;
  text-align: center;
  color: var(--text);
  background: rgba(14, 17, 22, 0.74);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
  animation: fxFloat 1.25s ease both;
  animation-delay: calc(var(--i) * 0.04s);
}

.fx.damage {
  color: #ffb2b7;
  border-color: rgba(224, 90, 100, 0.52);
}

.fx.block {
  color: #a4edf0;
  border-color: rgba(88, 191, 192, 0.52);
}

.fx.heal {
  color: #b9efc8;
  border-color: rgba(102, 193, 138, 0.52);
}

.fx.status {
  color: #e5d0ff;
  border-color: rgba(182, 138, 223, 0.52);
}

.hand {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(164px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.card {
  display: grid;
  grid-template-rows: auto 112px auto 1fr auto;
  min-height: 286px;
  border: 2px solid rgba(244, 234, 216, 0.16);
  border-radius: 8px;
  padding: 9px;
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    filter 0.18s ease;
  animation: cardEnter 0.28s ease both;
  will-change: transform;
}

.card.attack {
  background: linear-gradient(180deg, rgba(114, 45, 58, 0.96), rgba(31, 24, 30, 0.98));
}

.card.skill {
  background: linear-gradient(180deg, rgba(32, 79, 87, 0.96), rgba(20, 31, 35, 0.98));
}

.card.power {
  background: linear-gradient(180deg, rgba(102, 82, 41, 0.96), rgba(36, 31, 24, 0.98));
}

.card.retained {
  border-color: rgba(88, 191, 192, 0.5);
}

.card.exhausts {
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.28),
    inset 0 0 28px rgba(182, 138, 223, 0.12);
}

.card.disabled {
  filter: grayscale(0.55);
  opacity: 0.58;
}

.card:hover:not(.disabled) {
  transform: translateY(-6px);
  border-color: rgba(243, 240, 232, 0.44);
  box-shadow: 0 24px 42px rgba(0, 0, 0, 0.42);
}

.card:hover:not(.disabled) .card-art {
  filter: saturate(1.1) contrast(1.05);
}

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

.cost {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #11100e;
  background: #f1ca78;
  font-weight: 900;
}

.card-name {
  min-width: 0;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.card-art {
  width: 100%;
  height: 112px;
  object-fit: contain;
  border: 1px solid rgba(244, 234, 216, 0.22);
  border-radius: 5px;
  margin: 8px 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(244, 234, 216, 0.08), transparent 50%),
    rgba(0, 0, 0, 0.22);
}

.card-type {
  color: rgba(244, 234, 216, 0.72);
  font-size: 12px;
}

.card-text {
  margin: 8px 0;
  color: rgba(244, 234, 216, 0.92);
  font-size: 13px;
  line-height: 1.45;
}

.card button {
  width: 100%;
}

.log {
  max-height: 152px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.2);
  font-size: 13px;
  line-height: 1.5;
}

.log div + div {
  margin-top: 5px;
}

.log div {
  animation: logLine 0.2s ease both;
}

.reward-grid,
.shop-grid,
.deck-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.event-panel,
.reward-panel,
.shop-panel {
  padding: 18px;
}

.narrative-event {
  display: grid;
  gap: 14px;
}

.event-logline {
  padding: 14px;
}

.event-logline strong {
  display: block;
  margin: 4px 0 6px;
}

.choice-stack {
  display: grid;
  gap: 10px;
}

.choice-button {
  display: grid;
  gap: 4px;
  text-align: left;
}

.choice-button span {
  color: var(--muted);
  font-size: 12px;
}

.archive-grid {
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

.archive-progress {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.story-focus {
  margin-bottom: 14px;
  padding: 18px;
}

.story-focus h3 {
  margin: 4px 0 8px;
}

.archive-progress h3 {
  margin: 0 0 6px;
}

.archive-progress p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.progress-bar {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(243, 240, 232, 0.16);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.26);
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--violet));
  transition: width 0.3s ease;
}

.fragment {
  min-height: 164px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 14px;
  background: rgba(39, 35, 30, 0.76);
}

.fragment.locked {
  color: rgba(244, 234, 216, 0.34);
  background: rgba(0, 0, 0, 0.18);
}

.fragment h3 {
  margin: 0 0 8px;
}

.fragment p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid rgba(224, 162, 58, 0.5);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(22, 27, 32, 0.96);
  box-shadow: var(--shadow);
  color: var(--text);
  animation: toastIn 0.22s ease both;
}

.story-reveal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
}

.story-reveal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(88, 191, 192, 0.18), transparent 38%),
    rgba(4, 6, 8, 0.76);
  backdrop-filter: blur(8px);
}

.story-reveal-card {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  border: 1px solid rgba(229, 183, 81, 0.46);
  border-radius: 8px;
  padding: 24px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(40, 49, 58, 0.96), rgba(13, 16, 20, 0.98));
  box-shadow: var(--shadow);
  animation: panelEnter 0.24s ease both;
}

.story-reveal-card h2 {
  margin: 6px 0 12px;
}

.story-reveal-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.story-reveal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

@keyframes sigilPulse {
  0%,
  100% {
    box-shadow: 0 0 18px rgba(229, 183, 81, 0.16);
  }
  50% {
    box-shadow: 0 0 34px rgba(88, 191, 192, 0.26);
  }
}

@keyframes heroDrift {
  from {
    transform: scale(0.99) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.01) translate3d(-6px, -4px, 0);
  }
}

@keyframes arenaDrift {
  from {
    background-position: center;
  }
  to {
    background-position: center 46%;
  }
}

@keyframes nodePulse {
  0%,
  100% {
    box-shadow:
      0 0 0 4px rgba(229, 183, 81, 0.12),
      0 0 20px rgba(229, 183, 81, 0.18);
  }
  50% {
    box-shadow:
      0 0 0 7px rgba(229, 183, 81, 0.06),
      0 0 34px rgba(88, 191, 192, 0.28);
  }
}

@keyframes panelEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes enemyFloat {
  0%,
  100% {
    transform: translateY(0) rotateX(0deg);
  }
  50% {
    transform: translateY(-6px) rotateX(2deg);
  }
}

@keyframes intentGlow {
  0%,
  100% {
    border-color: rgba(229, 183, 81, 0.32);
  }
  50% {
    border-color: rgba(224, 90, 100, 0.5);
  }
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes logLine {
  from {
    opacity: 0;
    transform: translateX(-4px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fxFloat {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.94);
  }
  18% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-24px) scale(1.02);
  }
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .menu-grid,
  .character-grid,
  .combat-top,
  .enemy-zone,
  .character-panel,
  .enemy-codex-panel {
    grid-template-columns: 1fr;
  }

  .character-art,
  .enemy-portrait {
    min-height: 180px;
  }

  .menu-hero,
  .menu-hero-copy {
    min-height: 280px;
  }
}

@media (max-width: 620px) {
  .content {
    padding: 14px;
  }

  .screen-head {
    display: grid;
  }

  .screen-title {
    font-size: 25px;
  }

  .menu-hero-copy {
    padding: 18px;
  }

  .hand,
  .reward-grid,
  .shop-grid,
  .deck-grid {
    grid-template-columns: 1fr;
  }

  .card {
    min-height: 260px;
  }
}
