/* ════════════════════════════════════════════════════════════════════
   Menus on a landscape stage, lobby, champion selection, match intro,
   table reveal and the class-coloured hero console.
   Presentation only. Ambient motion uses transform/opacity.
   ════════════════════════════════════════════════════════════════════ */

/* ───── Landscape stage: read together from the long side ───── */
.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  container-type: size;
  container-name: stage;
  background: #070b11;
  z-index: 1;
}
/* Portrait: menus stand upright for player 1; the flip turns them to player 2. */
@media (orientation: portrait) {
  html[data-stage-flip="1"] .stage {
    transform: rotate(180deg);
  }
}
.stage > .page {
  height: 100%;
  overflow-y: auto;
  padding-bottom: 40px;
}
.stage .toast {
  position: absolute;
}
.screen-out {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
}

/* Blocks rise in one after another on entering a screen. */
html.screen-enter .rise {
  animation: rise-in 0.72s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--d, 0) * 70ms + 140ms);
}
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(22px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* ───── Shared buttons ───── */
.btn-hero {
  position: relative;
  overflow: hidden;
  padding: 17px 38px;
  border: 1px solid #e8c983;
  border-radius: 12px;
  color: #ffeec7;
  font: 600 20px Georgia, serif;
  letter-spacing: 0.06em;
  background: radial-gradient(130% 150% at 50% 0%, #6e4c1f 0%, #2c1d0d 55%, #150e07 100%);
  box-shadow:
    inset 0 1px #ffeec5aa,
    inset 0 0 0 1px #0007,
    0 0 0 1px #0009,
    0 12px 30px #000a,
    0 0 26px #f3c76a40;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    box-shadow 0.35s ease,
    filter 0.35s ease;
}
.btn-hero::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid #f3c76a55;
  border-radius: 9px;
  pointer-events: none;
}
.btn-hero::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% 0;
  width: 40%;
  background: linear-gradient(100deg, transparent, #fff3d03a 50%, transparent);
  translate: -140% 0;
  pointer-events: none;
  animation: hero-sheen 4.6s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}
@keyframes hero-sheen {
  0% {
    translate: -140% 0;
  }
  32%,
  100% {
    translate: 360% 0;
  }
}
.btn-hero:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px #ffeec5cc,
    inset 0 0 0 1px #0007,
    0 0 0 1px #0009,
    0 16px 34px #000b,
    0 0 40px #f3c76a77;
}
.btn-hero:active {
  transform: scale(0.98);
}
.btn-glass {
  padding: 14px 24px;
  border: 1px solid #f3e9ce30;
  border-radius: 12px;
  color: var(--paper);
  font: 16px Georgia, serif;
  background: linear-gradient(180deg, #ffffff16, #ffffff06);
  box-shadow:
    inset 0 1px #ffffff24,
    0 10px 24px #0007;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    border-color 0.3s ease,
    background 0.3s ease;
}
.btn-glass:hover {
  transform: translateY(-2px);
  border-color: #f3e9ce66;
  background: linear-gradient(180deg, #ffffff22, #ffffff0a);
}
.btn-glass.subtle {
  padding: 12px 18px;
  font-size: 14px;
  color: #d9cfb6;
}
.btn-chip {
  padding: 8px 14px;
  border: 1px solid #ffffff1f;
  border-radius: 999px;
  color: #d8cfb9;
  font: 600 11px Arial, sans-serif;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  background: #ffffff0b;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.btn-chip:hover {
  background: #ffffff17;
  border-color: #ffffff40;
}

/* ───── Lobby (home) ───── */
.lobby {
  position: relative;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  color: var(--paper);
}
.home-lobby {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 2cqh;
  padding: 3.2cqh 4.5cqw 2.6cqh;
}
.lobby-bg {
  position: absolute;
  inset: -5%;
  z-index: -1;
  translate: calc(var(--px, 0) * -22px) calc(var(--py, 0) * -14px);
  transition: translate 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.bg-arena {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: arena-cycle 32s linear infinite;
  animation-delay: calc(var(--n) * 8s - 1.5s);
}
.bg-arena:first-child {
  opacity: 1;
}
.bg-arena svg {
  width: 100%;
  height: 100%;
  filter: blur(2.5px) saturate(0.9) brightness(0.52);
  animation: ken-burns 32s ease-in-out infinite alternate;
}
@keyframes arena-cycle {
  0% {
    opacity: 0;
  }
  6%,
  25% {
    opacity: 1;
  }
  31%,
  100% {
    opacity: 0;
  }
}
@keyframes ken-burns {
  from {
    transform: scale(1.06) translate(-1%, 0);
  }
  to {
    transform: scale(1.16) translate(1.5%, -1%);
  }
}
.bg-fog {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  opacity: 0.55;
  background:
    radial-gradient(40% 26% at 30% 70%, #c9b7ff1c, transparent 70%),
    radial-gradient(36% 22% at 70% 60%, #f3c76a14, transparent 70%);
  animation: fog-drift 26s ease-in-out infinite alternate;
}
.bg-fog.f2 {
  opacity: 0.4;
  animation-duration: 38s;
  animation-direction: alternate-reverse;
  background:
    radial-gradient(50% 30% at 60% 85%, #9fd4ff14, transparent 70%),
    radial-gradient(30% 20% at 20% 40%, #ffffff0d, transparent 70%);
}
@keyframes fog-drift {
  from {
    transform: translate(-4%, 1%);
  }
  to {
    transform: translate(5%, -2%);
  }
}
.bg-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 40%, #04070bd9 100%),
    linear-gradient(0deg, #05080cf2 0%, transparent 38%),
    linear-gradient(90deg, #05080ccc 0%, transparent 55%);
}
.lobby-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font: 600 11px Arial, sans-serif;
  letter-spacing: 0.22em;
  color: #c9bea3;
}
.brand-mark {
  font: 600 22px Georgia, serif;
  letter-spacing: 0.02em;
  color: #f3e9ce;
}
.brand-mark span {
  color: #f3c76a;
  margin-left: 2px;
  font-size: 14px;
  vertical-align: super;
}
.lobby-top .edition {
  font-size: 9px;
  letter-spacing: 0.08em;
  opacity: 0.45;
}
.lobby-main {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 3cqw;
  min-height: 0;
}
.lobby-copy .eyebrow {
  font: 600 11px Arial, sans-serif;
  letter-spacing: 0.26em;
  color: #f3c76a;
}
.lobby-copy h1 {
  margin: 1.4cqh 0 1.2cqh;
  font: 400 clamp(64px, 15cqh, 150px) / 0.92 Georgia, serif;
  letter-spacing: -0.02em;
}
.title-glow {
  background: linear-gradient(100deg, #e9dcbc 15%, #fff2cf 38%, #ffffff 46%, #fff2cf 54%, #c9a865 85%);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px #f3c76a33);
  animation: title-shimmer 9s ease-in-out infinite;
}
@keyframes title-shimmer {
  0%,
  100% {
    background-position: 100% 0;
  }
  50% {
    background-position: 0% 0;
  }
}
.lobby-copy p {
  margin: 0 0 3.4cqh;
  max-width: 30em;
  font-size: clamp(15px, 2.4cqh, 21px);
  line-height: 1.55;
  color: #d9cfb8;
}
.lobby-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.lobby-cards {
  position: relative;
  height: 100%;
  min-height: 300px;
  translate: calc(var(--px, 0) * 14px) calc(var(--py, 0) * 10px);
  transition: translate 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.card-fan {
  position: absolute;
  left: 50%;
  top: 50%;
}
.card-fan .card {
  position: absolute;
  left: -95px;
  top: -142px;
  width: 190px;
  height: 285px;
  box-shadow:
    0 30px 60px #000c,
    0 0 0 1px #0008;
  animation: fan-float 7.5s ease-in-out infinite;
}
.card-fan .card:nth-child(1) {
  --r: -14deg;
  --x: -120px;
  --y: 22px;
  animation-delay: -2.5s;
  z-index: 1;
}
.card-fan .card:nth-child(2) {
  --r: 0deg;
  --x: 0px;
  --y: -16px;
  z-index: 3;
}
.card-fan .card:nth-child(3) {
  --r: 13deg;
  --x: 120px;
  --y: 26px;
  animation-delay: -5s;
  z-index: 2;
}
@keyframes fan-float {
  0%,
  100% {
    transform: translate(var(--x), var(--y)) rotate(var(--r));
  }
  50% {
    transform: translate(var(--x), calc(var(--y) - 12px)) rotate(calc(var(--r) * 1.1));
  }
}
.lobby-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.nav-tile {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid #f3e9ce22;
  border-radius: 14px;
  color: var(--paper);
  text-align: left;
  background: linear-gradient(180deg, #14202ecc, #0b131ccc);
  box-shadow:
    inset 0 1px #ffffff14,
    0 12px 28px #0008;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}
.nav-tile:hover {
  transform: translateY(-3px);
  border-color: #f3c76a66;
  box-shadow:
    inset 0 1px #ffffff1c,
    0 16px 32px #000a,
    0 0 22px #f3c76a26;
}
.nav-tile b {
  font: 600 12px Arial, sans-serif;
  color: #f3c76a;
  letter-spacing: 0.1em;
}
.nav-tile span {
  font: 18px Georgia, serif;
}
.nav-tile small {
  display: block;
  margin-top: 3px;
  font: 12px Arial, sans-serif;
  color: #a9a291;
}
.nav-tile i {
  font-style: normal;
  color: #f3c76a;
  transition: transform 0.25s ease;
}
.nav-tile:hover i {
  transform: translateX(4px);
}
.lobby-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font: 600 10px Arial, sans-serif;
  letter-spacing: 0.18em;
  color: #8f8977;
}
.lobby-foot > span {
  margin-right: auto;
}
.lobby-floor {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 0;
  height: 2px;
  pointer-events: none;
}

/* ───── Champion selection: each player in their own half ───── */
.setup-lobby {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 1.6cqh;
  padding: 2.6cqh 2.6cqw 2.6cqh;
  background:
    radial-gradient(80% 70% at 50% 50%, #121b27, #06090d);
}
.setup-lobby .lobby-top > span:nth-child(2) {
  text-align: center;
}
.duel-halves {
  display: grid;
  grid-template-columns: 1fr 170px 1fr;
  gap: 14px;
  min-height: 0;
}
@property --class {
  syntax: "<color>";
  inherits: true;
  initial-value: #c5a46a;
}
.duel-half {
  position: relative;
  transition-property: --class, border-color, box-shadow;
  transition-duration: 0.7s;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  align-content: start;
  gap: 1.8cqh;
  min-height: 0;
  padding: 2cqh 1.8cqw;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid color-mix(in srgb, var(--class), transparent 45%);
  border-radius: 18px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--class), #070b10 82%), #070b10f2);
  box-shadow:
    inset 0 1px #ffffff12,
    0 0 0 1px #0008,
    0 24px 50px #000a,
    0 0 46px color-mix(in srgb, var(--class), transparent 78%);
  transition:
    border-color 0.6s ease,
    box-shadow 0.6s ease,
    background 0.6s ease;
}
.half-arena {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.38;
  mask-image: linear-gradient(180deg, #000 0%, #000a 45%, transparent 95%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000a 45%, transparent 95%);
}
.half-arena svg {
  width: 100%;
  height: 100%;
  filter: blur(2px) saturate(0.9);
  transform: scale(1.08);
}
.half-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font: 600 12px Arial, sans-serif;
  letter-spacing: 0.22em;
  color: color-mix(in srgb, var(--class), #fff 35%);
}
.half-head small {
  font-weight: 400;
  letter-spacing: 0.08em;
  color: #9d9684;
  text-transform: none;
}
.champion {
  display: grid;
  grid-template-columns: auto minmax(230px, 1fr);
  gap: 1.8cqw;
  align-items: center;
}
.champion-portrait {
  position: relative;
  width: clamp(120px, 23cqh, 240px);
  aspect-ratio: 0.8;
  border-radius: 50% 50% 46% 46% / 55% 55% 45% 45%;
  overflow: hidden;
  border: 3px solid color-mix(in srgb, var(--class), #e7cb8c 45%);
  box-shadow:
    0 0 0 2px #070b10,
    0 0 0 4px color-mix(in srgb, var(--class), transparent 55%),
    0 18px 36px #000c,
    0 0 40px color-mix(in srgb, var(--class), transparent 45%);
  animation: champion-breathe 4.8s ease-in-out infinite;
}
.champion-portrait > .art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.champion-sheen {
  position: absolute;
  inset: -30% auto -30% 0;
  width: 45%;
  background: linear-gradient(100deg, transparent, #ffffff30 50%, transparent);
  translate: -150% 0;
  animation: hero-sheen 5.5s cubic-bezier(0.45, 0, 0.25, 1) infinite 1s;
  pointer-events: none;
}
@keyframes champion-breathe {
  50% {
    transform: translateY(-3px) scale(1.012);
  }
}
.champion-info {
  min-width: 0;
}
.champion-label {
  font: 600 11px Arial, sans-serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--class), #fff 40%);
}
.champion-info h2 {
  margin: 4px 0 4px;
  font: 400 clamp(22px, 4.6cqh, 36px) / 1.05 Georgia, serif;
}
.champion-identity {
  margin: 0 0 1.6cqh;
  font: 13px Arial, sans-serif;
  letter-spacing: 0.04em;
  color: #b8b09c;
}
.skill-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--class), #c5a46a 50%);
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--class), #0b1016 78%), #0a0f15e6);
  box-shadow:
    inset 0 1px #ffffff14,
    0 8px 18px #0008;
}
.skill-art .glyph {
  display: block;
  width: 54px;
  height: 54px;
  padding: 11px;
  border-radius: 12px;
  color: #ffe7a8;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--class), #2a3a52 40%), #0e1622 75%);
  border: 2px solid #c5a46a;
  box-shadow:
    0 0 0 2px #070b10,
    0 0 16px color-mix(in srgb, var(--class), transparent 45%);
}
.skill-art .power-img {
  padding: 0;
  object-fit: cover;
}
.skill-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 16px Georgia, serif;
}
.skill-text p {
  margin: 4px 0 0;
  font: 13px/1.4 Arial, sans-serif;
  color: #cfc6b0;
}
/* Two mana crystals instead of "2 many". */
.cost-crystals {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
}
.cost-crystals i {
  display: block;
  flex: none;
  width: 9px;
  height: 9px;
  rotate: 45deg;
  border-radius: 2px;
  background: linear-gradient(135deg, #e6f8ff, #7fd0f2 45%, #2f7fb0);
  box-shadow:
    0 0 0 1px #0b1a26,
    0 0 6px #8ad8ff99;
}
/* Nine champions: five on top, four centred below. */
.class-strip {
  --gap: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: var(--gap);
  min-height: 0;
}
.class-tile {
  position: relative;
  flex: 0 0 calc((100% - 4 * var(--gap)) / 5);
  aspect-ratio: 0.86;
  padding: 0;
  overflow: hidden;
  border: 1px solid #ffffff1f;
  border-radius: 10px;
  color: var(--paper);
  background: #0b1016;
  cursor: pointer;
  filter: saturate(0.7) brightness(0.72);
  transition:
    filter 0.3s ease,
    transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1),
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}
.class-tile > .art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.class-tile span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 6px 6px;
  font: 600 11px/1.15 Arial, sans-serif;
  letter-spacing: 0.02em;
  text-align: center;
  background: linear-gradient(0deg, #05080cee, transparent);
}
.class-tile:hover {
  filter: saturate(0.95) brightness(0.95);
  transform: translateY(-2px);
}
.class-tile.chosen {
  filter: none;
  transform: translateY(-3px) scale(1.04);
  z-index: 1;
  border: 2px solid color-mix(in srgb, var(--class), #fff 25%);
  box-shadow:
    0 0 0 2px #070b10,
    0 10px 22px #000b,
    0 0 22px color-mix(in srgb, var(--class), transparent 30%);
}
.class-tile.chosen::after {
  content: "";
  position: absolute;
  inset: -30% auto -30% 0;
  width: 50%;
  background: linear-gradient(100deg, transparent, #ffffff3a 50%, transparent);
  translate: -150% 0;
  animation: hero-sheen 3.8s cubic-bezier(0.45, 0, 0.25, 1) infinite;
  pointer-events: none;
}
.deck-pick label {
  display: grid;
  gap: 6px;
  font: 600 11px Arial, sans-serif;
  letter-spacing: 0.2em;
  color: #a9a291;
  text-transform: uppercase;
}
.deck-pick select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--class), #c5a46a 50%);
  border-radius: 10px;
  color: var(--paper);
  font: 15px Georgia, serif;
  letter-spacing: 0;
  text-transform: none;
  background: #0a0f15e6;
}
.deck-pick .deck-plan {
  margin: 8px 0 0;
  font: 13px/1.45 Arial, sans-serif;
  color: #b8b09c;
}
.duel-seam {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4cqh;
}
.seam-line {
  position: absolute;
  top: 2%;
  bottom: 2%;
  left: 50%;
  width: 1px;
  background: linear-gradient(180deg, transparent, #c5a46a88 30%, #fff3cf 50%, #c5a46a88 70%, transparent);
  opacity: 0.7;
}
.seam-sigil {
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  color: #f3d68f;
  background: radial-gradient(circle, #1c1407 0%, #08090b 70%);
  box-shadow:
    0 0 0 1px #c5a46a77,
    0 0 0 8px #07090cdd,
    0 0 40px #f3c76a44;
  animation: sigil-glow 4.8s ease-in-out infinite;
}
.seam-sigil svg {
  width: 62px;
  height: 62px;
  animation: sigil-turn 40s linear infinite;
}
@keyframes sigil-glow {
  50% {
    box-shadow:
      0 0 0 1px #f3c76aaa,
      0 0 0 8px #07090cdd,
      0 0 60px #f3c76a77;
  }
}
@keyframes sigil-turn {
  to {
    rotate: 360deg;
  }
}
.seam-start {
  position: relative;
  padding: 15px 22px;
  font-size: 17px;
  white-space: nowrap;
}

/* ───── Match intro ───── */
.intro {
  position: fixed;
  inset: 0;
  z-index: 84;
  overflow: hidden;
  background: #030507;
  cursor: pointer;
}
.intro-stage {
  position: absolute;
  inset: 0;
  container-type: size;
}
.intro-side {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  container-type: size;
}
.intro-side.s0 {
  bottom: 0;
}
/* Player 2 sits at the top edge: the whole half faces them. */
.intro-side.s1 {
  top: 0;
  transform: rotate(180deg);
}
.intro-arena {
  position: absolute;
  inset: -4%;
}
.intro-arena svg {
  width: 100%;
  height: 100%;
}
.intro-side::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(0deg, #030507 0%, transparent 45%),
    radial-gradient(70% 60% at 50% 45%, transparent 30%, #030507cc 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--class), transparent 70%), transparent 60%);
}
.intro-edge {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  z-index: 2;
  background: linear-gradient(90deg, transparent, var(--class), #fff, var(--class), transparent);
  box-shadow: 0 0 24px var(--class);
}
.intro-hero {
  position: relative;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 2.4cqh;
}
.intro-oval {
  position: relative;
  width: clamp(130px, 44cqh, 270px);
  aspect-ratio: 0.8;
  overflow: hidden;
  border-radius: 50% 50% 46% 46% / 55% 55% 45% 45%;
  border: 4px solid color-mix(in srgb, var(--class), #e7cb8c 45%);
  box-shadow:
    0 0 0 3px #030507,
    0 0 0 6px color-mix(in srgb, var(--class), transparent 50%),
    0 30px 60px #000d,
    0 0 70px color-mix(in srgb, var(--class), transparent 35%);
}
.intro-oval > .art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.intro-name {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}
.intro-name small {
  font: 600 12px Arial, sans-serif;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--class), #fff 45%);
}
.intro-name b {
  font: 400 clamp(24px, 8cqh, 46px) Georgia, serif;
  color: #f6ecd2;
  text-shadow: 0 0 24px color-mix(in srgb, var(--class), transparent 40%);
}
.intro-name span {
  font: 600 10px Arial, sans-serif;
  letter-spacing: 0.25em;
  color: #8f8977;
}
.intro-core {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  display: grid;
  justify-items: center;
  translate: -50% -50%;
}
.intro-sigil {
  display: grid;
  place-items: center;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  color: #f6d891;
  background: radial-gradient(circle, #1b1306 0%, #030507 70%);
  box-shadow:
    0 0 0 1px #c5a46a88,
    0 0 0 10px #030507ee,
    0 0 60px #f3c76a55;
}
.intro-sigil svg {
  width: 76px;
  height: 76px;
}
.intro-flash {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 70cqh;
  height: 70cqh;
  margin: -35cqh;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle, #ffffff 0%, #fff3cfcc 18%, color-mix(in srgb, var(--c0), transparent 50%) 38%, transparent 68%);
  pointer-events: none;
}
.intro-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120px;
  height: 120px;
  margin: -60px;
  border-radius: 50%;
  opacity: 0;
  border: 2px solid #fff3cf;
  box-shadow:
    0 0 30px var(--c0),
    inset 0 0 30px var(--c1);
}
.intro-first {
  position: absolute;
  top: calc(100% + 22px);
  white-space: nowrap;
  font: 600 12px Arial, sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #d9cfb8;
  opacity: 0;
}
.intro-first b {
  font: 400 18px Georgia, serif;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #ffe7a8;
}
.intro-skip {
  position: absolute;
  right: 18px;
  top: 50%;
  translate: 0 -50%;
  font: 600 10px Arial, sans-serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ffffff55;
}
.intro-flyer {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 86;
  overflow: hidden;
  pointer-events: none;
  transform-origin: 50% 50%;
  border-radius: 50% 50% 46% 46% / 55% 55% 45% 45%;
  border: 4px solid color-mix(in srgb, var(--class), #e7cb8c 45%);
  box-shadow:
    0 20px 40px #000c,
    0 0 50px color-mix(in srgb, var(--class), transparent 35%);
}
.intro-flyer > .art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Table hidden while the intro plays, then drawn in piece by piece. */
html.intro-hold .tabletop {
  visibility: hidden;
}
html.intro-heroes-hidden .tabletop .hero-portrait {
  opacity: 0;
}
html.table-reveal .tabletop .player-zone > .arena-art {
  animation: reveal-arena 1.1s ease-out both;
}
html.table-reveal .tabletop .player-bar {
  animation: reveal-bar 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both 0.15s;
}
html.table-reveal .tabletop .board-row,
html.table-reveal .tabletop .arena-dressing {
  animation: reveal-fade 0.9s ease-out both 0.25s;
}
html.table-reveal .tabletop .table-seam {
  animation: reveal-fade 0.7s ease-out both 0.5s;
}
html.table-reveal .tabletop .hand .card {
  animation: reveal-deal 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
  animation-delay: calc(0.45s + var(--deal, 0) * 90ms);
}
html.table-reveal .tabletop .hand .card:nth-child(2) { --deal: 1; }
html.table-reveal .tabletop .hand .card:nth-child(3) { --deal: 2; }
html.table-reveal .tabletop .hand .card:nth-child(4) { --deal: 3; }
html.table-reveal .tabletop .hand .card:nth-child(5) { --deal: 4; }
html.table-reveal .tabletop .hand .card:nth-child(6) { --deal: 5; }
html.table-reveal .tabletop .mulligan {
  animation: reveal-fade 0.6s ease-out both 1.05s;
}
@keyframes reveal-arena {
  from {
    opacity: 0;
    transform: scale(1.08);
  }
}
@keyframes reveal-bar {
  from {
    opacity: 0;
    transform: translateY(46px);
  }
}
@keyframes reveal-fade {
  from {
    opacity: 0;
  }
}
@keyframes reveal-deal {
  from {
    opacity: 0;
    transform: translateY(90px) rotate(-8deg) scale(0.9);
  }
}
@media (prefers-reduced-motion: reduce) {
  html.table-reveal .tabletop * {
    animation: none !important;
  }
}

/* ───── Hero console: class-coloured, power art + crystals, readable stats ───── */
.tabletop .player-bar {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--class), #0b0f15 74%) 0%,
    color-mix(in srgb, var(--class), #070a0e 86%) 100%
  );
  border-color: color-mix(in srgb, var(--class), #c5a46a 45%);
}
.tabletop .power {
  background: linear-gradient(180deg, color-mix(in srgb, var(--class), #0d131b 80%), #0a0f15);
}
.tabletop .power > .power-img {
  padding: 0;
  object-fit: cover;
}
.tabletop .power > .cost-crystals {
  display: flex;
  gap: 4px;
  padding-left: 2px;
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  margin-top: 3px;
}
.tabletop .power > .cost-crystals i {
  width: 8px;
  height: 8px;
}
.tabletop .hero-portrait > b,
.tabletop .hero-portrait > i,
.tabletop .hero-portrait > .hero-weapon,
.board-row > .unit-token {
  rotate: var(--board-rotation, 0deg);
  /* No rotate transition on the live table: the turn change is animated by
     the presentation clones; a transition here made Safari spin units. */
  transition: none;
}

@container (max-height: 860px) {
  .card-fan {
    scale: 0.82;
  }
}
@container (max-height: 700px) {
  .card-fan {
    scale: 0.66;
  }
}

.bg-backdrop {
  position: absolute;
  inset: 0;
}
.bg-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(1.5px) brightness(0.6);
  animation: ken-burns 40s ease-in-out infinite alternate;
}
.bg-backdrop ~ .bg-arena {
  mix-blend-mode: normal;
  opacity: 0;
}

/* Deck choice: illustrated cards instead of a system dropdown. */
.deck-pick-head {
  margin-bottom: 8px;
  font: 600 11px Arial, sans-serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #a9a291;
}
.deck-cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 10px;
}
.deck-card {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 86px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #ffffff1f;
  border-radius: 12px;
  color: var(--paper);
  text-align: left;
  background: #0a0f15;
  cursor: pointer;
  filter: saturate(0.75) brightness(0.78);
  transition:
    filter 0.3s ease,
    transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1),
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}
.deck-card-art {
  position: absolute;
  inset: 0;
}
.deck-card-art > .art,
.deck-card-art > svg,
.deck-card-art > span {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.deck-card-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #05080cf2 18%, #05080c80 60%, #05080c26);
}
.deck-card-body {
  position: relative;
  grid-row: 2;
  display: grid;
  gap: 2px;
  padding: 8px 10px 9px;
}
.deck-card-body small {
  font: 600 9px Arial, sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--class), #fff 45%);
}
.deck-card-body b {
  font: 400 15px/1.15 Georgia, serif;
}
.deck-card:hover {
  filter: saturate(0.95) brightness(0.95);
  transform: translateY(-2px);
}
.deck-card.chosen {
  filter: none;
  transform: translateY(-3px);
  border: 2px solid color-mix(in srgb, var(--class), #fff 25%);
  box-shadow:
    0 0 0 2px #070b10,
    0 10px 22px #000b,
    0 0 22px color-mix(in srgb, var(--class), transparent 35%);
}
.deck-card.chosen::after {
  content: "";
  position: absolute;
  inset: -30% auto -30% 0;
  width: 45%;
  background: linear-gradient(100deg, transparent, #ffffff30 50%, transparent);
  translate: -150% 0;
  animation: hero-sheen 4.2s cubic-bezier(0.45, 0, 0.25, 1) infinite;
  pointer-events: none;
}
.deck-pick .deck-plan {
  min-height: 2.9em;
}

/* Champion switch layers */
.half-arena-old {
  z-index: -1;
}
.champion-portrait > .art-old {
  z-index: 2;
}

/* Arena variant images fill the zone like the atlas arena. */
.player-zone > .arena-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ───── Opening hand: the cards come to the centre of your half ───── */
.player-zone.choosing .hand {
  visibility: hidden;
}
.mulligan {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 12px;
  pointer-events: none;
}
/* While choosing, the console steps back (the hero medallion stays). */
.player-zone.choosing .player-bar > :not(.hero-portrait):not(.bar-aura) {
  opacity: 0.18;
  transition: opacity 0.4s ease;
}
.player-zone.choosing .player-bar {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.player-zone.choosing .player-bar::before,
.player-zone.choosing .player-bar::after {
  opacity: 0;
}
.mulligan > * {
  pointer-events: auto;
}
.mull-head,
.mulligan.waiting {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}
.mulligan.waiting {
  inset: 0 0 auto;
  top: 34%;
  opacity: 0.85;
}
.mull-orn {
  width: 220px;
  height: 12px;
  background:
    radial-gradient(circle at 50% 50%, #f3d68f 0 3px, transparent 4px),
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--class), #c5a46a 40%) 30%, #f3e9ce 50%, color-mix(in srgb, var(--class), #c5a46a 40%) 70%, transparent) center / 100% 1px no-repeat;
}
.mull-title {
  font: 400 30px Georgia, serif;
  color: #f6ecd2;
  text-shadow:
    0 2px 10px #000,
    0 0 24px color-mix(in srgb, var(--class), transparent 50%);
}
.mulligan small {
  font: 600 11px Arial, sans-serif;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--class), #f3d68f 55%);
}
.mull-cards {
  display: flex;
  justify-content: center;
  gap: 16px;
}
.mull-card {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform: translateY(0) rotate(calc((var(--i) - (var(--n) - 1) / 2) * 3deg));
  transition:
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1.2),
    filter 0.35s ease;
  animation: mull-in 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
  animation-delay: calc(var(--i) * 90ms + 120ms);
}
.mull-card > .card {
  width: 158px;
  height: 236px;
  box-shadow:
    0 22px 40px #000b,
    0 0 0 1px #0008;
}
.mull-card:hover {
  transform: translateY(-8px) rotate(calc((var(--i) - (var(--n) - 1) / 2) * 3deg));
}
.mull-card.swap {
  transform: translateY(14px) rotate(calc((var(--i) - (var(--n) - 1) / 2) * 3deg)) scale(0.94);
}
.mull-card > .card {
  transition: filter 0.35s ease;
}
.mull-card.swap > .card {
  filter: saturate(0.45) brightness(0.55);
}
.mull-mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  opacity: 0;
  transform: scale(1.3) rotate(-12deg);
  transition:
    opacity 0.3s ease,
    transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.3);
  pointer-events: none;
  z-index: 9;
}
.mull-mark i {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font: 400 34px Georgia, serif;
  font-style: normal;
  color: #fff3d6;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--class), #fff 20%), color-mix(in srgb, var(--class), #1a0d05 55%) 70%);
  box-shadow:
    0 0 0 2px #0009,
    0 0 0 4px color-mix(in srgb, var(--class), #f3d68f 40%),
    0 8px 20px #000c;
}
.mull-mark b {
  font: 600 11px Arial, sans-serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ffe9bf;
  text-shadow: 0 2px 6px #000;
}
.mull-card.swap .mull-mark {
  opacity: 1;
  transform: none;
}
@keyframes mull-in {
  from {
    opacity: 0;
    transform: translateY(160px) rotate(0deg) scale(0.7);
  }
}
.mull-hint {
  margin: 0;
  font: 13px Arial, sans-serif;
  color: #b9b29e;
  text-shadow: 0 1px 4px #000;
}
.mull-flyer {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 86;
  pointer-events: none;
  transform-origin: 50% 50%;
}
.mull-flyer > .card {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  box-shadow: 0 18px 30px #000b;
}
@media (prefers-reduced-motion: reduce) {
  .mull-card,
  .mull-confirm {
    animation: none;
  }
}

/* ───── Turn banner ───── */
.turn-banner {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 83;
  height: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
}
.tb-glow {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 120px;
  top: -60px;
  background: radial-gradient(50% 50% at 50% 50%, color-mix(in srgb, var(--class), transparent 55%), transparent 70%);
}
.tb-ribbon {
  position: absolute;
  top: -30px;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 60px;
  padding: 0 56px;
  color: #fff3d6;
  white-space: nowrap;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--class), #0a0d12 45%) 18%, color-mix(in srgb, var(--class), #0a0d12 30%) 50%, color-mix(in srgb, var(--class), #0a0d12 45%) 82%, transparent);
  border-block: 1px solid color-mix(in srgb, var(--class), #f3d68f 45%);
  box-shadow: 0 0 40px color-mix(in srgb, var(--class), transparent 50%);
  clip-path: polygon(0 0, 100% 0, 96% 50%, 100% 100%, 0 100%, 4% 50%);
}
.tb-ribbon b {
  font: 400 30px Georgia, serif;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 10px #000a;
}
.tb-ribbon small {
  font: 600 11px Arial, sans-serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--class), #fff 55%);
}
.tb-orn {
  width: 40px;
  height: 8px;
  background:
    radial-gradient(circle at 50% 50%, #f3d68f 0 2.5px, transparent 3.5px),
    linear-gradient(90deg, transparent, #f3d68f, transparent) center / 100% 1px no-repeat;
}

/* ───── Hero power flourish ───── */
.power-flyer {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 86;
  pointer-events: none;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 0 18px var(--class)) drop-shadow(0 0 6px #fff8);
}
.power-flyer > .glyph {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
}

/* ───── End of match ───── */
.victory-overlay {
  position: fixed;
  inset: 0;
  z-index: 84;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
  opacity: 0;
}
html.victory-run .victory-overlay {
  animation: v-dim 0.9s ease-out both 0.3s;
}
html.victory-done .victory-overlay {
  pointer-events: auto;
}
@keyframes v-dim {
  from {
    opacity: 0;
    background: #03050700;
  }
  to {
    opacity: 1;
    background: radial-gradient(70% 60% at 50% 45%, color-mix(in srgb, var(--class), #05070a 82%), #030507f2 75%);
  }
}
.victory-overlay[data-face="top"] .victory-inner {
  rotate: 180deg;
}
.victory-inner {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 22px;
  text-align: center;
}
.victory-rays {
  position: absolute;
  left: 50%;
  top: 150px;
  width: 760px;
  height: 760px;
  margin: -380px;
  border-radius: 50%;
  opacity: 0;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--class), transparent 70%) 0deg 6deg, transparent 6deg 18deg);
  mask-image: radial-gradient(circle, #000 0%, #0008 40%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle, #000 0%, #0008 40%, transparent 70%);
  pointer-events: none;
}
html.victory-done .victory-rays {
  animation:
    v-fade 1.2s ease-out both,
    v-spin 60s linear infinite;
}
@keyframes v-fade {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
  }
}
@keyframes v-spin {
  to {
    rotate: 360deg;
  }
}
.victory-oval {
  position: relative;
  width: 240px;
  height: 300px;
  overflow: hidden;
  border-radius: 50% 50% 46% 46% / 55% 55% 45% 45%;
  border: 4px solid color-mix(in srgb, var(--class), #f3d68f 50%);
  box-shadow:
    0 0 0 3px #030507,
    0 0 0 7px color-mix(in srgb, var(--class), transparent 45%),
    0 30px 60px #000d,
    0 0 90px color-mix(in srgb, var(--class), transparent 30%);
  opacity: 0;
}
.victory-oval > .art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
html.victory-done .victory-oval {
  opacity: 1;
  animation: v-breathe 4s ease-in-out infinite 0.4s;
}
@keyframes v-breathe {
  50% {
    transform: scale(1.025);
  }
}
.victory-text {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
}
.v-rise {
  opacity: 0;
}
html.victory-done .v-rise {
  animation: rise-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--d, 0) * 120ms + 150ms);
}
.victory-text small {
  font: 600 12px Arial, sans-serif;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--class), #fff 50%);
}
.victory-text h1 {
  margin: 0;
  font: 400 clamp(54px, 9vw, 88px) / 1 Georgia, serif;
  background: linear-gradient(100deg, #e9dcbc 15%, #fff2cf 40%, #ffffff 48%, #fff2cf 56%, #c9a865 85%);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px color-mix(in srgb, var(--class), transparent 40%));
  animation: title-shimmer 7s ease-in-out infinite;
}
.victory-name {
  margin: 0;
  font: 400 24px Georgia, serif;
  color: #f6ecd2;
}
.victory-congrats {
  margin: 0;
  max-width: 28em;
  font: italic 16px Georgia, serif;
  color: #cfc6b0;
}
.victory-stats {
  display: flex;
  gap: 26px;
  margin: 10px 0 6px;
}
.victory-stats div {
  display: grid;
  gap: 2px;
}
.victory-stats dt {
  font: 600 10px Arial, sans-serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #9d9684;
}
.victory-stats dd {
  margin: 0;
  font: 400 28px Georgia, serif;
  color: #ffe7a8;
}
.victory-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.victory-actions button {
  min-width: 0;
}
.victory-flyer {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 85;
  overflow: hidden;
  pointer-events: none;
  transform-origin: 50% 50%;
  border-radius: 50% 50% 46% 46% / 55% 55% 45% 45%;
  border: 4px solid color-mix(in srgb, var(--class), #f3d68f 50%);
  box-shadow: 0 0 60px color-mix(in srgb, var(--class), transparent 30%);
}
.victory-flyer > .art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* The defeated medallion cracks and fades to stone. */
.medal-crack {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  animation: v-crack 0.45s ease-out both;
}
.medal-crack svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 4px #fff);
}
@keyframes v-crack {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}
.hero-portrait.medal-shatter {
  animation: v-shake 0.5s linear both;
}
.hero-portrait.medal-shatter > .art {
  filter: grayscale(1) brightness(0.55);
  transition: filter 1.2s ease 0.3s;
}
@keyframes v-shake {
  0%,
  100% {
    translate: 0 0;
  }
  20% {
    translate: -5px 2px;
  }
  40% {
    translate: 5px -2px;
  }
  60% {
    translate: -3px 1px;
  }
  80% {
    translate: 2px 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .v-rise,
  .victory-oval,
  .victory-rays,
  .victory-overlay {
    opacity: 1 !important;
    animation: none !important;
  }
}

/* Opening hand: room to breathe. */
.mulligan.choosing {
  gap: 0;
  align-content: center;
  padding: 3% 0 4%;
}
.mull-head {
  margin-bottom: 26px;
}
.mull-head .mull-title {
  margin-top: 8px;
}
.mull-head small {
  margin-top: 4px;
}
.mull-cards {
  gap: 26px;
}
/* Cards keep their native layout and are scaled as a whole (no overflow). */
.mull-card {
  --s: 0.86;
  width: calc(165px * var(--s));
  height: calc(245px * var(--s));
}
.mull-card > .card {
  width: 165px !important;
  height: 245px !important;
  transform: scale(var(--s));
  transform-origin: 0 0;
}
@media (max-height: 1050px) {
  .mull-card {
    --s: 0.7;
  }
  .mull-head {
    margin-bottom: 14px;
  }
  .mull-head .mull-title {
    font-size: 24px;
  }
  .mull-foot {
    margin-top: 18px;
    gap: 10px;
  }
}
.mull-foot {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-top: 30px;
}
.mull-hint {
  font-size: 12px;
  letter-spacing: 0.04em;
  opacity: 0.8;
}
/* Confirm in the same language as "Ukončit tah": a softly rounded rectangle. */
.mull-confirm {
  position: relative;
  overflow: hidden;
  min-width: 190px;
  min-height: 52px;
  padding: 0 28px;
  border: 1px solid color-mix(in srgb, var(--class), #f3d68f 55%);
  border-radius: 10px;
  color: #fff1d2;
  font: 600 17px Georgia, serif;
  letter-spacing: 0.03em;
  cursor: pointer;
  background: linear-gradient(180deg, color-mix(in srgb, var(--class), #241a10 55%), color-mix(in srgb, var(--class), #0b0d12 78%));
  box-shadow:
    inset 0 1px #ffffff2a,
    0 0 0 1px #0009,
    0 10px 24px #000a,
    0 0 26px color-mix(in srgb, var(--class), transparent 60%);
  transition:
    transform 0.25s ease,
    box-shadow 0.3s ease;
  animation: rise-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both 0.6s;
}
.mull-confirm::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% 0;
  width: 40%;
  background: linear-gradient(100deg, transparent, #fff3d030 50%, transparent);
  translate: -140% 0;
  animation: hero-sheen 4.6s cubic-bezier(0.45, 0, 0.25, 1) infinite 1.2s;
  pointer-events: none;
}
.mull-confirm:hover {
  transform: translateY(-2px);
}
.mull-confirm.swapping {
  box-shadow:
    inset 0 1px #ffffff2a,
    0 0 0 1px #0009,
    0 10px 24px #000a,
    0 0 36px color-mix(in srgb, var(--class), transparent 35%);
}

/* ───── Champion selection: entrance choreography ─────
   primary first (frames, portraits, names), then skill, champions, decks,
   and the start button last. */
html.screen-enter .setup-lobby .rise {
  animation: none;
}
html.screen-enter .setup-lobby .lobby-top {
  animation: rise-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both 0.05s;
}
html.screen-enter .setup-lobby .duel-half {
  animation: half-in 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
html.screen-enter .setup-lobby .duel-half.p0 {
  --from: -40px;
  animation-delay: 0.12s;
}
html.screen-enter .setup-lobby .duel-half.p1 {
  --from: 40px;
  animation-delay: 0.2s;
}
@keyframes half-in {
  from {
    opacity: 0;
    transform: translateX(var(--from, 0)) scale(0.98);
    filter: blur(6px);
  }
}
html.screen-enter .setup-lobby .half-arena {
  animation: reveal-arena 1.4s ease-out both 0.3s;
}
html.screen-enter .setup-lobby .champion-portrait {
  animation:
    pop-in 0.75s cubic-bezier(0.2, 0.9, 0.3, 1.2) both 0.42s,
    champion-breathe 4.8s ease-in-out infinite 1.2s;
}
html.screen-enter .setup-lobby .p1 .champion-portrait {
  animation-delay: 0.5s, 1.3s;
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(14px);
    filter: blur(6px);
  }
}
html.screen-enter .setup-lobby .half-head,
html.screen-enter .setup-lobby .champion-label,
html.screen-enter .setup-lobby .champion-info h2,
html.screen-enter .setup-lobby .champion-identity,
html.screen-enter .setup-lobby .skill-card,
html.screen-enter .setup-lobby .deck-pick-head,
html.screen-enter .setup-lobby .deck-plan {
  animation: rise-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
html.screen-enter .setup-lobby .half-head { animation-delay: 0.35s; }
html.screen-enter .setup-lobby .champion-label { animation-delay: 0.6s; }
html.screen-enter .setup-lobby .champion-info h2 { animation-delay: 0.68s; }
html.screen-enter .setup-lobby .champion-identity { animation-delay: 0.76s; }
html.screen-enter .setup-lobby .skill-card { animation-delay: 0.88s; }
html.screen-enter .setup-lobby .class-tile {
  animation: tile-in 0.5s cubic-bezier(0.2, 0.8, 0.3, 1.1) both;
  animation-delay: calc(1s + var(--t, 0) * 45ms);
}
@keyframes tile-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.9);
  }
}
html.screen-enter .setup-lobby .deck-pick-head { animation-delay: 1.35s; }
html.screen-enter .setup-lobby .deck-card {
  animation: tile-in 0.5s cubic-bezier(0.2, 0.8, 0.3, 1.1) both;
  animation-delay: calc(1.42s + var(--t, 0) * 70ms);
}
html.screen-enter .setup-lobby .deck-plan { animation-delay: 1.7s; }
html.screen-enter .setup-lobby .duel-seam .seam-line {
  animation: reveal-fade 1s ease-out both 0.5s;
}
html.screen-enter .setup-lobby .duel-seam .seam-sigil {
  animation:
    pop-in 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2) both 1.1s,
    sigil-glow 4.8s ease-in-out infinite 2s;
}
html.screen-enter .setup-lobby .duel-seam .seam-start {
  animation: pop-in 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) both 1.85s;
}

/* Deck preview images: subject on the right, text on the darker left. */
.deck-card-art > .deck-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 80% 50%;
}
.deck-card.has-art .deck-card-art::after {
  background:
    linear-gradient(90deg, #05080cf0 0%, #05080cb0 42%, #05080c20 78%, transparent),
    linear-gradient(0deg, #05080ccc 0%, transparent 55%);
}

/* Turn sign: light runs along the bar edge from the diamond outward. */
.turn-sweep {
  position: absolute;
  left: 4%;
  right: 4%;
  top: -2px;
  height: 3px;
  border-radius: 3px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--class) 20%, #fff8e6 50%, var(--class) 80%, transparent);
  box-shadow:
    0 0 14px var(--class),
    0 0 34px color-mix(in srgb, var(--class), transparent 40%);
}
.player-zone.p1 .turn-sweep {
  top: auto;
  bottom: -2px;
}

/* ───── Frozen: encased in a block of ice (units and heroes) ───── */
.card.unit-token.frozen:not(.selected) .card-image,
.card.unit-token.frozen .card-image {
  border: 0;
  box-shadow: inset 0 0 18px #7bdbff;
  filter: saturate(0.4) hue-rotate(15deg) brightness(0.9);
}
.ice-block {
  position: absolute;
  inset: -3px -3px 22px;
  z-index: 3;
  border-radius: 46% 46% 40% 40% / 50% 50% 42% 42%;
  pointer-events: none;
  overflow: hidden;
  background:
    linear-gradient(160deg, #f3fdffcc 0%, #bdeeff70 16%, #7fd4f533 34%, #c9f2ff59 52%, #6cc6ec30 70%, #e6faff80 100%),
    radial-gradient(60% 40% at 30% 20%, #ffffff66, transparent 70%);
  border: 2px solid #d9f7ff;
  box-shadow:
    inset 0 0 0 1px #ffffff55,
    inset 0 0 22px #bff0ffaa,
    inset 0 -14px 24px #7fd0f055,
    0 0 16px #8fe0ffaa,
    0 0 34px #6fcff066;
  animation: ice-in 0.55s cubic-bezier(0.2, 0.8, 0.3, 1.1) both;
}
/* Facets: pale shards and crack lines frozen into the block. */
.ice-block i {
  position: absolute;
  background: linear-gradient(135deg, #ffffffb0, #ffffff10);
  opacity: 0.55;
  mix-blend-mode: normal;
}
.ice-block i:nth-child(1) {
  left: -6%;
  top: 8%;
  width: 46%;
  height: 34%;
  clip-path: polygon(0 20%, 70% 0, 100% 55%, 30% 100%);
}
.ice-block i:nth-child(2) {
  right: -4%;
  top: 30%;
  width: 40%;
  height: 40%;
  clip-path: polygon(30% 0, 100% 25%, 80% 100%, 0 70%);
  opacity: 0.35;
}
.ice-block i:nth-child(3) {
  left: 18%;
  bottom: -4%;
  width: 52%;
  height: 30%;
  clip-path: polygon(0 60%, 45% 0, 100% 40%, 70% 100%);
  opacity: 0.4;
}
.ice-block i:nth-child(4) {
  left: 52%;
  top: -2%;
  width: 2px;
  height: 58%;
  rotate: 18deg;
  background: #ffffffcc;
  box-shadow: 0 0 4px #fff;
  opacity: 0.6;
}
/* A slow glint passes over the ice. */
.ice-block b {
  position: absolute;
  inset: -40% auto -40% 0;
  width: 38%;
  background: linear-gradient(100deg, transparent, #ffffff66 50%, transparent);
  translate: -160% 0;
  rotate: 12deg;
  animation: ice-glint 4.2s ease-in-out infinite 0.8s;
}
@keyframes ice-in {
  from {
    opacity: 0;
    transform: scale(1.12);
    clip-path: inset(100% 0 0 0 round 40%);
  }
  to {
    opacity: 1;
    transform: scale(1);
    clip-path: inset(0 0 0 0 round 0);
  }
}
@keyframes ice-glint {
  0% {
    translate: -160% 0;
  }
  35%,
  100% {
    translate: 380% 0;
  }
}
.tabletop .hero-portrait > .ice-block {
  inset: -4px;
  border-radius: 50% 50% 46% 46% / 55% 55% 45% 45%;
}
.tabletop .hero-portrait.frozen > .art {
  filter: saturate(0.4) hue-rotate(15deg) brightness(0.9);
}
@media (prefers-reduced-motion: reduce) {
  .ice-block,
  .ice-block b {
    animation: none;
  }
}

/* ───── Sleeping units (just played, cannot attack yet) ─────
   The frame dims, the art sinks into a night veil, the unit breathes
   slowly and a few z's drift up. */
.card.unit-token.sleeping::before {
  filter: saturate(0.35) brightness(0.72);
  transition: filter 0.6s ease;
}
.card.unit-token.sleeping:not(.selected) .card-image {
  filter: saturate(0.5) brightness(0.74);
}
.card.unit-token.sleeping .card-image::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, #0a1428a8 0%, #0a142840 45%, transparent 80%);
}
/* No breathing on the unit itself: it carries the board-facing rotation and a
   transform animation on it is not safe (see .fx-actor in style.css). */
.card.unit-token.sleeping {
  animation: none;
}
@keyframes unit-sleep {
  50% {
    transform: scale(0.985) translateY(2px);
  }
}
.card.unit-token.sleeping .unit-state {
  animation: zz-drift 2.8s ease-in-out infinite;
  background: #18233a;
  color: #cfe0ff;
}
@keyframes zz-drift {
  0%,
  100% {
    translate: 0 0;
    opacity: 0.85;
  }
  50% {
    translate: 2px -5px;
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .card.unit-token.sleeping,
  .card.unit-token.sleeping .unit-state {
    animation: none;
  }
}

.tabletop .hero-portrait > b,
.tabletop .hero-portrait > i,
.tabletop .hero-portrait > .hero-weapon {
  z-index: 4;
}

/* ───── Audio: music + effects mixer (lobby popover, pause menu) ───── */
.audio-pop {
  position: relative;
}
.audio-pop.open > .btn-chip {
  background: #ffffff17;
  border-color: #d9b56a80;
}
.audio-panel {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #d9b56a3d;
  border-radius: 10px;
  background: linear-gradient(180deg, #1d1a14f2, #0f0e0bf2);
  box-shadow: 0 18px 40px #000a, inset 0 1px 0 #ffffff12;
  font: 600 11px Arial, sans-serif;
  letter-spacing: 0.09em;
  color: #d8cfb9;
}
.audio-panel.pop {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: 300px;
  z-index: 30;
  animation: audio-pop 0.22s ease-out;
}
@keyframes audio-pop {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.audio-panel.inline {
  width: 320px;
  max-width: 90vw;
}
.audio-row {
  display: grid;
  grid-template-columns: 96px 1fr 42px;
  align-items: center;
  gap: 10px;
}
.audio-row.muted input,
.audio-row.muted output {
  opacity: 0.35;
}
.audio-panel .audio-toggle,
.global-overlay .audio-panel .audio-toggle {
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid #ffffff1f;
  border-radius: 6px;
  color: inherit;
  font: inherit;
  text-align: left;
  text-transform: uppercase;
  background: #ffffff0b;
  cursor: pointer;
}
.audio-row:not(.muted) .audio-toggle {
  border-color: #d9b56a70;
  color: #f1dca8;
}
.audio-row input[type="range"] {
  width: 100%;
  accent-color: #d9b56a;
  cursor: pointer;
}
.audio-row output {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #a79f8a;
}

/* ───── Ready: each player confirms; the duel starts when both are ready ───── */
.half-ready {
  display: flex;
  align-items: center;
  gap: 14px;
}
.half-ready small {
  font: 12px Arial, sans-serif;
  letter-spacing: 0.04em;
  color: #9d9684;
}
.ready-btn {
  position: relative;
  min-width: 170px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid color-mix(in srgb, var(--class), #f3d68f 55%);
  border-radius: 10px;
  color: #fff1d2;
  font: 600 17px Georgia, serif;
  letter-spacing: 0.03em;
  cursor: pointer;
  background: linear-gradient(180deg, color-mix(in srgb, var(--class), #241a10 55%), color-mix(in srgb, var(--class), #0b0d12 78%));
  box-shadow:
    inset 0 1px #ffffff26,
    0 8px 18px #0009;
  transition:
    box-shadow 0.3s ease,
    border-color 0.3s ease,
    background 0.3s ease;
}
.ready-btn.is-ready {
  border-color: #7fe3a3;
  background: linear-gradient(180deg, #1f5a3a, #0e2a1d);
  box-shadow:
    inset 0 1px #ffffff2a,
    0 0 0 3px #3fd07a33,
    0 0 22px #3fd07a66,
    0 8px 18px #0009;
}
.ready-btn.is-ready i {
  font-style: normal;
  color: #9ff0bf;
  margin-right: 4px;
}
.seam-back {
  display: none;
}
.seam-state {
  display: flex;
  gap: 10px;
}
.seam-state i {
  width: 12px;
  height: 12px;
  rotate: 45deg;
  border-radius: 2px;
  background: #2a2f36;
  box-shadow: 0 0 0 1px #0008;
  transition:
    background 0.3s ease,
    box-shadow 0.3s ease;
}
.seam-state i.on {
  background: #6fe39a;
  box-shadow:
    0 0 0 1px #0008,
    0 0 10px #3fd07a;
}
.seam-state.go i {
  animation: ready-go 0.9s ease-in-out infinite;
}
@keyframes ready-go {
  50% {
    box-shadow:
      0 0 0 1px #0008,
      0 0 18px #9ff0bf;
  }
}

/* ───── Portrait: home upright, champion choice mirrored for the two seats ───── */
@container stage (orientation: portrait) {
  .home-lobby {
    padding: 3cqh 6cqw 2.4cqh;
  }
  .lobby-main {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    justify-items: center;
    text-align: center;
    gap: 2cqh;
  }
  .lobby-cards {
    order: -1;
    width: 100%;
    min-height: 30cqh;
  }
  .lobby-copy h1 {
    font-size: clamp(64px, 13cqw, 150px);
  }
  .lobby-copy p {
    margin-inline: auto;
  }
  .lobby-actions {
    justify-content: center;
  }
  .lobby-nav {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .lobby-foot {
    justify-content: center;
  }
  .lobby-foot > span {
    flex-basis: 100%;
    margin: 0 0 4px;
    text-align: center;
  }

  .setup-lobby {
    grid-template-rows: 1fr;
    padding: 1.2cqh 2.4cqw;
  }
  .setup-lobby > .lobby-top {
    display: none;
  }
  .duel-halves {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 1cqh;
  }
  .duel-half.p1 {
    grid-row: 1;
    rotate: 180deg;
  }
  .duel-half.p0 {
    grid-row: 3;
  }
  .duel-seam {
    grid-row: 2;
    grid-auto-flow: column;
    justify-content: center;
    align-items: center;
    gap: 28px;
    min-height: 64px;
  }
  .seam-line {
    top: 50%;
    bottom: auto;
    left: 3%;
    right: 3%;
    width: auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, #c5a46a88 30%, #fff3cf 50%, #c5a46a88 70%, transparent);
  }
  .seam-sigil {
    width: 60px;
    height: 60px;
  }
  .seam-sigil svg {
    width: 40px;
    height: 40px;
  }
  .seam-back {
    display: inline-block;
    position: relative;
  }
  .duel-half {
    container-type: size;
    grid-template-columns: 1.1fr 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    column-gap: 3cqw;
    row-gap: 1.8cqh;
    padding: 2.4cqh 2.6cqw;
  }
  .half-head,
  .deck-pick,
  .half-ready {
    grid-column: 1 / -1;
  }
  .champion {
    grid-column: 1;
    grid-row: 2;
    grid-template-columns: auto minmax(0, 1fr);
    align-self: center;
  }
  .champion-portrait {
    width: clamp(110px, 30cqh, 210px);
  }
  .champion-info h2 {
    font-size: clamp(22px, 6.4cqh, 36px);
  }
  .class-strip {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
  }
  .half-ready {
    justify-content: center;
  }
}

/* The second player's opening hand arrives after the first one has settled. */
.mulligan.choosing.second .mull-card {
  animation-delay: calc(var(--i) * 90ms + 1000ms);
}
.mulligan.choosing.second .mull-head,
.mulligan.choosing.second .mull-foot {
  animation: log-in 0.4s ease-out both 0.9s;
}

/* ───── Solo setup: you (bigger) and the bot, one reading direction ───── */
.lobby-nav {
  grid-template-columns: repeat(4, 1fr);
}
.solo-halves {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
  min-height: 0;
}
.solo-halves > .bot-half {
  order: 2;
}
.solo-halves > .duel-half.p0 {
  order: 1;
}
.bot-half .champion-portrait {
  width: clamp(100px, 18cqh, 190px);
}
.bot-options {
  display: grid;
  gap: 10px;
}
.seg-group {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border: 1px solid color-mix(in srgb, var(--class), #c5a46a 45%);
  border-radius: 10px;
  overflow: hidden;
  background: #0a0f15e6;
}
.seg-group .seg {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-left: 1px solid #ffffff14;
  color: #d8cfb9;
  font: 600 14px Georgia, serif;
  background: none;
  cursor: pointer;
}
.seg-group .seg:first-child {
  border-left: 0;
}
.seg-group .seg.on {
  color: #fff1d2;
  background: linear-gradient(180deg, color-mix(in srgb, var(--class), #241a10 50%), color-mix(in srgb, var(--class), #0b0d12 75%));
  box-shadow: inset 0 1px #ffffff26;
}
.solo-toggles {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.solo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #ffffff22;
  border-radius: 999px;
  color: #d8cfb9;
  font: 600 12px Arial, sans-serif;
  letter-spacing: 0.06em;
  background: #ffffff0b;
  cursor: pointer;
}
.solo-toggle i {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid #ffffff44;
  border-radius: 4px;
  font-style: normal;
  font-size: 11px;
  color: #9ff0bf;
}
.solo-toggle.on {
  border-color: #7fe3a3aa;
  color: #f3e9ce;
}
.ready-btn.solo-start {
  min-width: 220px;
}
@container stage (orientation: portrait) {
  .solo-lobby {
    grid-template-rows: auto 1fr;
  }
  .solo-lobby > .lobby-top {
    display: flex;
  }
  .solo-halves {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 1.2cqh;
  }
  .solo-halves > .duel-half.p1 {
    grid-row: 1;
    rotate: none;
  }
  .solo-halves > .duel-half.p0 {
    grid-row: 2;
  }
  .lobby-nav {
    grid-template-columns: 1fr 1fr;
  }
}

/* ───── Solo battle: the bot's side reads the human's way ───── */
.tabletop.solo .player-zone.p1 :is(.hero-meta, .deck-pile, .power, .bot-controls, .mulligan.waiting) {
  rotate: 180deg;
}
.tabletop.solo .turn-controls.bot-hidden {
  display: none;
}
.bot-badge {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #ffffff22;
  border-radius: 10px;
  color: #c9c0aa;
  font: 600 13px Georgia, serif;
  letter-spacing: 0.04em;
  background: #0a0f15cc;
}
.bot-badge.thinking {
  color: #fff1d2;
  border-color: color-mix(in srgb, var(--class), #f3d68f 50%);
  box-shadow: 0 0 16px color-mix(in srgb, var(--class), transparent 60%);
}
.bot-badge i {
  font-style: normal;
  animation: bot-dot 1.2s ease-in-out infinite;
}
.bot-badge i:nth-child(2) {
  animation-delay: 0.2s;
}
.bot-badge i:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes bot-dot {
  50% {
    opacity: 0.2;
  }
}
.card.card-back {
  --rarity-line: #8a7f6a;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--class), transparent 55%) 0 22%, transparent 23%),
    repeating-linear-gradient(45deg, #ffffff08 0 6px, transparent 6px 12px),
    linear-gradient(160deg, color-mix(in srgb, var(--class), #0b0f16 70%), #070a10);
}
.card.card-back .back-img {
  position: absolute;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  object-fit: cover;
  border-radius: 8px;
}
.card.card-back .back-emblem {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #f3e3b8;
}
.card.card-back .back-emblem .glyph {
  width: 46%;
  height: 46%;
  opacity: 0.85;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--class), transparent 30%));
}
.fx-legend-dim.reveal {
  background: radial-gradient(ellipse at 50% 50%, #0a0f1580, #050a10c0 70%);
}
.fx-legend-rays.reveal {
  display: none;
}
.tabletop.solo .player-zone.p1 .hero-portrait {
  rotate: 180deg;
}

/* Ready: decorative lines either side, a pulse and sparks when confirmed. */
.half-ready {
  gap: 0;
}
.half-ready .ready-line {
  position: relative;
  flex: 1 1 0;
  max-width: 180px;
  height: 1px;
  overflow: visible;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--class), #f3d68f 50%));
  opacity: 0.6;
}
.half-ready .ready-line.r {
  background: linear-gradient(270deg, transparent, color-mix(in srgb, var(--class), #f3d68f 50%));
}
/* The running light moves with a transform (composited, smooth on iPad). */
.half-ready .ready-line {
  overflow: hidden;
}
.half-ready .ready-line::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background: radial-gradient(13px 2px at 13px 50%, #fff7dd, transparent);
  transform: translateX(-30px);
  animation: ready-run 3.2s ease-in-out infinite;
  will-change: transform, opacity;
}
.half-ready .ready-line.r::after {
  animation-name: ready-run-r;
}
@keyframes ready-run {
  0% {
    transform: translateX(-30px);
    opacity: 0;
  }
  20%,
  80% {
    opacity: 1;
  }
  100% {
    transform: translateX(calc(100% - 26px));
    opacity: 0;
  }
}
@keyframes ready-run-r {
  0% {
    transform: translateX(calc(100% - 26px));
    opacity: 0;
  }
  20%,
  80% {
    opacity: 1;
  }
  100% {
    transform: translateX(-30px);
    opacity: 0;
  }
}
.half-ready .ready-btn {
  margin: 0 14px;
}
.half-ready.is-ready .ready-line {
  opacity: 1;
  background: linear-gradient(90deg, transparent, #7fe3a3);
}
.half-ready.is-ready .ready-line.r {
  background: linear-gradient(270deg, transparent, #7fe3a3);
}
.ready-btn.is-ready {
  animation: ready-pulse 1.8s ease-out infinite;
}
@keyframes ready-pulse {
  0% {
    box-shadow:
      inset 0 1px #ffffff2a,
      0 0 0 0 #3fd07a88,
      0 0 22px #3fd07a66,
      0 8px 18px #0009;
  }
  70% {
    box-shadow:
      inset 0 1px #ffffff2a,
      0 0 0 14px #3fd07a00,
      0 0 22px #3fd07a66,
      0 8px 18px #0009;
  }
  100% {
    box-shadow:
      inset 0 1px #ffffff2a,
      0 0 0 0 #3fd07a00,
      0 0 22px #3fd07a66,
      0 8px 18px #0009;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ready-btn.is-ready,
  .half-ready .ready-line::after {
    animation: none;
  }
}
/* Seam: back on the left edge, the sigil and the ready lights in the middle. */
@container stage (orientation: portrait) {
  .duel-seam .seam-back {
    position: absolute;
    left: 2%;
    top: 50%;
    translate: 0 -50%;
  }
}

/* ───── Main menu scene: parallax layers, the Storyteller, a floating card ───── */
.home-scene {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: #070b11;
}
.home-lobby.has-scene .lobby-bg {
  display: none;
}
.scene-layer {
  position: absolute;
  display: block;
  user-select: none;
}
.scene-layer.l-sky {
  inset: -4%;
  width: 108%;
  height: 108%;
  object-fit: cover;
  translate: calc(var(--px, 0) * -10px) calc(var(--py, 0) * -6px);
}
.scene-layer.l-land {
  left: -5%;
  bottom: -2%;
  width: 110%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 100%;
  translate: calc(var(--px, 0) * -22px) calc(var(--py, 0) * -10px);
}
.scene-layer.l-front {
  left: -6%;
  bottom: -3%;
  width: 112%;
  height: auto;
  max-height: 55%;
  object-fit: cover;
  object-position: 50% 100%;
  translate: calc(var(--px, 0) * -48px) calc(var(--py, 0) * -14px);
}
@keyframes scene-sky {
  to {
    transform: scale(1.04) translate(-1%, 0.5%);
  }
}
@keyframes scene-land {
  to {
    transform: translateX(-1.2%);
  }
}
@keyframes scene-front {
  to {
    transform: translateX(1.6%) translateY(0.6%);
  }
}
.scene-fog {
  position: absolute;
  left: -20%;
  right: -20%;
  height: 26%;
  border-radius: 50%;
  background: radial-gradient(closest-side, #9fb4d62a, transparent);
}
.scene-fog.f1 {
  top: 34%;
}
.scene-fog.f2 {
  bottom: 12%;
  height: 22%;
  opacity: 0.8;
}
@keyframes scene-fog {
  to {
    transform: translateX(8%);
  }
}
/* The Storyteller: landscape on the right, portrait above the title. */
.scene-hero {
  position: absolute;
  right: 4cqw;
  bottom: 4cqh;
  height: 92cqh;
  aspect-ratio: 2 / 3;
  translate: calc(var(--px, 0) * -32px) calc(var(--py, 0) * -12px);
}
.scene-layer.l-hero {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 100%;
  -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent);
  mask-image: linear-gradient(180deg, #000 78%, transparent);
}
@keyframes scene-hero {
  50% {
    transform: translateY(-1%);
  }
}
.scene-source {
  position: absolute;
  left: var(--gx, 50%);
  top: var(--gy, 60%);
  width: 26%;
  height: 10%;
  translate: -50% -50%;
}
.scene-glow {
  position: absolute;
  left: var(--gx, 50%);
  top: var(--gy, 60%);
  width: 70%;
  aspect-ratio: 1.6;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--gc, #ffd98a), transparent 62%), color-mix(in srgb, var(--gc, #ffd98a), transparent 88%) 55%, transparent);
  animation: scene-glow 3.4s ease-in-out infinite;
}
@keyframes scene-glow {
  50% {
    opacity: 0.55;
    scale: 0.92;
  }
}
.scene-cards {
  position: absolute;
  left: 50%;
  top: 38%;
  width: calc(165px * var(--cs, 1));
  height: calc(245px * var(--cs, 1));
  translate: -50% -50%;
}
.scene-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 165px;
  height: 245px;
  margin: -122.5px 0 0 -82.5px;
  scale: var(--cs, 1);
  opacity: 0;
  animation: scene-card calc(var(--n) * 4.5s) ease-in-out infinite;
  animation-delay: calc(var(--i) * 4.5s);
}
.scene-card > .card {
  width: 100%;
  height: 100%;
  margin: 0;
  box-shadow:
    0 0 26px #ffd98a66,
    0 20px 34px #000c;
}
@keyframes scene-card {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(6%);
  }
  3% {
    opacity: 1;
    transform: none;
  }
  17% {
    opacity: 1;
    transform: translateY(-2%);
  }
  20% {
    opacity: 0;
    transform: scale(1.04) translateY(-5%);
  }
  100% {
    opacity: 0;
  }
}
@keyframes scene-float {
  50% {
    translate: 0 -4%;
    rotate: 1.5deg;
  }
}
.scene-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #05080cd9 0%, #05080c99 32%, transparent 62%),
    linear-gradient(0deg, #05080ccc 0%, transparent 34%);
}
@container stage (orientation: portrait) {
  .scene-hero {
    right: auto;
    left: 50%;
    bottom: 36cqh;
    height: 58cqh;
    margin-left: calc(-58cqh / 3);
  }
  .scene-shade {
    background:
      linear-gradient(0deg, #05080cf0 0%, #05080cc0 30%, #05080c40 46%, transparent 60%),
      linear-gradient(180deg, #05080c99 0%, transparent 12%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .scene-layer,
  .scene-fog,
  .scene-hero,
  .scene-glow,
  .scene-card > .card {
    animation: none;
  }
  .scene-card {
    animation: none;
  }
  .scene-card:first-child {
    opacity: 1;
  }
}

/* Scene readability: the title and the menu sit on a calm, darker band; the
   foreground sinks lower; the figure stands above the title. */
.home-lobby.has-scene .lobby-copy p {
  text-shadow:
    0 2px 14px #000,
    0 0 30px #000c;
}
/* The gradient title cannot take a text-shadow (it shows through the
   clipped text); it gets a drop-shadow on the element instead. */
.home-lobby.has-scene .title-glow {
  filter: drop-shadow(0 4px 22px #000) drop-shadow(0 0 22px #f3c76a33);
}
.home-lobby.has-scene .lobby-copy {
  position: relative;
}
.home-lobby.has-scene .lobby-copy::before {
  content: "";
  position: absolute;
  inset: -14% -18% -10%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, #04070bcc, #04070b80 55%, transparent);
}
@container stage (orientation: portrait) {
  .scene-hero {
    bottom: 44cqh;
    height: 52cqh;
    margin-left: calc(-52cqh / 3);
  }
  .scene-layer.l-front {
    bottom: -9%;
    max-height: 42%;
    opacity: 0.85;
  }
  .scene-shade {
    background:
      linear-gradient(0deg, #04070bfa 0%, #04070bf0 26%, #04070bc4 40%, #04070b55 52%, transparent 62%),
      linear-gradient(180deg, #04070bb0 0%, transparent 11%);
  }
}
@container stage (orientation: landscape) {
  .scene-layer.l-front {
    bottom: -7%;
    opacity: 0.85;
  }
  .scene-shade {
    background:
      linear-gradient(90deg, #04070be6 0%, #04070bb0 34%, transparent 64%),
      linear-gradient(0deg, #04070bf2 0%, #04070bb0 22%, transparent 42%);
  }
}
