/* Ava Atlas: a calm, interactive field guide. Rose/slate Ava palette. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 15% 20%, #e11d480b, transparent 45%),
    radial-gradient(ellipse at 85% 70%, #64748b12, transparent 45%);
  animation: ambient-drift 18s ease-in-out infinite alternate;
}
.experience-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4.5%;
  border-bottom: 1px solid var(--line);
  background: #ffffff03;
}
.experience-toolbar button {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: #ffffff05;
  padding: 7px 13px;
  font-size: 12px;
}
.experience-toolbar button:hover {
  border-color: var(--accent);
}
.experience-toolbar > span {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}
.welcome-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1360px;
  margin: 24px auto 0;
  padding: 20px 24px;
  border: 1px solid #fb718530;
  border-radius: 12px;
  background: linear-gradient(100deg, #e11d480c, #ffffff03);
}
.welcome-guide .eyebrow {
  display: block;
  font-size: 9px;
  margin: 0 0 5px;
}
.welcome-guide strong {
  font-size: 17px;
}
.welcome-guide p {
  font-size: 12px;
  margin: 5px 0 0;
}
.welcome-guide .secondary {
  white-space: nowrap;
}
.next-move {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 18px;
  padding: 16px 20px;
  border: 1px solid #fb718544;
  border-radius: 12px;
  background: linear-gradient(100deg, #e11d4816, #0f172a);
  position: relative;
}
.next-icon {
  font-size: 28px;
  color: var(--accent);
}
.next-move > div:first-of-type {
  flex: 1;
}
.next-move strong {
  font-size: 15px;
}
.next-move p {
  font-size: 12px;
  line-height: 1.6;
  margin: 4px 0 0;
  max-width: 700px;
}
.next-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
}
.next-actions .primary,
.next-actions .secondary {
  padding: 10px 14px;
  font-size: 12px;
}
.next-actions .text-button {
  font-size: 11px;
}
.card-key {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
  padding: 9px 0;
  color: var(--muted);
  font-size: 11px;
  flex-wrap: wrap;
}
.card-key button {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--accent);
  font-size: 11px;
}
.card-key span:first-child {
  color: var(--accent);
}
.collection-help {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 12px;
}
.collection-help button {
  font-size: 12px;
}
.quick-add {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  background: #ffffff06;
  border-radius: 6px;
  padding: 8px;
  margin: 6px 0 12px;
  font-size: 11px;
  color: var(--accent);
}
.quick-add:hover {
  background: #e11d481a;
}
.selection-bar {
  flex-wrap: wrap;
}
.selection-bar .secondary {
  padding: 10px 14px;
  font-size: 12px;
}
/* The guide is in the browser's modal top layer; no game state or timer lives here. */
#learning {
  width: min(1080px, calc(100vw - 36px));
  max-width: none;
  max-height: calc(100dvh - 36px);
  padding: 28px 32px;
  border: 1px solid #fb71853b;
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 8% 0, #e11d4815, transparent 40%), #080e20;
  color: var(--text);
  box-shadow: 0 30px 110px #0009;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#learning::backdrop {
  background: #020617ce;
  backdrop-filter: blur(9px);
}
#learning p {
  line-height: 1.7;
}
#learning button:focus-visible,
#learning select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
#learning h1 {
  font-size: 32px;
  line-height: 1.2;
  margin: 0;
  font-weight: 650;
  letter-spacing: -1px;
  font-family: var(--font);
}
#learning .eyebrow {
  font-size: 9px;
  letter-spacing: 2px;
}
.learn-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 25px;
}
.learn-top .eyebrow {
  margin: 0;
}
.learn-top > div {
  display: flex;
  gap: 12px;
  align-items: center;
}
.learn-top select {
  color: white;
  background: #0f172a;
  border: 1px solid var(--line);
  padding: 6px 9px;
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
}
.learn-close {
  border: 1px solid var(--line);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff05;
}
.tour-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 26px;
}
.tour-heading .eyebrow {
  margin: 0 0 6px;
}
.learn-number {
  font-family: Georgia, serif;
  font-size: 52px;
  color: #fb718580;
  line-height: 1;
}
.tour-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 32px;
}
.tour-visual {
  min-width: 0;
}
.tour-explanation {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}
.tour-explanation > p {
  font-size: 16px;
  margin: 0;
}
.lesson-tip {
  padding: 18px;
  border-left: 2px solid var(--accent);
  background: #ffffff03;
}
.lesson-tip b {
  font-size: 12px;
  color: var(--accent);
}
.lesson-tip p {
  font-size: 12px;
  margin: 8px 0 0;
}
.tour-explanation .text-button {
  text-align: left;
  font-size: 12px;
}
.tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.tour-footer .primary {
  min-width: 140px;
}
.tour-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.tour-dots button {
  width: 8px;
  height: 8px;
  background: #ffffff25;
  border: 0;
  padding: 0;
  border-radius: 20px;
  min-height: 8px;
}
.tour-dots button.current {
  width: 24px;
  background: var(--accent);
}
.tour-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 10px;
  color: var(--muted);
}
.tour-bottom button {
  font-size: 11px;
}
.live-warning {
  background: #fb718510;
  color: #fecdd3;
  border: 1px solid #fb718533;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: 8px;
  font-size: 12px;
}
.practice-stage,
.effect-demo {
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle at center, #fb71850b, transparent 65%), #ffffff02;
  padding: 20px;
  text-align: center;
  overflow: hidden;
  min-height: 300px;
  position: relative;
}
.demo-caption {
  display: block;
  font-size: 8px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.practice-stage p {
  font-size: 12px;
  margin: 14px 0;
}
.practice-stage .secondary,
.demo-trigger {
  padding: 10px 16px;
  font-size: 12px;
}
.practice-commanders {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 26px;
  margin: 28px 0 12px;
}
.training-piece {
  padding: 20px;
  border: 1px solid #94a3b845;
  border-radius: 14px;
  min-width: 120px;
  background: #0f172a;
}
.training-piece span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 7px;
}
.training-piece strong {
  font-size: 26px;
  color: #fda4af;
}
.demo-flight {
  font-size: 22px;
  color: var(--accent);
  margin: 12px;
}
.practice-card {
  width: 108px;
  flex-shrink: 0;
}
.practice-card .card {
  width: 100%;
  min-height: 0;
  pointer-events: none;
}
.practice-card .card-top {
  font-size: 6px;
}
.practice-card .cost {
  width: 20px;
  height: 20px;
  font-size: 11px;
}
.practice-card .card-name {
  font-size: 12px;
}
.practice-card .card-country {
  font-size: 8px;
}
.practice-card .card-text {
  min-height: 25px;
  font-size: 8px;
}
.practice-card .card-stats {
  font-size: 11px;
}
.practice-card .city-art {
  height: 65px;
}
.practice-hand {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  margin: 22px 0;
}
.practice-selected {
  outline: 2px solid var(--accent);
  border-radius: 10px;
  transform: translateY(-10px);
}
.practice-energy {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
}
.practice-board {
  position: relative;
  min-height: 180px;
  border: 1px dashed #fb718547;
  border-radius: 12px;
  margin-bottom: 8px;
}
.practice-board > span {
  position: absolute;
  top: 8px;
  left: 12px;
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--muted);
}
.practice-play-card {
  width: 95px;
  margin: 20px auto 0;
  transform: translateY(38px) rotate(-5deg);
}
.practice-play-card .card {
  min-height: 0;
  pointer-events: none;
}
.practice-play-card .card-name {
  font-size: 12px;
}
.practice-play-card .card-top {
  font-size: 6px;
}
.practice-play-card .cost {
  font-size: 10px;
  width: 17px;
  height: 17px;
}
.practice-play-card .city-art {
  height: 50px;
}
.practice-play-card .card-country,
.practice-play-card .card-text {
  font-size: 7px;
  min-height: 18px;
}
.practice-play-card .card-stats {
  font-size: 10px;
}
.practice-hand-label {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 20px 0 0;
}
.practice-forge {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  margin: 20px 0;
}
.practice-forge b {
  font-size: 36px;
  color: var(--accent);
}
.practice-forge > span {
  max-width: 100px;
  font-size: 12px;
  color: var(--muted);
}
.ready-orbit {
  font-size: 90px;
  line-height: 1.6;
  color: var(--accent);
  text-shadow: 0 0 45px #e11d4844;
  animation: orbit-breathe 5s ease-in-out infinite;
}
.ready-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  text-align: left;
  font-size: 12px;
  margin: 0 auto;
  max-width: 300px;
}
.ready-checks span {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.anatomy-stage {
  display: grid;
  grid-template-columns: minmax(130px, 180px) 1fr;
  gap: 20px;
  align-items: center;
  padding: 18px;
  background: #ffffff03;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.anatomy-card .card {
  width: 100%;
  pointer-events: none;
  min-height: 0;
}
.anatomy-card .card-name {
  font-size: 19px;
}
.anatomy-card .card-text {
  font-size: 10px;
}
.card-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.legend-item {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #ffffff02;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px;
}
.legend-item.active {
  border-color: #fb718570;
  background: #fb71850b;
}
.legend-item > b {
  min-width: 35px;
  color: var(--accent);
  font-size: 18px;
}
.legend-item strong {
  display: block;
  font-size: 11px;
}
.legend-item small {
  display: block;
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 3px;
}
.focus-cost .anatomy-card .cost,
.focus-attack .anatomy-card .attack,
.focus-hp .anatomy-card .hp,
.focus-symbol .anatomy-card .card-stats i {
  outline: 2px solid #fda4af;
  outline-offset: 4px;
  border-radius: 5px;
  box-shadow: 0 0 24px #fb71855c;
  animation: stat-breathe 2s ease-in-out infinite;
}
.inspect-heading {
  margin-bottom: 22px;
}
.inspect-heading .eyebrow {
  margin-bottom: 7px;
}
.inspect-heading > p:last-child {
  margin: 8px 0 0;
  font-size: 13px;
}
.inspect-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.inspect-layout .anatomy-stage {
  grid-template-columns: 1fr;
  align-content: start;
}
.inspect-layout .anatomy-card {
  width: 190px;
  margin: auto;
}
.inspect-layout .card-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.ability-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.ability-tabs .chip {
  font-size: 11px;
}
.inspect-rule {
  font-size: 12px;
  padding: 12px 0 0;
  margin: 0;
}
.inspect-deck {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 18px;
}
.inspect-deck p {
  font-size: 12px;
  margin: 0;
}
.inspect-deck [role="status"] {
  width: 100%;
  color: var(--accent);
}
.demo-mini-card {
  width: 90px;
  margin: 5px auto 16px;
}
.demo-mini-card .card {
  width: 100%;
  min-height: 0;
  pointer-events: none;
}
.demo-mini-card .city-art {
  height: 44px;
}
.demo-mini-card .card-top {
  font-size: 5px;
}
.demo-mini-card .cost {
  width: 16px;
  height: 16px;
  font-size: 9px;
}
.demo-mini-card .card-name {
  font-size: 10px;
}
.demo-mini-card .card-country,
.demo-mini-card .card-text {
  font-size: 6px;
  min-height: 13px;
}
.demo-mini-card .card-stats {
  font-size: 9px;
}
.effect-arrow {
  position: absolute;
  top: 170px;
  left: calc(50% - 8px);
  font-size: 22px;
  color: var(--accent);
  opacity: 0;
}
.demo-values {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.demo-token {
  border: 1px solid #ffffff1a;
  border-radius: 10px;
  background: #0f172a;
  padding: 10px 14px;
  min-width: 85px;
}
.demo-token small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}
.demo-token strong {
  display: block;
  color: #fda4af;
  font-size: 25px;
  margin-top: 3px;
}
.demo-comparison {
  font-size: 10px;
  color: var(--muted);
  margin: 13px 0;
  min-height: 16px;
}
.demo-note {
  font-size: 11px;
  margin: 13px 0 0;
}
.effect-demo {
  min-height: 0;
}
.sound-settings {
  margin: 24px 0;
}
.sound-settings input {
  accent-color: #f43f5e;
}
.setting-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  font-size: 15px;
  border-top: 1px solid var(--line);
}
.setting-toggle input {
  width: 20px;
  height: 20px;
}
.setting-volume {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 5px 0 20px;
  color: var(--muted);
  font-size: 12px;
}
.setting-volume span {
  min-width: 105px;
}
.setting-volume input {
  flex: 1;
}
.mode-sound.learn-dialog {
  max-width: 550px !important;
}
.mode-sound.learn-dialog h1 {
  margin-bottom: 16px !important;
}
.demonstrated.stage-play .practice-play-card {
  transform: translateY(0) rotate(0);
  animation: demo-deploy 0.8s ease both;
}
.demonstrated.stage-hand .practice-selected {
  animation: card-draw 0.6s ease both;
}
.demonstrated.stage-goal .practice-target,
.demonstrated.stage-turn .practice-target {
  animation: card-hit 0.5s ease both;
}
.demonstrated.stage-forge .practice-card {
  animation: forge-bloom 0.9s ease both;
}
.demonstrated.stage-deck .training-piece {
  animation: heal-bloom 0.7s ease both;
}
.demonstrated .demo-flight {
  animation: demo-strike 0.65s ease both;
}
.effect-demo.demonstrated .demo-token {
  animation: stat-change 0.65s ease both;
}
.effect-demo.demonstrated .effect-arrow {
  animation: effect-beam 0.7s ease both;
}
.effect-demo.demonstrated.fx-strike .demo-mini-card {
  animation: demo-strike 0.65s ease both;
}
.effect-demo.demonstrated.fx-shield .demo-mini-card {
  animation: shield-break 0.7s ease both;
}
.effect-demo.demonstrated.fx-heal .demo-values {
  animation: heal-bloom 0.8s ease both;
}
.effect-demo.demonstrated.fx-draw .demo-values {
  animation: card-draw 0.6s ease both;
}
.effect-demo.demonstrated.fx-guard .demo-mini-card {
  animation: guard-step 0.7s ease both;
}
.card,
.hero-token,
.player-identity {
  position: relative;
}
.card.fx-arrive {
  animation: card-arrive 0.55s ease both;
}
.card.fx-draw {
  animation: card-draw 0.45s ease both;
}
.fx-hit {
  animation: card-hit 0.45s ease both;
}
.fx-heal {
  animation: heal-bloom 0.6s ease both;
}
.fx-shield {
  animation: shield-break 0.6s ease both;
}
.fx-spell {
  animation: spell-bloom 0.6s ease both;
}
.fx-turn {
  animation: turn-bloom 0.7s ease both;
}
.damage-pop {
  position: absolute;
  top: 30%;
  left: 40%;
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 15px #e11d48;
  z-index: 20;
  pointer-events: none;
  animation: damage-float 0.85s ease both;
}
.flying-card {
  position: fixed;
  pointer-events: none;
  z-index: 100;
  transform-origin: top left;
}
.flying-card .card {
  width: 100%;
  height: 100%;
}
@keyframes ambient-drift {
  to {
    transform: scale(1.15) translate(2%, -2%);
    opacity: 0.65;
  }
}
@keyframes stat-breathe {
  50% {
    box-shadow: 0 0 8px #fb718520;
  }
}
@keyframes orbit-breathe {
  50% {
    transform: scale(1.07) rotate(5deg);
    text-shadow: 0 0 60px #e11d4877;
  }
}
@keyframes demo-deploy {
  from {
    transform: translateY(60px) rotate(-8deg);
    opacity: 0.65;
  }
  to {
    transform: translateY(0) rotate(0);
    opacity: 1;
  }
}
@keyframes demo-strike {
  35% {
    transform: translateY(24px) scale(1.08);
  }
  65% {
    transform: translateY(-5px);
  }
}
@keyframes guard-step {
  40% {
    transform: translateX(28px) scale(1.08);
    filter: drop-shadow(0 0 15px #fb7185);
  }
}
@keyframes effect-beam {
  0% {
    opacity: 0;
    transform: translateY(-35px) scale(0.6);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(50px) scale(1.6);
  }
}
@keyframes stat-change {
  0% {
    opacity: 0.5;
    transform: scale(0.92);
  }
  55% {
    transform: scale(1.1);
    border-color: var(--accent);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes card-arrive {
  from {
    transform: translateY(25px) scale(0.8);
    opacity: 0;
  }
  70% {
    transform: translateY(-5px) scale(1.03);
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes card-draw {
  from {
    transform: translateX(25px) rotate(7deg);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes card-hit {
  20%,
  60% {
    transform: translateX(-5px);
    filter: brightness(1.6);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}
@keyframes heal-bloom {
  45% {
    filter: brightness(1.5);
    box-shadow: 0 0 28px #fb718557;
  }
}
@keyframes shield-break {
  40% {
    filter: brightness(1.8);
    outline: 3px solid #fda4af;
    outline-offset: 8px;
  }
  100% {
    outline-color: transparent;
    outline-offset: 20px;
  }
}
@keyframes forge-bloom {
  0% {
    opacity: 0.3;
    transform: scale(0.7) rotate(-8deg);
  }
  65% {
    transform: scale(1.12);
    filter: drop-shadow(0 0 20px #e11d48);
  }
  100% {
    transform: none;
    opacity: 1;
  }
}
@keyframes spell-bloom {
  40% {
    box-shadow: inset 0 0 80px #e11d4833;
  }
}
@keyframes turn-bloom {
  40% {
    box-shadow: 0 0 30px #e11d482f;
  }
}
@keyframes damage-float {
  from {
    opacity: 1;
    transform: translateY(0) scale(0.8);
  }
  to {
    opacity: 0;
    transform: translateY(-60px) scale(1.1);
  }
}
@media (max-width: 760px) {
  .experience-toolbar {
    padding: 9px 18px;
    gap: 8px;
  }
  .experience-toolbar > span {
    display: none;
  }
  .welcome-guide {
    margin: 18px 16px 0;
    padding: 16px;
    gap: 12px;
  }
  .welcome-guide strong {
    font-size: 14px;
  }
  .welcome-guide p {
    font-size: 11px;
  }
  .welcome-guide .secondary {
    font-size: 11px;
    padding: 10px;
  }
  .next-move {
    padding: 13px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .next-icon {
    display: none;
  }
  .next-move > div:first-of-type {
    width: 100%;
    flex: auto;
  }
  .next-actions {
    justify-content: start;
  }
  .next-move p {
    font-size: 11px;
  }
  .next-move strong {
    font-size: 13px;
  }
  .card-key {
    gap: 10px;
    font-size: 9px;
  }
  .card-key button {
    font-size: 10px;
  }
  .collection-help {
    align-items: start;
    font-size: 11px;
  }
  .collection-help button {
    white-space: nowrap;
    font-size: 10px;
  }
  #learning {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    padding: 16px;
    border-radius: 14px;
  }
  #learning h1 {
    font-size: 24px;
  }
  .learn-top {
    margin-bottom: 18px;
  }
  .learn-top .eyebrow {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .learn-top > div {
    gap: 8px;
  }
  .learn-number {
    font-size: 38px;
  }
  .tour-heading {
    gap: 12px;
    margin-bottom: 18px;
  }
  .tour-layout,
  .inspect-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .tour-explanation > p {
    font-size: 13px;
  }
  .tour-explanation {
    gap: 12px;
  }
  .lesson-tip {
    padding: 12px;
  }
  .tour-explanation .text-button {
    font-size: 11px;
  }
  .tour-footer {
    gap: 8px;
    position: sticky;
    bottom: -16px;
    background: #080e20;
    padding: 14px 0;
    margin-top: 16px;
    z-index: 3;
  }
  .tour-footer .primary {
    min-width: 100px;
    font-size: 12px;
    padding: 12px;
  }
  .tour-footer > .text-button {
    font-size: 11px;
  }
  .tour-dots {
    gap: 4px;
  }
  .tour-dots button {
    width: 6px;
    height: 6px;
    min-height: 6px;
  }
  .tour-dots button.current {
    width: 14px;
  }
  .tour-bottom {
    padding-top: 10px;
    gap: 10px;
  }
  .tour-bottom > span:last-child {
    text-align: right;
  }
  .anatomy-stage {
    grid-template-columns: 125px 1fr;
    gap: 10px;
    padding: 12px;
  }
  .anatomy-card .card-name {
    font-size: 15px;
  }
  .anatomy-card .cost {
    width: 23px;
    height: 23px;
    font-size: 13px;
  }
  .anatomy-card .card-top {
    font-size: 6px;
  }
  .anatomy-card .card-country {
    font-size: 9px;
  }
  .anatomy-card .card-stats {
    font-size: 14px;
  }
  .anatomy-card .city-art {
    height: 85px;
  }
  .legend-item {
    padding: 7px;
    gap: 6px;
  }
  .legend-item > b {
    font-size: 15px;
    min-width: 28px;
  }
  .legend-item strong {
    font-size: 10px;
  }
  .legend-item small {
    font-size: 9px;
  }
  .practice-stage,
  .effect-demo {
    padding: 15px;
    min-height: 0;
  }
  .practice-commanders {
    gap: 16px;
  }
  .training-piece {
    min-width: 105px;
    padding: 16px;
  }
  .practice-hand {
    gap: 8px;
  }
  .practice-card {
    width: 90px;
  }
  .practice-card .card-name {
    font-size: 11px;
  }
  .practice-card .card-text {
    font-size: 7px;
  }
  .inspect-layout .anatomy-stage {
    grid-template-columns: 125px 1fr;
    gap: 10px;
  }
  .inspect-layout .anatomy-card {
    width: 125px;
  }
  .inspect-layout .card-legend {
    display: flex;
  }
  .demo-token {
    padding: 10px;
    min-width: 80px;
  }
  .demo-values {
    gap: 8px;
  }
  .welcome-guide {
    flex-wrap: wrap;
  }
}
/* Motion is never required to understand an action; final values stay visible. */
html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
html.reduce-motion .flying-card,
html.reduce-motion .damage-pop {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.legend-item > b {
  white-space: nowrap;
}
.phase-mulligan .board-row {
  min-height: 65px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.phase-mulligan .turn-actions,
.phase-mulligan .energy {
  display: none;
}
.phase-mulligan .battlefield {
  padding-top: 12px;
  padding-bottom: 12px;
}
.phase-mulligan .empty-board {
  font-size: 12px;
}
.phase-mulligan .player-bar {
  padding-top: 12px;
}
.card.fx-attack {
  animation: demo-strike 0.5s ease both;
}
.practice-play-card .card,
.practice-card .card,
.demo-mini-card .card {
  padding: 5px;
}
.practice-play-card .city-art,
.practice-card .city-art,
.demo-mini-card .city-art {
  flex-shrink: 0;
}
.practice-play-card .card-country,
.practice-play-card .card-name,
.practice-play-card .card-text,
.demo-mini-card .card-country,
.demo-mini-card .card-name,
.demo-mini-card .card-text {
  margin-top: 2px;
  padding-top: 0;
  padding-bottom: 0;
}

.battlefield::before {
  animation: arena-ambient 10s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes arena-ambient {
  to {
    opacity: 0.6;
    transform: scale(1.03);
  }
}

.practice-play-card .card,
.practice-card .card,
.demo-mini-card .card {
  aspect-ratio: auto;
  min-height: 150px;
}
@media (max-width: 760px) {
  #learning .learn-top {
    position: sticky;
    top: -16px;
    z-index: 5;
    background: #080e20;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }
}

/* Combat is readable without motion; color is always accompanied by a label. */
.card.rarity-common {
  --rarity: #94a3b8;
  border-color: #64748b;
}
.card.rarity-rare {
  --rarity: #c4b5fd;
  border: 2px solid #a78bfa;
  box-shadow:
    inset 0 0 0 2px #a78bfa33,
    0 0 16px #8b5cf62a;
}
.card.rarity-rare .card-top {
  background: linear-gradient(110deg, #312e81aa, transparent);
}
.card.rarity-rare .cost {
  border-color: #c4b5fd;
}
.rarity-label {
  display: block;
  font:
    600 8px/1.4 Inter,
    sans-serif;
  letter-spacing: 0.12em;
  color: var(--rarity, #94a3b8);
  padding-top: 3px;
}
.card.rarity-rare .rarity-label {
  text-shadow: 0 0 10px #a78bfa66;
}
.card.target {
  border-color: #fb7185;
  box-shadow: 0 0 0 3px #f43f5e66;
}
.rare-key {
  color: #c4b5fd;
}
.combat-recap {
  border-left: 3px solid #fb7185;
  padding: 12px 16px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.7;
  margin: 12px 0;
}
.battle-piles {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 0;
  flex-wrap: wrap;
}
.pile-pair {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.draw-pile,
.discard-pile {
  background: #0f172a;
  color: #cbd5e1;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
}
.discard-pile:hover {
  border-color: #fb7185;
  color: #fff;
}
.discard-list {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  max-height: 65vh;
  overflow: auto;
  padding: 12px;
}
.discard-list .card {
  width: 156px;
  min-width: 156px;
}
.discard-list article {
  width: 156px;
}
.discard-list p {
  font-size: 12px;
}
.live-card-status {
  padding: 14px 18px;
  border: 1px solid #64748b;
  background: #172036;
  border-radius: 10px;
  margin: 12px 0;
}
.live-card-status p {
  margin: 6px 0 0;
}
.shared-reserve {
  border: 1px solid #334155;
  background: linear-gradient(140deg, #111a30, #0f172a);
  border-radius: 12px;
  margin: 20px 0;
  padding: 16px 20px;
}
.shared-reserve summary {
  cursor: pointer;
  color: #f8fafc;
  font-weight: 600;
}
.shared-reserve summary span {
  display: inline-block;
  color: #fda4af;
  margin-left: 16px;
  font-size: 13px;
}
.shared-reserve > p {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.7;
  max-width: 950px;
}
.reserve-offers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.reserve-offers article {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid #475569;
  padding: 12px;
  border-radius: 8px;
  background: #1e293b;
}
.reserve-inspect {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  border: 0;
  color: #f8fafc;
  background: none;
}
.reserve-inspect span {
  font-size: 12px;
  color: #cbd5e1;
}
.card-peek {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  width: 260px;
  max-height: calc(100dvh - 16px);
  overflow: hidden;
  padding: 14px;
  border: 1px solid #64748b;
  background: #0f172af7;
  border-radius: 14px;
  box-shadow: 0 16px 60px #000a;
}
.card-peek .card {
  width: 130px;
  min-width: 130px;
  margin: 0 auto 10px;
  display: flex;
  cursor: default;
}
.card-peek .card .card-text {
  min-height: 25px;
}
.card-peek p {
  font-size: 12px;
  line-height: 1.65;
  color: #e2e8f0;
  margin: 8px 0;
}
.card-peek small {
  font-size: 10px;
  color: #94a3b8;
}
.peek-preview {
  color: #fda4af !important;
  border-top: 1px solid #475569;
  padding-top: 8px;
}
.flying-card {
  z-index: 90;
  pointer-events: none;
  transform-origin: center;
}
.flying-card .card {
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  transform: none !important;
  visibility: visible !important;
}
.attack-ghost {
  z-index: 92;
  filter: drop-shadow(0 0 13px #fb718580);
}
.target-ghost {
  z-index: 91;
}
.flying-card.fx-attack {
  animation: none;
}
.damage-pop {
  z-index: 96;
  white-space: nowrap;
  text-shadow: 0 2px 5px #020617;
}
@media (max-width: 640px) {
  .battle-piles {
    gap: 8px;
  }
  .pile-pair {
    width: 100%;
    justify-content: space-between;
    gap: 4px;
  }
  .draw-pile,
  .discard-pile {
    font-size: 10px;
    padding: 8px;
  }
  .combat-recap {
    font-size: 12px;
    padding: 10px 12px;
  }
  .shared-reserve {
    padding: 14px;
  }
  .shared-reserve summary span {
    display: block;
    margin: 8px 0 0;
  }
  .reserve-offers {
    grid-template-columns: 1fr;
  }
  .reserve-offers article {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .reserve-offers .secondary {
    font-size: 11px;
    padding: 10px;
  }
  .card-peek {
    display: none;
  }
}
.board-unit {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.inspect-unit {
  background: transparent;
  border: 0;
  color: #cbd5e1;
  font-size: 10px;
  padding: 5px 10px;
  border-radius: 5px;
}
.inspect-unit:hover,
.inspect-unit:focus-visible {
  color: #fff;
  background: #334155;
}
.selection-bar small {
  display: block;
  font-size: 12px;
  line-height: 1.6;
  color: #cbd5e1;
  max-width: 440px;
}
.selection-bar.has-selection {
  background: #101a30;
  border: 1px solid #fb71855c;
  padding: 14px;
  border-radius: 10px;
}
.combat-recap > small {
  display: block;
  color: #fb7185;
  font-size: 9px;
  letter-spacing: 0.13em;
  margin-bottom: 5px;
}
.reserve-rules {
  margin: 12px 0;
}
.reserve-rules summary {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 400;
}
.reserve-rules p {
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.7;
}
.reserve-offers article {
  align-items: center;
}
.reserve-offers .card {
  width: 135px;
  min-width: 0;
}
@media (max-width: 640px) {
  .reserve-offers {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .reserve-offers article {
    flex-direction: column;
    padding: 5px;
    gap: 8px;
    justify-content: flex-start;
  }
  .reserve-offers .card {
    width: 100%;
    padding: 4px;
  }
  .reserve-offers .card-top {
    font-size: 4px;
    gap: 2px;
  }
  .reserve-offers .cost {
    width: 17px;
    height: 17px;
    font-size: 10px;
  }
  .reserve-offers .card-name {
    font-size: 10px;
  }
  .reserve-offers .card-country {
    font-size: 6px;
  }
  .reserve-offers .card-text {
    font-size: 7px;
    padding: 4px 0;
    min-height: 18px;
  }
  .reserve-offers .card-stats {
    font-size: 10px;
  }
  .reserve-offers .rarity-label {
    font-size: 6px;
  }
  .reserve-offers .secondary {
    padding: 8px 3px;
    font-size: 9px;
    width: 100%;
  }
}

/* Engine-backed rehearsals: a readable battlefield, shared card art and timed outcomes. */
.rehearsal {
  padding: 16px;
  text-align: left;
  min-width: 0;
}
.rehearsal .demo-caption {
  margin: 0 0 10px;
  text-align: center;
}
.rehearsal-turn {
  text-align: center;
  font-size: 11px;
  color: var(--gold, #e6c887);
  margin-bottom: 12px;
}
.rehearsal-board {
  isolation: isolate;
  position: relative;
  border: 1px solid #65718b55;
  border-radius: 24px;
  background: radial-gradient(ellipse at center, #263b50 0%, #101b30 75%);
  padding: 10px;
}
.rehearsal-side header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 9px;
  color: #b7c4d9;
}
.rehearsal-side header > span:first-child {
  letter-spacing: 1px;
}
.rehearsal-hero {
  padding: 5px 9px;
  border: 1px solid #ffb0c188;
  border-radius: 14px;
  color: #ffb6c7;
  font-size: 13px;
}
.rehearsal-hero em {
  margin-left: 5px;
  font-style: normal;
}
.rehearsal-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 12px;
  min-height: 145px;
  padding: 12px 4px 7px;
  overflow: visible;
  flex-wrap: wrap;
}
.rehearsal-piece {
  width: 94px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.rehearsal-piece .card {
  width: 100%;
  min-width: 0;
  height: 122px;
  padding: 5px;
  border-radius: 10px;
  cursor: default;
  margin: 0;
}
.rehearsal .card-top {
  font-size: 5px;
  height: 15px;
}
.rehearsal .cost {
  font-size: 12px;
  min-width: 20px;
  width: 20px;
  height: 22px;
  padding: 1px;
}
.rehearsal-piece .city-art {
  height: 52px;
  min-height: 52px;
  margin-top: 2px;
}
.rehearsal-piece .card-name {
  font-size: 10px;
  line-height: 1.1;
  min-height: 0;
  margin: 5px 0 3px;
}
.rehearsal-piece .card-country,
.rehearsal-piece .card-text,
.rehearsal-piece .rarity-label {
  display: none;
}
.rehearsal-piece .card-stats {
  font-size: 13px;
  padding: 3px 0;
  margin-top: auto;
}
.rehearsal-status {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 5px;
}
.rehearsal-status span {
  font-size: 8px;
  padding: 2px 4px;
  background: #07111e;
  border: 1px solid #7cb6bb66;
  border-radius: 5px;
  color: #bce9d8;
}
.rehearsal-divider {
  height: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #b3a375;
}
.rehearsal-divider:before,
.rehearsal-divider:after {
  content: "";
  height: 1px;
  background: #b3a37555;
  flex: 1;
}
.rehearsal-empty {
  align-self: center;
  font-size: 11px;
  color: #7c8ca8;
}
.rehearsal-side.side-0 header {
  margin-top: 7px;
}
.rehearsal-relic {
  font-size: 10px;
  color: #e6c887;
  padding: 6px;
  border-top: 1px solid #e6c88744;
}
.rehearsal-hand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
.rehearsal-hand > small {
  font-size: 9px;
  color: var(--muted);
  flex-shrink: 0;
}
.rehearsal-hand > div {
  display: flex;
  gap: 5px;
  overflow: hidden;
}
.rehearsal-held {
  width: 50px;
  flex-shrink: 0;
}
.rehearsal-held .card {
  width: 50px;
  min-width: 0;
  height: 66px;
  padding: 3px;
  border-radius: 5px;
}
.rehearsal-held .city-art {
  min-height: 20px;
  height: 20px;
  margin: 0;
}
.rehearsal-held .card-name {
  font-size: 6px;
  margin: 2px 0;
}
.rehearsal-held .card-country,
.rehearsal-held .card-text,
.rehearsal-held .card-stats,
.rehearsal-held .rarity-label,
.rehearsal-held .spell-bottom {
  display: none;
}
.rehearsal-held .cost {
  font-size: 8px;
  width: 12px;
  min-width: 12px;
  height: 12px;
}
.rehearsal-held .card-top {
  height: 12px;
}
.rehearsal-held .card-top > span {
  display: none;
}
.rehearsal-narration {
  min-height: 80px;
  border-left: 2px solid var(--accent, #fb7185);
  padding: 8px 12px;
  background: #ffffff04;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.rehearsal-narration small {
  color: var(--muted);
  font-size: 10px;
}
.rehearsal-narration strong {
  font-size: 12px;
}
.rehearsal-narration > span {
  font-size: 11px;
  color: #c3cee2;
  line-height: 1.5;
}
.rehearsal-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 12px;
}
.rehearsal-controls button {
  font-size: 11px;
  padding: 9px 10px;
}
.rehearsal-context {
  font-size: 10px !important;
  color: var(--muted);
  line-height: 1.5;
  margin: 10px 0 0 !important;
}
.rehearsal-offers {
  font-size: 11px;
  color: #e6c887;
  margin: 0 0 10px;
}
.rehearsal-delta {
  position: absolute;
  top: 33%;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  color: #fff;
  text-shadow: 0 2px 8px #000;
  background: #a01838;
  border: 1px solid #ffc3d0;
  border-radius: 10px;
  padding: 4px 9px;
  font-size: 20px;
  white-space: nowrap;
  pointer-events: none;
  animation: rehearsal-number 1.8s both;
}
.rehearsal-delta.positive {
  background: #116b59;
}
.rehearsal-piece.hurt .card {
  animation: rehearsal-hit 0.5s;
}
.rehearsal-piece.healed .card {
  box-shadow: 0 0 20px #48d3a9;
}
.rehearsal-piece.departing {
  animation: rehearsal-depart 1.8s forwards;
}
.rehearsal-depart {
  display: block;
  color: #ffb6c7;
  text-align: center;
  font-size: 9px;
  margin-top: 4px;
}
.rehearsal .legal-target {
  outline: 2px solid #85e6c6;
  outline-offset: 3px;
  box-shadow: 0 0 16px #85e6c644;
}
@keyframes rehearsal-number {
  0% {
    opacity: 0;
    transform: translate(-50%, 5px) scale(0.8);
  }
  15%,
  70% {
    opacity: 1;
    transform: translate(-50%, -4px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
}
@keyframes rehearsal-hit {
  30% {
    filter: brightness(1.7);
    transform: rotate(-3deg);
  }
  60% {
    transform: rotate(3deg);
  }
}
@keyframes rehearsal-depart {
  0%,
  60% {
    opacity: 1;
    transform: none;
  }
  100% {
    opacity: 0;
    transform: translateY(24px) scale(0.75);
  }
}
.rehearsal-reduced *,
.rehearsal-reduced *:before {
  animation: none !important;
  transition: none !important;
}
.rehearsal-reduced .departing {
  opacity: 0.5;
}
@media (max-width: 600px) {
  .rehearsal {
    padding: 10px;
  }
  .rehearsal-row {
    gap: 8px;
  }
  .rehearsal-piece {
    width: 82px;
  }
  .rehearsal-piece .card {
    height: 116px;
  }
  .rehearsal-side header {
    font-size: 8px;
  }
  .rehearsal-hero {
    font-size: 11px;
    padding: 5px;
  }
}
.rehearsal-piece.corroded .card {
  box-shadow:
    0 0 14px #8bb54988,
    inset 0 0 12px #647e3433;
}
.rehearsal-piece.corroded.hurt .card {
  animation: rehearsal-corrosion 1.2s ease;
}
@keyframes rehearsal-corrosion {
  35% {
    filter: sepia(0.7) hue-rotate(35deg);
    box-shadow: 0 0 28px #a4df59;
  }
}
