:root {
  --obsidian-0: #06080d;
  --obsidian-1: #0c101a;
  --obsidian-2: #141a29;
  --obsidian-3: #1d253a;
  --gold-bright: #f7dfa4;
  --gold-mid: #cfa355;
  --gold-dark: #7a581d;
  --gold-border: rgba(212, 168, 87, 0.48);
  --mythic-top: #ff8024;
  --mythic-bot: #c93b00;
  --aether-cyan: #00e5ff;
  --aether-blue: #2563eb;
  --emerald: #10b981;
  --crimson: #ef4444;
  --text-light: #f8fafc;
  --text-dim: #94a3b8;
  --font-display: "Cinzel", Georgia, serif;
  --font-ui: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  font-family: var(--font-ui);
  background: radial-gradient(ellipse at 50% 15%, #19223a 0%, #090c14 60%, #040509 100%);
  color: var(--text-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.arena-bg-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 110, 20, 0.06), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(0, 229, 255, 0.05), transparent 40%),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.72) 100%);
  z-index: 0;
}

.hidden {
  display: none !important;
}

/* ==================== MTG ARENA TOP CHROME BAR ==================== */
.arena-topbar {
  height: 54px;
  background: linear-gradient(180deg, #161b28 0%, #0b0e16 100%);
  border-bottom: 1px solid var(--gold-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 60;
}

.arena-nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
}

.planeswalker-crest {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff9442, #b82d00);
  border: 2px solid var(--gold-bright);
  box-shadow: 0 0 14px rgba(255, 106, 19, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.planeswalker-crest:hover {
  transform: scale(1.08);
}
.pw-spark {
  font-size: 19px;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
}

.arena-tabs {
  display: flex;
  height: 100%;
  gap: 2px;
}

.arena-tab {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 1.1px;
  padding: 0 14px;
  height: 100%;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease, background 0.15s ease;
}

.arena-tab:hover {
  color: var(--gold-bright);
  background: rgba(255, 255, 255, 0.03);
}

.arena-tab.active {
  color: var(--gold-bright);
  text-shadow: 0 0 12px rgba(247, 223, 164, 0.65);
  background: linear-gradient(180deg, transparent 0%, rgba(207, 163, 85, 0.16) 100%);
}

.arena-tab.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
  box-shadow: 0 0 8px var(--gold-bright);
}

.arena-tab.done {
  color: #cbd5e1;
}

.arena-event-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: 1.4px;
  color: var(--gold-mid);
  text-transform: uppercase;
}

@media (max-width: 1050px) {
  .arena-event-title { display: none; }
}

.arena-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.arena-gem-pill {
  background: linear-gradient(180deg, #1b2438 0%, #0e1422 100%);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #e0f2fe;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}
.arena-gem-pill:hover {
  border-color: var(--aether-cyan);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
}
.arena-gem-pill.gold-pill {
  border-color: var(--gold-border);
  color: var(--gold-bright);
}
.arena-gem-pill.gold-pill:hover {
  border-color: var(--gold-bright);
  box-shadow: 0 0 12px rgba(247, 223, 164, 0.35);
}

/* ==================== MTG ARENA CHAMFERED & MOLTEN BUTTONS ==================== */
.arena-cta-btn {
  position: relative;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  background: linear-gradient(180deg, #ff9233 0%, #ea580c 48%, #9a2a00 100%);
  border: none;
  padding: 12px 30px;
  font-size: 15px;
  cursor: pointer;
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%);
  box-shadow: 0 0 22px rgba(234, 88, 12, 0.55);
  transition: transform 0.14s ease, filter 0.14s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.arena-cta-btn::before {
  content: "";
  position: absolute;
  inset: 1.5px;
  clip-path: polygon(11px 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 11px 100%, 0 50%);
  border-top: 1px solid rgba(255, 237, 190, 0.65);
  pointer-events: none;
}

.arena-cta-btn:hover:not(:disabled) {
  transform: scale(1.04);
  filter: brightness(1.14);
}

.arena-cta-btn:disabled {
  background: linear-gradient(180deg, #334155, #1e293b);
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
}

.arena-cta-btn.blue-cta {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 50%, #0c4a6e 100%);
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.5);
}

.arena-metal-btn {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: #e2e8f0;
  background: linear-gradient(180deg, #27324b 0%, #151c2c 100%);
  border: 1px solid var(--gold-border);
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.14s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.arena-metal-btn:hover:not(:disabled) {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  background: linear-gradient(180deg, #313f5e 0%, #1b2438 100%);
  box-shadow: 0 0 12px rgba(207, 163, 85, 0.28);
}

.arena-metal-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-xs {
  padding: 5px 11px;
  font-size: 11px;
}

/* ==================== VIEWPORT & MANA SYMBOLS ==================== */
.arena-viewport {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 10px 14px;
}

.loading-screen {
  margin: auto;
  font-family: var(--font-display);
  color: var(--gold-mid);
  font-size: 18px;
  letter-spacing: 1.5px;
}

.mana-pip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 800;
  box-shadow: inset 0 -1px 2px rgba(0,0,0,0.55), 0 1px 3px rgba(0,0,0,0.7);
  margin-right: 2px;
  flex-shrink: 0;
}
.mana-W { background: radial-gradient(circle at 30% 30%, #fffbeb, #fde68a); color: #1c1917; }
.mana-U { background: radial-gradient(circle at 30% 30%, #bae6fd, #38bdf8); color: #082f49; }
.mana-B { background: radial-gradient(circle at 30% 30%, #94a3b8, #334155); color: #f8fafc; border: 1px solid #cbd5e1; }
.mana-R { background: radial-gradient(circle at 30% 30%, #fecaca, #f87171); color: #450a0a; }
.mana-G { background: radial-gradient(circle at 30% 30%, #bbf7d0, #4ade80); color: #052e16; }
.mana-C { background: radial-gradient(circle at 30% 30%, #e2e8f0, #94a3b8); color: #0f172a; }

/* ==================== 0. ARENA HOME / PLAY BLADE LOBBY ==================== */
.arena-home-grid {
  display: grid;
  grid-template-columns: 1fr 410px;
  gap: 22px;
  min-height: calc(100vh - 92px);
  align-items: stretch;
}

@media (max-width: 1080px) {
  .arena-home-grid {
    grid-template-columns: 1fr;
  }
}

.arena-showcase-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.arena-Billboard {
  position: relative;
  border-radius: 10px;
  border: 1px solid var(--gold-border);
  overflow: hidden;
  min-height: 250px;
  background-color: #111624;
  background-size: cover;
  background-position: center 22%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.7);
}

.arena-Billboard::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(6, 8, 15, 0.94) 0%, rgba(8, 11, 20, 0.72) 55%, rgba(8, 11, 20, 0.25) 100%),
              linear-gradient(0deg, rgba(6, 8, 15, 0.95) 0%, transparent 65%);
}

.billboard-content {
  position: relative;
  z-index: 2;
  max-width: 620px;
}

.billboard-kicker {
  display: inline-block;
  background: linear-gradient(90deg, var(--mythic-top), var(--mythic-bot));
  color: #fff;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 10px;
}

.billboard-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 900;
  color: var(--gold-bright);
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.95);
  line-height: 1.1;
  margin-bottom: 8px;
}

.billboard-desc {
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.5;
}

.arena-sets-header {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 1.4px;
  color: var(--gold-mid);
  text-transform: uppercase;
}

.arena-sets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.arena-set-tile {
  position: relative;
  background: linear-gradient(160deg, #1a2236, #0e1320);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 13px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.15s ease;
  overflow: hidden;
}

.arena-set-tile:hover {
  border-color: var(--gold-mid);
  transform: translateY(-2px);
}

.arena-set-tile.selected {
  border: 2px solid var(--gold-bright);
  background: linear-gradient(160deg, rgba(207, 163, 85, 0.22), rgba(17, 24, 39, 0.95));
  box-shadow: 0 0 22px rgba(207, 163, 85, 0.3);
}

.set-svg-icon {
  width: 32px;
  height: 32px;
  filter: invert(1) sepia(0.4) saturate(2) hue-rotate(5deg);
  flex-shrink: 0;
}

.set-badge-tag {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--mythic-top);
  color: #fff;
}

/* Right-side MTG Arena Play Blade */
.arena-play-blade {
  background: linear-gradient(180deg, #161d2f 0%, #0b0f19 100%);
  border: 1px solid var(--gold-border);
  border-radius: 10px;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: inset 0 1px 0 rgba(255, 235, 180, 0.25), 0 20px 50px rgba(0, 0, 0, 0.75);
}

.blade-hdr {
  text-align: center;
  border-bottom: 1px solid rgba(207, 163, 85, 0.25);
  padding-bottom: 16px;
}

.blade-mode-sub {
  font-family: var(--font-display);
  font-size: 11.5px;
  letter-spacing: 2px;
  color: var(--aether-cyan);
  margin-bottom: 4px;
}

.blade-mode-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  color: var(--gold-bright);
}

.blade-rules-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 18px 0;
}

.blade-rule-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
}

.trophy-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0 20px;
}

.trophy-node {
  background: #0f1523;
  border: 1px solid rgba(207, 163, 85, 0.3);
  border-radius: 6px;
  padding: 8px 4px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 11px;
  color: #cbd5e1;
}
.trophy-node.grand {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  background: rgba(207, 163, 85, 0.14);
}

/* ==================== 1. ARENA DRAFT POD SCREEN ==================== */
.arena-draft-screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: calc(100vh - 86px);
}

/* Top Pod Seating Ring Bar */
.arena-pod-ring-bar {
  background: linear-gradient(180deg, #171f32 0%, #0e1320 100%);
  border: 1px solid var(--gold-border);
  border-radius: 10px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.arena-pack-plaque {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pack-emblem {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  color: var(--gold-bright);
  background: linear-gradient(180deg, #2b2112, #171108);
  border: 1px solid var(--gold-mid);
  padding: 6px 14px;
  border-radius: 6px;
  letter-spacing: 1px;
}

.pod-ring-avatars {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pod-seat-node {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  background: #0c101b;
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 11.5px;
}

.pod-seat-node.you-node {
  border-color: var(--gold-bright);
  background: rgba(207, 163, 85, 0.18);
  box-shadow: 0 0 12px rgba(207, 163, 85, 0.3);
}

.pod-avatar-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #3b4b6b, #182032);
  border: 1px solid var(--gold-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  color: var(--gold-bright);
}

.pod-pass-chevron {
  color: var(--aether-cyan);
  font-weight: 900;
  font-size: 12px;
  text-shadow: 0 0 8px var(--aether-cyan);
}

/* Booster Pack Canvas */
.arena-pack-stage {
  background: radial-gradient(ellipse at 50% 40%, rgba(28, 38, 64, 0.65) 0%, rgba(10, 13, 22, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 18px;
  position: relative;
}

.pack-stage-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.arena-pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--draft-card-min, 224px), 1fr));
  gap: 16px;
}

@media (max-width: 1360px) {
  .arena-pack-grid {
    grid-template-columns: repeat(auto-fill, minmax(var(--draft-card-min, 204px), 1fr));
  }
}

.arena-booster-card {
  position: relative;
  border-radius: 11px;
  aspect-ratio: 488 / 680;
  background: #101522;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: transform 0.16s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.16s ease, border-color 0.16s ease;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.72);
}
.arena-booster-card:active {
  cursor: grabbing;
}

.arena-booster-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #070a12;
  display: block;
}

.arena-booster-card:hover {
  transform: translateY(-7px) scale(1.045);
  z-index: 10;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.85), 0 0 14px rgba(0, 229, 255, 0.45);
}

.arena-booster-card.selected-pick {
  border-color: var(--aether-cyan);
  box-shadow: 0 0 0 2px var(--aether-cyan), 0 0 26px rgba(0, 229, 255, 0.85);
  transform: translateY(-8px) scale(1.05);
  z-index: 12;
}

.arena-booster-card.rarity-mythic {
  box-shadow: 0 0 16px rgba(255, 110, 20, 0.38);
  border-color: rgba(255, 128, 36, 0.75);
}
.arena-booster-card.rarity-rare {
  box-shadow: 0 0 14px rgba(245, 190, 65, 0.32);
  border-color: rgba(247, 223, 164, 0.65);
}

/* Foil Rainbow Shimmer Overlay */
.foil-shimmer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(125deg, transparent 20%, rgba(255, 0, 180, 0.14) 38%, rgba(0, 229, 255, 0.18) 50%, rgba(255, 230, 0, 0.14) 62%, transparent 80%);
  mix-blend-mode: screen;
}

.foil-tag {
  position: absolute;
  top: 7px;
  left: 7px;
  background: linear-gradient(90deg, #ec4899, #8b5cf6, #06b6d4);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 2px 7px;
  border-radius: 4px;
  z-index: 3;
}

.card-inspect-loupe {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--gold-border);
  background: rgba(9, 12, 20, 0.86);
  color: var(--gold-bright);
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.14s;
  z-index: 4;
}
.arena-booster-card:hover .card-inspect-loupe {
  opacity: 1;
}

.arena-coach-plate {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, rgba(6, 8, 14, 0.96) 72%, rgba(6, 8, 14, 0.55) 100%);
  padding: 6px 8px;
  z-index: 3;
}

.coach-grade-hex {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 11px;
  background: #334155;
  color: #fff;
}
.coach-grade-hex.grade-A { background: linear-gradient(135deg, #fbbf24, #d97706); color: #090c14; }
.coach-grade-hex.grade-B { background: linear-gradient(135deg, #34d399, #059669); color: #090c14; }
.coach-grade-hex.grade-C { background: linear-gradient(135deg, #38bdf8, #0284c7); color: #090c14; }

/* ==================== ARENA HORIZONTAL DECK TRAY (CROPPED ART STRIPS!) ==================== */
.arena-horizontal-tray {
  background: linear-gradient(180deg, #121726 0%, #090c14 100%);
  border: 1px solid var(--gold-border);
  border-radius: 10px;
  padding: 12px 16px;
}

.tray-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.arena-7col-stacks {
  display: grid;
  grid-template-columns: repeat(7, minmax(155px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.arena-stack-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.arena-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--gold-mid);
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
  margin-bottom: 3px;
}

/* MTG Arena's signature Cropped-Art Card Bar */
.arena-card-bar {
  position: relative;
  height: 36px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-left-width: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 10px;
  cursor: grab;
  user-select: none;
  background-color: #1a2234;
  background-size: cover;
  background-position: center 22%;
  transition: transform 0.1s ease, border-color 0.1s ease, box-shadow 0.12s ease;
}
.arena-card-bar:active {
  cursor: grabbing;
}

.arena-card-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 14, 24, 0.93) 0%, rgba(10, 14, 24, 0.75) 58%, rgba(10, 14, 24, 0.88) 100%);
  z-index: 0;
}

.arena-card-bar:hover {
  transform: translateX(2px) scale(1.02);
  border-color: var(--gold-bright);
  z-index: 5;
}

.arena-card-bar.col-W { border-left-color: #fde68a; }
.arena-card-bar.col-U { border-left-color: #38bdf8; }
.arena-card-bar.col-B { border-left-color: #a855f7; }
.arena-card-bar.col-R { border-left-color: #f87171; }
.arena-card-bar.col-G { border-left-color: #4ade80; }
.arena-card-bar.col-M { border-left-color: #f59e0b; }
.arena-card-bar.col-C { border-left-color: #94a3b8; }

.bar-name {
  position: relative;
  z-index: 1;
  font-size: 12.8px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 6px;
  text-shadow: 0 1px 3px #000;
}

.bar-cost {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ==================== 2. ARENA SPLIT DECKBUILDER & SIDEBOARD ==================== */
.arena-deckbuilder {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.arena-filter-bar {
  background: linear-gradient(180deg, #161d2f 0%, #0e1320 100%);
  border: 1px solid var(--gold-border);
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.mana-filter-orbs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-orb {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: #141b2c;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}

.filter-orb.active {
  border-color: var(--gold-bright);
  box-shadow: 0 0 12px rgba(247, 223, 164, 0.7);
  transform: scale(1.1);
}

.arena-sb-collection {
  background: rgba(11, 15, 25, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 16px;
  max-height: 445px;
  min-height: 230px;
  overflow-y: auto;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.arena-sb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--sb-card-min, 196px), 1fr));
  gap: 14px;
}

.sb-card-thumb {
  border-radius: 10px;
  aspect-ratio: 488 / 680;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  border: 2px solid rgba(255,255,255,0.16);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.7);
  transition: transform 0.15s cubic-bezier(0.2, 0.9, 0.3, 1), border-color 0.14s ease, box-shadow 0.15s ease;
  position: relative;
}
.sb-card-thumb:active {
  cursor: grabbing;
}
.sb-card-thumb:hover {
  transform: translateY(-6px) scale(1.045);
  border-color: var(--aether-cyan);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.88), 0 0 16px rgba(0, 229, 255, 0.45);
  z-index: 5;
}
.sb-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #070a12;
}

.land-stepper-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.arena-land-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #131929;
  border: 1px solid rgba(207, 163, 85, 0.3);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.land-adj-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.2);
  background: #1e293b;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.land-adj-btn:hover {
  background: var(--gold-mid);
  color: #090c14;
}

/* ==================== 3. SWISS EVENT HUB ==================== */
.arena-swiss-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
  align-items: start;
}

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

.arena-panel {
  background: linear-gradient(180deg, #151c2e 0%, #0b0f19 100%);
  border: 1px solid var(--gold-border);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
}

.arena-panel-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--gold-bright);
  letter-spacing: 1.2px;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.arena-vs-banner {
  background: radial-gradient(circle at 50% 0%, rgba(234, 88, 12, 0.22), rgba(12, 16, 28, 0.96) 75%);
  border: 1px solid var(--gold-bright);
  border-radius: 10px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 0 30px rgba(207, 163, 85, 0.18);
}

.vs-duelists {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin: 16px 0;
}

.vs-score-shield {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 900;
  color: var(--gold-bright);
  background: #090c14;
  border: 2px solid var(--gold-mid);
  padding: 6px 20px;
  border-radius: 8px;
  box-shadow: 0 0 18px rgba(207, 163, 85, 0.3);
}

.pairing-plate {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 6px;
  background: #101624;
  border: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 7px;
  font-size: 13px;
}
.pairing-plate.you-plate {
  border-color: var(--gold-mid);
  background: rgba(207, 163, 85, 0.1);
}

.arena-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.arena-table th {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--gold-mid);
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--gold-border);
}
.arena-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.arena-table tr.you-row {
  background: rgba(207, 163, 85, 0.14);
}
.arena-table tr.inspectable:hover {
  background: rgba(0, 229, 255, 0.09);
  cursor: pointer;
}

/* ==================== 4. MTG ARENA TABLETOP BATTLEFIELD ==================== */
.arena-battlefield-root {
  position: relative;
  min-height: calc(100vh - 80px);
  height: auto;
  background:
    radial-gradient(ellipse at 50% 48%, #1d2842 0%, #101626 58%, #070a12 100%);
  border: 1px solid var(--gold-border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  padding-bottom: 8px;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.85);
}

/* Center Arena Command & Full 8-Phase Track Belt (Always dead-center in view!) */
.arena-command-belt {
  background: linear-gradient(90deg, rgba(8, 12, 22, 0.96) 0%, rgba(20, 28, 48, 0.98) 50%, rgba(8, 12, 22, 0.96) 100%);
  border-top: 1px solid var(--gold-border);
  border-bottom: 1px solid var(--gold-border);
  padding: 7px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  z-index: 25;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.75);
}

.turn-owner-badge {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 5px 12px;
  border-radius: 6px;
  background: rgba(207, 163, 85, 0.14);
  border: 1px solid var(--gold-mid);
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}

.turn-owner-badge.opp-turn {
  background: rgba(239, 68, 68, 0.15);
  border-color: #f87171;
  color: #fecaca;
}

/* Full 8-Phase MTG Turn Stepper */
.mtg-phase-track {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.mtg-phase-node {
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #64748b;
  transition: all 0.14s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mtg-phase-node.clickable-step {
  cursor: pointer;
  color: #cbd5e1;
  border-color: rgba(207, 163, 85, 0.4);
}
.mtg-phase-node.clickable-step:hover {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  background: rgba(207, 163, 85, 0.16);
}

.mtg-phase-node.active-step {
  background: linear-gradient(135deg, var(--mythic-top), var(--mythic-bot));
  border-color: var(--gold-bright);
  color: #fff;
  box-shadow: 0 0 14px rgba(255, 128, 36, 0.8);
  transform: scale(1.05);
}

.mtg-phase-node.defend-step {
  background: linear-gradient(135deg, #dc2626, #7f1d1d);
  border-color: #fca5a5;
  color: #fff;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.85);
}

.belt-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Instruction Sub-banner when in Draw / Attack / Block / Target step */
.combat-callout-strip {
  background: rgba(0, 229, 255, 0.1);
  border-bottom: 1px solid rgba(0, 229, 255, 0.3);
  color: #e0f2fe;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 14px;
  z-index: 20;
}
.combat-callout-strip.warn {
  background: rgba(239, 68, 68, 0.16);
  border-bottom-color: rgba(248, 113, 113, 0.5);
  color: #fee2e2;
}

/* Opponent Top Edge (Fanned Card Backs + Portrait Medallion) */
.arena-opp-top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 6px 18px 0;
  position: relative;
  z-index: 10;
}

.opp-cardbacks-fan {
  display: flex;
  justify-content: center;
  margin-top: -14px;
}

.opp-cardback {
  width: 36px;
  height: 48px;
  border-radius: 5px;
  background: radial-gradient(circle at 50% 45%, #7c2d12, #1e1b4b);
  border: 1.5px solid var(--gold-mid);
  margin-left: -13px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.7);
}
.opp-cardback:first-child { margin-left: 0; }

/* Avatar Medallions (Top Center & Bottom Center) */
.arena-avatar-medallion {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.avatar-ring {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #374151, #111827);
  border: 3px solid var(--gold-mid);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  color: var(--gold-bright);
  position: relative;
}

.avatar-ring.active-turn-glow {
  border-color: var(--aether-cyan);
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.7);
}

.avatar-ring.targetable-face {
  border-color: var(--crimson);
  box-shadow: 0 0 26px rgba(239, 68, 68, 0.95);
  cursor: pointer;
  animation: pulseTarget 0.8s infinite alternate;
}

.arena-life-shield {
  margin-top: -12px;
  min-width: 42px;
  padding: 1px 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, #991b1b 0%, #450a0a 100%);
  border: 2px solid var(--gold-bright);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
  color: #fff;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.85);
  z-index: 2;
}

.arena-life-shield.player-shield {
  background: linear-gradient(180deg, #065f46 0%, #022c22 100%);
}

.avatar-nameplate {
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
  margin-top: 2px;
  text-shadow: 0 1px 3px #000;
}

/* Half-Board Layout: Lands Left | Creatures/Permanents Center */
.arena-board-half {
  display: grid;
  grid-template-columns: 215px 1fr 245px;
  align-items: center;
  padding: 4px 16px;
  gap: 12px;
  min-height: 118px;
}

@media (max-width: 1120px) {
  .arena-board-half {
    grid-template-columns: 155px 1fr;
  }
  .board-right-spacer { display: none; }
}

.lands-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
}

.creatures-stage {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: center;
  min-height: 114px;
}

/* MTG Arena Art-Crop Battlefield Permanent Frame */
.arena-perm-frame {
  width: 108px;
  height: 122px;
  border-radius: 8px;
  background-color: #151c2c;
  background-size: cover;
  background-position: center 22%;
  border: 2px solid rgba(212, 168, 87, 0.55);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.75);
  position: relative;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}

.arena-perm-frame.land-frame {
  width: 60px;
  height: 70px;
  border-radius: 6px;
  border-width: 1.5px;
}

.arena-perm-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(6, 9, 16, 0.8) 0%, transparent 32%, transparent 62%, rgba(6, 9, 16, 0.88) 100%);
  pointer-events: none;
}

.arena-perm-frame:hover {
  transform: translateY(-4px) scale(1.06);
  z-index: 18;
}

.arena-perm-frame.tapped {
  transform: rotate(14deg);
  filter: brightness(0.75);
  margin: 0 6px;
}

.tap-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 2px 6px #000;
  pointer-events: none;
}

.arena-perm-frame.can-attack-glow {
  border-color: var(--aether-cyan);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.6);
}

.arena-perm-frame.attacking-glow {
  border-color: #ff4d4d;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.95);
  transform: translateY(-7px);
}

.arena-perm-frame.blocking-glow {
  border-color: var(--gold-bright);
  box-shadow: 0 0 22px rgba(247, 223, 164, 0.95);
}

.arena-perm-frame.valid-target-glow {
  border-color: #10b981;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.95);
  animation: pulseTarget 0.8s infinite alternate;
}

@keyframes pulseTarget {
  from { transform: scale(1.0); }
  to { transform: scale(1.06); }
}

.perm-top-name {
  position: absolute;
  top: 3px;
  left: 5px;
  right: 5px;
  font-size: 10px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px #000;
  z-index: 2;
}

.perm-kw-strip {
  position: absolute;
  top: 19px;
  left: 4px;
  right: 4px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  z-index: 2;
}

.kw-chip {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(8, 12, 22, 0.88);
  border: 1px solid rgba(255,255,255,0.22);
  color: #e2e8f0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kw-chip.atk-chip { background: #dc2626; border-color: #fca5a5; color: #fff; }
.kw-chip.blk-chip { background: #d97706; border-color: #fde68a; color: #fff; }
.kw-chip.ctr-chip { background: #0284c7; border-color: #7dd3fc; color: #fff; }

/* On-Card Direct Attack / Block Pill Buttons */
.perm-combat-btn {
  position: absolute;
  bottom: 23px;
  left: 4px;
  right: 4px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 900;
  padding: 3px 4px;
  text-align: center;
  cursor: pointer;
  z-index: 5;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 2px 8px rgba(0,0,0,0.85);
}
.perm-combat-btn.atk-ready {
  background: linear-gradient(180deg, #ea580c, #9a3412);
  color: #fff;
}
.perm-combat-btn.atk-active {
  background: linear-gradient(180deg, #ef4444, #991b1b);
  border-color: #fde047;
  color: #fef08a;
}
.perm-combat-btn.blk-ready {
  background: linear-gradient(180deg, #d97706, #92400e);
  color: #fff;
}
.perm-combat-btn.blk-target {
  background: linear-gradient(180deg, #10b981, #047857);
  color: #fff;
}

.arena-pt-plate {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: linear-gradient(180deg, #263147 0%, #0f1522 100%);
  border: 1.5px solid var(--gold-bright);
  border-radius: 5px;
  padding: 1px 7px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.9);
  z-index: 3;
}
.arena-pt-plate.damaged {
  color: #fca5a5;
  border-color: #ef4444;
  background: #450a0a;
}

.perm-ability-btn {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: linear-gradient(180deg, #0284c7, #0369a1);
  border: 1px solid var(--aether-cyan);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 4;
}
.perm-ability-btn:hover {
  filter: brightness(1.2);
}

/* Bottom HUD: Interactive 3D Library & Graveyard Left | Hand Arc Center | Action Button Right */
.arena-bottom-dock {
  display: grid;
  grid-template-columns: 265px 1fr 250px;
  align-items: end;
  padding: 0 16px 6px;
  position: relative;
  z-index: 20;
  gap: 10px;
}

@media (max-width: 980px) {
  .arena-bottom-dock {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

.dock-left-zones {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.piles-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

/* Interactive 3D Library Deck Stack & Graveyard Pile */
.arena-deck-pile {
  width: 66px;
  height: 88px;
  border-radius: 7px;
  background: radial-gradient(circle at 50% 40%, #7c2d12, #17153b);
  border: 2px solid var(--gold-mid);
  box-shadow: 0 3px 0 #422006, 0 6px 0 #1e1b4b, 0 10px 18px rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.arena-deck-pile:hover {
  transform: translateY(-3px);
}

.arena-deck-pile.draw-ready-glow {
  border-color: var(--aether-cyan);
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.95), 0 4px 0 #0284c7;
  animation: pulseTarget 0.75s infinite alternate;
}

.pile-draw-tag {
  position: absolute;
  top: -11px;
  background: var(--aether-cyan);
  color: #041019;
  font-size: 9px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

.arena-grave-pile {
  width: 66px;
  height: 88px;
  border-radius: 7px;
  background-color: #111624;
  background-size: cover;
  background-position: center;
  border: 1.5px dashed rgba(207, 163, 85, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 6px;
  cursor: pointer;
  position: relative;
}
.arena-grave-pile::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: rgba(8, 11, 19, 0.58);
}

.zone-counters-pill {
  display: inline-flex;
  gap: 10px;
  font-size: 11.5px;
  color: #cbd5e1;
  background: rgba(8, 11, 19, 0.85);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 5px 10px;
  border-radius: 6px;
  width: fit-content;
}

/* Player Medallion + Curved Arc Hand Fan */
.dock-center-hand {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.arena-hand-arc {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 132px;
  padding-top: 4px;
  flex-wrap: wrap;
}

.arena-hand-card {
  width: 98px;
  height: 136px;
  border-radius: 8px;
  background: #121826;
  border: 2px solid rgba(255, 255, 255, 0.16);
  margin-left: -14px;
  cursor: pointer;
  box-shadow: -4px 6px 18px rgba(0, 0, 0, 0.8);
  transition: transform 0.16s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.16s ease;
  overflow: hidden;
  transform-origin: bottom center;
  position: relative;
}
.arena-hand-card:first-child {
  margin-left: 0;
}

.arena-hand-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #070a12;
  display: block;
}

.arena-hand-card.castable-glow {
  border-color: var(--aether-cyan);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.78), -4px 6px 18px rgba(0,0,0,0.8);
}

.arena-hand-card:hover {
  transform: translateY(-38px) scale(1.42) rotate(0deg) !important;
  z-index: 45 !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.95), 0 0 22px rgba(247, 223, 164, 0.6);
}

/* Bottom-Right Giant Action Button Dock */
.dock-right-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding-bottom: 4px;
}

/* Floating Collapsible Battle Log Drawer (Top-Right of Playmat) */
.arena-log-drawer {
  position: absolute;
  top: 52px;
  right: 14px;
  width: 245px;
  max-height: 195px;
  background: rgba(8, 11, 19, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(212, 168, 87, 0.32);
  border-radius: 8px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  z-index: 15;
}

@media (max-width: 1120px) {
  .arena-log-drawer { display: none; }
}

.log-scroll {
  overflow-y: auto;
  font-size: 11px;
  line-height: 1.38;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.log-line {
  color: #cbd5e1;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.03);
}
.log-line.turn-sep {
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-weight: 700;
  text-align: center;
  background: rgba(207, 163, 85, 0.14);
}

/* ==================== ARENA LONDON MULLIGAN OVERLAY ==================== */
.arena-mulligan-overlay {
  position: fixed;
  inset: 54px 0 0 0;
  background: rgba(5, 8, 15, 0.9);
  backdrop-filter: blur(8px);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 18px;
  overflow-y: auto;
}

.mulligan-title {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 900;
  color: var(--gold-bright);
  letter-spacing: 1.5px;
  text-align: center;
}

.mulligan-hand-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.mulligan-card {
  width: clamp(148px, 14.2vw, 214px);
  aspect-ratio: 488 / 680;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.22);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: transform 0.16s cubic-bezier(0.2, 0.9, 0.3, 1), border-color 0.15s ease, box-shadow 0.16s ease, opacity 0.15s ease;
  box-shadow: 0 16px 36px rgba(0,0,0,0.88);
  position: relative;
}
.mulligan-card:active {
  cursor: grabbing;
}
.mulligan-card:hover {
  transform: translateY(-10px) scale(1.06);
  border-color: var(--gold-bright);
  box-shadow: 0 22px 44px rgba(0,0,0,0.95), 0 0 20px rgba(247, 223, 164, 0.45);
  z-index: 5;
}
.mulligan-card.bottom-picked {
  border-color: var(--crimson);
  opacity: 0.52;
  transform: translateY(14px) scale(0.94);
}
.mulligan-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #070a12;
  pointer-events: none;
}

/* ==================== FLOATING HOVER PREVIEW & MODALS ==================== */
.arena-hover-preview {
  position: fixed;
  z-index: 130;
  pointer-events: none;
  width: 312px;
  background: linear-gradient(180deg, rgba(13, 18, 32, 0.98), rgba(6, 9, 17, 0.98));
  border: 2px solid var(--gold-bright);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.95), 0 0 24px rgba(207, 163, 85, 0.32);
}
.arena-hover-preview img {
  width: 100%;
  border-radius: 10px;
  display: block;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.86);
  backdrop-filter: blur(7px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
  padding: 20px;
}

.arena-modal-frame {
  background: linear-gradient(180deg, #161d2f 0%, #0b0f19 100%);
  border: 1.5px solid var(--gold-bright);
  border-radius: 12px;
  padding: 24px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.95);
}

.card-inspect-frame {
  max-width: 740px;
  width: 100%;
}

.wide-inspect-frame {
  max-width: 1000px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
}

.arena-modal-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--gold-border);
  padding-bottom: 10px;
}
.arena-modal-hdr h3 {
  font-family: var(--font-display);
  color: var(--gold-bright);
  letter-spacing: 1.4px;
}

.arena-close-x {
  position: absolute;
  top: 14px;
  right: 18px;
  background: transparent;
  border: none;
  color: var(--gold-mid);
  font-size: 28px;
  cursor: pointer;
}
.arena-close-x:hover { color: #fff; }

.modal-card-layout {
  display: grid;
  grid-template-columns: 265px 1fr;
  gap: 22px;
  align-items: start;
}
@media (max-width: 680px) {
  .modal-card-layout { grid-template-columns: 1fr; }
}
.modal-card-layout img {
  width: 100%;
  border-radius: 11px;
}

.fallback-card-face {
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  background: linear-gradient(160deg, #1e293b, #090d16);
}

.toast-container {
  position: fixed;
  top: 66px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: linear-gradient(180deg, #1b2438, #0f1523);
  border: 1px solid var(--gold-bright);
  color: var(--gold-bright);
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.8);
}
.toast.error {
  border-color: var(--crimson);
  color: #fecaca;
  background: #450a0a;
}

/* ==================== RESPONSIVE / MOBILE PHONE ("REACTIVE") SYSTEM ==================== */
.show-xs-inline { display: none; }
.mobile-only { display: none; }

.table-scroll-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.inspector-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.hand-zoom-chip {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--gold-border);
  background: rgba(8, 11, 19, 0.86);
  color: var(--gold-bright);
  font-size: 11px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 6;
  cursor: pointer;
}

/* Touch / Coarse Pointer Devices (Phones & Tablets) */
@media (hover: none), (pointer: coarse) {
  .arena-hover-preview {
    display: none !important;
  }
  .card-inspect-loupe {
    opacity: 0.92 !important;
    width: 28px;
    height: 28px;
  }
  .hand-zoom-chip {
    display: flex;
  }
  /* Prevent sticky hover zoom on phone tap */
  .arena-hand-card:hover {
    transform: none !important;
    box-shadow: -2px 4px 12px rgba(0, 0, 0, 0.8) !important;
  }
  .arena-booster-card:hover {
    transform: none;
  }
  .arena-booster-card.selected-pick {
    transform: scale(1.02);
  }
}

/* Tablet & Phone Breakpoint (<= 768px) */
@media (max-width: 768px) {
  .hide-xs { display: none !important; }
  .show-xs-inline { display: inline !important; }
  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }

  .arena-viewport {
    padding: 8px 8px 16px;
  }

  /* Compact Scrollable Arena Topbar */
  .arena-topbar {
    height: 48px;
    padding: 0 8px;
    gap: 6px;
  }
  .arena-nav-left {
    gap: 6px;
    min-width: 0;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .arena-nav-left::-webkit-scrollbar { display: none; }
  .planeswalker-crest {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
  }
  .pw-spark { font-size: 15px; }
  .arena-tab {
    padding: 0 8px;
    font-size: 11px;
    letter-spacing: 0.5px;
    white-space: nowrap;
  }
  .arena-nav-right {
    gap: 5px;
    flex-shrink: 0;
  }
  .arena-gem-pill {
    padding: 4px 8px;
    font-size: 10.5px;
  }

  /* Home / Lobby: Show Play Blade right near top on Phone! */
  .arena-home-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: auto;
  }
  .arena-play-blade {
    order: -1;
    padding: 16px 14px;
  }
  .blade-mode-title { font-size: 20px; }
  .blade-rules-list { margin: 12px 0; gap: 8px; }
  .blade-rule-item { padding: 8px 10px; font-size: 12px; }
  .arena-Billboard {
    min-height: 170px;
    padding: 16px;
  }
  .billboard-title { font-size: 22px; }
  .billboard-desc { font-size: 12.5px; }
  .arena-sets-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .arena-set-tile {
    padding: 10px;
    gap: 8px;
  }
  .set-svg-icon { width: 24px; height: 24px; }

  /* Draft Screen on Phone */
  .arena-pod-ring-bar {
    padding: 8px 10px;
    gap: 8px;
  }
  .pack-emblem {
    font-size: 12.5px;
    padding: 4px 10px;
  }
  .pod-ring-avatars {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .pod-ring-avatars::-webkit-scrollbar { display: none; }
  .pod-seat-node { flex-shrink: 0; font-size: 11px; }

  .arena-pack-stage {
    padding: 10px;
  }
  .pack-stage-toolbar {
    position: sticky;
    top: 50px;
    z-index: 30;
    background: rgba(12, 16, 28, 0.95);
    backdrop-filter: blur(8px);
    padding: 8px 10px;
    margin: -6px -6px 10px;
    border-radius: 8px;
    border: 1px solid var(--gold-border);
  }
  .arena-pack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .arena-7col-stacks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  /* Deckbuilder & Sideboarding on Phone */
  .arena-filter-bar {
    padding: 8px 10px;
    gap: 8px;
  }
  .mana-filter-orbs {
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .mana-filter-orbs::-webkit-scrollbar { display: none; }
  .filter-orb { flex-shrink: 0; width: 28px; height: 28px; }
  .land-stepper-strip {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .land-stepper-strip::-webkit-scrollbar { display: none; }
  .arena-land-pill { flex-shrink: 0; }
  .arena-sb-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
  .arena-sb-collection {
    max-height: 235px;
    padding: 9px;
  }

  /* Swiss Hub on Phone */
  .arena-panel { padding: 14px 12px; }
  .arena-vs-banner { padding: 14px 12px; }
  .vs-duelists { gap: 8px; }
  .vs-score-shield { font-size: 22px; padding: 4px 12px; }
  .arena-table th, .arena-table td { padding: 7px 6px; font-size: 11.5px; }

  /* Battlefield on Phone (Native MTG Arena Mobile Layout!) */
  .arena-battlefield-root {
    min-height: calc(100dvh - 64px);
    border-radius: 8px;
    gap: 4px;
    padding-bottom: 6px;
  }

  .arena-opp-top-bar {
    padding: 6px 8px 0;
    align-items: center;
  }
  .opp-cardbacks-fan { display: none; }
  .avatar-ring { width: 42px; height: 42px; font-size: 13px; border-width: 2px; }
  .arena-life-shield { font-size: 13px; min-width: 36px; padding: 1px 7px; margin-top: -10px; }
  .avatar-nameplate { font-size: 10px; }
  .zone-counters-pill { padding: 4px 7px; font-size: 10.5px; gap: 6px; }

  /* Full-width stacked Lands + Creatures rows on Phone! */
  .arena-board-half {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 2px 8px;
    gap: 5px;
    min-height: 86px;
  }
  .lands-cluster {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 5px;
    padding-bottom: 2px;
    scrollbar-width: none;
    min-height: 0;
  }
  .lands-cluster::-webkit-scrollbar { display: none; }

  .creatures-stage {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    gap: 9px;
    min-height: 98px;
    padding: 4px 2px;
    scrollbar-width: none;
  }
  .creatures-stage::-webkit-scrollbar { display: none; }

  .arena-perm-frame {
    width: 88px;
    height: 102px;
  }
  .arena-perm-frame.land-frame {
    width: 48px;
    height: 56px;
  }
  .perm-top-name { font-size: 9px; }
  .kw-chip { font-size: 8px; padding: 1px 4px; }
  .perm-combat-btn { font-size: 8.5px; bottom: 20px; padding: 2px 3px; }
  .arena-pt-plate { font-size: 10.5px; padding: 1px 5px; }

  /* Center Command Belt on Phone: Swipeable single-row Phase Ribbon + Full-Width Action Buttons */
  .arena-command-belt {
    padding: 6px 8px;
    gap: 6px;
  }
  .turn-owner-badge {
    font-size: 10.5px;
    padding: 3px 8px;
  }
  .mtg-phase-track {
    width: 100%;
    order: 3;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .mtg-phase-track::-webkit-scrollbar { display: none; }
  .mtg-phase-node {
    flex-shrink: 0;
    font-size: 9.5px;
    padding: 4px 8px;
  }
  .belt-actions-group {
    margin-left: auto;
    gap: 5px;
  }
  .combat-callout-strip {
    font-size: 11px;
    padding: 4px 8px;
  }

  /* Bottom Dock on Phone: Compact Utility Row + Swipeable Horizontal Hand! */
  .arena-bottom-dock {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0 8px 4px;
    gap: 6px;
  }
  .dock-right-controls {
    display: none !important; /* Already prominently displayed in Center Command Belt! */
  }
  .dock-left-zones {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    order: 2;
    gap: 6px;
    flex-wrap: wrap;
  }
  .piles-row { gap: 8px; align-items: center; }
  .arena-deck-pile, .arena-grave-pile {
    width: 52px;
    height: 58px;
  }
  .dock-center-hand {
    width: 100%;
    order: 1;
  }
  .arena-hand-arc {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    min-height: 126px;
    gap: 7px;
    padding: 6px 4px 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .arena-hand-arc::-webkit-scrollbar { display: none; }
  .arena-hand-card {
    width: 86px;
    height: 120px;
    margin-left: 0 !important;
    transform: none !important;
    flex-shrink: 0;
  }

  /* Mulligan Overlay on Phone */
  .arena-mulligan-overlay {
    inset: 48px 0 0 0;
    padding: 12px 10px;
    gap: 12px;
    justify-content: flex-start;
  }
  .mulligan-title { font-size: 18px; }
  .mulligan-hand-row { gap: 8px; }
  .mulligan-card { width: 96px; }

  /* Modals on Phone */
  .modal-backdrop { padding: 10px; }
  .arena-modal-frame {
    padding: 16px 14px;
    max-height: 90dvh;
    overflow-y: auto;
  }
  .modal-card-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .modal-card-layout img {
    max-width: 200px;
    margin: 0 auto;
    display: block;
  }
  .inspector-two-col {
    grid-template-columns: 1fr;
  }

  .toast-container {
    top: auto;
    bottom: 12px;
    left: 12px;
    right: 12px;
  }
  .toast {
    font-size: 12px;
    padding: 8px 12px;
    text-align: center;
  }
}

/* Extra-Small Phones (<= 400px) */
@media (max-width: 400px) {
  .arena-sets-grid {
    grid-template-columns: 1fr;
  }
  .arena-cta-btn {
    padding: 9px 16px;
    font-size: 12px;
  }
  .mulligan-card { width: 84px; }
}

/* ==================== MTG ARENA KINETIC ANIMATIONS & VFX ENGINE ==================== */

.arena-particles-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.72;
}

.arena-fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 115;
  overflow: hidden;
}

/* 1. Booster Pack Deal-In Cascade & Animated Foil Sweep */
@keyframes packDealIn {
  0% {
    opacity: 0;
    transform: perspective(700px) translateY(34px) rotateX(22deg) scale(0.86);
  }
  70% {
    opacity: 1;
    transform: perspective(700px) translateY(-3px) rotateX(0deg) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: perspective(700px) translateY(0) rotateX(0deg) scale(1);
  }
}

.pack-deal-anim {
  animation: packDealIn 0.42s cubic-bezier(0.2, 0.9, 0.25, 1) both;
  animation-delay: calc(var(--deal-idx, 0) * 32ms);
}

@keyframes foilSweep {
  0% { background-position: -180% 0; }
  100% { background-position: 220% 0; }
}

.foil-shimmer {
  background-size: 220% 100%;
  animation: foilSweep 3.4s linear infinite;
}

/* 2. Battlefield Permanent ETB Slam & Shockwave */
@keyframes etbSlam {
  0% {
    opacity: 0;
    transform: translateY(-54px) scale(1.32);
    filter: brightness(1.8);
  }
  65% {
    opacity: 1;
    transform: translateY(4px) scale(0.96);
    filter: brightness(1.2);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
}

.etb-slam-anim {
  animation: etbSlam 0.44s cubic-bezier(0.22, 1.15, 0.36, 1) both;
}

@keyframes handSlideIn {
  0% {
    opacity: 0;
    transform: translateY(48px) scale(0.75);
  }
  100% {
    opacity: 1;
  }
}

.hand-newly-drawn {
  animation: handSlideIn 0.38s cubic-bezier(0.2, 0.95, 0.3, 1) both;
}

@keyframes shockwaveExpand {
  0% {
    transform: translate(-50%, -50%) scale(0.25);
    opacity: 0.95;
    border-width: 5px;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.35);
    opacity: 0;
    border-width: 1px;
  }
}

.fx-shockwave-ring {
  position: fixed;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid var(--gold-bright);
  box-shadow: 0 0 24px rgba(247, 223, 164, 0.85);
  pointer-events: none;
  animation: shockwaveExpand 0.55s ease-out forwards;
}

.fx-shockwave-ring.cyan-wave {
  border-color: var(--aether-cyan);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.9);
}

.fx-shockwave-ring.crimson-wave {
  border-color: #ef4444;
  box-shadow: 0 0 28px rgba(239, 68, 68, 0.95);
}

/* 3. Flying Card Clone (Deck -> Spotlight -> Hand / Booster -> Pool) */
.fx-flying-card {
  position: fixed;
  width: 120px;
  aspect-ratio: 488 / 680;
  border-radius: 9px;
  overflow: hidden;
  border: 2px solid var(--aether-cyan);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.92), 0 0 24px rgba(0, 229, 255, 0.85);
  background: radial-gradient(circle at 50% 40%, #7c2d12, #17153b);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: left 0.46s cubic-bezier(0.2, 0.9, 0.25, 1),
              top 0.46s cubic-bezier(0.2, 0.9, 0.25, 1),
              transform 0.46s cubic-bezier(0.2, 0.9, 0.25, 1),
              opacity 0.28s ease;
}

.fx-flying-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 4. Cinematic Arena Turn Sweep Banner */
@keyframes turnSweepAnim {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scaleX(0.35);
    letter-spacing: 8px;
  }
  22% {
    opacity: 1;
    transform: translate(-50%, -50%) scaleX(1.02);
    letter-spacing: 3px;
  }
  78% {
    opacity: 1;
    transform: translate(-50%, -50%) scaleX(1);
    letter-spacing: 2.5px;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scaleX(1.18);
    letter-spacing: 5px;
  }
}

.fx-turn-banner {
  position: fixed;
  left: 50%;
  top: 46%;
  width: min(680px, 92vw);
  padding: 13px 28px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(16px, 3vw, 24px);
  color: var(--gold-bright);
  background: linear-gradient(90deg, transparent 0%, rgba(10, 14, 26, 0.95) 20%, rgba(28, 38, 66, 0.98) 50%, rgba(10, 14, 26, 0.95) 80%, transparent 100%);
  border-top: 1.5px solid var(--gold-bright);
  border-bottom: 1.5px solid var(--gold-bright);
  text-shadow: 0 0 18px rgba(247, 223, 164, 0.9);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.85);
  animation: turnSweepAnim 0.78s ease-out forwards;
}

.fx-turn-banner.opp-banner {
  color: #fecaca;
  border-color: #f87171;
  text-shadow: 0 0 18px rgba(239, 68, 68, 0.85);
}

/* 5. Spell Cast "On The Stack" Spotlight */
@keyframes stackSpotlightAnim {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.7) rotate(-6deg);
  }
  22% {
    opacity: 1;
    transform: translateY(0) scale(1.04) rotate(0deg);
  }
  80% {
    opacity: 1;
    transform: translateY(-4px) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-24px) scale(0.85);
  }
}

.fx-stack-spotlight {
  position: fixed;
  right: max(18px, 4vw);
  top: 26%;
  width: clamp(130px, 22vw, 185px);
  border-radius: 11px;
  overflow: hidden;
  border: 2px solid var(--mythic-top);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.95), 0 0 30px rgba(255, 128, 36, 0.85);
  background: #0c101a;
  animation: stackSpotlightAnim 0.72s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

.fx-stack-spotlight img {
  width: 100%;
  display: block;
}

.fx-stack-caption {
  background: rgba(8, 11, 19, 0.94);
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  padding: 4px 6px;
  letter-spacing: 0.8px;
}

/* 6. Combat Attack Lunges & Camera Screen Shake */
@keyframes lungeUpAnim {
  0% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-46px) scale(1.16); filter: brightness(1.35); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes lungeDownAnim {
  0% { transform: translateY(0) scale(1); }
  45% { transform: translateY(46px) scale(1.16); filter: brightness(1.35); }
  100% { transform: translateY(0) scale(1); }
}

.lunge-up {
  animation: lungeUpAnim 0.44s cubic-bezier(0.2, 0.9, 0.3, 1) !important;
  z-index: 35 !important;
}

.lunge-down {
  animation: lungeDownAnim 0.44s cubic-bezier(0.2, 0.9, 0.3, 1) !important;
  z-index: 35 !important;
}

@keyframes arenaShakeLight {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 3px); }
  40% { transform: translate(4px, -3px); }
  60% { transform: translate(-3px, -2px); }
  80% { transform: translate(3px, 2px); }
}

@keyframes arenaShakeHeavy {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(-9px, 6px); }
  30% { transform: translate(8px, -6px); }
  45% { transform: translate(-7px, -4px); }
  60% { transform: translate(7px, 5px); }
  80% { transform: translate(-4px, 2px); }
}

.shake-light {
  animation: arenaShakeLight 0.34s ease-out;
}

.shake-heavy {
  animation: arenaShakeHeavy 0.46s ease-out;
}

/* 7. Floating Damage & Life Numbers */
@keyframes floatNumPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -20%) scale(0.45);
  }
  22% {
    opacity: 1;
    transform: translate(-50%, -65%) scale(1.28);
  }
  75% {
    opacity: 1;
    transform: translate(-50%, -120%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -165%) scale(0.9);
  }
}

.fx-float-num {
  position: fixed;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 32px;
  color: #ff4d4d;
  text-shadow: 0 0 14px rgba(239, 68, 68, 0.95), 0 3px 8px #000;
  animation: floatNumPop 0.92s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

.fx-float-num.heal-num {
  color: #34d399;
  text-shadow: 0 0 14px rgba(16, 185, 129, 0.95), 0 3px 8px #000;
}

/* 8. Creature Shatter / Dissolve Ghost */
@keyframes creatureShatter {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    filter: brightness(2) sepia(1) hue-rotate(-35deg) saturate(4);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35) rotate(14deg);
    filter: blur(4px) brightness(0.4);
  }
}

.fx-death-ghost {
  position: fixed;
  width: 104px;
  height: 118px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  border: 2px solid #ef4444;
  box-shadow: 0 0 28px rgba(239, 68, 68, 0.95);
  animation: creatureShatter 0.55s ease-out forwards;
}

/* 9. Live SVG Combat Attack Arrows & Blocker Tethers */
.combat-svg-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 32;
}

@keyframes dashMarch {
  to { stroke-dashoffset: -28; }
}

.svg-atk-arrow {
  fill: none;
  stroke: #ff5722;
  stroke-width: 3.5;
  stroke-dasharray: 9 5;
  filter: drop-shadow(0 0 6px rgba(255, 87, 34, 0.9));
  animation: dashMarch 0.55s linear infinite;
}

.svg-blk-tether {
  fill: none;
  stroke: #fbbf24;
  stroke-width: 3.5;
  stroke-dasharray: 6 4;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.95));
  animation: dashMarch 0.65s linear infinite;
}

@keyframes beamFlash {
  0% { opacity: 0; stroke-width: 2; }
  30% { opacity: 1; stroke-width: 7; }
  100% { opacity: 0; stroke-width: 1; }
}

.svg-spell-beam {
  fill: none;
  stroke-linecap: round;
  animation: beamFlash 0.48s ease-out forwards;
}

/* 10. Auto-Flow Status Pill & Dramatic Victory/Defeat Emblem */
.auto-flow-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 229, 255, 0.14);
  border: 1px solid var(--aether-cyan);
  color: #a5f3fc;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.4);
}

@keyframes victoryBurst {
  0% { opacity: 0; transform: scale(0.45); }
  55% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

.fx-endgame-banner {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(10, 14, 26, 0.82), rgba(3, 5, 10, 0.94));
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 150;
  animation: victoryBurst 0.48s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

.endgame-emblem-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(38px, 8vw, 68px);
  letter-spacing: 5px;
  color: var(--gold-bright);
  text-shadow: 0 0 36px rgba(247, 223, 164, 0.95), 0 6px 18px #000;
}

.endgame-emblem-title.defeat-title {
  color: #f87171;
  text-shadow: 0 0 36px rgba(239, 68, 68, 0.95), 0 6px 18px #000;
}

/* ==================== LIVE ARENA STACK SHOWCASE & DEATH CALLOUTS ==================== */

.arena-live-stack-box {
  position: fixed;
  right: 18px;
  top: 72px;
  width: 248px;
  background: linear-gradient(180deg, rgba(22, 16, 40, 0.97) 0%, rgba(10, 12, 22, 0.98) 100%);
  border: 2px solid var(--mythic-top);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95), 0 0 28px rgba(255, 128, 36, 0.75);
  z-index: 65;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: etbSlam 0.36s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.stack-box-hdr {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  color: var(--mythic-top);
  letter-spacing: 1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stack-card-img-wrap {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
}
.stack-card-img-wrap img {
  width: 100%;
  display: block;
}

.stack-target-alert {
  background: rgba(220, 38, 38, 0.22);
  border: 1px solid #f87171;
  color: #fecaca;
  font-size: 11.5px;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 6px;
  text-align: center;
}

.stack-oracle-snippet {
  font-size: 11px;
  line-height: 1.4;
  color: #e2e8f0;
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 8px;
  border-radius: 6px;
  max-height: 82px;
  overflow-y: auto;
  white-space: pre-line;
}

@keyframes fuseShrink {
  from { width: 100%; }
  to { width: 0%; }
}

.stack-fuse-track {
  height: 5px;
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.stack-fuse-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--aether-cyan), var(--gold-bright), var(--mythic-top));
  animation: fuseShrink var(--fuse-ms, 3400ms) linear forwards;
}

.stack-fuse-fill.paused {
  animation-play-state: paused !important;
}

/* Pulsing Crimson Crosshair Glow on Creature Targeted by Opponent's Stack Spell! */
@keyframes stackTargetPulse {
  from {
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.8), inset 0 0 10px rgba(239, 68, 68, 0.5);
    transform: scale(1);
  }
  to {
    box-shadow: 0 0 30px rgba(239, 68, 68, 1), inset 0 0 18px rgba(239, 68, 68, 0.85);
    transform: scale(1.06);
  }
}

.arena-perm-frame.stack-targeted-glow {
  border-color: #ff3b3b !important;
  animation: stackTargetPulse 0.55s infinite alternate !important;
  z-index: 30 !important;
}

.svg-stack-target-line {
  fill: none;
  stroke: #c084fc;
  stroke-width: 4;
  stroke-dasharray: 8 5;
  filter: drop-shadow(0 0 8px rgba(192, 132, 252, 0.95));
  animation: dashMarch 0.48s linear infinite;
}

/* Death Cause Floating Banner */
@keyframes deathCalloutAnim {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(0.75); }
  15% { opacity: 1; transform: translate(-50%, -60%) scale(1.05); }
  80% { opacity: 1; transform: translate(-50%, -95%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -130%) scale(0.92); }
}

.fx-death-callout {
  position: fixed;
  background: rgba(69, 10, 10, 0.95);
  border: 1.5px solid #f87171;
  color: #fecaca;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.9), 0 0 18px rgba(239, 68, 68, 0.75);
  animation: deathCalloutAnim 1.75s ease-out forwards;
}

.last-cast-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(88, 28, 135, 0.35);
  border: 1px solid rgba(192, 132, 252, 0.55);
  color: #e9d5ff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
}
.last-cast-pill:hover {
  border-color: #f3e8ff;
  background: rgba(107, 33, 168, 0.55);
}

@media (max-width: 768px) {
  .arena-live-stack-box {
    right: 8px;
    left: 8px;
    top: 56px;
    width: auto;
    flex-direction: row;
    align-items: center;
    padding: 8px;
    gap: 10px;
  }
  .stack-card-img-wrap {
    width: 92px;
    flex-shrink: 0;
  }
  .stack-mobile-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
}

/* ==================== PLANESWALKER FRAMES, LOYALTY SHIELDS & PREPARED CHIPS ==================== */
.arena-perm-frame.planeswalker-frame {
  width: 122px;
  height: 132px;
  border-color: #38bdf8;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85), 0 0 18px rgba(56, 189, 248, 0.45);
  border-radius: 10px;
}

.kw-chip.pw-chip {
  background: linear-gradient(90deg, #0369a1, #4f46e5);
  border-color: #7dd3fc;
  color: #fff;
}

.kw-chip.prep-chip {
  background: linear-gradient(90deg, #581c87, #7e22ce);
  border-color: #d8b4fe;
  color: #f3e8ff;
}

.arena-loyalty-shield {
  position: absolute;
  bottom: -5px;
  right: -5px;
  background: linear-gradient(180deg, #1e1b4b 0%, #090d1a 100%);
  border: 2px solid #38bdf8;
  border-radius: 7px 7px 12px 12px;
  padding: 1px 8px 2px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  color: #f8fafc;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.92), 0 0 10px rgba(56, 189, 248, 0.55);
  z-index: 6;
}

.pw-loyalty-strip {
  position: absolute;
  bottom: 24px;
  left: 4px;
  right: 42px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 6;
}

.pw-loyalty-btn {
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 900;
  padding: 2px 5px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
  transition: transform 0.1s ease, filter 0.1s ease;
}

.pw-loyalty-btn:hover {
  transform: scale(1.05);
  filter: brightness(1.18);
}

.pw-loyalty-btn.pw-plus {
  background: linear-gradient(180deg, #059669, #064e3b);
  border-color: #6ee7b7;
}

.pw-loyalty-btn.pw-minus {
  background: linear-gradient(180deg, #4f46e5, #1e1b4b);
  border-color: #a5b4fc;
}

.perm-ability-btn {
  max-width: calc(100% - 48px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .arena-perm-frame.planeswalker-frame {
    width: 98px;
    height: 112px;
  }
  .pw-loyalty-strip {
    right: 38px;
  }
  .pw-loyalty-btn {
    font-size: 8px;
    padding: 2px 4px;
  }
  .arena-loyalty-shield {
    font-size: 10.5px;
    padding: 1px 6px;
  }
}

/* ==================== AI DECLARED BLOCKERS SHOWCASE BOX ==================== */
.arena-live-stack-box.block-showcase-box {
  border-color: #fbbf24;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95), 0 0 28px rgba(251, 191, 36, 0.75);
}

.block-showcase-row {
  background: rgba(217, 119, 6, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.55);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11.5px;
  line-height: 1.35;
  cursor: pointer;
}
.block-showcase-row:hover {
  background: rgba(217, 119, 6, 0.28);
  border-color: #fde68a;
}

/* ==================== MTG ARENA PLANESWALKER LOYALTY SELECTOR MODAL ==================== */
.perm-combat-btn.pw-activate-cta {
  bottom: 3px;
  right: 42px;
  background: linear-gradient(180deg, #0284c7, #1e1b4b);
  border-color: #7dd3fc;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 10px rgba(56, 189, 248, 0.7);
}

.pw-modal-ability-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.92);
  border: 2px solid rgba(56, 189, 248, 0.55);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.pw-modal-ability-row.usable:hover {
  transform: translateY(-2px) scale(1.01);
  border-color: var(--gold-bright);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 18px rgba(56, 189, 248, 0.6);
}

.pw-modal-ability-row.locked {
  opacity: 0.52;
  border-color: rgba(255, 255, 255, 0.14);
  cursor: not-allowed;
}

.pw-modal-shield {
  min-width: 48px;
  height: 44px;
  border-radius: 8px 8px 16px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
  border: 2px solid #7dd3fc;
  background: linear-gradient(180deg, #059669, #064e3b);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

.pw-modal-minus .pw-modal-shield {
  background: linear-gradient(180deg, #4f46e5, #1e1b4b);
  border-color: #a5b4fc;
}

.pw-modal-desc {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.45;
}

/* ==================== MTG ARENA INTERACTIVE SURVEIL / SCRY BROWSER ==================== */
.arena-surveil-overlay {
  position: absolute;
  inset: 0;
  z-index: 82;
  background: radial-gradient(circle at center, rgba(12, 18, 36, 0.88) 0%, rgba(4, 7, 15, 0.94) 100%);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.18s ease-out;
}

.surveil-browser-panel {
  width: min(760px, 100%);
  max-height: 88dvh;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(16, 24, 46, 0.98) 0%, rgba(9, 13, 26, 0.99) 100%);
  border: 2px solid rgba(56, 189, 248, 0.72);
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.95), 0 0 38px rgba(56, 189, 248, 0.45);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.surveil-hdr-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.surveil-eyebrow {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  color: var(--aether-cyan);
  letter-spacing: 1.5px;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.55);
}

.surveil-subtitle {
  font-size: 13px;
  color: #cbd5e1;
  margin-top: 4px;
  line-height: 1.45;
}

.surveil-single-showcase {
  display: grid;
  grid-template-columns: 215px 1fr;
  gap: 20px;
  align-items: center;
  background: rgba(5, 8, 18, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
}

.surveil-card-frame {
  width: 215px;
  aspect-ratio: 63 / 88;
  border-radius: 11px;
  overflow: hidden;
  border: 2px solid var(--gold-bright);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.9), 0 0 22px rgba(56, 189, 248, 0.5);
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin: 0 auto;
}

.surveil-card-frame:hover {
  transform: translateY(-3px) scale(1.03);
}

.surveil-card-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.surveil-oracle-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13.5px;
  color: #f1f5f9;
  line-height: 1.55;
  white-space: pre-line;
}

.surveil-bonus-tip {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.65);
  color: #fde68a;
  font-size: 12.5px;
  font-weight: 700;
}

.surveil-cta-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.surveil-choice-btn {
  flex: 1;
  min-width: 210px;
  padding: 14px 20px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.8px;
  cursor: pointer;
  color: #fff;
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.surveil-choice-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.surveil-choice-btn.keep-top-btn {
  background: linear-gradient(180deg, #0284c7 0%, #0f172a 100%);
  border: 2px solid #38bdf8;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85), 0 0 18px rgba(56, 189, 248, 0.55);
}

.surveil-choice-btn.send-gy-btn {
  background: linear-gradient(180deg, #7c3aed 0%, #3b0764 100%);
  border: 2px solid #c084fc;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85), 0 0 18px rgba(192, 132, 252, 0.55);
}

.surveil-multi-row {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.surveil-multi-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  border: 2px solid rgba(56, 189, 248, 0.55);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.surveil-multi-slot.dest-grave {
  border-color: #c084fc;
  background: rgba(59, 7, 100, 0.45);
}

.surveil-card-frame.multi-frame {
  width: 175px;
}

.surveil-dest-badge {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.8px;
}

.surveil-dest-badge.top {
  background: rgba(2, 132, 199, 0.35);
  border: 1px solid #38bdf8;
  color: #e0f2fe;
}

.surveil-dest-badge.grave {
  background: rgba(124, 58, 237, 0.45);
  border: 1px solid #c084fc;
  color: #f3e8ff;
}

.surveil-slot-toggle-hint {
  font-size: 11px;
  color: #cbd5e1;
  text-align: center;
}

.surveil-minimized-bar {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 84;
  background: rgba(12, 19, 38, 0.96);
  border: 2px solid var(--aether-cyan);
  border-radius: 999px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  color: #f8fafc;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.9), 0 0 22px rgba(0, 229, 255, 0.55);
  max-width: 94vw;
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 768px) {
  .surveil-browser-panel {
    padding: 14px;
    gap: 12px;
  }
  .surveil-single-showcase {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 10px;
    gap: 12px;
  }
  .surveil-card-frame {
    width: 168px;
  }
  .surveil-card-frame.multi-frame {
    width: 138px;
  }
  .surveil-choice-btn {
    min-width: 100%;
    padding: 12px 14px;
    font-size: 13px;
  }
}

/* ==================== CUSTOM EVENT MODES, PICK-2, CROSS-POD & SEALED LEAGUE ==================== */
.blade-config-section {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.blade-config-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  color: var(--gold-mid);
  letter-spacing: 1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.format-mode-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.format-mode-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 11px;
  border-radius: 8px;
  background: rgba(15, 22, 38, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  cursor: pointer;
  transition: all 0.14s ease;
}

.format-mode-card:hover {
  border-color: var(--gold-mid);
  background: rgba(24, 34, 58, 0.92);
}

.format-mode-card.active {
  border-color: var(--aether-cyan);
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.14) 0%, rgba(15, 23, 42, 0.95) 100%);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.28);
}

.fmt-icon {
  font-size: 19px;
  flex-shrink: 0;
}

.fmt-title {
  font-weight: 800;
  font-size: 13px;
  color: #fff;
}

.fmt-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.config-pills-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cfg-pill {
  background: rgba(15, 22, 38, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.cfg-pill:hover {
  border-color: var(--gold-bright);
  color: #fff;
}

.cfg-pill.active {
  background: linear-gradient(180deg, #0284c7, #0c4a6e);
  border-color: var(--aether-cyan);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.45);
}

.cfg-custom-stepper {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(8, 12, 22, 0.9);
  border: 1px solid var(--gold-border);
  border-radius: 6px;
  padding: 2px 5px;
}

.cfg-num-input {
  width: 38px;
  background: transparent;
  border: none;
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 13px;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}
.cfg-num-input::-webkit-outer-spin-button,
.cfg-num-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pick-two-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 8;
  background: linear-gradient(90deg, #0284c7, #2563eb);
  border: 1.5px solid #7dd3fc;
  color: #fff;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.85), 0 0 12px rgba(56, 189, 248, 0.8);
}

.pod-tag-mini {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #bae6fd;
  vertical-align: middle;
}

.xpod-pill {
  display: inline-block;
  background: rgba(168, 85, 247, 0.22);
  border: 1px solid #c084fc;
  color: #f3e8ff;
  font-size: 10px;
  padding: 1px 8px;
  border-radius: 999px;
  margin-left: 6px;
}

/* ==================== AUTHENTIC MTG ARENA FULL-SCREEN TABLETOP (LARGE CARDS + ZERO SCROLL) ==================== */
html:has(body.in-battle-mode),
body.in-battle-mode {
  height: 100dvh !important;
  max-height: 100dvh !important;
  min-height: 100dvh !important;
  width: 100vw !important;
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.in-battle-mode .arena-topbar {
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 10px !important;
  background: rgba(6, 9, 16, 0.94) !important;
  border-bottom: 1px solid rgba(207, 163, 85, 0.25) !important;
}

body.in-battle-mode .planeswalker-crest {
  width: 24px !important;
  height: 24px !important;
}
body.in-battle-mode .pw-spark {
  font-size: 13px !important;
}
body.in-battle-mode .arena-tab {
  font-size: 10.5px !important;
  padding: 0 8px !important;
}
body.in-battle-mode .arena-gem-pill {
  padding: 2px 8px !important;
  font-size: 9.8px !important;
}

body.in-battle-mode .arena-viewport {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  height: calc(100dvh - 32px) !important;
  max-height: calc(100dvh - 32px) !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.in-battle-mode .arena-battlefield-root {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto minmax(0, 1fr) auto !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  border-radius: 0 !important;
  border: none !important;
  padding: 0 !important;
  gap: 0 !important;
  overflow: hidden !important;
  background:
    radial-gradient(ellipse 75% 42% at 50% 24%, rgba(30, 44, 78, 0.55) 0%, transparent 70%),
    radial-gradient(ellipse 78% 46% at 50% 74%, rgba(22, 54, 76, 0.48) 0%, transparent 72%),
    radial-gradient(ellipse at 50% 50%, #1a243b 0%, #0e1424 62%, #060811 100%) !important;
  box-shadow: inset 0 0 110px rgba(0, 0, 0, 0.9) !important;
}

/* Row 1: Authentic MTG Arena Top Edge Opponent HUD */
body.in-battle-mode .arena-opp-top-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  padding: 3px 14px 2px !important;
  gap: 8px;
  min-height: 42px;
  z-index: 22;
}

.opp-top-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.opp-top-left::-webkit-scrollbar { display: none; }

.opp-top-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.opp-inline-medallion {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px;
  margin: 0 !important;
}

body.in-battle-mode .opp-inline-medallion .avatar-ring {
  width: 44px !important;
  height: 44px !important;
  font-size: 13.5px !important;
  border-width: 2.5px !important;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.9);
}

body.in-battle-mode .opp-inline-medallion .arena-life-shield {
  margin-top: 0 !important;
  margin-left: -14px !important;
  font-size: 15px !important;
  min-width: 40px !important;
  padding: 2px 9px !important;
}

body.in-battle-mode .opp-inline-medallion .avatar-nameplate {
  margin-top: 0 !important;
  font-size: 12px !important;
  white-space: nowrap;
}

body.in-battle-mode .opp-cardbacks-fan {
  margin-top: -10px !important;
}
body.in-battle-mode .opp-cardback {
  width: 30px;
  height: 42px;
  margin-left: -11px;
  border-radius: 5px;
  transition: transform 0.14s ease;
}
@media (max-width: 960px) {
  body.in-battle-mode .opp-cardbacks-fan {
    display: none !important;
  }
}

.opp-top-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Collapsible Action Log Drawer (no longer permanently steals 245px of board width!) */
.compact-log-btn {
  display: inline-flex !important;
}
body.in-battle-mode .arena-log-drawer {
  display: none !important;
  top: 46px !important;
  right: 14px !important;
  width: 280px !important;
  max-height: 290px !important;
  z-index: 65 !important;
  background: rgba(7, 10, 19, 0.95) !important;
  border: 1.5px solid var(--gold-border) !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.92) !important;
}
body.in-battle-mode .arena-log-drawer.log-open {
  display: flex !important;
}

/* Row 2 & Row 4: Full-Width Arena Board Halves (Lands Left | Massive Creatures Stage Center) */
body.in-battle-mode .arena-board-half {
  min-height: 0 !important;
  height: 100% !important;
  overflow: visible !important;
  padding: 4px 18px !important;
  gap: 16px !important;
  position: relative;
}

body.in-battle-mode .board-right-spacer {
  display: none !important;
}

@media (min-width: 600px) {
  body.in-battle-mode .arena-board-half {
    display: grid !important;
    grid-template-columns: minmax(110px, max-content) minmax(0, 1fr) !important;
    align-items: center !important;
  }
}

body.in-battle-mode .lands-cluster {
  max-height: 100%;
  max-width: min(34vw, 440px);
  overflow: visible !important;
  align-content: center;
  gap: 8px !important;
  padding: 6px 8px !important;
}

body.in-battle-mode .creatures-stage {
  min-height: 0 !important;
  height: 100% !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow: visible !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 14px !important;
  padding: 8px 12px !important;
}

/* AUTHENTIC LARGE MTG ARENA PERMANENT FRAMES (Uncut + Dynamically Scaled to Fit Row Height & Width!) */
body.in-battle-mode .arena-perm-frame {
  height: calc(clamp(88px, 19.8dvh, 188px) * var(--bf-scale, 1)) !important;
  width: calc(clamp(78px, 17.2dvh, 164px) * var(--bf-scale, 1)) !important;
  border-radius: 10px !important;
  border-width: 2.5px !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  touch-action: none;
  user-select: none;
}

body.in-battle-mode .arena-perm-frame.planeswalker-frame {
  height: calc(clamp(94px, 21.0dvh, 198px) * var(--bf-scale, 1)) !important;
  width: calc(clamp(84px, 18.2dvh, 174px) * var(--bf-scale, 1)) !important;
  border-radius: 14px 14px 10px 10px !important;
}

body.in-battle-mode .arena-perm-frame.land-frame {
  height: calc(clamp(64px, 12.8dvh, 118px) * var(--land-scale, 1)) !important;
  width: calc(clamp(56px, 11.2dvh, 104px) * var(--land-scale, 1)) !important;
  border-radius: 8px !important;
  border-width: 2px !important;
}

body.in-battle-mode .perm-top-name {
  top: 0;
  left: 0;
  right: 0;
  padding: 3px 6px 5px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
  background: linear-gradient(180deg, rgba(5, 8, 16, 0.92) 0%, rgba(5, 8, 16, 0.52) 70%, transparent 100%);
  border-radius: 8px 8px 0 0;
}

body.in-battle-mode .arena-perm-frame.land-frame .perm-top-name {
  font-size: 10px;
  padding: 2px 5px 4px;
}

body.in-battle-mode .perm-kw-strip {
  top: 23px;
  left: 5px;
  right: 5px;
  gap: 3px;
}

body.in-battle-mode .kw-chip {
  font-size: 10px;
  padding: 1.5px 6px;
  border-radius: 4px;
}

body.in-battle-mode .perm-combat-btn {
  bottom: 27px;
  left: 5px;
  right: 5px;
  font-size: 10.5px;
  padding: 3.5px 6px;
  border-radius: 5px;
}

body.in-battle-mode .arena-pt-plate {
  bottom: -4px;
  right: -4px;
  font-size: 14px;
  padding: 2px 8px;
  border-radius: 6px;
  border-width: 2px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.95);
}

body.in-battle-mode .perm-ability-btn {
  bottom: 5px;
  left: 5px;
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 5px;
}

/* Row 3: Sleek Planar Horizon Seam + Floating Prompt Pill (Zero wasted vertical band!) */
body.in-battle-mode .arena-center-belt-wrap {
  position: relative;
  z-index: 26;
}

body.in-battle-mode .arena-command-belt {
  padding: 2px 14px !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  min-height: 26px;
  background: linear-gradient(90deg, rgba(6, 9, 18, 0.45) 0%, rgba(16, 25, 46, 0.88) 50%, rgba(6, 9, 18, 0.45) 100%) !important;
  border-top: 1px solid rgba(207, 163, 85, 0.28) !important;
  border-bottom: 1px solid rgba(0, 229, 255, 0.22) !important;
}

body.in-battle-mode .turn-owner-badge {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 2px 9px !important;
  font-size: 10.5px !important;
}

body.in-battle-mode .mtg-phase-track {
  flex: 1;
  min-width: 0;
  width: auto !important;
  order: 0 !important;
  flex-wrap: nowrap !important;
  overflow-x: auto;
  scrollbar-width: none;
  justify-content: safe center !important;
  gap: 4px !important;
  padding-bottom: 0 !important;
}
body.in-battle-mode .mtg-phase-track::-webkit-scrollbar { display: none; }

body.in-battle-mode .mtg-phase-node {
  flex-shrink: 0;
  padding: 2.5px 9px !important;
  font-size: 10px !important;
}

@media (min-width: 600px) {
  body.in-battle-mode .belt-actions-group {
    display: none !important;
  }
  body.in-battle-mode .combat-callout-strip {
    position: absolute !important;
    left: 50%;
    top: calc(100% + 3px);
    transform: translateX(-50%);
    width: max-content;
    max-width: min(88vw, 860px);
    border-radius: 999px;
    border: 1px solid rgba(0, 229, 255, 0.45);
    background: rgba(7, 12, 24, 0.88) !important;
    backdrop-filter: blur(6px);
    padding: 3px 16px !important;
    font-size: 11.5px !important;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.78);
    pointer-events: none;
  }
  body.in-battle-mode .combat-callout-strip.warn {
    border-color: rgba(248, 113, 113, 0.72);
    background: rgba(48, 10, 14, 0.9) !important;
  }
}

/* Row 5: Authentic MTG Arena Bottom Dock — 100% Uncut Full-Frame Hand Cards! */
body.in-battle-mode .arena-bottom-dock {
  --hand-card-h: clamp(104px, 24.2dvh, 214px);
  overflow: visible !important;
}

@media (min-width: 600px) {
  body.in-battle-mode .arena-bottom-dock {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    flex-direction: row !important;
    align-items: end !important;
    padding: 0 14px 6px !important;
    gap: 10px !important;
    overflow: visible !important;
    z-index: 38 !important;
  }

  body.in-battle-mode .dock-left-zones {
    display: flex !important;
    flex-direction: column-reverse !important;
    align-items: flex-start !important;
    gap: 5px !important;
    order: 0 !important;
    width: auto !important;
    padding-bottom: 2px;
  }

  body.in-battle-mode .dock-util-grid {
    flex-direction: row !important;
    gap: 4px !important;
  }

  body.in-battle-mode .dock-center-hand {
    min-width: 0;
    width: 100% !important;
    order: 0 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: visible !important;
  }

  body.in-battle-mode .dock-right-controls {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-end !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    padding-bottom: 4px !important;
  }
}

.dock-util-grid {
  display: flex;
  flex-direction: row;
  gap: 4px;
}
.dock-util-grid .arena-metal-btn {
  padding: 3px 7px !important;
  font-size: 9.5px !important;
  justify-content: center;
}

body.in-battle-mode .arena-deck-pile,
body.in-battle-mode .arena-grave-pile {
  width: clamp(50px, 8.2dvh, 68px) !important;
  height: clamp(66px, 10.8dvh, 90px) !important;
}

.pile-icon { font-size: 15px; line-height: 1; }
.pile-count { font-family: var(--font-display); font-weight: 900; font-size: 12px; color: var(--gold-bright); }
.pile-lbl { font-size: 8px; color: #cbd5e1; letter-spacing: 0.5px; }

.hum-inline-medallion {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px;
  margin-bottom: 4px !important;
  z-index: 4;
}

body.in-battle-mode .hum-inline-medallion .avatar-ring {
  width: 34px !important;
  height: 34px !important;
  font-size: 10.5px !important;
  border-width: 2px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.9);
}

body.in-battle-mode .hum-inline-medallion .arena-life-shield {
  margin-top: 0 !important;
  margin-left: -10px !important;
  font-size: 14px !important;
  min-width: 38px !important;
  padding: 1px 8px !important;
}

/* 100% UNCUT HAND FAN: Exact Card-Proportional Container Height + Zero Overflow Clipping! */
body.in-battle-mode .arena-hand-arc {
  width: 100%;
  min-height: 0 !important;
  height: calc(var(--hand-card-h) + 10px) !important;
  flex-wrap: nowrap !important;
  overflow: visible !important;
  justify-content: center !important;
  align-items: flex-end !important;
  gap: 0 !important;
  padding: 6px 8px 2px !important;
  position: relative;
}

body.in-battle-mode .arena-hand-card {
  height: var(--hand-card-h) !important;
  width: calc(var(--hand-card-h) * 488 / 680) !important;
  aspect-ratio: 488 / 680 !important;
  margin-left: var(--hand-overlap, -18px) !important;
  flex-shrink: 0;
  border-radius: 9px !important;
  border-width: 2px !important;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform-origin: bottom center;
  transform: translateY(var(--fan-lift, 0px)) rotate(var(--fan-deg, 0deg)) !important;
  transition: transform 0.18s cubic-bezier(0.2, 0.92, 0.28, 1), box-shadow 0.18s ease, border-color 0.16s ease;
  box-shadow: -5px 8px 22px rgba(0, 0, 0, 0.92);
}
body.in-battle-mode .arena-hand-card:first-child {
  margin-left: 0 !important;
}
body.in-battle-mode .arena-hand-card:active {
  cursor: grabbing;
}

body.in-battle-mode .arena-hand-card.castable-glow {
  border-color: #00e5ff !important;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.88), 0 0 4px #e0f2fe, -5px 8px 22px rgba(0, 0, 0, 0.92);
}

@media (hover: hover) and (pointer: fine) {
  body.in-battle-mode .arena-hand-card:hover {
    transform: translateY(-28px) scale(1.36) rotate(0deg) !important;
    z-index: 95 !important;
    box-shadow: 0 26px 56px rgba(0, 0, 0, 0.96), 0 0 28px rgba(0, 229, 255, 0.75) !important;
  }
}

@media (hover: none), (pointer: coarse) {
  body.in-battle-mode .arena-hand-arc {
    overflow: visible !important;
    justify-content: center !important;
  }
  body.in-battle-mode .arena-hand-card {
    transform: translateY(var(--fan-lift, 0px)) rotate(calc(var(--fan-deg, 0deg) * 0.55)) !important;
  }
}

/* Folded Narrow Cover Screen (< 600px): 100% Uncut & Zero-Scroll inside 100dvh! */
@media (max-width: 599px) {
  body.in-battle-mode .opp-inline-medallion .avatar-nameplate {
    display: none;
  }
  body.in-battle-mode .arena-board-half {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: 3px !important;
    padding: 2px 6px !important;
  }
  body.in-battle-mode .lands-cluster {
    max-width: 100%;
    flex-wrap: nowrap !important;
    padding: 2px !important;
  }
  body.in-battle-mode .arena-perm-frame {
    height: calc(clamp(82px, 15.8dvh, 126px) * var(--bf-scale, 1)) !important;
    width: calc(clamp(72px, 13.8dvh, 110px) * var(--bf-scale, 1)) !important;
  }
  body.in-battle-mode .arena-perm-frame.land-frame {
    height: calc(clamp(50px, 8.8dvh, 72px) * var(--land-scale, 1)) !important;
    width: calc(clamp(44px, 7.8dvh, 64px) * var(--land-scale, 1)) !important;
  }
  body.in-battle-mode .arena-bottom-dock {
    --hand-card-h: clamp(98px, 19.5dvh, 148px);
    padding: 0 6px 4px !important;
    gap: 4px !important;
  }
  body.in-battle-mode .dock-util-grid {
    flex-direction: row;
  }
}

/* Compact Stack / Blockers Showcase & Mulligan inside Locked-Viewport Arena */
@media (max-width: 1120px), (max-height: 860px) {
  body.in-battle-mode .arena-live-stack-box {
    top: 48px !important;
    right: 12px !important;
    left: auto !important;
    width: min(390px, calc(100vw - 24px)) !important;
    flex-direction: row !important;
    align-items: center !important;
    padding: 9px !important;
    gap: 11px !important;
  }
  body.in-battle-mode .stack-card-img-wrap {
    width: 96px !important;
    flex-shrink: 0;
  }
  body.in-battle-mode .stack-mobile-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
}

body.in-battle-mode .arena-mulligan-overlay {
  position: absolute !important;
  inset: 0 !important;
  padding: 14px !important;
  gap: 12px !important;
  justify-content: center !important;
  overflow-y: auto !important;
}

body.in-battle-mode .mulligan-hand-row {
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  gap: 12px;
  padding: 12px 10px;
}

body.in-battle-mode .mulligan-card {
  width: clamp(94px, min(12.8vw, 24dvh), 192px) !important;
  flex-shrink: 0;
}

/* ==================== MTG ARENA MODAL / DILEMMA CHOICE OVERLAY ==================== */
.arena-modal-choice-overlay {
  position: absolute;
  inset: 0;
  z-index: 83;
  background: radial-gradient(circle at center, rgba(14, 20, 40, 0.88) 0%, rgba(4, 7, 15, 0.94) 100%);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  animation: fadeIn 0.18s ease-out;
}

.choice-browser-panel {
  width: min(760px, 100%);
  max-height: calc(100dvh - 58px);
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(16, 24, 46, 0.98) 0%, rgba(9, 13, 26, 0.99) 100%);
  border: 2px solid rgba(245, 197, 99, 0.78);
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.95), 0 0 38px rgba(245, 197, 99, 0.32);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choice-browser-body {
  display: grid;
  grid-template-columns: 165px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.choice-card-art-wrap {
  width: 165px;
  aspect-ratio: 63 / 88;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--gold-bright);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.9), 0 0 18px rgba(245, 197, 99, 0.4);
  cursor: pointer;
  transition: transform 0.14s ease;
}
.choice-card-art-wrap:hover {
  transform: translateY(-2px) scale(1.02);
}
.choice-card-art-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.choice-modes-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.choice-modes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice-mode-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  text-align: left;
  padding: 10px 13px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.92);
  border: 2px solid rgba(255, 255, 255, 0.18);
  color: #f8fafc;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
.choice-mode-card:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--gold-bright);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.75), 0 0 14px rgba(245, 197, 99, 0.35);
}
.choice-mode-card.selected {
  border-color: var(--aether-cyan);
  background: rgba(2, 132, 199, 0.24);
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.45);
}
.choice-mode-card:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.choice-mode-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid var(--gold-mid);
  color: var(--gold-bright);
  margin-top: 1px;
}
.choice-mode-card.selected .choice-mode-num {
  background: var(--aether-cyan);
  border-color: #e0f2fe;
  color: #041019;
}

.choice-mode-body {
  flex: 1;
  min-width: 0;
}

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

.choice-mode-label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13.5px;
  color: #fde68a;
}

.choice-mode-target-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.22);
  border: 1px solid rgba(248, 113, 113, 0.6);
  color: #fecaca;
}

.choice-mode-text {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.4;
  margin-top: 3px;
}

.choice-cta-row {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

@media (max-width: 680px), (max-height: 620px) {
  .choice-browser-panel {
    padding: 11px 13px;
    gap: 9px;
  }
  .choice-browser-body {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .choice-card-art-wrap {
    width: 96px;
    margin: 0 auto;
  }
  .choice-mode-card {
    padding: 8px 10px;
    gap: 9px;
  }
  .choice-mode-label {
    font-size: 12.5px;
  }
  .choice-mode-text {
    font-size: 11.5px;
  }
}

/* ==================== HAND ABILITY PILLS & EXILE BADGE ==================== */
.arena-hand-card.ability-glow {
  border-color: #c084fc;
  box-shadow: 0 0 14px rgba(192, 132, 252, 0.72), -4px 6px 18px rgba(0, 0, 0, 0.8);
}

.hand-exile-badge {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 6;
  font-size: 7.5px;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(88, 28, 135, 0.92);
  border: 1px solid #d8b4fe;
  color: #f3e8ff;
  letter-spacing: 0.25px;
  line-height: 1.2;
  pointer-events: none;
}

.hand-pills-stack {
  position: absolute;
  bottom: 3px;
  left: 3px;
  right: 3px;
  z-index: 7;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hand-ability-pill {
  width: 100%;
  border-radius: 4px;
  border: 1px solid #38bdf8;
  background: linear-gradient(180deg, rgba(2, 132, 199, 0.95), rgba(15, 23, 42, 0.96));
  color: #f0f9ff;
  font-size: 8px;
  font-weight: 900;
  padding: 2px 3px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  line-height: 1.15;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.88);
}
.hand-ability-pill:hover {
  filter: brightness(1.18);
}

.hand-ability-pill.alt-cast-pill {
  border-color: #fbbf24;
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.96), rgba(69, 26, 3, 0.96));
  color: #fef3c7;
}

/* ==================== PERMANENT EXTRA ABILITIES & GRAVEYARD PLAYABLES ==================== */
.perm-ability-btn.multi-ab-btn {
  background: linear-gradient(180deg, #7c3aed, #4c1d95);
  border-color: #d8b4fe;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.85), 0 0 10px rgba(168, 85, 247, 0.55);
}

body.in-battle-mode .arena-perm-frame.land-frame .perm-ability-btn {
  max-width: calc(100% - 6px);
  font-size: 7.5px;
  padding: 1px 4px;
  bottom: 2px;
  left: 3px;
}

.perm-modal-ability-row {
  border-color: rgba(212, 168, 87, 0.55);
}
.perm-modal-badge {
  background: linear-gradient(180deg, #0284c7, #0f172a);
  border-color: var(--aether-cyan);
  border-radius: 10px;
}

.arena-grave-pile.gy-playable-glow {
  border: 2px solid #c084fc;
  box-shadow: 0 0 18px rgba(192, 132, 252, 0.85);
}

.gy-playable-badge {
  position: absolute;
  top: -8px;
  right: -6px;
  z-index: 5;
  background: linear-gradient(180deg, #9333ea, #581c87);
  border: 1.5px solid #e9d5ff;
  color: #fff;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  animation: pulseTarget 0.9s infinite alternate;
}

.gy-playable-banner {
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(124, 58, 237, 0.22);
  border: 1px solid rgba(192, 132, 252, 0.65);
  color: #f3e8ff;
  font-size: 12.5px;
}

.gy-card-slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.gy-card-slot.gy-slot-playable {
  border-color: rgba(192, 132, 252, 0.85);
  background: rgba(59, 7, 100, 0.28);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.35);
}

.gy-card-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gy-action-btn {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #c084fc;
  background: linear-gradient(180deg, #7c3aed, #3b0764);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  transition: filter 0.12s ease, transform 0.12s ease;
}
.gy-action-btn:hover {
  filter: brightness(1.16);
  transform: translateY(-1px);
}

.card-modal-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.card-modal-actions-row .gy-action-btn {
  width: auto;
}


/* ==================== SCHEMA V4 MECHANIC CHIPS & PLAYER STATUS BADGES ==================== */
.kw-chip.debuff-chip {
  background: linear-gradient(90deg, #7f1d1d, #991b1b);
  border-color: #fca5a5;
  color: #fee2e2;
}

.player-mech-strip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.player-mech-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.65);
  color: #e0f2fe;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
}

.player-mech-badge.max-speed-badge {
  background: linear-gradient(90deg, rgba(180, 83, 9, 0.92), rgba(220, 38, 38, 0.92));
  border-color: #fde68a;
  color: #fef3c7;
}

.player-mech-badge.storied-badge {
  background: rgba(88, 28, 135, 0.88);
  border-color: #e9d5ff;
  color: #f3e8ff;
}


/* ==================== AUTHENTIC MTG ARENA STACKED LANDS, PASS ORB, CARD ZOOM & DRAG-AND-DROP ENGINE ==================== */

/* 1. Arena Cascading Land Stacks (e.g., 4x Island stacked with layered edges & x4 badge) */
.arena-land-stack {
  position: relative;
  display: inline-flex;
  margin-right: 4px;
  margin-bottom: 4px;
}
.arena-land-stack.has-stack-2 {
  margin-right: 9px;
  margin-bottom: 6px;
}
.arena-land-stack.has-stack-3 {
  margin-right: 14px;
  margin-bottom: 9px;
}

.land-stack-back {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background-color: #111827;
  background-size: cover;
  background-position: center 22%;
  border: 1.5px solid rgba(212, 168, 87, 0.48);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}
.land-stack-back.layer-1 {
  transform: translate(5px, 4px);
  filter: brightness(0.76);
  z-index: 0;
}
.land-stack-back.layer-2 {
  transform: translate(10px, 8px);
  filter: brightness(0.58);
  z-index: -1;
}
.arena-land-stack.stack-tapped .land-stack-back.layer-1 {
  transform: rotate(14deg) translate(6px, 4px);
}
.arena-land-stack.stack-tapped .land-stack-back.layer-2 {
  transform: rotate(14deg) translate(11px, 8px);
}

.arena-land-stack > .arena-perm-frame {
  z-index: 2;
}

.land-stack-count-badge {
  position: absolute;
  bottom: -5px;
  right: -6px;
  z-index: 6;
  background: linear-gradient(180deg, #1e293b 0%, #090d16 100%);
  border: 2px solid var(--gold-bright);
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  padding: 1px 7px;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.95);
  pointer-events: none;
}

/* 2. Iconic MTG Arena Bottom-Right Glowing Primary Action Button + Keycap Hint */
.arena-pass-orb-btn {
  position: relative;
  min-width: 146px;
  min-height: 54px;
  padding: 10px 24px !important;
  font-size: 14px !important;
  letter-spacing: 1.4px !important;
  box-shadow: 0 0 28px rgba(234, 88, 12, 0.68), inset 0 1px 1px rgba(255, 255, 255, 0.45) !important;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px !important;
}
.arena-pass-orb-btn.blue-cta {
  box-shadow: 0 0 28px rgba(14, 165, 233, 0.65), inset 0 1px 1px rgba(255, 255, 255, 0.45) !important;
}
.pass-key-hint {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.1px;
  opacity: 0.82;
  color: rgba(255, 255, 255, 0.88);
}
@media (hover: none), (pointer: coarse) {
  .pass-key-hint {
    display: none;
  }
}

/* 3. Card Size Zoom Switcher (Draft & Deckbuilder Toolbars) */
.card-zoom-pill-group {
  display: inline-flex;
  align-items: center;
  background: #0d1322;
  border: 1px solid var(--gold-border);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}
.card-zoom-lbl {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  color: var(--gold-mid);
  padding: 0 6px 0 8px;
  letter-spacing: 0.6px;
}
.card-zoom-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.card-zoom-btn:hover {
  color: #fff;
}
.card-zoom-btn.active {
  background: linear-gradient(135deg, var(--mythic-top), var(--mythic-bot));
  color: #fff;
  box-shadow: 0 0 10px rgba(234, 88, 12, 0.55);
}

/* 4. Universal Pointer Drag-and-Drop Overlay, Floating 3D Card Ghost, Targeting Arrow & Drop Portals */
.arena-drag-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 220;
  overflow: hidden;
}

body.is-dragging-card,
body.is-dragging-card * {
  cursor: grabbing !important;
  user-select: none !important;
}

.drag-source-dimmed {
  opacity: 0.28 !important;
  filter: saturate(0.5) !important;
  transform: scale(0.94) !important;
}

.arena-drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 164px;
  aspect-ratio: 63 / 88;
  border-radius: 11px;
  overflow: hidden;
  border: 2.5px solid #00e5ff;
  background: #0f1626;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.95), 0 0 30px rgba(0, 229, 255, 0.85);
  pointer-events: none;
  will-change: transform;
  z-index: 225;
}
.arena-drag-ghost.gold-ghost {
  border-color: var(--gold-bright);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.95), 0 0 30px rgba(247, 223, 164, 0.82);
}
.arena-drag-ghost img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.arena-drag-ghost-tag {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  background: rgba(5, 10, 20, 0.92);
  border: 1px solid #00e5ff;
  border-radius: 6px;
  padding: 3px 6px;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 900;
  color: #e0f2fe;
  text-align: center;
  letter-spacing: 0.6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.9);
}

/* Anchored Hovering Spell Card while Dragging Targeting Arrow (Exact MTG Arena Behavior!) */
.arena-cast-anchor {
  position: fixed;
  width: 168px;
  aspect-ratio: 63 / 88;
  border-radius: 12px;
  overflow: hidden;
  border: 2.5px solid #00e5ff;
  background: #0f1626;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.96), 0 0 34px rgba(0, 229, 255, 0.9);
  transform: translate(-50%, -50%) scale(1.04);
  z-index: 222;
  pointer-events: none;
}
.arena-cast-anchor img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Live Glowing Curved Bézier Targeting Arrow & Crosshair Reticle */
.drag-arrow-svg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 224;
}

@keyframes dashFlow {
  from { stroke-dashoffset: 36; }
  to { stroke-dashoffset: 0; }
}

.svg-drag-arrow-glow {
  fill: none;
  stroke: rgba(0, 229, 255, 0.36);
  stroke-width: 16;
  stroke-linecap: round;
}
.svg-drag-arrow-glow.combat-arrow {
  stroke: rgba(255, 94, 26, 0.38);
}
.svg-drag-arrow-glow.block-arrow {
  stroke: rgba(251, 191, 36, 0.38);
}
.svg-drag-arrow-glow.locked {
  stroke: rgba(16, 185, 129, 0.52);
}

.svg-drag-arrow-core {
  fill: none;
  stroke: #00e5ff;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 18 10;
  animation: dashFlow 0.48s linear infinite;
  filter: drop-shadow(0 0 10px #00e5ff);
}
.svg-drag-arrow-core.combat-arrow {
  stroke: #ff6b2b;
  filter: drop-shadow(0 0 12px #ff5722);
}
.svg-drag-arrow-core.block-arrow {
  stroke: #fbbf24;
  filter: drop-shadow(0 0 12px #f59e0b);
}
.svg-drag-arrow-core.locked {
  stroke: #34d399;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 14px #10b981);
}

.svg-drag-reticle {
  fill: rgba(0, 229, 255, 0.14);
  stroke: #00e5ff;
  stroke-width: 3;
  filter: drop-shadow(0 0 10px #00e5ff);
}
.svg-drag-reticle.locked {
  fill: rgba(16, 185, 129, 0.25);
  stroke: #34d399;
  stroke-width: 4;
  filter: drop-shadow(0 0 16px #10b981);
}

/* Battlefield Playmat Drop Highlight & Target Lock Highlight */
.hum-board-half.playmat-drop-ready {
  outline: 2px dashed rgba(0, 229, 255, 0.52);
  outline-offset: -6px;
  background: radial-gradient(ellipse at 50% 55%, rgba(0, 229, 255, 0.12), transparent 72%);
}
.hum-board-half.playmat-drop-hovered {
  outline: 3px solid #00e5ff;
  outline-offset: -6px;
  background: radial-gradient(ellipse at 50% 55%, rgba(0, 229, 255, 0.22), transparent 75%);
  box-shadow: inset 0 0 42px rgba(0, 229, 255, 0.28);
}

.opp-board-half.attack-drop-ready {
  outline: 2px dashed rgba(255, 107, 43, 0.55);
  outline-offset: -6px;
  background: radial-gradient(ellipse at 50% 50%, rgba(239, 68, 68, 0.12), transparent 72%);
}
.opp-board-half.attack-drop-hovered {
  outline: 3px solid #ff6b2b;
  outline-offset: -6px;
  background: radial-gradient(ellipse at 50% 50%, rgba(239, 68, 68, 0.24), transparent 76%);
}

.drag-valid-target {
  border-color: #10b981 !important;
  box-shadow: 0 0 26px rgba(16, 185, 129, 0.92) !important;
}
.drag-target-locked {
  border-color: #34d399 !important;
  box-shadow: 0 0 0 3px #34d399, 0 0 38px rgba(16, 185, 129, 1) !important;
  transform: scale(1.08) !important;
  z-index: 50 !important;
}

/* MTG Arena Dual-Choice Split Cast Portals (Adventure / MDFC / Kicker / Alt-Cost) */
.arena-split-cast-portals {
  position: fixed;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 22px;
  align-items: stretch;
  justify-content: center;
  z-index: 221;
  pointer-events: none;
}

.split-cast-portal {
  min-width: 210px;
  max-width: 270px;
  padding: 18px 20px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(12, 22, 42, 0.94), rgba(6, 11, 22, 0.96));
  border: 2.5px dashed rgba(0, 229, 255, 0.68);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.92), 0 0 24px rgba(0, 229, 255, 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
.split-cast-portal.alt-portal {
  border-color: rgba(251, 191, 36, 0.78);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.92), 0 0 24px rgba(251, 191, 36, 0.28);
}
.split-cast-portal.portal-hovered {
  transform: scale(1.08);
  border-style: solid;
  border-color: #34d399;
  background: linear-gradient(180deg, rgba(6, 78, 59, 0.92), rgba(6, 28, 36, 0.96));
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.96), 0 0 38px rgba(52, 211, 153, 0.85);
}
.portal-kicker {
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--aether-cyan);
}
.split-cast-portal.alt-portal .portal-kicker {
  color: var(--gold-bright);
}
.portal-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  color: #fff;
}
.portal-cost {
  margin-top: 2px;
}

/* Draft, Deckbuilder, Mulligan & Surveil Drop Zone Highlights */
.drop-zone-ready {
  border-color: rgba(0, 229, 255, 0.68) !important;
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.28), inset 0 0 22px rgba(0, 229, 255, 0.12) !important;
}
.drop-zone-hovered {
  border-color: #34d399 !important;
  box-shadow: 0 0 0 2px #34d399, 0 0 34px rgba(16, 185, 129, 0.65), inset 0 0 28px rgba(16, 185, 129, 0.22) !important;
}

.mulligan-bottom-dropzone {
  width: min(560px, 92vw);
  padding: 12px 20px;
  border-radius: 12px;
  border: 2px dashed rgba(248, 113, 113, 0.55);
  background: rgba(30, 12, 18, 0.65);
  color: #fecaca;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: center;
  transition: all 0.15s ease;
}
.mulligan-bottom-dropzone.drop-zone-hovered {
  background: rgba(127, 29, 29, 0.72);
  border-style: solid;
  border-color: #fca5a5 !important;
  color: #fff;
}

/* ==================== MTG ARENA INTERACTIVE ZONE BROWSER (OPPONENT HAND, LIBRARY, GRAVEYARD) ==================== */
.arena-zone-browser-overlay {
  z-index: 84;
}

.zone-browser-panel {
  width: min(1040px, 96vw) !important;
  max-height: min(90dvh, calc(100% - 12px)) !important;
  padding: clamp(12px, 2.2dvh, 20px) clamp(14px, 2.4vw, 24px) !important;
  gap: clamp(10px, 1.8dvh, 16px) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.browser-count-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #cbd5e1;
}
.browser-count-pill.ready {
  background: rgba(6, 78, 59, 0.72);
  border-color: #34d399;
  color: #a7f3d0;
}

.browser-oracle-strip {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 7px;
  background: rgba(2, 6, 17, 0.65);
  border-left: 3px solid var(--gold-bright);
  color: #e2e8f0;
  font-size: 11.5px;
  line-height: 1.38;
  max-height: 52px;
  overflow-y: auto;
}

.arena-browser-cards-row {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(10px, 1.6vw, 18px);
  padding: 10px 8px 14px;
  background: rgba(4, 7, 16, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.browser-empty-zone {
  padding: 28px 20px;
  text-align: center;
  width: 100%;
}

.arena-browser-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: calc(clamp(138px, 31dvh, 236px) * 488 / 680);
  flex: 0 0 auto;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  transition: transform 0.15s cubic-bezier(0.2, 0.9, 0.25, 1), filter 0.15s ease;
}

.browser-card-art {
  width: 100%;
  aspect-ratio: 488 / 680;
  border-radius: 9px;
  overflow: hidden;
  background: #070a12;
  border: 2px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.9);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.browser-card-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.arena-browser-card.browser-card-valid .browser-card-art {
  border-color: var(--aether-cyan);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.9), 0 0 18px rgba(0, 229, 255, 0.45);
}
.arena-browser-card.browser-card-valid:hover {
  transform: translateY(-6px) scale(1.04);
  z-index: 5;
}

.arena-browser-card.browser-card-selected {
  transform: translateY(-7px) scale(1.05);
  z-index: 6;
}
.arena-browser-card.browser-card-selected .browser-card-art {
  border-color: #34d399;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.95), 0 0 0 2px #34d399, 0 0 28px rgba(52, 211, 153, 0.85);
}

.arena-browser-card.browser-card-invalid {
  opacity: 0.62;
  filter: saturate(0.55);
}
.arena-browser-card.browser-card-invalid:hover {
  opacity: 0.92;
  filter: saturate(0.9);
  transform: translateY(-3px);
}
.arena-browser-card.browser-card-invalid .browser-card-art,
.arena-browser-card.browser-card-whiff .browser-card-art {
  border-color: rgba(248, 113, 113, 0.55);
}

.arena-browser-card.browser-card-look .browser-card-art {
  border-color: var(--gold-bright);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.9), 0 0 16px rgba(251, 191, 36, 0.35);
}
.arena-browser-card.browser-card-look:hover {
  transform: translateY(-5px) scale(1.03);
}

.browser-copy-pill {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 4;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.94);
  border: 1.5px solid var(--gold-bright);
  color: #fde68a;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.85);
}

.browser-card-status {
  margin-top: 5px;
  padding: 2.5px 8px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-align: center;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.browser-card-status.eligible {
  background: rgba(8, 47, 73, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.6);
  color: #bae6fd;
}
.browser-card-status.selected {
  background: rgba(6, 78, 59, 0.92);
  border: 1px solid #34d399;
  color: #ecfdf5;
}
.browser-card-status.invalid {
  background: rgba(69, 10, 10, 0.88);
  border: 1px solid rgba(248, 113, 113, 0.65);
  color: #fecaca;
}

/* Persistent Face-Up Revealed Cards in Opponent's Top Hand Fan */
body.in-battle-mode .opp-cardbacks-fan.has-revealed-cards {
  display: flex !important;
  align-items: center;
}

.opp-revealed-card {
  position: relative;
  width: 33px;
  height: 46px;
  margin-left: -6px;
  border-radius: 5px;
  overflow: hidden;
  background: #070a12;
  border: 1.5px solid var(--aether-cyan);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 229, 255, 0.45);
  cursor: pointer;
  z-index: 3;
  flex-shrink: 0;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.opp-revealed-card:first-child {
  margin-left: 0;
}
.opp-revealed-card:hover {
  transform: translateY(5px) scale(1.22);
  z-index: 12;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.95), 0 0 16px rgba(0, 229, 255, 0.85);
}
.opp-revealed-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.opp-rev-eye {
  position: absolute;
  bottom: 1px;
  right: 1px;
  font-size: 8px;
  line-height: 1;
  background: rgba(4, 10, 22, 0.88);
  border-radius: 3px;
  padding: 1px 2px;
  pointer-events: none;
}
.opp-rev-pill {
  border-color: rgba(0, 229, 255, 0.65) !important;
  color: #bae6fd !important;
  background: rgba(8, 47, 73, 0.65) !important;
}

/* ==================== DESKTOP NATIVE IMAGE DRAG PREVENTION ==================== */
.arena-booster-card img,
.arena-browser-card img,
.arena-hand-card img,
.mulligan-card img,
.surveil-card-frame img,
.choice-card-art-wrap img,
.sb-card-thumb img,
.opp-revealed-card img,
.arena-drag-ghost img,
.arena-cast-anchor img {
  -webkit-user-drag: none;
  user-select: none;
}

/* ==================== EXILE VFX (CYAN / VIOLET AETHER DISSOLVE) ==================== */
.fx-exile-ghost {
  position: fixed;
  width: 104px;
  height: 118px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  border: 2px solid #c084fc;
  box-shadow: 0 0 28px rgba(192, 132, 252, 0.95), 0 0 18px rgba(0, 229, 255, 0.75);
  animation: creatureShatter 0.55s ease-out forwards;
}

.fx-exile-callout {
  position: fixed;
  background: rgba(46, 16, 101, 0.95);
  border: 1.5px solid #c084fc;
  color: #e9d5ff;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.9), 0 0 18px rgba(168, 85, 247, 0.78);
  animation: deathCalloutAnim 1.75s ease-out forwards;
}

/* ==================== MULTI-TARGET & CHOICE / SACRIFICE POLISH ==================== */
.arena-perm-frame.selected-target-glow {
  border-color: #fde047 !important;
  box-shadow: 0 0 0 3px #fde047, 0 0 28px rgba(250, 204, 21, 0.95) !important;
  transform: scale(1.06);
  z-index: 25;
}

.perm-target-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 9;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, #facc15, #ca8a04);
  border: 1.5px solid #fef9c3;
  color: #1c1917;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

.avatar-ring.selected-target-face {
  border-color: #fde047 !important;
  box-shadow: 0 0 0 3px #fde047, 0 0 28px rgba(250, 204, 21, 0.95) !important;
}

.choice-mode-disabled-reason {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #fca5a5;
}

.choice-mode-repeat-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.choice-repeat-dec {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(248, 113, 113, 0.7);
  background: rgba(127, 29, 29, 0.85);
  color: #fecaca;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.choice-repeat-dec:hover {
  filter: brightness(1.2);
}

.browser-perm-meta-pill {
  margin-top: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.92);
  border: 1px solid rgba(245, 197, 99, 0.55);
  color: #fde68a;
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 800;
  text-align: center;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== ENGINE RULES SUPPORT BADGES, PREVIEW & COVERAGE MODAL ==================== */
#cardModal {
  z-index: 126;
}

.card-partial-badge {
  position: absolute;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(120, 53, 15, 0.92);
  border: 1px solid #f59e0b;
  color: #fde68a;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.4px;
  line-height: 1.2;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.85);
  pointer-events: auto;
  cursor: help;
}

.booster-partial-badge {
  bottom: 8px;
  left: 7px;
}
.booster-partial-badge.with-coach {
  bottom: 50px;
}

.sb-partial-badge {
  top: 6px;
  left: 6px;
  font-size: 8.5px;
  padding: 1px 5px;
}

.hand-top-badges {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  pointer-events: none;
}
.hand-top-badges .hand-exile-badge {
  position: static;
}
.hand-partial-badge {
  position: static;
  font-size: 7.5px;
  padding: 1px 4px;
  border-radius: 4px;
  pointer-events: auto;
}

.bar-partial-pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(120, 53, 15, 0.9);
  border: 1px solid rgba(245, 158, 11, 0.85);
  color: #fde68a;
  font-family: var(--font-display);
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.hover-support-strip {
  margin-top: 7px;
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(9, 13, 24, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 11px;
  line-height: 1.35;
}
.hover-support-strip.full {
  border-color: rgba(16, 185, 129, 0.6);
  background: rgba(6, 42, 34, 0.92);
}
.hover-support-strip.partial {
  border-color: rgba(245, 158, 11, 0.72);
  background: rgba(58, 28, 7, 0.92);
}

.card-support-box {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(10, 15, 28, 0.78);
}
.card-support-box.full {
  border-color: rgba(16, 185, 129, 0.58);
  background: rgba(6, 78, 59, 0.22);
}
.card-support-box.partial {
  border-color: rgba(245, 158, 11, 0.68);
  background: rgba(120, 53, 15, 0.22);
}

.support-box-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.support-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.4px;
}
.support-status-pill.full {
  color: #6ee7b7;
}
.support-status-pill.partial {
  color: #fcd34d;
}
.support-lines-count {
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
}

.support-mapped-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}
.support-mapped-chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.38);
  color: #d1fae5;
  font-size: 11px;
  font-weight: 600;
}
.support-mapped-chip.more-chip {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
}

.support-unmapped-list {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed rgba(245, 158, 11, 0.4);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.support-unmapped-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fbbf24;
}
.support-unmapped-item {
  font-size: 11.5px;
  color: #fef3c7;
  background: rgba(180, 83, 9, 0.28);
  border-left: 3px solid #f59e0b;
  padding: 4px 8px;
  border-radius: 4px;
}

/* Coverage Modal Dashboard */
.coverage-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.coverage-kpi-card {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(207, 163, 85, 0.3);
  border-radius: 9px;
  padding: 10px 12px;
}
.coverage-kpi-lbl {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.coverage-kpi-val {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  color: #f8fafc;
  margin-top: 2px;
}
.coverage-progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.22);
  overflow: hidden;
  margin-top: 6px;
}
.coverage-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 999px;
}

.coverage-mech-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.coverage-mech-pill {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
}

.coverage-sets-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 7px;
  margin-bottom: 14px;
}
.coverage-set-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s ease, transform 0.12s ease, background 0.12s ease;
}
.coverage-set-chip:hover {
  border-color: var(--aether-cyan);
  transform: translateY(-1px);
}
.coverage-set-chip.active {
  border-color: var(--gold-bright);
  background: rgba(207, 163, 85, 0.16);
  box-shadow: 0 0 12px rgba(207, 163, 85, 0.28);
}
.coverage-set-icon {
  width: 18px;
  height: 18px;
  filter: invert(0.92);
  flex-shrink: 0;
}

.coverage-search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.coverage-search-input {
  flex: 1;
  min-width: 210px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(207, 163, 85, 0.38);
  background: #0b101d;
  color: #f8fafc;
  font-size: 13px;
}
.coverage-search-input:focus {
  outline: none;
  border-color: var(--aether-cyan);
}

.coverage-partial-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 9px;
  max-height: 44vh;
  overflow-y: auto;
  padding-right: 4px;
}
.coverage-partial-row {
  display: flex;
  gap: 10px;
  padding: 9px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(245, 158, 11, 0.35);
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.coverage-partial-row:hover {
  border-color: var(--gold-bright);
  transform: translateY(-1px);
}
.coverage-partial-thumb {
  width: 56px;
  height: 78px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
  background: #070a12;
}

/* ==================== PHASE 3: EMBLEMS, PHASED OUT & TOP-OF-LIBRARY ==================== */
.player-mech-badge.emblem-badge {
  background: linear-gradient(90deg, rgba(67, 56, 202, 0.92), rgba(180, 83, 9, 0.88));
  border-color: #fde68a;
  color: #fef3c7;
  cursor: pointer;
}

@keyframes phasedShimmer {
  0%, 100% {
    opacity: 0.48;
    box-shadow: 0 0 10px rgba(103, 232, 249, 0.3), inset 0 0 14px rgba(192, 132, 252, 0.22);
  }
  50% {
    opacity: 0.66;
    box-shadow: 0 0 18px rgba(165, 243, 252, 0.55), inset 0 0 22px rgba(192, 132, 252, 0.42);
  }
}

.arena-perm-frame.perm-phased-out {
  filter: saturate(0.45) hue-rotate(14deg) brightness(0.92);
  border-style: dashed !important;
  border-color: rgba(165, 243, 252, 0.78) !important;
  animation: phasedShimmer 2.6s ease-in-out infinite;
}

.kw-chip.phased-chip {
  background: linear-gradient(90deg, rgba(14, 116, 144, 0.95), rgba(109, 40, 217, 0.92));
  border-color: #a5f3fc;
  color: #ecfeff;
}

.hand-toplib-badge {
  font-size: 7.5px;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(14, 116, 144, 0.94);
  border: 1px solid #67e8f9;
  color: #ecfeff;
  letter-spacing: 0.25px;
  line-height: 1.2;
  pointer-events: none;
}

/* ==================== PHASE 4: STUN, GOAD & MDFC BACK FACE INSPECT ==================== */
.kw-chip.stun-chip {
  background: linear-gradient(90deg, rgba(30, 64, 175, 0.94), rgba(91, 33, 182, 0.92));
  border-color: #93c5fd;
  color: #eff6ff;
}

.card-backface-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.card-backface-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: #7dd3fc;
}

/* ==================== PHASE 5: CUSTOM CHOICE GRIDS, CARD NAME INPUT, ASSIMILATED & ATK TARGET ==================== */
.choice-name-entry-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.choice-modes-list.compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 6px;
  max-height: 46dvh;
  overflow-y: auto;
  padding-right: 2px;
}

.choice-modes-list.number-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 7px;
}

.choice-modes-list.number-grid .choice-mode-card {
  justify-content: center;
  align-items: center;
  padding: 9px 6px;
}
.choice-modes-list.number-grid .choice-mode-num {
  display: none;
}
.choice-modes-list.number-grid .choice-mode-title-row {
  justify-content: center;
}
.choice-modes-list.compact-grid .choice-mode-card {
  padding: 8px 10px;
}

.kw-chip.borg-chip {
  background: linear-gradient(90deg, #0f172a, #164e63);
  border-color: #67e8f9;
  color: #cffafe;
}

.perm-atk-target-pill {
  position: absolute;
  bottom: 50px;
  left: 5px;
  right: 5px;
  z-index: 8;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid #f59e0b;
  background: rgba(120, 53, 15, 0.94);
  color: #fef3c7;
  font-family: var(--font-display);
  font-size: 8.5px;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.perm-atk-target-pill:hover {
  filter: brightness(1.18);
  border-color: #fde68a;
}
